From 2d67b2382e90accdc2e0c111206c0ec237afaa11 Mon Sep 17 00:00:00 2001 From: acirillo87 Date: Sat, 30 Mar 2013 09:19:03 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5520 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/SPC5xx/FlexPWM_v1/pwm_lld.c | 12 ++++------- os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c | 30 +++++++++------------------- 2 files changed, 13 insertions(+), 29 deletions(-) (limited to 'os/hal/platforms') diff --git a/os/hal/platforms/SPC5xx/FlexPWM_v1/pwm_lld.c b/os/hal/platforms/SPC5xx/FlexPWM_v1/pwm_lld.c index 3c379af9e..c44a801af 100644 --- a/os/hal/platforms/SPC5xx/FlexPWM_v1/pwm_lld.c +++ b/os/hal/platforms/SPC5xx/FlexPWM_v1/pwm_lld.c @@ -1078,8 +1078,7 @@ void pwm_lld_start(PWMDriver *pwmp) { * If this is the first FlexPWM0 submodule * activated then the FlexPWM0 is enabled. */ -#if SPC5_PWM_USE_SMOD0 || SPC5_PWM_USE_SMOD1 || \ - SPC5_PWM_USE_SMOD2 || SPC5_PWM_USE_SMOD3 +#if SPC5_PWM_USE_FLEXPWM0 /* Set Peripheral Clock.*/ if (flexpwm_active_submodules0 == 1) { halSPCSetPeripheralClockMode(SPC5_FLEXPWM0_PCTL, @@ -1087,8 +1086,7 @@ void pwm_lld_start(PWMDriver *pwmp) { } #endif -#if SPC5_PWM_USE_SMOD4 || SPC5_PWM_USE_SMOD5 || \ - SPC5_PWM_USE_SMOD6 || SPC5_PWM_USE_SMOD7 +#if SPC5_PWM_USE_FLEXPWM1 /* Set Peripheral Clock.*/ if (flexpwm_active_submodules1 == 1) { halSPCSetPeripheralClockMode(SPC5_FLEXPWM1_PCTL, @@ -1448,8 +1446,7 @@ void pwm_lld_stop(PWMDriver *pwmp) { } #endif -#if SPC5_PWM_USE_SMOD0 || SPC5_PWM_USE_SMOD1 || \ - SPC5_PWM_USE_SMOD2 || SPC5_PWM_USE_SMOD3 +#if SPC5_PWM_USE_FLEXPWM0 /* Disable peripheral clock if there is not an activated module.*/ if (flexpwm_active_submodules0 == 0) { halSPCSetPeripheralClockMode(SPC5_FLEXPWM0_PCTL, @@ -1457,8 +1454,7 @@ void pwm_lld_stop(PWMDriver *pwmp) { } #endif -#if SPC5_PWM_USE_SMOD4 || SPC5_PWM_USE_SMOD5 || \ - SPC5_PWM_USE_SMOD6 || SPC5_PWM_USE_SMOD7 +#if SPC5_PWM_USE_FLEXPWM1 /* Disable peripheral clock if there is not an activated module.*/ if (flexpwm_active_submodules1 == 0) { halSPCSetPeripheralClockMode(SPC5_FLEXPWM1_PCTL, diff --git a/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c b/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c index 006c5e30c..434c88c64 100644 --- a/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c +++ b/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c @@ -891,9 +891,7 @@ void icu_lld_init(void) { ICUD18.smod_number = 5U; #endif -#if SPC5_ICU_USE_SMOD0 || SPC5_ICU_USE_SMOD1 || \ - SPC5_ICU_USE_SMOD2 || SPC5_ICU_USE_SMOD3 || \ - SPC5_ICU_USE_SMOD4 || SPC5_ICU_USE_SMOD5 +#if SPC5_ICU_USE_ETIMER0 INTC.PSR[SPC5_ETIMER0_TC0IR_NUMBER].R = SPC5_ICU_ETIMER0_PRIORITY; INTC.PSR[SPC5_ETIMER0_TC1IR_NUMBER].R = SPC5_ICU_ETIMER0_PRIORITY; @@ -906,9 +904,7 @@ void icu_lld_init(void) { #endif -#if SPC5_ICU_USE_SMOD6 || SPC5_ICU_USE_SMOD7 || \ - SPC5_ICU_USE_SMOD8 || SPC5_ICU_USE_SMOD9 || \ - SPC5_ICU_USE_SMOD10 || SPC5_ICU_USE_SMOD11 +#if SPC5_ICU_USE_ETIMER1 INTC.PSR[SPC5_ETIMER1_TC0IR_NUMBER].R = SPC5_ICU_ETIMER1_PRIORITY; INTC.PSR[SPC5_ETIMER1_TC1IR_NUMBER].R = SPC5_ICU_ETIMER1_PRIORITY; @@ -920,9 +916,7 @@ void icu_lld_init(void) { #endif -#if SPC5_ICU_USE_SMOD12 || SPC5_ICU_USE_SMOD13 || \ - SPC5_ICU_USE_SMOD14 || SPC5_ICU_USE_SMOD15 || \ - SPC5_ICU_USE_SMOD16 || SPC5_ICU_USE_SMOD17 +#if SPC5_ICU_USE_ETIMER2 INTC.PSR[SPC5_ETIMER2_TC0IR_NUMBER].R = SPC5_ICU_ETIMER2_PRIORITY; INTC.PSR[SPC5_ETIMER2_TC1IR_NUMBER].R = SPC5_ICU_ETIMER2_PRIORITY; @@ -1034,8 +1028,7 @@ void icu_lld_start(ICUDriver *icup) { #endif /* Set eTimer0 Clock.*/ -#if SPC5_ICU_USE_SMOD0 || SPC5_ICU_USE_SMOD1 || SPC5_ICU_USE_SMOD2 || \ - SPC5_ICU_USE_SMOD3 || SPC5_ICU_USE_SMOD4 || SPC5_ICU_USE_SMOD5 +#if SPC5_ICU_USE_ETIMER0 /* If this is the first Submodule activated then the eTimer0 is enabled.*/ if (icu_active_submodules0 == 1) { @@ -1045,8 +1038,7 @@ void icu_lld_start(ICUDriver *icup) { #endif /* Set eTimer1 Clock.*/ -#if SPC5_ICU_USE_SMOD6 || SPC5_ICU_USE_SMOD7 || SPC5_ICU_USE_SMOD8 || \ - SPC5_ICU_USE_SMOD9 || SPC5_ICU_USE_SMOD10 || SPC5_ICU_USE_SMOD11 +#if SPC5_ICU_USE_ETIMER1 /* If this is the first Submodule activated then the eTimer1 is enabled.*/ if (icu_active_submodules1 == 1) { halSPCSetPeripheralClockMode(SPC5_ETIMER1_PCTL, @@ -1055,8 +1047,7 @@ void icu_lld_start(ICUDriver *icup) { #endif /* Set eTimer2 Clock.*/ -#if SPC5_ICU_USE_SMOD12 || SPC5_ICU_USE_SMOD13 || SPC5_ICU_USE_SMOD14 || \ - SPC5_ICU_USE_SMOD15 || SPC5_ICU_USE_SMOD16 || SPC5_ICU_USE_SMOD17 +#if SPC5_ICU_USE_ETIMER2 /* If this is the first Submodule activated then the eTimer2 is enabled.*/ if (icu_active_submodules2 == 1) { halSPCSetPeripheralClockMode(SPC5_ETIMER2_PCTL, @@ -1236,8 +1227,7 @@ void icu_lld_stop(ICUDriver *icup) { } #endif /* eTimer0 clock deactivation.*/ -#if SPC5_ICU_USE_SMOD0 || SPC5_ICU_USE_SMOD1 || SPC5_ICU_USE_SMOD2 || \ - SPC5_ICU_USE_SMOD3 || SPC5_ICU_USE_SMOD4 || SPC5_ICU_USE_SMOD5 +#if SPC5_ICU_USE_ETIMER0 /* If it is the last active submodules then the eTimer0 is disabled.*/ if (icu_active_submodules0 == 0) { if (icup->etimerp->ENBL.B.ENBL == 0) { @@ -1248,8 +1238,7 @@ void icu_lld_stop(ICUDriver *icup) { #endif /* eTimer1 clock deactivation.*/ -#if SPC5_ICU_USE_SMOD6 || SPC5_ICU_USE_SMOD7 || SPC5_ICU_USE_SMOD8 || \ - SPC5_ICU_USE_SMOD9 || SPC5_ICU_USE_SMOD10 || SPC5_ICU_USE_SMOD11 +#if SPC5_ICU_USE_ETIMER1 /* If it is the last active submodules then the eTimer1 is disabled.*/ if (icu_active_submodules1 == 0) { if (icup->etimerp->ENBL.B.ENBL == 0) { @@ -1260,8 +1249,7 @@ void icu_lld_stop(ICUDriver *icup) { #endif /* eTimer2 clock deactivation.*/ -#if SPC5_ICU_USE_SMOD12 || SPC5_ICU_USE_SMOD13 || SPC5_ICU_USE_SMOD14 || \ - SPC5_ICU_USE_SMOD15 || SPC5_ICU_USE_SMOD16 || SPC5_ICU_USE_SMOD17 +#if SPC5_ICU_USE_ETIMER2 /* If it is the last active submodules then the eTimer2 is disabled.*/ if (icu_active_submodules2 == 0) { if (icup->etimerp->ENBL.B.ENBL == 0) { -- cgit v1.2.3