changed for STM32F4
Fork of FastPWM by
Diff: Device/FastPWM_KLXX_K20D50M.cpp
- Revision:
- 14:b30038fbba51
- Parent:
- 11:e0a8f0fcb1c9
--- a/Device/FastPWM_KLXX_K20D50M.cpp Sun Jul 20 19:49:43 2014 +0000 +++ b/Device/FastPWM_KLXX_K20D50M.cpp Tue Sep 30 19:00:27 2014 +0000 @@ -37,6 +37,8 @@ if (retval >= reqScale) break; } + if (bin == 8) + bin = 7; //Clear lower 5 bits, write new value: char clockbits = *TPM_SC & (3<<3); @@ -46,7 +48,7 @@ *TPM_SC &= ~0x1F; - *TPM_SC |= bin + clockbits; + *TPM_SC = bin + clockbits; return retval; }