mbed library sources. Supersedes mbed-src.
Fork of mbed-dev by
Diff: targets/TARGET_NUVOTON/TARGET_NUC472/pwmout_api.c
- Revision:
- 165:e614a9f1c9e2
- Parent:
- 161:2cc1468da177
- Child:
- 176:447f873cad2f
--- a/targets/TARGET_NUVOTON/TARGET_NUC472/pwmout_api.c Wed May 10 12:06:41 2017 +0100 +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/pwmout_api.c Fri May 26 12:39:01 2017 +0100 @@ -105,11 +105,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) @@ -145,11 +143,9 @@ } } - 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)