From b6bd556805144489369eb5a4e5cc7bc42fac8bab Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sun, 15 Feb 2015 21:41:54 +0100 Subject: [PATCH] Fix clock.h warnings caused by multiple, conflicting documentation blocks of clock functions --- cpu/avr/dev/clock.c | 56 +++++++++++++++++++------------------- cpu/cc2430/dev/clock.c | 4 +-- cpu/cc2538/clock.c | 9 +++--- cpu/cc253x/dev/clock.c | 2 +- cpu/mc1322x/clock.c | 8 +++--- cpu/msp430/f1xxx/clock.c | 2 +- cpu/msp430/f5xxx/clock.c | 2 +- cpu/stm32w108/clock.c | 2 +- platform/exp5438/clock.c | 2 +- platform/mbxxx/clock.c | 2 +- platform/micaz/dev/clock.c | 2 +- 11 files changed, 45 insertions(+), 46 deletions(-) diff --git a/cpu/avr/dev/clock.c b/cpu/avr/dev/clock.c index 7fcc72063..fdb2acce4 100644 --- a/cpu/avr/dev/clock.c +++ b/cpu/avr/dev/clock.c @@ -159,7 +159,7 @@ clock_set_seconds(unsigned long sec) seconds = sec; } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a number of clock ticks. */ void @@ -175,7 +175,7 @@ clock_wait(clock_time_t t) } } /*---------------------------------------------------------------------------*/ -/** +/* * Delay the CPU for up to 65535*(4000000/F_CPU) microseconds. * Copied from _delay_loop_2 in AVR library delay_basic.h, 4 clocks per loop. * For accurate short delays, inline _delay_loop_2 in the caller, use a constant @@ -193,44 +193,44 @@ my_delay_loop_2(uint16_t __count) ); } void -clock_delay_usec(uint16_t howlong) +clock_delay_usec(uint16_t dt) { #if 0 /* Accurate delay at any frequency, but introduces a 64 bit intermediate * and has a 279 clock overhead. */ - if(howlong<=(uint16_t)(279000000UL/F_CPU)) return; - howlong-=(uint16_t) (279000000UL/F_CPU); - my_delay_loop_2(((uint64_t)(howlong) * (uint64_t) F_CPU) / 4000000ULL); + if(dt<=(uint16_t)(279000000UL/F_CPU)) return; + dt-=(uint16_t) (279000000UL/F_CPU); + my_delay_loop_2(((uint64_t)(dt) * (uint64_t) F_CPU) / 4000000ULL); /* Remaining numbers tweaked for the breakpoint CPU frequencies */ /* Add other frequencies as necessary */ #elif F_CPU>=16000000UL - if(howlong<1) return; - my_delay_loop_2((howlong*(uint16_t)(F_CPU/3250000))); + if(dt<1) return; + my_delay_loop_2((dt*(uint16_t)(F_CPU/3250000))); #elif F_CPU >= 12000000UL - if(howlong<2) return; - howlong-=(uint16_t) (3*12000000/F_CPU); - my_delay_loop_2((howlong*(uint16_t)(F_CPU/3250000))); + if(dt<2) return; + dt-=(uint16_t) (3*12000000/F_CPU); + my_delay_loop_2((dt*(uint16_t)(F_CPU/3250000))); #elif F_CPU >= 8000000UL - if(howlong<4) return; - howlong-=(uint16_t) (3*8000000/F_CPU); - my_delay_loop_2((howlong*(uint16_t)(F_CPU/2000000))/2); + if(dt<4) return; + dt-=(uint16_t) (3*8000000/F_CPU); + my_delay_loop_2((dt*(uint16_t)(F_CPU/2000000))/2); #elif F_CPU >= 4000000UL - if(howlong<5) return; - howlong-=(uint16_t) (4*4000000/F_CPU); - my_delay_loop_2((howlong*(uint16_t)(F_CPU/2000000))/2); + if(dt<5) return; + dt-=(uint16_t) (4*4000000/F_CPU); + my_delay_loop_2((dt*(uint16_t)(F_CPU/2000000))/2); #elif F_CPU >= 2000000UL - if(howlong<11) return; - howlong-=(uint16_t) (10*2000000/F_CPU); - my_delay_loop_2((howlong*(uint16_t)(F_CPU/1000000))/4); + if(dt<11) return; + dt-=(uint16_t) (10*2000000/F_CPU); + my_delay_loop_2((dt*(uint16_t)(F_CPU/1000000))/4); #elif F_CPU >= 1000000UL - if(howlong<=17) return; - howlong-=(uint16_t) (17*1000000/F_CPU); - my_delay_loop_2((howlong*(uint16_t)(F_CPU/1000000))/4); + if(dt<=17) return; + dt-=(uint16_t) (17*1000000/F_CPU); + my_delay_loop_2((dt*(uint16_t)(F_CPU/1000000))/4); #else - howlong >> 5; - if (howlong < 1) return; - my_delay_loop_2(howlong); + dt >> 5; + if (dt < 1) return; + my_delay_loop_2(dt); #endif } #if 0 @@ -250,7 +250,7 @@ clock_delay(unsigned int howlong) /*---------------------------------------------------------------------------*/ /** * Delay up to 65535 milliseconds. - * \param dt How many milliseconds to delay. + * \param howlong How many milliseconds to delay. * * Neither interrupts nor the watchdog timer is disabled over the delay. * Platforms are not required to implement this call. @@ -279,7 +279,7 @@ clock_delay_msec(uint16_t howlong) /*---------------------------------------------------------------------------*/ /** * Adjust the system current clock time. - * \param dt How many ticks to add + * \param howmany How many ticks to add * * Typically used to add ticks after an MCU sleep * clock_seconds will increment if necessary to reflect the tick addition. diff --git a/cpu/cc2430/dev/clock.c b/cpu/cc2430/dev/clock.c index c0b8f2c9d..1fc781b1b 100644 --- a/cpu/cc2430/dev/clock.c +++ b/cpu/cc2430/dev/clock.c @@ -54,7 +54,7 @@ static unsigned long timer_value; static volatile CC_AT_DATA clock_time_t count = 0; /* Uptime in ticks */ static volatile CC_AT_DATA clock_time_t seconds = 0; /* Uptime in secs */ /*---------------------------------------------------------------------------*/ -/** +/* * Each iteration is ~1.0xy usec, so this function delays for roughly len usec */ void @@ -68,7 +68,7 @@ clock_delay_usec(uint16_t len) ENABLE_INTERRUPTS(); } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of ~8 ms (a tick) */ void diff --git a/cpu/cc2538/clock.c b/cpu/cc2538/clock.c index 98abdf2e3..b453f2aa3 100644 --- a/cpu/cc2538/clock.c +++ b/cpu/cc2538/clock.c @@ -136,16 +136,15 @@ clock_wait(clock_time_t i) while(clock_time() - start < (clock_time_t)i); } /*---------------------------------------------------------------------------*/ -/** - * \brief Arch-specific implementation of clock_delay_usec for the cc2538 - * \param len Delay \e len uSecs +/* + * Arch-specific implementation of clock_delay_usec for the cc2538 * * See clock_init() for GPT0 Timer A's configuration */ void -clock_delay_usec(uint16_t len) +clock_delay_usec(uint16_t dt) { - REG(GPT_0_BASE | GPTIMER_TAILR) = len; + REG(GPT_0_BASE | GPTIMER_TAILR) = dt; REG(GPT_0_BASE | GPTIMER_CTL) |= GPTIMER_CTL_TAEN; /* One-Shot mode: TAEN will be cleared when the timer reaches 0 */ diff --git a/cpu/cc253x/dev/clock.c b/cpu/cc253x/dev/clock.c index ff1c4cf4a..e78635361 100644 --- a/cpu/cc253x/dev/clock.c +++ b/cpu/cc253x/dev/clock.c @@ -70,7 +70,7 @@ clock_delay_usec(uint16_t len) ENABLE_INTERRUPTS(); } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of ~8 ms (a tick) */ void diff --git a/cpu/mc1322x/clock.c b/cpu/mc1322x/clock.c index 611a90251..ac70dfcf5 100644 --- a/cpu/mc1322x/clock.c +++ b/cpu/mc1322x/clock.c @@ -97,7 +97,7 @@ clock_wait(clock_time_t t) while ((signed long)(current_clock - endticks) < 0) {;} } /*---------------------------------------------------------------------------*/ -/** +/* * Delay the CPU for up to 65535 microseconds. * Use the 250KHz MACA clock for longer delays to avoid interrupt effects. * However that can't be used if the radio is being power cycled! @@ -118,7 +118,7 @@ clock_delay_usec(uint16_t howlong) while(--i); } /*---------------------------------------------------------------------------*/ -/** +/* * Delay the CPU for up to 65535 milliseconds. The watchdog is NOT disabled. */ void @@ -127,7 +127,7 @@ clock_delay_msec(uint16_t howlong) while(howlong--) clock_delay_usec(1000); } /*---------------------------------------------------------------------------*/ -/** +/* * Legacy delay. The original clock_delay for the msp430 used a granularity * of 2.83 usec. This approximates that delay for values up to 1456 usec. * (The largest core call in leds.c uses 400). @@ -139,7 +139,7 @@ clock_delay(unsigned int howlong) clock_delay_usec((283*howlong)/100); } /*---------------------------------------------------------------------------*/ -/** +/* * Adjust clock ticks after a cpu sleep. */ void clock_adjust_ticks(clock_time_t howmany) { diff --git a/cpu/msp430/f1xxx/clock.c b/cpu/msp430/f1xxx/clock.c index b99827c04..b81bb7498 100644 --- a/cpu/msp430/f1xxx/clock.c +++ b/cpu/msp430/f1xxx/clock.c @@ -195,7 +195,7 @@ clock_delay(unsigned int i) } } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of 10 ms. * */ diff --git a/cpu/msp430/f5xxx/clock.c b/cpu/msp430/f5xxx/clock.c index b0047a9e6..1def811e6 100644 --- a/cpu/msp430/f5xxx/clock.c +++ b/cpu/msp430/f5xxx/clock.c @@ -192,7 +192,7 @@ clock_delay(unsigned int i) } } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of 10 ms. * */ diff --git a/cpu/stm32w108/clock.c b/cpu/stm32w108/clock.c index f4a17ad53..5e3464d16 100644 --- a/cpu/stm32w108/clock.c +++ b/cpu/stm32w108/clock.c @@ -113,7 +113,7 @@ clock_delay(unsigned int i) } } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of 1 ms. */ void diff --git a/platform/exp5438/clock.c b/platform/exp5438/clock.c index be8fcca47..d6118e12e 100644 --- a/platform/exp5438/clock.c +++ b/platform/exp5438/clock.c @@ -222,7 +222,7 @@ __delay_cycles(unsigned long c) } #endif /* __GNUC__ */ /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of 10 ms. * */ diff --git a/platform/mbxxx/clock.c b/platform/mbxxx/clock.c index cc9a1406b..896c2a9bb 100644 --- a/platform/mbxxx/clock.c +++ b/platform/mbxxx/clock.c @@ -126,7 +126,7 @@ void clock_delay(unsigned int i) } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of 1 ms. * */ diff --git a/platform/micaz/dev/clock.c b/platform/micaz/dev/clock.c index 2ed808637..e8e387b08 100644 --- a/platform/micaz/dev/clock.c +++ b/platform/micaz/dev/clock.c @@ -129,7 +129,7 @@ clock_delay(unsigned int i) } /*---------------------------------------------------------------------------*/ -/** +/* * Wait for a multiple of 1 / 128 sec = 7.8125 ms. * */