Forked.
Fork of mbed-dev by
Diff: targets/TARGET_NUVOTON/TARGET_M451/pwmout_api.c
- Revision:
- 165:e614a9f1c9e2
- Parent:
- 161:2cc1468da177
diff -r 289d4deac6e4 -r e614a9f1c9e2 targets/TARGET_NUVOTON/TARGET_M451/pwmout_api.c --- a/targets/TARGET_NUVOTON/TARGET_M451/pwmout_api.c Wed May 10 12:06:41 2017 +0100 +++ b/targets/TARGET_NUVOTON/TARGET_M451/pwmout_api.c Fri May 26 12:39:01 2017 +0100 @@ -99,11 +99,9 @@ ((struct nu_pwm_var *) modinit->var)->en_msk |= 1 << chn; - if (((struct nu_pwm_var *) modinit->var)->en_msk) { - // Mark this module to be inited. - int i = modinit - pwm_modinit_tab; - pwm_modinit_mask |= 1 << i; - } + // Mark this module to be inited. + int i = modinit - pwm_modinit_tab; + pwm_modinit_mask |= 1 << i; } void pwmout_free(pwmout_t* obj) @@ -122,11 +120,9 @@ CLK_DisableModuleClock(modinit->clkidx); } - if (((struct nu_pwm_var *) modinit->var)->en_msk == 0) { - // Mark this module to be deinited. - int i = modinit - pwm_modinit_tab; - pwm_modinit_mask &= ~(1 << i); - } + // Mark this module to be deinited. + int i = modinit - pwm_modinit_tab; + pwm_modinit_mask &= ~(1 << i); } void pwmout_write(pwmout_t* obj, float value)