mirror of https://github.com/ARMmbed/mbed-os.git
Fix for issue #7743 NRF52 Cannot initialize PWM
Deleted lines that caused the problem. Note that, in nrf_drv_pwm_init there are lines that check if pwm instance is already running, so we don't even need to check it in nordic_pwm_init. nrf_drv_uninit should be used in nordic_pwm_restart.pull/7779/head
parent
0e68570d49
commit
e1d50193b0
|
@ -98,9 +98,6 @@ static void nordic_pwm_init(pwmout_t *obj)
|
||||||
.step_mode = NRF_PWM_STEP_AUTO,
|
.step_mode = NRF_PWM_STEP_AUTO,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Make sure PWM instance is not running before making changes. */
|
|
||||||
nrf_drv_pwm_uninit(&nordic_nrf5_pwm_instance[obj->instance]);
|
|
||||||
|
|
||||||
/* Initialize instance with new configuration. */
|
/* Initialize instance with new configuration. */
|
||||||
ret_code_t result = nrf_drv_pwm_init(&nordic_nrf5_pwm_instance[obj->instance],
|
ret_code_t result = nrf_drv_pwm_init(&nordic_nrf5_pwm_instance[obj->instance],
|
||||||
&config,
|
&config,
|
||||||
|
@ -114,6 +111,9 @@ static void nordic_pwm_restart(pwmout_t *obj)
|
||||||
{
|
{
|
||||||
MBED_ASSERT(obj);
|
MBED_ASSERT(obj);
|
||||||
|
|
||||||
|
/* Uninitialize PWM instace */
|
||||||
|
nrf_drv_pwm_uninit(&nordic_nrf5_pwm_instance[obj->instance]);
|
||||||
|
|
||||||
/* (Re)initialize PWM instance. */
|
/* (Re)initialize PWM instance. */
|
||||||
nordic_pwm_init(obj);
|
nordic_pwm_init(obj);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue