From 6c97d4f6fb4184c41f6283ce025a7030280a1802 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 31 Aug 2014 17:21:02 +0000 Subject: Enhanced ICU driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7211 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/STM32L1xx/PWM-ICU/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'testhal/STM32/STM32L1xx/PWM-ICU') diff --git a/testhal/STM32/STM32L1xx/PWM-ICU/main.c b/testhal/STM32/STM32L1xx/PWM-ICU/main.c index 654f23379..450899049 100644 --- a/testhal/STM32/STM32L1xx/PWM-ICU/main.c +++ b/testhal/STM32/STM32L1xx/PWM-ICU/main.c @@ -48,13 +48,13 @@ icucnt_t last_width, last_period; static void icuwidthcb(ICUDriver *icup) { palSetPad(GPIOB, GPIOB_LED3); - last_width = icuGetWidth(icup); + last_width = icuGetWidthX(icup); } static void icuperiodcb(ICUDriver *icup) { palClearPad(GPIOB, GPIOB_LED3); - last_period = icuGetPeriod(icup); + last_period = icuGetPeriodX(icup); } static ICUConfig icucfg = { @@ -93,7 +93,8 @@ int main(void) { palSetPadMode(GPIOA, 15, PAL_MODE_ALTERNATE(1)); icuStart(&ICUD3, &icucfg); palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2)); - icuEnable(&ICUD3); + icuStartCapture(&ICUD3); + icuEnableNotifications(&ICUD3); chThdSleepMilliseconds(2000); /* @@ -127,7 +128,7 @@ int main(void) { */ pwmDisableChannel(&PWMD2, 0); pwmStop(&PWMD2); - icuDisable(&ICUD3); + icuStopCapture(&ICUD3); icuStop(&ICUD3); palClearPad(GPIOB, GPIOB_LED3); palClearPad(GPIOB, GPIOB_LED4); -- cgit v1.2.3