fix LPC812 PWM

Dependents:   IR_LED_Send

Fork of mbed-dev by mbed official

Files at this revision

API Documentation at this revision

Comitter:
nameless129
Date:
Mon May 16 16:50:30 2016 +0000
Parent:
128:c31e94a47539
Commit message:
PWM Fix:Duty 0%??H???????????????

Changed in this revision

targets/hal/TARGET_NXP/TARGET_LPC81X/pwmout_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_NXP/TARGET_LPC81X/pwmout_api.c	Fri May 13 16:00:11 2016 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC81X/pwmout_api.c	Mon May 16 16:50:30 2016 +0000
@@ -122,7 +122,8 @@
 
     pwm->OUT[sct_n].SET = (1 << 0);                         // All PWM channels are SET on Event_0
     pwm->OUT[sct_n].CLR = (1 << (sct_n + 1));               // PWM ch is CLRed on Event_(ch+1)
-   
+    pwm->RES = 0x02;
+
     // default to 20ms: standard for servos, and fine for e.g. brightness control
     pwmout_period_ms(obj, 20);   // 20ms period
     pwmout_write    (obj, 0.0);  //  0ms pulsewidth, dutycycle 0