PWMGen
Recalculamos los timers de cuanto tiempo debe estar a 0 y cuanto tiempo debe estar a 1.
Code
PWMGen_timHigh=(t_timer)((FL_32)PWMGen_period*PWMGen_duty);
PWMGen_timLow=PWMGen_period-PWMGen_timHigh-PWMGen_offset;
PWMGen_oldduty=PWMGen_duty;
PWMGen_oldperiod=PWMGen_period;
PWMGen_oldoffset=PWMGen_offset;