File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
targets/TARGET_NXP/TARGET_LPC15XX Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ void pwmout_init(pwmout_t* obj, PinName pin) {
91
91
92
92
pwm -> OUT0_SET = (1 << 0 ); // event 0
93
93
pwm -> OUT0_CLR = (1 << 1 ); // event 1
94
+ // Resolve conflicts on output 0 to set output
95
+ // This allows duty cycle = 1.0 to work, where the MATCH registers for set and clear are equal
96
+ pwm -> RES = 0x01 ;
94
97
95
98
pwm -> EV0_CTRL = (1 << 12 );
96
99
pwm -> EV0_STATE = 0xFFFFFFFF ;
@@ -169,7 +172,7 @@ void pwmout_period_us(pwmout_t* obj, int us) {
169
172
// Halt the timer and force the output low
170
173
pwm -> CTRL |= (1 << 2 ) | (1 << 3 );
171
174
pwm -> OUTPUT = 0x00000000 ;
172
-
175
+
173
176
// Ensure the new period will take immediate effect when the timer is un-halted
174
177
pwm -> MATCH0 = pwm -> MATCHREL0 ;
175
178
}
You can’t perform that action at this time.
0 commit comments