aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/TIVA/LLD/hal_pwm_lld.c
diff options
context:
space:
mode:
authorStephane D'Alu <sdalu@sdalu.com>2016-07-07 21:31:22 +0200
committerStephane D'Alu <sdalu@sdalu.com>2016-07-07 21:31:22 +0200
commit60ce974437bd0cd4f59a7bf2617a81644253aacf (patch)
tree0820df5b36bf7645997df9ed0c17b81585928f0f /os/hal/ports/TIVA/LLD/hal_pwm_lld.c
parentf75abd1037a5c2eb119533eb2f4c7c16d874abf2 (diff)
parentc7f7b70596d200afb76c3c8a24d4ddaaa61a2f1e (diff)
downloadChibiOS-Contrib-60ce974437bd0cd4f59a7bf2617a81644253aacf.tar.gz
ChibiOS-Contrib-60ce974437bd0cd4f59a7bf2617a81644253aacf.tar.bz2
ChibiOS-Contrib-60ce974437bd0cd4f59a7bf2617a81644253aacf.zip
Merge branch 'master' into qei
Diffstat (limited to 'os/hal/ports/TIVA/LLD/hal_pwm_lld.c')
-rw-r--r--os/hal/ports/TIVA/LLD/hal_pwm_lld.c8
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);