diff options
Diffstat (limited to 'os/hal/ports/TIVA/LLD/hal_pwm_lld.c')
-rw-r--r-- | os/hal/ports/TIVA/LLD/hal_pwm_lld.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/ports/TIVA/LLD/hal_pwm_lld.c b/os/hal/ports/TIVA/LLD/hal_pwm_lld.c index b223a9c..ad7c587 100644 --- a/os/hal/ports/TIVA/LLD/hal_pwm_lld.c +++ b/os/hal/ports/TIVA/LLD/hal_pwm_lld.c @@ -341,6 +341,10 @@ void pwm_lld_start(PWMDriver *pwmp) #if TIVA_PWM_USE_PWM0 if (&PWMD1 == pwmp) { SYSCTL->RCGCPWM |= (1 << 0); + + while (!(SYSCTL->PRPWM & (1 << 0))) + ; + nvicEnableVector(TIVA_PWM0FAULT_NUMBER, TIVA_PWM_PWM0_FAULT_IRQ_PRIORITY); nvicEnableVector(TIVA_PWM0GEN0_NUMBER, TIVA_PWM_PWM0_0_IRQ_PRIORITY); @@ -353,6 +357,10 @@ void pwm_lld_start(PWMDriver *pwmp) #if TIVA_PWM_USE_PWM1 if (&PWMD2 == pwmp) { SYSCTL->RCGCPWM |= (1 << 1); + + while (!(SYSCTL->PRPWM & (1 << 1))) + ; + nvicEnableVector(TIVA_PWM1FAULT_NUMBER, TIVA_PWM_PWM1_FAULT_IRQ_PRIORITY); nvicEnableVector(TIVA_PWM1GEN0_NUMBER, TIVA_PWM_PWM1_0_IRQ_PRIORITY); |