My forked repository. DISCO_F407VG, DISCO_F303VC, DISCO_F051R8 and DISCO_F100RB maybe added.
Dependents: FastPWM-DISCO-test
Fork of FastPWM by
Revision 9:c50f688cad07, committed 2014-06-27
- Comitter:
- Sissors
- Date:
- Fri Jun 27 06:02:37 2014 +0000
- Parent:
- 8:a7745c791b0c
- Child:
- 10:36362e9067b0
- Commit message:
- Period of KLxx decreased by 1 before writing to make sure it is exactly correct for my beloved users.
Changed in this revision
Device/FastPWM_KLXX.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Device/FastPWM_KLXX.cpp Fri Jun 27 05:48:25 2014 +0000 +++ b/Device/FastPWM_KLXX.cpp Fri Jun 27 06:02:37 2014 +0000 @@ -11,11 +11,11 @@ } void FastPWM::period_ticks( uint32_t ticks ) { - *(_pwm.MOD) = ticks; + *(_pwm.MOD) = ticks - 1; } uint32_t FastPWM::getPeriod( void ) { - return *(_pwm.MOD); + return *(_pwm.MOD) + 1; } uint32_t FastPWM::setPrescaler(uint32_t reqScale) {