Cleanup and refactoring of the STM32w port
This is a general cleanup of things like code style issues and code structure of the STM32w port to make it more like the rest of Contiki is structured.
This commit is contained in:
parent
12b3d02ba1
commit
a5046e83c7
118 changed files with 4470 additions and 4281 deletions
|
@ -32,14 +32,14 @@ static boolean sleepTimerInterruptOccurred = FALSE;
|
|||
* a single clock tick occurs every 0.9769625 milliseconds, and a rollover
|
||||
* of the 16-bit timer occurs every 64 seconds.
|
||||
*/
|
||||
int16u halCommonGetInt16uMillisecondTick(void)
|
||||
uint16_t halCommonGetInt16uMillisecondTick(void)
|
||||
{
|
||||
return (int16u)halCommonGetInt32uMillisecondTick();
|
||||
return (uint16_t)halCommonGetInt32uMillisecondTick();
|
||||
}
|
||||
|
||||
int16u halCommonGetInt16uQuarterSecondTick(void)
|
||||
uint16_t halCommonGetInt16uQuarterSecondTick(void)
|
||||
{
|
||||
return (int16u)(halCommonGetInt32uMillisecondTick() >> 8);
|
||||
return (uint16_t)(halCommonGetInt32uMillisecondTick() >> 8);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,9 +47,9 @@ int16u halCommonGetInt16uQuarterSecondTick(void)
|
|||
* a single clock tick occurs every 0.9769625 milliseconds, and a rollover
|
||||
* of the 32-bit timer occurs approximately every 48.5 days.
|
||||
*/
|
||||
int32u halCommonGetInt32uMillisecondTick(void)
|
||||
uint32_t halCommonGetInt32uMillisecondTick(void)
|
||||
{
|
||||
int32u time;
|
||||
uint32_t time;
|
||||
|
||||
time = SLEEPTMR_CNTH<<16;
|
||||
time |= SLEEPTMR_CNTL;
|
||||
|
@ -71,13 +71,13 @@ void halSleepTimerIsr(void)
|
|||
#define CONVERT_TICKS_TO_QS(x) ((x) >> 8)
|
||||
#define TIMER_MAX_QS 0x1000000 // = 4194304 seconds * 4 = 16777216
|
||||
static StStatus internalSleepForQs(boolean useGpioWakeMask,
|
||||
int32u *duration,
|
||||
int32u gpioWakeBitMask)
|
||||
uint32_t *duration,
|
||||
uint32_t gpioWakeBitMask)
|
||||
{
|
||||
StStatus status = ST_SUCCESS;
|
||||
int32u sleepOverflowCount;
|
||||
int32u remainder;
|
||||
int32u startCount;
|
||||
uint32_t sleepOverflowCount;
|
||||
uint32_t remainder;
|
||||
uint32_t startCount;
|
||||
|
||||
//There is really no reason to bother with a duration of 0qs
|
||||
if(*duration==0) {
|
||||
|
@ -165,7 +165,7 @@ static StStatus internalSleepForQs(boolean useGpioWakeMask,
|
|||
return status;
|
||||
}
|
||||
|
||||
StStatus halSleepForQsWithOptions(int32u *duration, int32u gpioWakeBitMask)
|
||||
StStatus halSleepForQsWithOptions(uint32_t *duration, uint32_t gpioWakeBitMask)
|
||||
{
|
||||
return internalSleepForQs(TRUE, duration, gpioWakeBitMask);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue