Refactored pwm_step to macro (optimization)