Replace standard types with stdint.h types.

Replace #define types with typedefs.
Rename all typedefs to have a _t extension.
Add #defines to automatically convert old FreeRTOS specific types to their new names (with the _t).
This commit is contained in:
Richard Barry 2013-12-29 14:06:04 +00:00
parent f292243dcf
commit 3e20aa7d60
190 changed files with 4940 additions and 4603 deletions

View file

@ -92,8 +92,8 @@ Changes from V3.0.1
* We require the address of the pxCurrentTCB variable, but don't want to
* know any details of its type.
*/
typedef void tskTCB;
extern volatile tskTCB * volatile pxCurrentTCB;
typedef void TCB_t;
extern volatile TCB_t * volatile pxCurrentTCB;
/*
* Define minimal-stack constants
@ -125,17 +125,17 @@ extern volatile tskTCB * volatile pxCurrentTCB;
#define portSTACK_MINIMAL_CALLRETURN_DEPTH ( 10 )
#define portSTACK_OTHER_BYTES ( 20 )
unsigned short usCalcMinStackSize = 0;
uint16_t usCalcMinStackSize = 0;
/*-----------------------------------------------------------*/
/*
* We initialise ucCriticalNesting to the middle value an
* unsigned char can contain. This way portENTER_CRITICAL()
* uint8_t can contain. This way portENTER_CRITICAL()
* and portEXIT_CRITICAL() can be called without interrupts
* being enabled before the scheduler starts.
*/
register unsigned char ucCriticalNesting = 0x7F;
register uint8_t ucCriticalNesting = 0x7F;
/*-----------------------------------------------------------*/
@ -143,9 +143,9 @@ register unsigned char ucCriticalNesting = 0x7F;
* Initialise the stack of a new task.
* See portSAVE_CONTEXT macro for description.
*/
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
unsigned char ucScratch;
uint8_t ucScratch;
/*
* Get the size of the RAMarea in page 0 used by the compiler
* We do this here already to avoid W-register conflicts.
@ -173,38 +173,38 @@ unsigned char ucScratch;
* First store the function parameters. This is where the task expects
* to find them when it starts running.
*/
*pxTopOfStack-- = ( portSTACK_TYPE ) ( (( unsigned short ) pvParameters >> 8) & 0x00ff );
*pxTopOfStack-- = ( portSTACK_TYPE ) ( ( unsigned short ) pvParameters & 0x00ff );
*pxTopOfStack-- = ( StackType_t ) ( (( uint16_t ) pvParameters >> 8) & 0x00ff );
*pxTopOfStack-- = ( StackType_t ) ( ( uint16_t ) pvParameters & 0x00ff );
/*
* Next are all the registers that form part of the task context.
*/
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x11; /* STATUS. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x22; /* WREG. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x33; /* BSR. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x44; /* PRODH. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x55; /* PRODL. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x66; /* FSR0H. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x77; /* FSR0L. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x88; /* FSR1H. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x99; /* FSR1L. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0xAA; /* TABLAT. */
*pxTopOfStack-- = ( StackType_t ) 0x11; /* STATUS. */
*pxTopOfStack-- = ( StackType_t ) 0x22; /* WREG. */
*pxTopOfStack-- = ( StackType_t ) 0x33; /* BSR. */
*pxTopOfStack-- = ( StackType_t ) 0x44; /* PRODH. */
*pxTopOfStack-- = ( StackType_t ) 0x55; /* PRODL. */
*pxTopOfStack-- = ( StackType_t ) 0x66; /* FSR0H. */
*pxTopOfStack-- = ( StackType_t ) 0x77; /* FSR0L. */
*pxTopOfStack-- = ( StackType_t ) 0x88; /* FSR1H. */
*pxTopOfStack-- = ( StackType_t ) 0x99; /* FSR1L. */
*pxTopOfStack-- = ( StackType_t ) 0xAA; /* TABLAT. */
#if _ROMSIZE > 0x8000
*pxTopOfStack-- = ( portSTACK_TYPE ) 0x00; /* TBLPTRU. */
*pxTopOfStack-- = ( StackType_t ) 0x00; /* TBLPTRU. */
#endif
*pxTopOfStack-- = ( portSTACK_TYPE ) 0xCC; /* TBLPTRH. */
*pxTopOfStack-- = ( portSTACK_TYPE ) 0xDD; /* TBLPTRL. */
*pxTopOfStack-- = ( StackType_t ) 0xCC; /* TBLPTRH. */
*pxTopOfStack-- = ( StackType_t ) 0xDD; /* TBLPTRL. */
#if _ROMSIZE > 0x8000
*pxTopOfStack-- = ( portSTACK_TYPE ) 0xEE; /* PCLATU. */
*pxTopOfStack-- = ( StackType_t ) 0xEE; /* PCLATU. */
#endif
*pxTopOfStack-- = ( portSTACK_TYPE ) 0xFF; /* PCLATH. */
*pxTopOfStack-- = ( StackType_t ) 0xFF; /* PCLATH. */
/*
* Next the compiler's scratchspace.
*/
while(ucScratch-- > 0)
{
*pxTopOfStack-- = ( portSTACK_TYPE ) 0;
*pxTopOfStack-- = ( StackType_t ) 0;
}
/*
@ -214,16 +214,16 @@ unsigned char ucScratch;
* functionpointers to point above 64kB in ROM.
*/
#if _ROMSIZE > 0x8000
*pxTopOfStack-- = ( portSTACK_TYPE ) 0;
*pxTopOfStack-- = ( StackType_t ) 0;
#endif
*pxTopOfStack-- = ( portSTACK_TYPE ) ( ( ( unsigned short ) pxCode >> 8 ) & 0x00ff );
*pxTopOfStack-- = ( portSTACK_TYPE ) ( ( unsigned short ) pxCode & 0x00ff );
*pxTopOfStack-- = ( StackType_t ) ( ( ( uint16_t ) pxCode >> 8 ) & 0x00ff );
*pxTopOfStack-- = ( StackType_t ) ( ( uint16_t ) pxCode & 0x00ff );
/*
* Store the number of return addresses on the hardware stack.
* So far only the address of the task entry point.
*/
*pxTopOfStack-- = ( portSTACK_TYPE ) 1;
*pxTopOfStack-- = ( StackType_t ) 1;
/*
* The code generated by wizC does not maintain separate
@ -232,13 +232,13 @@ unsigned char ucScratch;
* track of the critical section nesting. This variable has to be stored
* as part of the task context and is initially set to zero.
*/
*pxTopOfStack-- = ( portSTACK_TYPE ) portNO_CRITICAL_SECTION_NESTING;
*pxTopOfStack-- = ( StackType_t ) portNO_CRITICAL_SECTION_NESTING;
return pxTopOfStack;
}
/*-----------------------------------------------------------*/
unsigned short usPortCALCULATE_MINIMAL_STACK_SIZE( void )
uint16_t usPortCALCULATE_MINIMAL_STACK_SIZE( void )
{
/*
* Fetch the size of compiler's scratchspace.
@ -261,7 +261,7 @@ unsigned short usPortCALCULATE_MINIMAL_STACK_SIZE( void )
/*-----------------------------------------------------------*/
portBASE_TYPE xPortStartScheduler( void )
BaseType_t xPortStartScheduler( void )
{
extern void portSetupTick( void );
@ -320,7 +320,7 @@ void vPortYield( void )
/*-----------------------------------------------------------*/
void *pvPortMalloc( unsigned short usWantedSize )
void *pvPortMalloc( uint16_t usWantedSize )
{
void *pvReturn;