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/STM32F1xx/PWM-ICU/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'testhal/STM32/STM32F1xx/PWM-ICU/main.c') diff --git a/testhal/STM32/STM32F1xx/PWM-ICU/main.c b/testhal/STM32/STM32F1xx/PWM-ICU/main.c index 92805fec4..2700dea7f 100644 --- a/testhal/STM32/STM32F1xx/PWM-ICU/main.c +++ b/testhal/STM32/STM32F1xx/PWM-ICU/main.c @@ -50,12 +50,12 @@ icucnt_t last_width, last_period; static void icuwidthcb(ICUDriver *icup) { - last_width = icuGetWidth(icup); + last_width = icuGetWidthX(icup); } static void icuperiodcb(ICUDriver *icup) { - last_period = icuGetPeriod(icup); + last_period = icuGetPeriodX(icup); } static ICUConfig icucfg = { @@ -95,7 +95,8 @@ int main(void) { pwmEnablePeriodicNotification(&PWMD1); palSetPadMode(IOPORT1, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL); icuStart(&ICUD4, &icucfg); - icuEnable(&ICUD4); + icuStartCapture(&ICUD4); + icuEnableNotifications(&ICUD4); chThdSleepMilliseconds(2000); /* @@ -129,7 +130,7 @@ int main(void) { */ pwmDisableChannel(&PWMD1, 0); pwmStop(&PWMD1); - icuDisable(&ICUD4); + icuStopCapture(&ICUD4); icuStop(&ICUD4); palSetPad(IOPORT3, GPIOC_LED); -- cgit v1.2.3