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

@ -76,15 +76,15 @@
/*-----------------------------------------------------------*/
/* When the task starts interrupts should be enabled. */
#define portINITIAL_CCR ( ( portSTACK_TYPE ) 0x00 )
#define portINITIAL_CCR ( ( StackType_t ) 0x00 )
/* Hardware specific constants used to generate the RTOS tick from the TPU. */
#define portCLEAR_ON_TGRA_COMPARE_MATCH ( ( unsigned char ) 0x20 )
#define portCLOCK_DIV_64 ( ( unsigned char ) 0x03 )
#define portCLOCK_DIV ( ( unsigned long ) 64 )
#define portTGRA_INTERRUPT_ENABLE ( ( unsigned char ) 0x01 )
#define portTIMER_CHANNEL ( ( unsigned char ) 0x02 )
#define portMSTP13 ( ( unsigned short ) 0x2000 )
#define portCLEAR_ON_TGRA_COMPARE_MATCH ( ( uint8_t ) 0x20 )
#define portCLOCK_DIV_64 ( ( uint8_t ) 0x03 )
#define portCLOCK_DIV ( ( uint32_t ) 64 )
#define portTGRA_INTERRUPT_ENABLE ( ( uint8_t ) 0x01 )
#define portTIMER_CHANNEL ( ( uint8_t ) 0x02 )
#define portMSTP13 ( ( uint16_t ) 0x2000 )
/*
* Setup TPU channel one for the RTOS tick at the requested frequency.
@ -101,12 +101,12 @@ void vPortYield( void ) __attribute__ ( ( saveall, interrupt_handler ) );
/*
* See header file 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 long ulValue;
uint32_t ulValue;
/* This requires an even address. */
ulValue = ( unsigned long ) pxTopOfStack;
ulValue = ( uint32_t ) pxTopOfStack;
if( ulValue & 1UL )
{
pxTopOfStack = pxTopOfStack - 1;
@ -125,16 +125,16 @@ unsigned long ulValue;
/* The initial stack mimics an interrupt stack. First there is the program
counter (24 bits). */
ulValue = ( unsigned long ) pxCode;
ulValue = ( uint32_t ) pxCode;
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
*pxTopOfStack = ( StackType_t ) ( ulValue & 0xff );
pxTopOfStack--;
ulValue >>= 8UL;
*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
*pxTopOfStack = ( StackType_t ) ( ulValue & 0xff );
pxTopOfStack--;
ulValue >>= 8UL;
*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
*pxTopOfStack = ( StackType_t ) ( ulValue & 0xff );
/* Followed by the CCR. */
pxTopOfStack--;
@ -155,19 +155,19 @@ unsigned long ulValue;
*pxTopOfStack = 0x66;
/* ER0 */
ulValue = ( unsigned long ) pvParameters;
ulValue = ( uint32_t ) pvParameters;
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
*pxTopOfStack = ( StackType_t ) ( ulValue & 0xff );
pxTopOfStack--;
ulValue >>= 8UL;
*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
*pxTopOfStack = ( StackType_t ) ( ulValue & 0xff );
pxTopOfStack--;
ulValue >>= 8UL;
*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
*pxTopOfStack = ( StackType_t ) ( ulValue & 0xff );
pxTopOfStack--;
ulValue >>= 8UL;
*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
*pxTopOfStack = ( StackType_t ) ( ulValue & 0xff );
/* ER1 */
pxTopOfStack--;
@ -223,7 +223,7 @@ unsigned long ulValue;
}
/*-----------------------------------------------------------*/
portBASE_TYPE xPortStartScheduler( void )
BaseType_t xPortStartScheduler( void )
{
extern void * pxCurrentTCB;
@ -319,7 +319,7 @@ void vPortYield( void )
*/
static void prvSetupTimerInterrupt( void )
{
const unsigned long ulCompareMatch = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) / portCLOCK_DIV;
const uint32_t ulCompareMatch = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) / portCLOCK_DIV;
/* Turn the module on. */
MSTPCR &= ~portMSTP13;

View file

@ -1,5 +1,5 @@
/*
FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
@ -72,7 +72,7 @@ extern "C" {
#endif
/*-----------------------------------------------------------
* Port specific definitions.
* Port specific definitions.
*
* The settings in this file configure FreeRTOS correctly for the
* given hardware and compiler.
@ -87,22 +87,26 @@ extern "C" {
#define portDOUBLE double
#define portLONG long
#define portSHORT short
#define portSTACK_TYPE unsigned portCHAR
#define portSTACK_TYPE uint8_t
#define portBASE_TYPE char
typedef portSTACK_TYPE StackType_t;
typedef signed char BaseType_t;
typedef unsigned char UBaseType_t;
#if( configUSE_16_BIT_TICKS == 1 )
typedef unsigned portSHORT portTickType;
#define portMAX_DELAY ( portTickType ) 0xffff
typedef uint16_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffff
#else
typedef unsigned portLONG portTickType;
#define portMAX_DELAY ( portTickType ) 0xffffffffUL
typedef uint32_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
#endif
/*-----------------------------------------------------------*/
/* Hardware specifics. */
#define portBYTE_ALIGNMENT 2
#define portSTACK_GROWTH ( -1 )
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portTICK_RATE_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
#define portYIELD() asm volatile( "TRAPA #0" )
#define portNOP() asm volatile( "NOP" )
/*-----------------------------------------------------------*/
@ -121,8 +125,8 @@ extern "C" {
/* Task utilities. */
/* Context switch macros. These macros are very simple as the context
is saved simply by selecting the saveall attribute of the context switch
/* Context switch macros. These macros are very simple as the context
is saved simply by selecting the saveall attribute of the context switch
interrupt service routines. These macros save and restore the stack
pointer to the TCB. */