mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #289 from neilt6/master
LPC11UXX and LPCU13XX - Fix reset glitch in pwmout_write()pull/299/head
commit
f62e0e4d9f
|
|
@ -113,9 +113,7 @@ void pwmout_write(pwmout_t* obj, float value) {
|
|||
LPC_CTxxBx_Type *timer = Timers[tid.timer];
|
||||
uint32_t t_off = timer->MR3 - (uint32_t)((float)(timer->MR3) * value);
|
||||
|
||||
timer->TCR = TCR_RESET;
|
||||
timer->MR[tid.mr] = t_off;
|
||||
timer->TCR = TCR_CNT_EN;
|
||||
}
|
||||
|
||||
float pwmout_read(pwmout_t* obj) {
|
||||
|
|
|
|||
|
|
@ -119,9 +119,7 @@ void pwmout_write(pwmout_t* obj, float value) {
|
|||
LPC_CTxxBx_Type *timer = Timers[tid.timer];
|
||||
uint32_t t_off = timer->MR3 - (uint32_t)((float)(timer->MR3) * value);
|
||||
|
||||
timer->TCR = TCR_RESET;
|
||||
timer->MR[tid.mr] = t_off;
|
||||
timer->TCR = TCR_CNT_EN;
|
||||
}
|
||||
|
||||
float pwmout_read(pwmout_t* obj) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue