diff options
author | Fabio Utzig <utzig@utzig.org> | 2015-08-22 22:29:07 +0000 |
---|---|---|
committer | Fabio Utzig <utzig@utzig.org> | 2015-08-22 22:29:07 +0000 |
commit | 6774111f771c29a4fe4635dea3cec3b0f6a1c1f2 (patch) | |
tree | 59dbf3dabee4fe705a168a4b2314b67fc01ce45c /os | |
parent | 6ae7992c99f50928545523325fe717911dac50c2 (diff) | |
download | ChibiOS-6774111f771c29a4fe4635dea3cec3b0f6a1c1f2.tar.gz ChibiOS-6774111f771c29a4fe4635dea3cec3b0f6a1c1f2.tar.bz2 ChibiOS-6774111f771c29a4fe4635dea3cec3b0f6a1c1f2.zip |
[AVR] PWM driver without callback doesnt enable int
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8236 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/AVR/pwm_lld.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/os/hal/ports/AVR/pwm_lld.c b/os/hal/ports/AVR/pwm_lld.c index 6e60f4120..bec1559e5 100644 --- a/os/hal/ports/AVR/pwm_lld.c +++ b/os/hal/ports/AVR/pwm_lld.c @@ -366,7 +366,8 @@ void pwm_lld_start(PWMDriver *pwmp) *regs_table[i].tccrb &= ~(1 << CS11);
*regs_table[i].tccrb |= (1 << CS12) | (1 << CS10);
- *regs_table[i].timsk = (1 << TOIE1);
+ if (pwmp->config->callback != NULL)
+ *regs_table[i].timsk = (1 << TOIE1);
}
}
@@ -468,7 +469,7 @@ void pwm_lld_enable_channel(PWMDriver *pwmp, *ocrh = val >> 8;
*ocrl = val & 0xFF;
*regs_table[i].tifr |= (1 << (channel + 1));
- if (pwmp->config->channels[channel].callback)
+ if (pwmp->config->channels[channel].callback != NULL)
*regs_table[i].timsk |= (1 << (channel + 1));
}
|