extern portBASE_TYPE xSecondTimerHandler( void );\r
/*---------------------------------------------------------------------------*/\r
\r
extern portBASE_TYPE xSecondTimerHandler( void );\r
/*---------------------------------------------------------------------------*/\r
\r
-CY_ISR_PROTO(vHighFrequencyFirstISR);\r
-CY_ISR_PROTO(vHighFrequencySecondISR);\r
+CY_ISR_PROTO( vHighFrequencyFirstISR );\r
+CY_ISR_PROTO( vHighFrequencySecondISR );\r
/*---------------------------------------------------------------------------*/\r
\r
/**\r
/*---------------------------------------------------------------------------*/\r
\r
/**\r
{\r
/* Initialise and start the First Timer ISR. */\r
isr_High_Frequency_2000Hz_ClearPending();\r
{\r
/* Initialise and start the First Timer ISR. */\r
isr_High_Frequency_2000Hz_ClearPending();\r
- isr_High_Frequency_2000Hz_StartEx((cyisraddress)vHighFrequencyFirstISR);\r
+ isr_High_Frequency_2000Hz_StartEx( ( cyisraddress ) vHighFrequencyFirstISR );\r
\r
/* Initialise and start the Second Timer ISR. */\r
isr_High_Frequency_2001Hz_ClearPending();\r
\r
/* Initialise and start the Second Timer ISR. */\r
isr_High_Frequency_2001Hz_ClearPending();\r
- isr_High_Frequency_2001Hz_StartEx((cyisraddress)vHighFrequencySecondISR);\r
+ isr_High_Frequency_2001Hz_StartEx( ( cyisraddress ) vHighFrequencySecondISR );\r
}\r
taskEXIT_CRITICAL();\r
}\r
}\r
taskEXIT_CRITICAL();\r
}\r
void vParTestInitialise( void )\r
{\r
long lIndex;\r
void vParTestInitialise( void )\r
{\r
long lIndex;\r
- for ( lIndex = 0; lIndex < partstMAX_LED; lIndex++ )\r
+\r
+ for( lIndex = 0; lIndex < partstMAX_LED; lIndex++ )\r
{\r
cLedOutput[ lIndex ] = 0;\r
}\r
{\r
cLedOutput[ lIndex ] = 0;\r
}\r
{\r
taskENTER_CRITICAL();\r
{\r
{\r
taskENTER_CRITICAL();\r
{\r
{\r
case 0:\r
Pin_LED_0_Write( xValue & 0x1 );\r
{\r
case 0:\r
Pin_LED_0_Write( xValue & 0x1 );\r
taskEXIT_CRITICAL();\r
\r
/* Record the output for the sake of toggling. */\r
taskEXIT_CRITICAL();\r
\r
/* Record the output for the sake of toggling. */\r
- if ( uxLED < partstMAX_LED )\r
+ if( uxLED < partstMAX_LED )\r
{\r
cLedOutput[ uxLED ] = ( xValue & 0x1 );\r
}\r
{\r
cLedOutput[ uxLED ] = ( xValue & 0x1 );\r
}\r
\r
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )\r
{\r
\r
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )\r
{\r
- if ( uxLED < partstMAX_LED )\r
+ if( uxLED < partstMAX_LED )\r
{\r
vParTestSetLED( uxLED, !cLedOutput[ uxLED ] );\r
}\r
{\r
vParTestSetLED( uxLED, !cLedOutput[ uxLED ] );\r
}\r
#define serialSTRING_DELAY_TICKS ( portMAX_DELAY )\r
/*---------------------------------------------------------------------------*/\r
\r
#define serialSTRING_DELAY_TICKS ( portMAX_DELAY )\r
/*---------------------------------------------------------------------------*/\r
\r
-CY_ISR_PROTO(vUartRxISR);\r
-CY_ISR_PROTO(vUartTxISR);\r
+CY_ISR_PROTO( vUartRxISR );\r
+CY_ISR_PROTO( vUartTxISR );\r
/*---------------------------------------------------------------------------*/\r
\r
static xQueueHandle xSerialTxQueue = NULL;\r
/*---------------------------------------------------------------------------*/\r
\r
static xQueueHandle xSerialTxQueue = NULL;\r
UART_1_SetTxInterruptMode( 0 );\r
\r
/* Both configured successfully. */\r
UART_1_SetTxInterruptMode( 0 );\r
\r
/* Both configured successfully. */\r
- return (xComPortHandle)( xSerialTxQueue && xSerialRxQueue );\r
+ return ( xComPortHandle )( xSerialTxQueue && xSerialRxQueue );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength )\r
{\r
unsigned short usIndex = 0;\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength )\r
{\r
unsigned short usIndex = 0;\r
- for ( usIndex = 0; usIndex < usStringLength; usIndex++ )\r
+\r
+ for( usIndex = 0; usIndex < usStringLength; usIndex++ )\r
{\r
/* Check for pre-mature end of line. */\r
{\r
/* Check for pre-mature end of line. */\r
- if ( '\0' == pcString[ usIndex ] )\r
+ if( '\0' == pcString[ usIndex ] )\r
{\r
break;\r
}\r
\r
/* Send out, one character at a time. */\r
{\r
break;\r
}\r
\r
/* Send out, one character at a time. */\r
- if ( pdTRUE != xSerialPutChar( NULL, pcString[ usIndex ], serialSTRING_DELAY_TICKS ) )\r
+ if( pdTRUE != xSerialPutChar( NULL, pcString[ usIndex ], serialSTRING_DELAY_TICKS ) )\r
{\r
/* Failed to send, this will be picked up in the receive comtest task. */\r
}\r
{\r
/* Failed to send, this will be picked up in the receive comtest task. */\r
}\r
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )\r
{\r
portBASE_TYPE xReturn = pdFALSE;\r
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )\r
{\r
portBASE_TYPE xReturn = pdFALSE;\r
- if ( pdTRUE == xQueueReceive( xSerialRxQueue, pcRxedChar, xBlockTime ) )\r
+\r
+ if( pdTRUE == xQueueReceive( xSerialRxQueue, pcRxedChar, xBlockTime ) )\r
{\r
/* Picked up a character. */\r
xReturn = pdTRUE;\r
{\r
/* Picked up a character. */\r
xReturn = pdTRUE;\r
portBASE_TYPE xReturn = pdFALSE;\r
\r
/* The ISR is processing characters is so just add to the end of the queue. */\r
portBASE_TYPE xReturn = pdFALSE;\r
\r
/* The ISR is processing characters is so just add to the end of the queue. */\r
- if ( pdTRUE == xQueueSend( xSerialTxQueue, &cOutChar, xBlockTime ) )\r
+ if( pdTRUE == xQueueSend( xSerialTxQueue, &cOutChar, xBlockTime ) )\r
{ \r
xReturn = pdTRUE;\r
}\r
{ \r
xReturn = pdTRUE;\r
}\r
}\r
\r
/* Make sure that the interrupt will fire in the case where:\r
}\r
\r
/* Make sure that the interrupt will fire in the case where:\r
- * Currently sending so the Tx Complete will fire.\r
- * Not sending so the Empty will fire.\r
- */\r
+ Currently sending so the Tx Complete will fire.\r
+ Not sending so the Empty will fire. */\r
taskENTER_CRITICAL();\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE | UART_1_TX_STS_FIFO_EMPTY );\r
taskEXIT_CRITICAL();\r
taskENTER_CRITICAL();\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE | UART_1_TX_STS_FIFO_EMPTY );\r
taskEXIT_CRITICAL();\r
\r
CY_ISR(vUartRxISR)\r
{\r
\r
CY_ISR(vUartRxISR)\r
{\r
-portBASE_TYPE xTaskWoken = pdFALSE;\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
volatile unsigned char ucStatus = 0;\r
signed char cInChar = 0;\r
unsigned long ulMask = 0;\r
volatile unsigned char ucStatus = 0;\r
signed char cInChar = 0;\r
unsigned long ulMask = 0;\r
ucStatus = UART_1_ReadRxStatus();\r
\r
/* Only interested in a character being received. */\r
ucStatus = UART_1_ReadRxStatus();\r
\r
/* Only interested in a character being received. */\r
- if ( 0 != ( ucStatus & UART_1_RX_STS_FIFO_NOTEMPTY ) )\r
+ if( 0 != ( ucStatus & UART_1_RX_STS_FIFO_NOTEMPTY ) )\r
{\r
/* Get the character. */\r
cInChar = UART_1_GetChar();\r
{\r
/* Get the character. */\r
cInChar = UART_1_GetChar();\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
/* Try to deliver the character. */\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
/* Try to deliver the character. */\r
- if ( pdTRUE != xQueueSendFromISR( xSerialRxQueue, &cInChar, &xTaskWoken ) )\r
+ if( pdTRUE != xQueueSendFromISR( xSerialRxQueue, &cInChar, &xHigherPriorityTaskWoken ) )\r
{\r
/* Run out of space. */\r
}\r
{\r
/* Run out of space. */\r
}\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
- /* If we delivered the character then a context switch might be required. */\r
- portEND_SWITCHING_ISR( xTaskWoken );\r
+ /* If we delivered the character then a context switch might be required.\r
+ xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling \r
+ xQueueSendFromISR() caused a task to unblock, and the unblocked task has\r
+ a priority equal to or higher than the currently running task (the task this\r
+ ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and\r
+ portEND_SWITCHING_ISR() will request a context switch to the newly unblocked\r
+ task. */\r
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
CY_ISR(vUartTxISR)\r
{\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
CY_ISR(vUartTxISR)\r
{\r
-portBASE_TYPE xTaskWoken = pdFALSE;\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
volatile unsigned char ucStatus = 0;\r
signed char cOutChar = 0;\r
unsigned long ulMask = 0;\r
volatile unsigned char ucStatus = 0;\r
signed char cOutChar = 0;\r
unsigned long ulMask = 0;\r
ucStatus = UART_1_ReadTxStatus();\r
\r
/* Check to see whether this is a genuine interrupt. */\r
ucStatus = UART_1_ReadTxStatus();\r
\r
/* Check to see whether this is a genuine interrupt. */\r
- if ( ( 0 != ( ucStatus & UART_1_TX_STS_COMPLETE ) )\r
- || ( 0 != ( ucStatus & UART_1_TX_STS_FIFO_EMPTY ) ) )\r
+ if( ( 0 != ( ucStatus & UART_1_TX_STS_COMPLETE ) ) || ( 0 != ( ucStatus & UART_1_TX_STS_FIFO_EMPTY ) ) )\r
{ \r
/* Mask off the other RTOS interrupts to interact with the queue. */\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
{ \r
/* Mask off the other RTOS interrupts to interact with the queue. */\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
- if ( pdTRUE == xQueueReceiveFromISR( xSerialTxQueue, &cOutChar, &xTaskWoken ) )\r
+ if( pdTRUE == xQueueReceiveFromISR( xSerialTxQueue, &cOutChar, &xHigherPriorityTaskWoken ) )\r
{\r
/* Send the next character. */\r
UART_1_PutChar( cOutChar ); \r
\r
/* If we are firing, then the only interrupt we are interested in\r
{\r
/* Send the next character. */\r
UART_1_PutChar( cOutChar ); \r
\r
/* If we are firing, then the only interrupt we are interested in\r
- * is the Complete. The application code will add the Empty interrupt\r
- * when there is something else to be done.\r
- */\r
+ is the Complete. The application code will add the Empty interrupt\r
+ when there is something else to be done. */\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE );\r
}\r
else\r
{\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE );\r
}\r
else\r
{\r
- /* There is no work left so disable the interrupt\r
- * until the application puts more into the queue.\r
- */\r
+ /* There is no work left so disable the interrupt until the application \r
+ puts more into the queue. */\r
UART_1_SetTxInterruptMode( 0 );\r
}\r
}\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
UART_1_SetTxInterruptMode( 0 );\r
}\r
}\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
- /* If we delivered the character then a context switch might be required. */\r
- portEND_SWITCHING_ISR( xTaskWoken );\r
+ /* If we delivered the character then a context switch might be required.\r
+ xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling \r
+ xQueueSendFromISR() caused a task to unblock, and the unblocked task has\r
+ a priority equal to or higher than the currently running task (the task this\r
+ ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and\r
+ portEND_SWITCHING_ISR() will request a context switch to the newly unblocked\r
+ task. */\r
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
/*---------------------------------------------------------------------------*/\r
}\r
/*---------------------------------------------------------------------------*/\r
extern void vSetupTimerTest( void );\r
/*---------------------------------------------------------------------------*/\r
\r
extern void vSetupTimerTest( void );\r
/*---------------------------------------------------------------------------*/\r
\r
* The Check task periodical interrogates each of the running tests to\r
* ensure that they are still executing correctly.\r
* If all the tests pass, then the LCD is updated with Pass, the number of \r
* The Check task periodical interrogates each of the running tests to\r
* ensure that they are still executing correctly.\r
* If all the tests pass, then the LCD is updated with Pass, the number of \r
*/\r
void vCheckTask( void *pvParameters );\r
\r
*/\r
void vCheckTask( void *pvParameters );\r
\r
* Installs the RTOS interrupt handlers and starts the peripherals.\r
*/\r
static void prvHardwareSetup( void );\r
* Installs the RTOS interrupt handlers and starts the peripherals.\r
*/\r
static void prvHardwareSetup( void );\r
/* Place your initialization/startup code here (e.g. MyInst_Start()) */\r
prvHardwareSetup();\r
\r
/* Place your initialization/startup code here (e.g. MyInst_Start()) */\r
prvHardwareSetup();\r
\r
- /* Poll the switch connected to P1[7]\r
- * to prevent the Soak test from (re)starting.\r
- */\r
- while ( 0 != Startup_Release_Switch_Read() )\r
- {\r
- if ( 100000 <= ulIteration++ )\r
- {\r
- vParTestToggleLED( ulLed++ );\r
- ulLed = ulLed % 4;\r
- ulIteration = 0;\r
- }\r
- }\r
- \r
- /* Reset the LEDS. */\r
- for ( ulLed = 0; ulLed < 4; ulLed++ )\r
- {\r
- vParTestSetLED( ulLed, pdFALSE );\r
- }\r
-\r
/* Start the standard demo tasks. These are just here to exercise the\r
kernel port and provide examples of how the FreeRTOS API can be used. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
/* Start the standard demo tasks. These are just here to exercise the\r
kernel port and provide examples of how the FreeRTOS API can be used. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vStartInterruptQueueTasks();\r
\r
/* Start the error checking task. */\r
vStartInterruptQueueTasks();\r
\r
/* Start the error checking task. */\r
- (void)xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ ( void ) xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
task. The idle task is created within vTaskStartScheduler(). */\r
vTaskStartScheduler();\r
\r
task. The idle task is created within vTaskStartScheduler(). */\r
vTaskStartScheduler();\r
\r
- /* Should never reach here. */\r
- for (;;);\r
+ /* Should never reach here as the kernel will now be running. If\r
+ vTaskStartScheduler() does return then it is very likely that there was\r
+ insufficient (FreeRTOS) heap space available to create all the tasks,\r
+ including the idle task that is created within vTaskStartScheduler() itself. */\r
+ for( ;; );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
extern cyisraddress CyRamVectors[];\r
\r
/* Install the OS Interrupt Handlers. */\r
extern cyisraddress CyRamVectors[];\r
\r
/* Install the OS Interrupt Handlers. */\r
- CyRamVectors[11] = (cyisraddress)vPortSVCHandler;\r
- CyRamVectors[14] = (cyisraddress)xPortPendSVHandler;\r
- CyRamVectors[15] = (cyisraddress)xPortSysTickHandler;\r
+ CyRamVectors[ 11 ] = ( cyisraddress ) vPortSVCHandler;\r
+ CyRamVectors[ 14 ] = ( cyisraddress ) xPortPendSVHandler;\r
+ CyRamVectors[ 15 ] = ( cyisraddress ) xPortSysTickHandler;\r
\r
/* Start-up the peripherals. */\r
\r
/* Enable and clear the LCD Display. */\r
LCD_Character_Display_Start();\r
LCD_Character_Display_ClearDisplay();\r
\r
/* Start-up the peripherals. */\r
\r
/* Enable and clear the LCD Display. */\r
LCD_Character_Display_Start();\r
LCD_Character_Display_ClearDisplay();\r
- LCD_Character_Display_Position(0,0);\r
- LCD_Character_Display_PrintString("www.FreeRTOS.org ");\r
- LCD_Character_Display_Position(1,0);\r
+ LCD_Character_Display_Position( 0, 0 );\r
+ LCD_Character_Display_PrintString( "www.FreeRTOS.org " );\r
+ LCD_Character_Display_Position( 1, 0 );\r
LCD_Character_Display_PrintString("CY8C5588AX-060 ");\r
\r
/* Start the UART. */\r
LCD_Character_Display_PrintString("CY8C5588AX-060 ");\r
\r
/* Start the UART. */\r
/* Intialise the sleeper. */\r
xDelay = xTaskGetTickCount();\r
\r
/* Intialise the sleeper. */\r
xDelay = xTaskGetTickCount();\r
\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );\r
\r
/* Check that all of the Demo tasks are still running. */\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );\r
\r
/* Check that all of the Demo tasks are still running. */\r
- if ( pdTRUE != xAreBlockingQueuesStillRunning() )\r
+ if( pdTRUE != xAreBlockingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x1;\r
}\r
\r
{\r
usErrorCode |= 0x1;\r
}\r
\r
- if ( pdTRUE != xAreBlockTimeTestTasksStillRunning() )\r
+ if( pdTRUE != xAreBlockTimeTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x2;\r
}\r
\r
{\r
usErrorCode |= 0x2;\r
}\r
\r
- if ( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )\r
+ if( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x4;\r
}\r
\r
{\r
usErrorCode |= 0x4;\r
}\r
\r
- if ( pdTRUE != xIsCreateTaskStillRunning() )\r
+ if( pdTRUE != xIsCreateTaskStillRunning() )\r
{\r
usErrorCode |= 0x8;\r
}\r
\r
{\r
usErrorCode |= 0x8;\r
}\r
\r
- if ( pdTRUE != xAreDynamicPriorityTasksStillRunning() )\r
+ if( pdTRUE != xAreDynamicPriorityTasksStillRunning() )\r
{\r
usErrorCode |= 0x10;\r
}\r
\r
{\r
usErrorCode |= 0x10;\r
}\r
\r
- if ( pdTRUE != xAreMathsTaskStillRunning() )\r
+ if( pdTRUE != xAreMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x20;\r
}\r
\r
{\r
usErrorCode |= 0x20;\r
}\r
\r
- if ( pdTRUE != xAreGenericQueueTasksStillRunning() )\r
+ if( pdTRUE != xAreGenericQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x40;\r
}\r
\r
{\r
usErrorCode |= 0x40;\r
}\r
\r
- if ( pdTRUE != xAreIntegerMathsTaskStillRunning() )\r
+ if( pdTRUE != xAreIntegerMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x80;\r
}\r
\r
{\r
usErrorCode |= 0x80;\r
}\r
\r
- if ( pdTRUE != xArePollingQueuesStillRunning() )\r
+ if( pdTRUE != xArePollingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x100;\r
}\r
\r
{\r
usErrorCode |= 0x100;\r
}\r
\r
- if ( pdTRUE != xAreQueuePeekTasksStillRunning() )\r
+ if( pdTRUE != xAreQueuePeekTasksStillRunning() )\r
{\r
usErrorCode |= 0x200;\r
}\r
\r
{\r
usErrorCode |= 0x200;\r
}\r
\r
- if ( pdTRUE != xAreSemaphoreTasksStillRunning() )\r
+ if( pdTRUE != xAreSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x400;\r
}\r
\r
{\r
usErrorCode |= 0x400;\r
}\r
\r
- if ( pdTRUE != xAreComTestTasksStillRunning() )\r
+ if( pdTRUE != xAreComTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x800;\r
}\r
\r
{\r
usErrorCode |= 0x800;\r
}\r
\r
- if ( pdTRUE != xAreIntQueueTasksStillRunning() )\r
+ if( pdTRUE != xAreIntQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x1000;\r
}\r
\r
/* Clear the display. */\r
LCD_Character_Display_ClearDisplay();\r
{\r
usErrorCode |= 0x1000;\r
}\r
\r
/* Clear the display. */\r
LCD_Character_Display_ClearDisplay();\r
- if ( 0 == usErrorCode )\r
+ if( 0 == usErrorCode )\r
- LCD_Character_Display_Position( (ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Pass: ");\r
- LCD_Character_Display_PrintNumber(ulIteration++);\r
- LCD_Character_Display_Position( (++ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Jitter(ns):");\r
- LCD_Character_Display_PrintNumber((usMaxJitter * mainNS_PER_CLOCK));\r
+ LCD_Character_Display_Position( ( ulRow ) & 0x1, 0);\r
+ LCD_Character_Display_PrintString( "Pass: " );\r
+ LCD_Character_Display_PrintNumber( ulIteration++ );\r
+ LCD_Character_Display_Position( ( ++ulRow ) & 0x1, 0 );\r
+ LCD_Character_Display_PrintString( "Jitter(ns):" );\r
+ LCD_Character_Display_PrintNumber( ( usMaxJitter * mainNS_PER_CLOCK ) );\r
}\r
else\r
{\r
/* Do something to indicate the failure. */\r
}\r
else\r
{\r
/* Do something to indicate the failure. */\r
- LCD_Character_Display_Position( (ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Fail at: ");\r
- LCD_Character_Display_PrintNumber(ulIteration);\r
- LCD_Character_Display_Position( (++ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Error: 0x");\r
- LCD_Character_Display_PrintHexUint16(usErrorCode);\r
+ LCD_Character_Display_Position( ( ulRow ) & 0x1, 0 );\r
+ LCD_Character_Display_PrintString( "Fail at: " );\r
+ LCD_Character_Display_PrintNumber( ulIteration );\r
+ LCD_Character_Display_Position( ( ++ulRow ) & 0x1, 0 );\r
+ LCD_Character_Display_PrintString( "Error: 0x" );\r
+ LCD_Character_Display_PrintHexUint16( usErrorCode );\r
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )\r
{\r
/* The stack space has been execeeded for a task, considering allocating more. */\r
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )\r
{\r
/* The stack space has been execeeded for a task, considering allocating more. */\r
+ taskDISABLE_INTERRUPTS();\r
+ for( ;; );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vApplicationMallocFailedHook( void )\r
{\r
/* The heap space has been execeeded. */\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vApplicationMallocFailedHook( void )\r
{\r
/* The heap space has been execeeded. */\r
+ taskDISABLE_INTERRUPTS();\r
+ for( ;; );\r
}\r
/*---------------------------------------------------------------------------*/\r
}\r
/*---------------------------------------------------------------------------*/\r
extern portBASE_TYPE xSecondTimerHandler( void );\r
/*---------------------------------------------------------------------------*/\r
\r
extern portBASE_TYPE xSecondTimerHandler( void );\r
/*---------------------------------------------------------------------------*/\r
\r
-CY_ISR_PROTO(vHighFrequencyFirstISR);\r
-CY_ISR_PROTO(vHighFrequencySecondISR);\r
+CY_ISR_PROTO( vHighFrequencyFirstISR );\r
+CY_ISR_PROTO( vHighFrequencySecondISR );\r
/*---------------------------------------------------------------------------*/\r
\r
/**\r
/*---------------------------------------------------------------------------*/\r
\r
/**\r
{\r
/* Initialise and start the First Timer ISR. */\r
isr_High_Frequency_2000Hz_ClearPending();\r
{\r
/* Initialise and start the First Timer ISR. */\r
isr_High_Frequency_2000Hz_ClearPending();\r
- isr_High_Frequency_2000Hz_StartEx((cyisraddress)vHighFrequencyFirstISR);\r
+ isr_High_Frequency_2000Hz_StartEx( ( cyisraddress ) vHighFrequencyFirstISR );\r
\r
/* Initialise and start the Second Timer ISR. */\r
isr_High_Frequency_2001Hz_ClearPending();\r
\r
/* Initialise and start the Second Timer ISR. */\r
isr_High_Frequency_2001Hz_ClearPending();\r
- isr_High_Frequency_2001Hz_StartEx((cyisraddress)vHighFrequencySecondISR);\r
+ isr_High_Frequency_2001Hz_StartEx( ( cyisraddress ) vHighFrequencySecondISR );\r
}\r
taskEXIT_CRITICAL();\r
}\r
}\r
taskEXIT_CRITICAL();\r
}\r
void vParTestInitialise( void )\r
{\r
long lIndex;\r
void vParTestInitialise( void )\r
{\r
long lIndex;\r
- for ( lIndex = 0; lIndex < partstMAX_LED; lIndex++ )\r
+\r
+ for( lIndex = 0; lIndex < partstMAX_LED; lIndex++ )\r
{\r
cLedOutput[ lIndex ] = 0;\r
}\r
{\r
cLedOutput[ lIndex ] = 0;\r
}\r
{\r
taskENTER_CRITICAL();\r
{\r
{\r
taskENTER_CRITICAL();\r
{\r
{\r
case 0:\r
Pin_LED_0_Write( xValue & 0x1 );\r
{\r
case 0:\r
Pin_LED_0_Write( xValue & 0x1 );\r
taskEXIT_CRITICAL();\r
\r
/* Record the output for the sake of toggling. */\r
taskEXIT_CRITICAL();\r
\r
/* Record the output for the sake of toggling. */\r
- if ( uxLED < partstMAX_LED )\r
+ if( uxLED < partstMAX_LED )\r
{\r
cLedOutput[ uxLED ] = ( xValue & 0x1 );\r
}\r
{\r
cLedOutput[ uxLED ] = ( xValue & 0x1 );\r
}\r
\r
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )\r
{\r
\r
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )\r
{\r
- if ( uxLED < partstMAX_LED )\r
+ if( uxLED < partstMAX_LED )\r
{\r
vParTestSetLED( uxLED, !cLedOutput[ uxLED ] );\r
}\r
{\r
vParTestSetLED( uxLED, !cLedOutput[ uxLED ] );\r
}\r
#define serialSTRING_DELAY_TICKS ( portMAX_DELAY )\r
/*---------------------------------------------------------------------------*/\r
\r
#define serialSTRING_DELAY_TICKS ( portMAX_DELAY )\r
/*---------------------------------------------------------------------------*/\r
\r
-CY_ISR_PROTO(vUartRxISR);\r
-CY_ISR_PROTO(vUartTxISR);\r
+CY_ISR_PROTO( vUartRxISR );\r
+CY_ISR_PROTO( vUartTxISR );\r
/*---------------------------------------------------------------------------*/\r
\r
static xQueueHandle xSerialTxQueue = NULL;\r
/*---------------------------------------------------------------------------*/\r
\r
static xQueueHandle xSerialTxQueue = NULL;\r
UART_1_SetTxInterruptMode( 0 );\r
\r
/* Both configured successfully. */\r
UART_1_SetTxInterruptMode( 0 );\r
\r
/* Both configured successfully. */\r
- return (xComPortHandle)( xSerialTxQueue && xSerialRxQueue );\r
+ return ( xComPortHandle )( xSerialTxQueue && xSerialRxQueue );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength )\r
{\r
unsigned short usIndex = 0;\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength )\r
{\r
unsigned short usIndex = 0;\r
- for ( usIndex = 0; usIndex < usStringLength; usIndex++ )\r
+\r
+ for( usIndex = 0; usIndex < usStringLength; usIndex++ )\r
{\r
/* Check for pre-mature end of line. */\r
{\r
/* Check for pre-mature end of line. */\r
- if ( '\0' == pcString[ usIndex ] )\r
+ if( '\0' == pcString[ usIndex ] )\r
{\r
break;\r
}\r
\r
/* Send out, one character at a time. */\r
{\r
break;\r
}\r
\r
/* Send out, one character at a time. */\r
- if ( pdTRUE != xSerialPutChar( NULL, pcString[ usIndex ], serialSTRING_DELAY_TICKS ) )\r
+ if( pdTRUE != xSerialPutChar( NULL, pcString[ usIndex ], serialSTRING_DELAY_TICKS ) )\r
{\r
/* Failed to send, this will be picked up in the receive comtest task. */\r
}\r
{\r
/* Failed to send, this will be picked up in the receive comtest task. */\r
}\r
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )\r
{\r
portBASE_TYPE xReturn = pdFALSE;\r
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )\r
{\r
portBASE_TYPE xReturn = pdFALSE;\r
- if ( pdTRUE == xQueueReceive( xSerialRxQueue, pcRxedChar, xBlockTime ) )\r
+\r
+ if( pdTRUE == xQueueReceive( xSerialRxQueue, pcRxedChar, xBlockTime ) )\r
{\r
/* Picked up a character. */\r
xReturn = pdTRUE;\r
{\r
/* Picked up a character. */\r
xReturn = pdTRUE;\r
portBASE_TYPE xReturn = pdFALSE;\r
\r
/* The ISR is processing characters is so just add to the end of the queue. */\r
portBASE_TYPE xReturn = pdFALSE;\r
\r
/* The ISR is processing characters is so just add to the end of the queue. */\r
- if ( pdTRUE == xQueueSend( xSerialTxQueue, &cOutChar, xBlockTime ) )\r
+ if( pdTRUE == xQueueSend( xSerialTxQueue, &cOutChar, xBlockTime ) )\r
{ \r
xReturn = pdTRUE;\r
}\r
{ \r
xReturn = pdTRUE;\r
}\r
}\r
\r
/* Make sure that the interrupt will fire in the case where:\r
}\r
\r
/* Make sure that the interrupt will fire in the case where:\r
- * Currently sending so the Tx Complete will fire.\r
- * Not sending so the Empty will fire.\r
- */\r
+ Currently sending so the Tx Complete will fire.\r
+ Not sending so the Empty will fire. */\r
taskENTER_CRITICAL();\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE | UART_1_TX_STS_FIFO_EMPTY );\r
taskEXIT_CRITICAL();\r
taskENTER_CRITICAL();\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE | UART_1_TX_STS_FIFO_EMPTY );\r
taskEXIT_CRITICAL();\r
\r
CY_ISR(vUartRxISR)\r
{\r
\r
CY_ISR(vUartRxISR)\r
{\r
-portBASE_TYPE xTaskWoken = pdFALSE;\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
volatile unsigned char ucStatus = 0;\r
signed char cInChar = 0;\r
unsigned long ulMask = 0;\r
volatile unsigned char ucStatus = 0;\r
signed char cInChar = 0;\r
unsigned long ulMask = 0;\r
ucStatus = UART_1_ReadRxStatus();\r
\r
/* Only interested in a character being received. */\r
ucStatus = UART_1_ReadRxStatus();\r
\r
/* Only interested in a character being received. */\r
- if ( 0 != ( ucStatus & UART_1_RX_STS_FIFO_NOTEMPTY ) )\r
+ if( 0 != ( ucStatus & UART_1_RX_STS_FIFO_NOTEMPTY ) )\r
{\r
/* Get the character. */\r
cInChar = UART_1_GetChar();\r
{\r
/* Get the character. */\r
cInChar = UART_1_GetChar();\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
/* Try to deliver the character. */\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
/* Try to deliver the character. */\r
- if ( pdTRUE != xQueueSendFromISR( xSerialRxQueue, &cInChar, &xTaskWoken ) )\r
+ if( pdTRUE != xQueueSendFromISR( xSerialRxQueue, &cInChar, &xHigherPriorityTaskWoken ) )\r
{\r
/* Run out of space. */\r
}\r
{\r
/* Run out of space. */\r
}\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
- /* If we delivered the character then a context switch might be required. */\r
- portEND_SWITCHING_ISR( xTaskWoken );\r
+ /* If we delivered the character then a context switch might be required.\r
+ xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling \r
+ xQueueSendFromISR() caused a task to unblock, and the unblocked task has\r
+ a priority equal to or higher than the currently running task (the task this\r
+ ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and\r
+ portEND_SWITCHING_ISR() will request a context switch to the newly unblocked\r
+ task. */\r
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
CY_ISR(vUartTxISR)\r
{\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
CY_ISR(vUartTxISR)\r
{\r
-portBASE_TYPE xTaskWoken = pdFALSE;\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
volatile unsigned char ucStatus = 0;\r
signed char cOutChar = 0;\r
unsigned long ulMask = 0;\r
volatile unsigned char ucStatus = 0;\r
signed char cOutChar = 0;\r
unsigned long ulMask = 0;\r
ucStatus = UART_1_ReadTxStatus();\r
\r
/* Check to see whether this is a genuine interrupt. */\r
ucStatus = UART_1_ReadTxStatus();\r
\r
/* Check to see whether this is a genuine interrupt. */\r
- if ( ( 0 != ( ucStatus & UART_1_TX_STS_COMPLETE ) )\r
- || ( 0 != ( ucStatus & UART_1_TX_STS_FIFO_EMPTY ) ) )\r
+ if( ( 0 != ( ucStatus & UART_1_TX_STS_COMPLETE ) ) || ( 0 != ( ucStatus & UART_1_TX_STS_FIFO_EMPTY ) ) )\r
{ \r
/* Mask off the other RTOS interrupts to interact with the queue. */\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
{ \r
/* Mask off the other RTOS interrupts to interact with the queue. */\r
ulMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
- if ( pdTRUE == xQueueReceiveFromISR( xSerialTxQueue, &cOutChar, &xTaskWoken ) )\r
+ if( pdTRUE == xQueueReceiveFromISR( xSerialTxQueue, &cOutChar, &xHigherPriorityTaskWoken ) )\r
{\r
/* Send the next character. */\r
UART_1_PutChar( cOutChar ); \r
\r
/* If we are firing, then the only interrupt we are interested in\r
{\r
/* Send the next character. */\r
UART_1_PutChar( cOutChar ); \r
\r
/* If we are firing, then the only interrupt we are interested in\r
- * is the Complete. The application code will add the Empty interrupt\r
- * when there is something else to be done.\r
- */\r
+ is the Complete. The application code will add the Empty interrupt\r
+ when there is something else to be done. */\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE );\r
}\r
else\r
{\r
UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE );\r
}\r
else\r
{\r
- /* There is no work left so disable the interrupt\r
- * until the application puts more into the queue.\r
- */\r
+ /* There is no work left so disable the interrupt until the application \r
+ puts more into the queue. */\r
UART_1_SetTxInterruptMode( 0 );\r
}\r
}\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
UART_1_SetTxInterruptMode( 0 );\r
}\r
}\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulMask );\r
}\r
\r
- /* If we delivered the character then a context switch might be required. */\r
- portEND_SWITCHING_ISR( xTaskWoken );\r
+ /* If we delivered the character then a context switch might be required.\r
+ xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling \r
+ xQueueSendFromISR() caused a task to unblock, and the unblocked task has\r
+ a priority equal to or higher than the currently running task (the task this\r
+ ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and\r
+ portEND_SWITCHING_ISR() will request a context switch to the newly unblocked\r
+ task. */\r
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
/*---------------------------------------------------------------------------*/\r
}\r
/*---------------------------------------------------------------------------*/\r
extern void vSetupTimerTest( void );\r
/*---------------------------------------------------------------------------*/\r
\r
extern void vSetupTimerTest( void );\r
/*---------------------------------------------------------------------------*/\r
\r
* The Check task periodical interrogates each of the running tests to\r
* ensure that they are still executing correctly.\r
* If all the tests pass, then the LCD is updated with Pass, the number of \r
* The Check task periodical interrogates each of the running tests to\r
* ensure that they are still executing correctly.\r
* If all the tests pass, then the LCD is updated with Pass, the number of \r
*/\r
void vCheckTask( void *pvParameters );\r
\r
*/\r
void vCheckTask( void *pvParameters );\r
\r
* Installs the RTOS interrupt handlers and starts the peripherals.\r
*/\r
static void prvHardwareSetup( void );\r
* Installs the RTOS interrupt handlers and starts the peripherals.\r
*/\r
static void prvHardwareSetup( void );\r
/* Place your initialization/startup code here (e.g. MyInst_Start()) */\r
prvHardwareSetup();\r
\r
/* Place your initialization/startup code here (e.g. MyInst_Start()) */\r
prvHardwareSetup();\r
\r
- /* Poll the switch connected to P1[7]\r
- * to prevent the Soak test from (re)starting.\r
- */\r
- while ( 0 != Startup_Release_Switch_Read() )\r
- {\r
- if ( 100000 <= ulIteration++ )\r
- {\r
- vParTestToggleLED( ulLed++ );\r
- ulLed = ulLed % 4;\r
- ulIteration = 0;\r
- }\r
- }\r
- \r
- /* Reset the LEDS. */\r
- for ( ulLed = 0; ulLed < 4; ulLed++ )\r
- {\r
- vParTestSetLED( ulLed, pdFALSE );\r
- }\r
-\r
/* Start the standard demo tasks. These are just here to exercise the\r
kernel port and provide examples of how the FreeRTOS API can be used. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
/* Start the standard demo tasks. These are just here to exercise the\r
kernel port and provide examples of how the FreeRTOS API can be used. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vStartInterruptQueueTasks();\r
\r
/* Start the error checking task. */\r
vStartInterruptQueueTasks();\r
\r
/* Start the error checking task. */\r
- (void)xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ ( void ) xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
task. The idle task is created within vTaskStartScheduler(). */\r
vTaskStartScheduler();\r
\r
task. The idle task is created within vTaskStartScheduler(). */\r
vTaskStartScheduler();\r
\r
- /* Should never reach here. */\r
- for (;;);\r
+ /* Should never reach here as the kernel will now be running. If\r
+ vTaskStartScheduler() does return then it is very likely that there was\r
+ insufficient (FreeRTOS) heap space available to create all the tasks,\r
+ including the idle task that is created within vTaskStartScheduler() itself. */\r
+ for( ;; );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
extern cyisraddress CyRamVectors[];\r
\r
/* Install the OS Interrupt Handlers. */\r
extern cyisraddress CyRamVectors[];\r
\r
/* Install the OS Interrupt Handlers. */\r
- CyRamVectors[11] = (cyisraddress)vPortSVCHandler;\r
- CyRamVectors[14] = (cyisraddress)xPortPendSVHandler;\r
- CyRamVectors[15] = (cyisraddress)xPortSysTickHandler;\r
+ CyRamVectors[ 11 ] = ( cyisraddress ) vPortSVCHandler;\r
+ CyRamVectors[ 14 ] = ( cyisraddress ) xPortPendSVHandler;\r
+ CyRamVectors[ 15 ] = ( cyisraddress ) xPortSysTickHandler;\r
\r
/* Start-up the peripherals. */\r
\r
/* Enable and clear the LCD Display. */\r
LCD_Character_Display_Start();\r
LCD_Character_Display_ClearDisplay();\r
\r
/* Start-up the peripherals. */\r
\r
/* Enable and clear the LCD Display. */\r
LCD_Character_Display_Start();\r
LCD_Character_Display_ClearDisplay();\r
- LCD_Character_Display_Position(0,0);\r
- LCD_Character_Display_PrintString("www.FreeRTOS.org ");\r
- LCD_Character_Display_Position(1,0);\r
+ LCD_Character_Display_Position( 0, 0 );\r
+ LCD_Character_Display_PrintString( "www.FreeRTOS.org " );\r
+ LCD_Character_Display_Position( 1, 0 );\r
LCD_Character_Display_PrintString("CY8C5588AX-060 ");\r
\r
/* Start the UART. */\r
LCD_Character_Display_PrintString("CY8C5588AX-060 ");\r
\r
/* Start the UART. */\r
/* Intialise the sleeper. */\r
xDelay = xTaskGetTickCount();\r
\r
/* Intialise the sleeper. */\r
xDelay = xTaskGetTickCount();\r
\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );\r
\r
/* Check that all of the Demo tasks are still running. */\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );\r
\r
/* Check that all of the Demo tasks are still running. */\r
- if ( pdTRUE != xAreBlockingQueuesStillRunning() )\r
+ if( pdTRUE != xAreBlockingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x1;\r
}\r
\r
{\r
usErrorCode |= 0x1;\r
}\r
\r
- if ( pdTRUE != xAreBlockTimeTestTasksStillRunning() )\r
+ if( pdTRUE != xAreBlockTimeTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x2;\r
}\r
\r
{\r
usErrorCode |= 0x2;\r
}\r
\r
- if ( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )\r
+ if( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x4;\r
}\r
\r
{\r
usErrorCode |= 0x4;\r
}\r
\r
- if ( pdTRUE != xIsCreateTaskStillRunning() )\r
+ if( pdTRUE != xIsCreateTaskStillRunning() )\r
{\r
usErrorCode |= 0x8;\r
}\r
\r
{\r
usErrorCode |= 0x8;\r
}\r
\r
- if ( pdTRUE != xAreDynamicPriorityTasksStillRunning() )\r
+ if( pdTRUE != xAreDynamicPriorityTasksStillRunning() )\r
{\r
usErrorCode |= 0x10;\r
}\r
\r
{\r
usErrorCode |= 0x10;\r
}\r
\r
- if ( pdTRUE != xAreMathsTaskStillRunning() )\r
+ if( pdTRUE != xAreMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x20;\r
}\r
\r
{\r
usErrorCode |= 0x20;\r
}\r
\r
- if ( pdTRUE != xAreGenericQueueTasksStillRunning() )\r
+ if( pdTRUE != xAreGenericQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x40;\r
}\r
\r
{\r
usErrorCode |= 0x40;\r
}\r
\r
- if ( pdTRUE != xAreIntegerMathsTaskStillRunning() )\r
+ if( pdTRUE != xAreIntegerMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x80;\r
}\r
\r
{\r
usErrorCode |= 0x80;\r
}\r
\r
- if ( pdTRUE != xArePollingQueuesStillRunning() )\r
+ if( pdTRUE != xArePollingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x100;\r
}\r
\r
{\r
usErrorCode |= 0x100;\r
}\r
\r
- if ( pdTRUE != xAreQueuePeekTasksStillRunning() )\r
+ if( pdTRUE != xAreQueuePeekTasksStillRunning() )\r
{\r
usErrorCode |= 0x200;\r
}\r
\r
{\r
usErrorCode |= 0x200;\r
}\r
\r
- if ( pdTRUE != xAreSemaphoreTasksStillRunning() )\r
+ if( pdTRUE != xAreSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x400;\r
}\r
\r
{\r
usErrorCode |= 0x400;\r
}\r
\r
- if ( pdTRUE != xAreComTestTasksStillRunning() )\r
+ if( pdTRUE != xAreComTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x800;\r
}\r
\r
{\r
usErrorCode |= 0x800;\r
}\r
\r
- if ( pdTRUE != xAreIntQueueTasksStillRunning() )\r
+ if( pdTRUE != xAreIntQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x1000;\r
}\r
\r
/* Clear the display. */\r
LCD_Character_Display_ClearDisplay();\r
{\r
usErrorCode |= 0x1000;\r
}\r
\r
/* Clear the display. */\r
LCD_Character_Display_ClearDisplay();\r
- if ( 0 == usErrorCode )\r
+ if( 0 == usErrorCode )\r
- LCD_Character_Display_Position( (ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Pass: ");\r
- LCD_Character_Display_PrintNumber(ulIteration++);\r
- LCD_Character_Display_Position( (++ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Jitter(ns):");\r
- LCD_Character_Display_PrintNumber((usMaxJitter * mainNS_PER_CLOCK));\r
+ LCD_Character_Display_Position( ( ulRow ) & 0x1, 0);\r
+ LCD_Character_Display_PrintString( "Pass: " );\r
+ LCD_Character_Display_PrintNumber( ulIteration++ );\r
+ LCD_Character_Display_Position( ( ++ulRow ) & 0x1, 0 );\r
+ LCD_Character_Display_PrintString( "Jitter(ns):" );\r
+ LCD_Character_Display_PrintNumber( ( usMaxJitter * mainNS_PER_CLOCK ) );\r
}\r
else\r
{\r
/* Do something to indicate the failure. */\r
}\r
else\r
{\r
/* Do something to indicate the failure. */\r
- LCD_Character_Display_Position( (ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Fail at: ");\r
- LCD_Character_Display_PrintNumber(ulIteration);\r
- LCD_Character_Display_Position( (++ulRow) & 0x1, 0);\r
- LCD_Character_Display_PrintString("Error: 0x");\r
- LCD_Character_Display_PrintHexUint16(usErrorCode);\r
+ LCD_Character_Display_Position( ( ulRow ) & 0x1, 0 );\r
+ LCD_Character_Display_PrintString( "Fail at: " );\r
+ LCD_Character_Display_PrintNumber( ulIteration );\r
+ LCD_Character_Display_Position( ( ++ulRow ) & 0x1, 0 );\r
+ LCD_Character_Display_PrintString( "Error: 0x" );\r
+ LCD_Character_Display_PrintHexUint16( usErrorCode );\r
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )\r
{\r
/* The stack space has been execeeded for a task, considering allocating more. */\r
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )\r
{\r
/* The stack space has been execeeded for a task, considering allocating more. */\r
+ taskDISABLE_INTERRUPTS();\r
+ for( ;; );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vApplicationMallocFailedHook( void )\r
{\r
/* The heap space has been execeeded. */\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
void vApplicationMallocFailedHook( void )\r
{\r
/* The heap space has been execeeded. */\r
+ taskDISABLE_INTERRUPTS();\r
+ for( ;; );\r
}\r
/*---------------------------------------------------------------------------*/\r
}\r
/*---------------------------------------------------------------------------*/\r