Fix clock.h warnings caused by multiple, conflicting documentation blocks of clock functions
This commit is contained in:
parent
43aeddbd89
commit
b6bd556805
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -70,7 +70,7 @@ clock_delay_usec(uint16_t len)
|
|||
ENABLE_INTERRUPTS();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
/*
|
||||
* Wait for a multiple of ~8 ms (a tick)
|
||||
*/
|
||||
void
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -195,7 +195,7 @@ clock_delay(unsigned int i)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
/*
|
||||
* Wait for a multiple of 10 ms.
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -192,7 +192,7 @@ clock_delay(unsigned int i)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
/*
|
||||
* Wait for a multiple of 10 ms.
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -113,7 +113,7 @@ clock_delay(unsigned int i)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
/*
|
||||
* Wait for a multiple of 1 ms.
|
||||
*/
|
||||
void
|
||||
|
|
|
@ -222,7 +222,7 @@ __delay_cycles(unsigned long c)
|
|||
}
|
||||
#endif /* __GNUC__ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
/*
|
||||
* Wait for a multiple of 10 ms.
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -126,7 +126,7 @@ void clock_delay(unsigned int i)
|
|||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
/*
|
||||
* Wait for a multiple of 1 ms.
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -129,7 +129,7 @@ clock_delay(unsigned int i)
|
|||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
/*
|
||||
* Wait for a multiple of 1 / 128 sec = 7.8125 ms.
|
||||
*
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue