Fix #ifdef -> #if, and update PWM on SET.
Stop logging upon disconnect.