mbed library sources

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Tue Apr 29 17:00:07 2014 +0100
Parent:
174:8bb9f3a33240
Child:
176:2d0c9ad7ef62
Commit message:
Synchronized with git revision b5f6c135e4cf5642883e2355c012264ce42eea51

Full URL: https://github.com/mbedmicro/mbed/commit/b5f6c135e4cf5642883e2355c012264ce42eea51/

fix prescaler settings

Changed in this revision

targets/hal/TARGET_NXP/TARGET_LPC11UXX/pwmout_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_NXP/TARGET_LPC11UXX/pwmout_api.c	Tue Apr 29 11:15:07 2014 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC11UXX/pwmout_api.c	Tue Apr 29 17:00:07 2014 +0100
@@ -144,8 +144,8 @@
     uint32_t old_period_ticks = timer->MR3;
 
     // for 16bit timer, set prescaler to avoid overflow
-    uint16_t high_period_ticks = period_ticks >> 16; 
-    if ((high_period_ticks) && (timer == LPC_CT16B0 || timer == LPC_CT16B1)) {
+    if (timer == LPC_CT16B0 || timer == LPC_CT16B1) {
+        uint16_t high_period_ticks = period_ticks >> 16; 
         timer->PR = high_period_ticks;
         period_ticks /= (high_period_ticks + 1);
     }