Fix clock.h warnings caused by multiple, conflicting documentation blocks of clock functions

This commit is contained in:
George Oikonomou 2015-02-15 21:41:54 +01:00
parent 43aeddbd89
commit b6bd556805
11 changed files with 45 additions and 46 deletions

View file

@ -159,7 +159,7 @@ clock_set_seconds(unsigned long sec)
seconds = sec; seconds = sec;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a number of clock ticks. * Wait for a number of clock ticks.
*/ */
void void
@ -175,7 +175,7 @@ clock_wait(clock_time_t t)
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Delay the CPU for up to 65535*(4000000/F_CPU) microseconds. * 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. * 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 * 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 void
clock_delay_usec(uint16_t howlong) clock_delay_usec(uint16_t dt)
{ {
#if 0 #if 0
/* Accurate delay at any frequency, but introduces a 64 bit intermediate /* Accurate delay at any frequency, but introduces a 64 bit intermediate
* and has a 279 clock overhead. * and has a 279 clock overhead.
*/ */
if(howlong<=(uint16_t)(279000000UL/F_CPU)) return; if(dt<=(uint16_t)(279000000UL/F_CPU)) return;
howlong-=(uint16_t) (279000000UL/F_CPU); dt-=(uint16_t) (279000000UL/F_CPU);
my_delay_loop_2(((uint64_t)(howlong) * (uint64_t) F_CPU) / 4000000ULL); my_delay_loop_2(((uint64_t)(dt) * (uint64_t) F_CPU) / 4000000ULL);
/* Remaining numbers tweaked for the breakpoint CPU frequencies */ /* Remaining numbers tweaked for the breakpoint CPU frequencies */
/* Add other frequencies as necessary */ /* Add other frequencies as necessary */
#elif F_CPU>=16000000UL #elif F_CPU>=16000000UL
if(howlong<1) return; if(dt<1) return;
my_delay_loop_2((howlong*(uint16_t)(F_CPU/3250000))); my_delay_loop_2((dt*(uint16_t)(F_CPU/3250000)));
#elif F_CPU >= 12000000UL #elif F_CPU >= 12000000UL
if(howlong<2) return; if(dt<2) return;
howlong-=(uint16_t) (3*12000000/F_CPU); dt-=(uint16_t) (3*12000000/F_CPU);
my_delay_loop_2((howlong*(uint16_t)(F_CPU/3250000))); my_delay_loop_2((dt*(uint16_t)(F_CPU/3250000)));
#elif F_CPU >= 8000000UL #elif F_CPU >= 8000000UL
if(howlong<4) return; if(dt<4) return;
howlong-=(uint16_t) (3*8000000/F_CPU); dt-=(uint16_t) (3*8000000/F_CPU);
my_delay_loop_2((howlong*(uint16_t)(F_CPU/2000000))/2); my_delay_loop_2((dt*(uint16_t)(F_CPU/2000000))/2);
#elif F_CPU >= 4000000UL #elif F_CPU >= 4000000UL
if(howlong<5) return; if(dt<5) return;
howlong-=(uint16_t) (4*4000000/F_CPU); dt-=(uint16_t) (4*4000000/F_CPU);
my_delay_loop_2((howlong*(uint16_t)(F_CPU/2000000))/2); my_delay_loop_2((dt*(uint16_t)(F_CPU/2000000))/2);
#elif F_CPU >= 2000000UL #elif F_CPU >= 2000000UL
if(howlong<11) return; if(dt<11) return;
howlong-=(uint16_t) (10*2000000/F_CPU); dt-=(uint16_t) (10*2000000/F_CPU);
my_delay_loop_2((howlong*(uint16_t)(F_CPU/1000000))/4); my_delay_loop_2((dt*(uint16_t)(F_CPU/1000000))/4);
#elif F_CPU >= 1000000UL #elif F_CPU >= 1000000UL
if(howlong<=17) return; if(dt<=17) return;
howlong-=(uint16_t) (17*1000000/F_CPU); dt-=(uint16_t) (17*1000000/F_CPU);
my_delay_loop_2((howlong*(uint16_t)(F_CPU/1000000))/4); my_delay_loop_2((dt*(uint16_t)(F_CPU/1000000))/4);
#else #else
howlong >> 5; dt >> 5;
if (howlong < 1) return; if (dt < 1) return;
my_delay_loop_2(howlong); my_delay_loop_2(dt);
#endif #endif
} }
#if 0 #if 0
@ -250,7 +250,7 @@ clock_delay(unsigned int howlong)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**
* Delay up to 65535 milliseconds. * 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. * Neither interrupts nor the watchdog timer is disabled over the delay.
* Platforms are not required to implement this call. * Platforms are not required to implement this call.
@ -279,7 +279,7 @@ clock_delay_msec(uint16_t howlong)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**
* Adjust the system current clock time. * 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 * Typically used to add ticks after an MCU sleep
* clock_seconds will increment if necessary to reflect the tick addition. * clock_seconds will increment if necessary to reflect the tick addition.

