diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-31 17:21:02 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-31 17:21:02 +0000 |
commit | 6c97d4f6fb4184c41f6283ce025a7030280a1802 (patch) | |
tree | 3c3c5fa9401c3d2aa6a4da4747a31fa0aa9c997a /testhal/STM32/STM32F0xx/PWM-ICU | |
parent | 87e4b85755680a122f690f445b8cb320ca4f05ad (diff) | |
download | ChibiOS-6c97d4f6fb4184c41f6283ce025a7030280a1802.tar.gz ChibiOS-6c97d4f6fb4184c41f6283ce025a7030280a1802.tar.bz2 ChibiOS-6c97d4f6fb4184c41f6283ce025a7030280a1802.zip |
Enhanced ICU driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7211 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F0xx/PWM-ICU')
-rw-r--r-- | testhal/STM32/STM32F0xx/PWM-ICU/main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/testhal/STM32/STM32F0xx/PWM-ICU/main.c b/testhal/STM32/STM32F0xx/PWM-ICU/main.c index 661635c95..c2f1a9e0b 100644 --- a/testhal/STM32/STM32F0xx/PWM-ICU/main.c +++ b/testhal/STM32/STM32F0xx/PWM-ICU/main.c @@ -48,13 +48,13 @@ icucnt_t last_width, last_period; static void icuwidthcb(ICUDriver *icup) {
palSetPad(GPIOC, GPIOC_LED3);
- last_width = icuGetWidth(icup);
+ last_width = icuGetWidthX(icup);
}
static void icuperiodcb(ICUDriver *icup) {
palClearPad(GPIOC, GPIOC_LED3);
- last_period = icuGetPeriod(icup);
+ last_period = icuGetPeriodX(icup);
}
static void icuoverflowcb(ICUDriver *icup) {
@@ -98,7 +98,8 @@ int main(void) { palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(2));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1));
- icuEnable(&ICUD3);
+ icuStartCapture(&ICUD3);
+ icuEnableNotifications(&ICUD3);
chThdSleepMilliseconds(2000);
/*
@@ -132,7 +133,7 @@ int main(void) { */
pwmDisableChannel(&PWMD1, 0);
pwmStop(&PWMD1);
- icuDisable(&ICUD3);
+ icuStopCapture(&ICUD3);
icuStop(&ICUD3);
palClearPad(GPIOC, GPIOC_LED3);
palClearPad(GPIOC, GPIOC_LED4);
|