Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Device/FastPWM_LPC11U24.cpp
- Revision:
- 7:1b5df740bcd7
- Parent:
- 4:a7b9f778c4b4
- Child:
- 10:36362e9067b0
--- a/Device/FastPWM_LPC11U24.cpp Mon Mar 17 22:12:58 2014 +0000
+++ b/Device/FastPWM_LPC11U24.cpp Thu May 01 16:54:00 2014 +0000
@@ -36,16 +36,14 @@
bits = 16;
else
//32-bit timer
- bits = 32;
-
- printf("Bits = %d, PWM = %d, MR = %d\n\r", bits, tid.timer, tid.mr);
-
+ bits = 32;
}
void FastPWM::pulsewidth_ticks( uint32_t ticks ) {
- pwm_obj->TCR = 0x02;
- *PWM_MR = pwm_obj->MR3 - ticks; //They inverted PWM on the 11u24
- pwm_obj->TCR = 0x01;
+ if (ticks)
+ *PWM_MR = pwm_obj->MR3 - ticks; //They inverted PWM on the 11u24
+ else
+ *PWM_MR = 0xFFFFFFFF; //If MR3 = ticks 1 clock cycle wide errors appear, this prevents that (unless MR3 = max).
}
void FastPWM::period_ticks( uint32_t ticks ) {