View file

@ -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 count = 0; /* Uptime in ticks */
static volatile CC_AT_DATA clock_time_t seconds = 0; /* Uptime in secs */ 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 * Each iteration is ~1.0xy usec, so this function delays for roughly len usec
*/ */
void void
@ -68,7 +68,7 @@ clock_delay_usec(uint16_t len)
ENABLE_INTERRUPTS(); ENABLE_INTERRUPTS();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of ~8 ms (a tick) * Wait for a multiple of ~8 ms (a tick)
*/ */
void void

View file

@ -136,16 +136,15 @@ clock_wait(clock_time_t i)
while(clock_time() - start < (clock_time_t)i); while(clock_time() - start < (clock_time_t)i);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* \brief Arch-specific implementation of clock_delay_usec for the cc2538 * Arch-specific implementation of clock_delay_usec for the cc2538
* \param len Delay \e len uSecs
* *
* See clock_init() for GPT0 Timer A's configuration * See clock_init() for GPT0 Timer A's configuration
*/ */
void 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; REG(GPT_0_BASE | GPTIMER_CTL) |= GPTIMER_CTL_TAEN;
/* One-Shot mode: TAEN will be cleared when the timer reaches 0 */ /* One-Shot mode: TAEN will be cleared when the timer reaches 0 */

View file

@ -70,7 +70,7 @@ clock_delay_usec(uint16_t len)
ENABLE_INTERRUPTS(); ENABLE_INTERRUPTS();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of ~8 ms (a tick) * Wait for a multiple of ~8 ms (a tick)
*/ */
void void

View file

@ -97,7 +97,7 @@ clock_wait(clock_time_t t)
while ((signed long)(current_clock - endticks) < 0) {;} while ((signed long)(current_clock - endticks) < 0) {;}
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Delay the CPU for up to 65535 microseconds. * Delay the CPU for up to 65535 microseconds.
* Use the 250KHz MACA clock for longer delays to avoid interrupt effects. * 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! * 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); while(--i);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Delay the CPU for up to 65535 milliseconds. The watchdog is NOT disabled. * Delay the CPU for up to 65535 milliseconds. The watchdog is NOT disabled.
*/ */
void void
@ -127,7 +127,7 @@ clock_delay_msec(uint16_t howlong)
while(howlong--) clock_delay_usec(1000); while(howlong--) clock_delay_usec(1000);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Legacy delay. The original clock_delay for the msp430 used a granularity * 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. * of 2.83 usec. This approximates that delay for values up to 1456 usec.
* (The largest core call in leds.c uses 400). * (The largest core call in leds.c uses 400).
@ -139,7 +139,7 @@ clock_delay(unsigned int howlong)
clock_delay_usec((283*howlong)/100); clock_delay_usec((283*howlong)/100);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Adjust clock ticks after a cpu sleep. * Adjust clock ticks after a cpu sleep.
*/ */
void clock_adjust_ticks(clock_time_t howmany) { void clock_adjust_ticks(clock_time_t howmany) {

View file

@ -195,7 +195,7 @@ clock_delay(unsigned int i)
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of 10 ms. * Wait for a multiple of 10 ms.
* *
*/ */

View file

@ -192,7 +192,7 @@ clock_delay(unsigned int i)
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of 10 ms. * Wait for a multiple of 10 ms.
* *
*/ */

View file

@ -113,7 +113,7 @@ clock_delay(unsigned int i)
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of 1 ms. * Wait for a multiple of 1 ms.
*/ */
void void

View file

@ -222,7 +222,7 @@ __delay_cycles(unsigned long c)
} }
#endif /* __GNUC__ */ #endif /* __GNUC__ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of 10 ms. * Wait for a multiple of 10 ms.
* *
*/ */

View file

@ -126,7 +126,7 @@ void clock_delay(unsigned int i)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of 1 ms. * Wait for a multiple of 1 ms.
* *
*/ */

View file

@ -129,7 +129,7 @@ clock_delay(unsigned int i)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /*
* Wait for a multiple of 1 / 128 sec = 7.8125 ms. * Wait for a multiple of 1 / 128 sec = 7.8125 ms.
* *
*/ */