Added #ifdef for PWM mode.