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
MateuszM 2018-08-13 17:29:49 +02:00
parent 0e68570d49
commit e1d50193b0
1 changed files with 3 additions and 3 deletions

View File

@ -98,9 +98,6 @@ static void nordic_pwm_init(pwmout_t *obj)
.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. */
ret_code_t result = nrf_drv_pwm_init(&nordic_nrf5_pwm_instance[obj->instance],
&config,
@ -114,6 +111,9 @@ static void nordic_pwm_restart(pwmout_t *obj)
{
MBED_ASSERT(obj);
/* Uninitialize PWM instace */
nrf_drv_pwm_uninit(&nordic_nrf5_pwm_instance[obj->instance]);
/* (Re)initialize PWM instance. */
nordic_pwm_init(obj);