mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-05-25 22:49:04 -04:00
Replace portLONG with long, portCHAR with char, and portSHORT with short.
This commit is contained in:
parent
85096f6159
commit
876caa2967
|
@ -74,7 +74,7 @@ void vInitialiseTimerForIntQueueTest( void )
|
||||||
|
|
||||||
T3CON = 0;
|
T3CON = 0;
|
||||||
TMR3 = 0;
|
TMR3 = 0;
|
||||||
PR3 = ( unsigned portSHORT ) ( configPERIPHERAL_CLOCK_HZ / timerINTERRUPT3_FREQUENCY );
|
PR3 = ( unsigned short ) ( configPERIPHERAL_CLOCK_HZ / timerINTERRUPT3_FREQUENCY );
|
||||||
|
|
||||||
/* Setup timer 3 interrupt priority to be above the kernel priority. */
|
/* Setup timer 3 interrupt priority to be above the kernel priority. */
|
||||||
ConfigIntTimer3( T3_INT_ON | ( configMAX_SYSCALL_INTERRUPT_PRIORITY - 1 ) );
|
ConfigIntTimer3( T3_INT_ON | ( configMAX_SYSCALL_INTERRUPT_PRIORITY - 1 ) );
|
||||||
|
@ -92,7 +92,7 @@ void vInitialiseTimerForIntQueueTest( void )
|
||||||
/* Do the same for timer 4. */
|
/* Do the same for timer 4. */
|
||||||
T4CON = 0;
|
T4CON = 0;
|
||||||
TMR4 = 0;
|
TMR4 = 0;
|
||||||
PR4 = ( unsigned portSHORT ) ( configPERIPHERAL_CLOCK_HZ / timerINTERRUPT4_FREQUENCY );
|
PR4 = ( unsigned short ) ( configPERIPHERAL_CLOCK_HZ / timerINTERRUPT4_FREQUENCY );
|
||||||
|
|
||||||
/* Setup timer 4 interrupt priority to be above the kernel priority. */
|
/* Setup timer 4 interrupt priority to be above the kernel priority. */
|
||||||
ConfigIntTimer4( T4_INT_ON | ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) );
|
ConfigIntTimer4( T4_INT_ON | ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) );
|
||||||
|
|
|
@ -78,12 +78,12 @@ static void prvSetupLCD( void );
|
||||||
/*
|
/*
|
||||||
* Move to the first (0) or second (1) row of the LCD.
|
* Move to the first (0) or second (1) row of the LCD.
|
||||||
*/
|
*/
|
||||||
static void prvLCDGotoRow( unsigned portSHORT usRow );
|
static void prvLCDGotoRow( unsigned short usRow );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write a string of text to the LCD.
|
* Write a string of text to the LCD.
|
||||||
*/
|
*/
|
||||||
static void prvLCDPutString( portCHAR *pcString );
|
static void prvLCDPutString( char *pcString );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear the LCD.
|
* Clear the LCD.
|
||||||
|
@ -121,8 +121,8 @@ static void prvLCDClear( void );
|
||||||
xQueueHandle xLCDQueue;
|
xQueueHandle xLCDQueue;
|
||||||
|
|
||||||
/* LCD access functions. */
|
/* LCD access functions. */
|
||||||
static void prvLCDCommand( portCHAR cCommand );
|
static void prvLCDCommand( char cCommand );
|
||||||
static void prvLCDData( portCHAR cChar );
|
static void prvLCDData( char cChar );
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -134,13 +134,13 @@ xQueueHandle xStartLCDTask( void )
|
||||||
|
|
||||||
/* Start the task that will write to the LCD. The LCD hardware is
|
/* Start the task that will write to the LCD. The LCD hardware is
|
||||||
initialised from within the task itself so delays can be used. */
|
initialised from within the task itself so delays can be used. */
|
||||||
xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );
|
xTaskCreate( vLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );
|
||||||
|
|
||||||
return xLCDQueue;
|
return xLCDQueue;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvLCDGotoRow( unsigned portSHORT usRow )
|
static void prvLCDGotoRow( unsigned short usRow )
|
||||||
{
|
{
|
||||||
if(usRow == 0)
|
if(usRow == 0)
|
||||||
{
|
{
|
||||||
|
@ -153,7 +153,7 @@ static void prvLCDGotoRow( unsigned portSHORT usRow )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvLCDCommand( portCHAR cCommand )
|
static void prvLCDCommand( char cCommand )
|
||||||
{
|
{
|
||||||
PMPSetAddress( LCD_COMMAND_ADDRESS );
|
PMPSetAddress( LCD_COMMAND_ADDRESS );
|
||||||
PMPMasterWrite( cCommand );
|
PMPMasterWrite( cCommand );
|
||||||
|
@ -161,7 +161,7 @@ static void prvLCDCommand( portCHAR cCommand )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvLCDData( portCHAR cChar )
|
static void prvLCDData( char cChar )
|
||||||
{
|
{
|
||||||
PMPSetAddress( LCD_DATA_ADDRESS );
|
PMPSetAddress( LCD_DATA_ADDRESS );
|
||||||
PMPMasterWrite( cChar );
|
PMPMasterWrite( cChar );
|
||||||
|
@ -169,7 +169,7 @@ static void prvLCDData( portCHAR cChar )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvLCDPutString( portCHAR *pcString )
|
static void prvLCDPutString( char *pcString )
|
||||||
{
|
{
|
||||||
/* Write out each character with appropriate delay between each. */
|
/* Write out each character with appropriate delay between each. */
|
||||||
while(*pcString)
|
while(*pcString)
|
||||||
|
@ -226,7 +226,7 @@ static void prvSetupLCD(void)
|
||||||
static void vLCDTask(void *pvParameters)
|
static void vLCDTask(void *pvParameters)
|
||||||
{
|
{
|
||||||
xLCDMessage xMessage;
|
xLCDMessage xMessage;
|
||||||
unsigned portSHORT usRow = 0;
|
unsigned short usRow = 0;
|
||||||
|
|
||||||
/* Initialise the hardware. This uses delays so must not be called prior
|
/* Initialise the hardware. This uses delays so must not be called prior
|
||||||
to the scheduler being started. */
|
to the scheduler being started. */
|
||||||
|
|
|
@ -166,7 +166,7 @@ interrupt test" interrupt. */
|
||||||
#define mainEXPECTED_CLOCKS_BETWEEN_INTERRUPTS ( ( configCPU_CLOCK_HZ >> 1 ) / mainTEST_INTERRUPT_FREQUENCY )
|
#define mainEXPECTED_CLOCKS_BETWEEN_INTERRUPTS ( ( configCPU_CLOCK_HZ >> 1 ) / mainTEST_INTERRUPT_FREQUENCY )
|
||||||
|
|
||||||
/* The number of nano seconds between each core clock. */
|
/* The number of nano seconds between each core clock. */
|
||||||
#define mainNS_PER_CLOCK ( ( unsigned portLONG ) ( ( 1.0 / ( double ) ( configCPU_CLOCK_HZ >> 1 ) ) * 1000000000.0 ) )
|
#define mainNS_PER_CLOCK ( ( unsigned long ) ( ( 1.0 / ( double ) ( configCPU_CLOCK_HZ >> 1 ) ) * 1000000000.0 ) )
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -197,12 +197,12 @@ static xQueueHandle xLCDQueue;
|
||||||
|
|
||||||
/* Flag used by prvTestTask1() and prvTestTask2() to indicate their status
|
/* Flag used by prvTestTask1() and prvTestTask2() to indicate their status
|
||||||
(pass/fail). */
|
(pass/fail). */
|
||||||
unsigned portLONG ulStatus1 = pdPASS;
|
unsigned long ulStatus1 = pdPASS;
|
||||||
|
|
||||||
/* Variables incremented by prvTestTask1() and prvTestTask2() respectively on
|
/* Variables incremented by prvTestTask1() and prvTestTask2() respectively on
|
||||||
each iteration of their function. This is used to detect either task stopping
|
each iteration of their function. This is used to detect either task stopping
|
||||||
their execution.. */
|
their execution.. */
|
||||||
unsigned portLONG ulRegTest1Cycles = 0, ulRegTest2Cycles = 0;
|
unsigned long ulRegTest1Cycles = 0, ulRegTest2Cycles = 0;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -293,14 +293,14 @@ static void prvSetupHardware( void )
|
||||||
|
|
||||||
static void prvCheckTask( void *pvParameters )
|
static void prvCheckTask( void *pvParameters )
|
||||||
{
|
{
|
||||||
unsigned portLONG ulLastRegTest1Value = 0, ulLastRegTest2Value = 0, ulTicksToWait = mainNO_ERROR_PERIOD;
|
unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0, ulTicksToWait = mainNO_ERROR_PERIOD;
|
||||||
portTickType xLastExecutionTime;
|
portTickType xLastExecutionTime;
|
||||||
|
|
||||||
/* Buffer into which the high frequency timer count is written as a string. */
|
/* Buffer into which the high frequency timer count is written as a string. */
|
||||||
static portCHAR cStringBuffer[ mainMAX_STRING_LENGTH ];
|
static char cStringBuffer[ mainMAX_STRING_LENGTH ];
|
||||||
|
|
||||||
/* The count of the high frequency timer interrupts. */
|
/* The count of the high frequency timer interrupts. */
|
||||||
extern unsigned portLONG ulHighFrequencyTimerInterrupts;
|
extern unsigned long ulHighFrequencyTimerInterrupts;
|
||||||
xLCDMessage xMessage = { ( 200 / portTICK_RATE_MS ), cStringBuffer };
|
xLCDMessage xMessage = { ( 200 / portTICK_RATE_MS ), cStringBuffer };
|
||||||
|
|
||||||
/* Setup the high frequency, high priority, timer test. It is setup here
|
/* Setup the high frequency, high priority, timer test. It is setup here
|
||||||
|
@ -391,7 +391,7 @@ void vApplicationStackOverflowHook( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void _general_exception_handler( unsigned portLONG ulCause, unsigned portLONG ulStatus )
|
void _general_exception_handler( unsigned long ulCause, unsigned long ulStatus )
|
||||||
{
|
{
|
||||||
/* This overrides the definition provided by the kernel. Other exceptions
|
/* This overrides the definition provided by the kernel. Other exceptions
|
||||||
should be handled here. */
|
should be handled here. */
|
||||||
|
|
|
@ -68,17 +68,17 @@ void __attribute__( (interrupt(ipl0), vector(_TIMER_2_VECTOR))) vT2InterruptWrap
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Incremented every 20,000 interrupts, so should count in seconds. */
|
/* Incremented every 20,000 interrupts, so should count in seconds. */
|
||||||
unsigned portLONG ulHighFrequencyTimerInterrupts = 0;
|
unsigned long ulHighFrequencyTimerInterrupts = 0;
|
||||||
|
|
||||||
/* The frequency at which the timer is interrupting. */
|
/* The frequency at which the timer is interrupting. */
|
||||||
static unsigned portLONG ulFrequencyHz;
|
static unsigned long ulFrequencyHz;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vSetupTimerTest( unsigned portSHORT usFrequencyHz )
|
void vSetupTimerTest( unsigned short usFrequencyHz )
|
||||||
{
|
{
|
||||||
/* Remember the frequency so it can be used from the ISR. */
|
/* Remember the frequency so it can be used from the ISR. */
|
||||||
ulFrequencyHz = ( unsigned portLONG ) usFrequencyHz;
|
ulFrequencyHz = ( unsigned long ) usFrequencyHz;
|
||||||
|
|
||||||
/* T2 is used to generate interrupts above the kernel and max syscall interrupt
|
/* T2 is used to generate interrupts above the kernel and max syscall interrupt
|
||||||
priority. */
|
priority. */
|
||||||
|
@ -86,7 +86,7 @@ void vSetupTimerTest( unsigned portSHORT usFrequencyHz )
|
||||||
TMR2 = 0;
|
TMR2 = 0;
|
||||||
|
|
||||||
/* Timer 2 is going to interrupt at usFrequencyHz Hz. */
|
/* Timer 2 is going to interrupt at usFrequencyHz Hz. */
|
||||||
PR2 = ( unsigned portSHORT ) ( ( configPERIPHERAL_CLOCK_HZ / ( unsigned portLONG ) usFrequencyHz ) - 1 );
|
PR2 = ( unsigned short ) ( ( configPERIPHERAL_CLOCK_HZ / ( unsigned long ) usFrequencyHz ) - 1 );
|
||||||
|
|
||||||
/* Setup timer 2 interrupt priority to be above the kernel priority so
|
/* Setup timer 2 interrupt priority to be above the kernel priority so
|
||||||
the timer jitter is not effected by the kernel activity. */
|
the timer jitter is not effected by the kernel activity. */
|
||||||
|
@ -105,7 +105,7 @@ void vSetupTimerTest( unsigned portSHORT usFrequencyHz )
|
||||||
|
|
||||||
void vT2InterruptHandler( void )
|
void vT2InterruptHandler( void )
|
||||||
{
|
{
|
||||||
static unsigned portLONG ulCalls = 0;
|
static unsigned long ulCalls = 0;
|
||||||
|
|
||||||
++ulCalls;
|
++ulCalls;
|
||||||
if( ulCalls >= ulFrequencyHz )
|
if( ulCalls >= ulFrequencyHz )
|
||||||
|
|
Loading…
Reference in a new issue