From: richardbarry Date: Thu, 27 Oct 2011 10:45:27 +0000 (+0000) Subject: Updated TriCore demo application. X-Git-Tag: V7.1.0~33 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=97c1736e921d6ca2aac1f2d546404df5423a35d4;p=freertos Updated TriCore demo application. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1627 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/TriCore_TC1782_TriBoard_GCC/.ude/UDEDefEclipseWorkspace.wsx b/Demo/TriCore_TC1782_TriBoard_GCC/.ude/UDEDefEclipseWorkspace.wsx index 0b5b53a9e..65be8fab4 100644 --- a/Demo/TriCore_TC1782_TriBoard_GCC/.ude/UDEDefEclipseWorkspace.wsx +++ b/Demo/TriCore_TC1782_TriBoard_GCC/.ude/UDEDefEclipseWorkspace.wsx @@ -1,6 +1,6 @@ - UDEDefEclipseWorkspace.wsx0012vQTv/gAAAQAQAAIAoAgKAAAAAwAAAAAAPwAAAAAAAAAEAAAAAgAAAAAAAAAAAAAAAAAAAA==3.009.10.2011 23:28:09:000 + UDEDefEclipseWorkspace.wsx0015vQTv/gAAAQAQAAIAoAgKAAAAAwAAAAAAPwAAAAAAAAAEAAAAAgAAAAAAAAAAAAAAAAAAAA==3.009.10.2011 23:28:09:000 @@ -46,13 +46,6 @@ - - - - - - - @@ -83,7 +76,7 @@ - + @@ -99,28 +92,21 @@ - + - - - - - - - - + + + + + + + + - - - - - - - @@ -175,17 +161,37 @@ + + + + - + - + + + + + + + + + + + + + - - - + + + + + + + @@ -204,29 +210,11 @@ - - - - - - - - - - - - - - - - - - - + @@ -235,7 +223,7 @@ - + @@ -246,9 +234,6 @@ - - - @@ -327,8 +312,8 @@ - - + + @@ -394,13 +379,6 @@ - - - - - - - @@ -431,7 +409,7 @@ - + @@ -447,28 +425,21 @@ - + - - - - - - - - + + + + + + + + - - - - - - - @@ -490,161 +461,171 @@ - + - - - + + + + + + + + + + + - - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + - + - - + + - + - - + + - - + + - - + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + @@ -666,7 +647,7 @@ 009.10.2011 23:28:11:619nAAAAD8AAYAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1515524294967295100Samsung SCX-3200 Series..\..\..\..\Program Files (x86)\pls\UDE 3.0\StdLibrary.mso{7c641d47-534f-4ed9-9070-088b60a3befa}..\..\..\..\Users\Public\Documents\pls\UDE 3.0The script contains a collection of macros to save memory content into different file formats +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1515524294967295100Samsung SCX-3200 Series..\..\..\..\Program Files (x86)\pls\UDE 3.0\StdLibrary.mso{7c641d47-534f-4ed9-9070-088b60a3befa}..\..\..\..\Users\Public\Documents\pls\UDE 3.0The script contains a collection of macros to save memory content into different file formats and fill target memory rangesV:\UDE\AddOns\Macro\MacroLibrary\StdMacros1.dsm' ' $Header: /Ude/AddOns/Macro/MacroLibrary/StdMacros.dsm 3 30.04.04 9:34 Weisses $ '_______________________________________________________ @@ -936,4 +917,4 @@ Sub FillDWord(ParameterObj) debugger.Write Address,udearrayobj Next -End Sub63VBScript24.11.2006 14:43:20:0001WS_CORE_DUOMacro_25_10_11_12_15_14_010Execute UnAss ..Macro UnAssExecute macro UnAss0210Execute SaveHEX ..Macro SaveHEXExecute macro SaveHEX0210Execute FillByte ..Macro FillByteExecute macro FillByte0110Execute FillWord ..Macro FillWordExecute macro FillWord0110Execute FillDWord ..Macro FillDWordExecute macro FillDWord015118.10.2011 12:08:31:0830x000000001351684294967295009.10.2011 23:28:11:73713926442949672951009.10.2011 23:28:17:413..\RTOSDemo\main.c13516842949672959024.10.2011 10:48:48:675..\RTOSDemo\FreeRTOS_Source\tasks.c1351684294967295221.10.2011 11:09:25:6341351684294967295..\RTOSDemo\Common_Demo_Source\death.c21.10.2011 11:09:53:005..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\porttrap.c13516842949672953524.10.2011 10:49:13:935..\RTOSDemo\FreeRTOS_Source\queue.c1351684294967295121.10.2011 11:11:16:7721351684294967295..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\port.c25.10.2011 10:02:06:267..\RTOSDemo\Common_Demo_Source\countsem.c13516842949672954625.10.2011 11:38:01:109..\RTOSDemo\Common_Demo_Source\blocktim.c135168429496729525.10.2011 11:40:09:775code <0xC0000000-0xC00003FF>1351684294967295780109.10.2011 23:54:28:21928801920013516842949672950121.10.2011 12:11:03:525009720663003300331351684294967295024.10.2011 11:39:29:87501330033?(*((unsigned long *)0xD000AB80))#0$1,1$#0$1,1$753050300135168429496729500000024.10.2011 11:37:39:7580xD000AB80AAAAAA==AAAAAA==AgAAAA==AQAAAA==AAAAAA==AAAAAA==BAAAAA==
EIXr0Q==
13053398801307275768
1351684294967295
109.10.2011 23:57:15:537<_ExtentX type="bin" size="8">AAAAAA==<_ExtentY type="bin" size="8">AAAAAA==<_StockProps type="bin" size="8">AAAAAA==AgAAAA==UABDAAAAUABDAAAAAAAAAA==YAAAAA==RgB1AG4AYwB0AGkAbwBuAAAARgB1AG4AYwB0AGkAbwBuAAAAAAAAAA==QAYAAA==13516842949672950
OFF010000x00x00000000x00x00000000010000x00x00000000x00x00000000010001120100000001429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672951..\iRAM\FreeRTOS_Demo.elfvCreateTasks01100000verify.txt00000012..\RTOSDemo\Common_Demo_Source\flash.c..\RTOSDemo\ThirdPartyCode\cpufreq.c..\RTOSDemo\Common_Demo_Source\integer.c..\RTOSDemo\main.c..\RTOSDemo\Common_Demo_Source\death.c..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\porttrap.c..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\port.c..\RTOSDemo\FreeRTOS_Source\tasks.c..\RTOSDemo\FreeRTOS_Source\queue.c..\RTOSDemo\Common_Demo_Source\countsem.c..\RTOSDemo\Common_Demo_Source\blocktim.ccode <0xC0000000-0xC00003FF>
.target\TriBoard_TC1782.cfg25.10.2011 12:15:15:000
+End Sub63VBScript24.11.2006 14:43:20:0001WS_CORE_DUOMacro_27_10_11_11_43_15_010Execute UnAss ..Macro UnAssExecute macro UnAss0210Execute SaveHEX ..Macro SaveHEXExecute macro SaveHEX0210Execute FillByte ..Macro FillByteExecute macro FillByte0110Execute FillWord ..Macro FillWordExecute macro FillWord0110Execute FillDWord ..Macro FillDWordExecute macro FillDWord015118.10.2011 12:08:31:0830x000000001351684294967295009.10.2011 23:28:11:73713926442949672951009.10.2011 23:28:17:413..\RTOSDemo\main.c13516842949672952027.10.2011 10:46:52:070..\RTOSDemo\FreeRTOS_Source\tasks.c1351684294967295121.10.2011 11:09:25:6341351684294967295..\RTOSDemo\Common_Demo_Source\death.c21.10.2011 11:09:53:005..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\porttrap.c13516842949672953524.10.2011 10:49:13:935..\RTOSDemo\FreeRTOS_Source\queue.c1351684294967295121.10.2011 11:11:16:7721351684294967295..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\port.c25.10.2011 10:02:06:267..\RTOSDemo\Common_Demo_Source\countsem.c13516842949672954625.10.2011 11:38:01:109..\RTOSDemo\Common_Demo_Source\blocktim.c135168429496729525.10.2011 11:40:09:775code <0xC0000000-0xC00003FF>1351684294967295780109.10.2011 23:54:28:21928801920013516842949672950121.10.2011 12:11:03:525009720663003300331351684294967295024.10.2011 11:39:29:87501330033?(*((unsigned long *)0xD000AB80))#0$1,1$#0$1,1$753050300135168429496729500000024.10.2011 11:37:39:7580xD000AB80AAAAAA==AAAAAA==AgAAAA==AQAAAA==AAAAAA==AAAAAA==BAAAAA==
EIXr0Q==
13053398801307275768
1351684294967295
109.10.2011 23:57:15:537<_ExtentX type="bin" size="8">AAAAAA==<_ExtentY type="bin" size="8">AAAAAA==<_StockProps type="bin" size="8">AAAAAA==AgAAAA==UABDAAAAUABDAAAAAAAAAA==YAAAAA==RgB1AG4AYwB0AGkAbwBuAAAARgB1AG4AYwB0AGkAbwBuAAAAAAAAAA==QAYAAA==13516842949672950
OFF010000x00x00000000x00x00000000010000x00x00000000x00x00000000010001120100000001429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672951..\iRAM\FreeRTOS_Demo.elfvCreateTasks01100000verify.txt00000011..\RTOSDemo\Common_Demo_Source\flash.c..\RTOSDemo\ThirdPartyCode\cpufreq.c..\RTOSDemo\Common_Demo_Source\integer.c..\RTOSDemo\Common_Demo_Source\death.c..\RTOSDemo\Common_Demo_Source\blocktim.c..\RTOSDemo\Common_Demo_Source\countsem.c..\RTOSDemo\FreeRTOS_Source\queue.c..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\port.c..\RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\porttrap.c..\RTOSDemo\main.c..\RTOSDemo\FreeRTOS_Source\tasks.c
.target\TriBoard_TC1782.cfg27.10.2011 11:43:15:000 diff --git a/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h b/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h index 9cea43a5d..403133a4c 100644 --- a/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h @@ -105,21 +105,27 @@ runs from RAM. */ #define configUSE_TICK_HOOK 1 #endif -#define configTIMER_TASK_PRIORITY ( 4 ) -#define configTIMER_QUEUE_LENGTH ( 5 ) -#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE +#define configTIMER_TASK_PRIORITY ( 4 ) +#define configTIMER_QUEUE_LENGTH ( 5 ) +#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. We use --gc-sections when linking, so there is no harm is setting all of these to 1 */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 + +#define configMAX_SYSCALL_INTERRUPT_PRIORITY 64 +#define configKERNEL_INTERRUPT_PRIORITY 1 + +/* Default definition of configASSERT(). */ +//#define configASSERT( x ) if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); for( ;; ); } #endif /* FREERTOS_CONFIG_H */ diff --git a/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/ParTest.c b/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/ParTest.c index ddf4d3eec..1cf7db355 100644 --- a/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/ParTest.c +++ b/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/ParTest.c @@ -57,32 +57,32 @@ /* Demo Includes. */ #include "partest.h" -/* Machine Includes. */ +/* Hardware specific includes. */ #include + /*---------------------------------------------------------------------------*/ void vParTestInitialise( void ) { /* The TriBoard TC1782 v2.1 has 8 LEDs connected to GPIO5. */ - P5_IOCR0.reg = 0xC0C0C0C0; - P5_IOCR4.reg = 0xC0C0C0C0; - - P5_PDR.reg = 0x00000000; - - P5_OMR.reg = 0x0000FFFF; + P5_IOCR0.reg = 0xC0C0C0C0UL; + P5_IOCR4.reg = 0xC0C0C0C0UL; + P5_PDR.reg = 0x00000000UL; + P5_OMR.reg = 0x0000FFFFUL; } /*---------------------------------------------------------------------------*/ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { unsigned long ulBitPattern = 1UL << uxLED; - if ( xValue != 0 ) + + if( xValue != 0 ) { P5_OMR.reg = ulBitPattern; } else { - P5_OMR.reg = ulBitPattern << 16; + P5_OMR.reg = ulBitPattern << 16UL; } } /*---------------------------------------------------------------------------*/ @@ -90,6 +90,7 @@ unsigned long ulBitPattern = 1UL << uxLED; void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { unsigned long ulBitPattern = 1UL << uxLED; + P5_OMR.reg = ( ulBitPattern << 16 ) | ulBitPattern; } /*---------------------------------------------------------------------------*/ diff --git a/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/serial.c b/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/serial.c index 9d81801ab..0620aa63a 100644 --- a/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/serial.c +++ b/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/serial.c @@ -51,6 +51,7 @@ licensing and training services. */ +/* Hardware specific includes. */ #include #include #include @@ -63,44 +64,53 @@ /* Demo Includes. */ #include "serial.h" + /*---------------------------------------------------------------------------*/ +/* Interrupt priorities. */ #define serialINTERRUPT_PRIORITY_TX 16 #define serialINTERRUPT_PRIORITY_RX 18 + /*---------------------------------------------------------------------------*/ /* - * This reference is required by the Save/Restore Context Macros. + * See if the Serial Transmit Interrupt is currently activated, meaning that + * the interrupt is working through the back log of bytes that it needs to + * send. If the ISR is not enabled, then it will be triggered to send the first + * byte, and it will be automatically re-triggered when that byte has been + * sent. When the queue is exhausted, the ISR disables itself. */ -extern volatile unsigned portBASE_TYPE * pxCurrentTCB; -/*-----------------------------------------------------------*/ +static void prvCheckTransmit( void ); -/** - * This function will check to see whether the Serial Transmit Interrupt is currently - * activated, meaning that the interrupt is working through the back log of bytes - * that it needs to send. If the ISR is not enabled, then it will be triggered to send - * the first byte and it will be automatically re-triggered when that byte has been - * sent. When the queue is exhausted, the ISR disables itself. - * This function is privileged because it will trigger an interrupt. +/* + * The transmit and receive interrupt handlers. */ -static void prvCheckTransmit( void ) PRIVILEGED_FUNCTION; -/*-----------------------------------------------------------*/ +static void prvTxBufferInterruptHandler( int iArg ) __attribute__( ( longcall ) ); +static void prvRxInterruptHandler( int iArg )__attribute__( ( longcall ) ); -void vSerialTransmitBufferInterrupt( int iArg ) __attribute__((longcall)); -void vSerialReceiveInterrupt( int iArg )__attribute__((longcall)); /*-----------------------------------------------------------*/ +/* Queues used to pass bytes into and out of the interrupt handlers. +NOTE: This is not intended to be an example of an efficient interrupt handler, +but instead to load the kernel and interrupt mechanisms in order to test the +FreeRTOS port. Using a FIFO, DMA, circular buffer, etc. architecture will +to improve efficiency. */ static xQueueHandle xSerialTransmitQueue = NULL; static xQueueHandle xSerialReceiveQueue = NULL; static volatile portBASE_TYPE xTransmitStatus = 0UL; -/*---------------------------------------------------------------------------*/ + +/* This reference is required by the Save/Restore Context Macros. */ +extern volatile unsigned portBASE_TYPE * pxCurrentTCB; + +/*-----------------------------------------------------------*/ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) { unsigned long ulReloadValue = 0UL; + ulReloadValue = ( configPERIPHERAL_CLOCK_HZ / ( 32 * ulWantedBaud ) ) - 1; - if ( NULL == xSerialTransmitQueue ) + if( NULL == xSerialTransmitQueue ) { xSerialTransmitQueue = xQueueCreate( uxQueueLength, sizeof( char ) ); xSerialReceiveQueue = xQueueCreate( uxQueueLength, sizeof( char ) ); @@ -108,8 +118,10 @@ unsigned long ulReloadValue = 0UL; /* Enable ASC0 Module. */ unlock_wdtcon(); + { while ( 0 != ( WDT_CON0.reg & 0x1UL ) ); ASC0_CLC.reg = 0x0200UL; + } lock_wdtcon(); /* Disable the Operation. */ @@ -117,9 +129,8 @@ unsigned long ulReloadValue = 0UL; /* Set-up the GPIO Ports. */ P3_IOCR0.reg = 0x00009000; /* 3.0 ASC In, 3.1 Alt ASC Out */ - /* Do we need to set 3.1 high? OMR.PS1 = 1??? */ - /* Write the Baudrate. */ + /* Write the baud rate. */ ASC0_BG.reg = ulReloadValue; /* Reconfigure and re-initialise the Operation. */ @@ -127,14 +138,14 @@ unsigned long ulReloadValue = 0UL; ASC0_CON.reg = 0x00008011; /* 1 Start, 1 Stop, 8 Data, No Parity, No Error Checking, Receive On, Module On. */ /* Install the Tx interrupt. */ - if ( 0 != _install_int_handler( serialINTERRUPT_PRIORITY_TX, vSerialTransmitBufferInterrupt, 0 ) ) + if( 0 != _install_int_handler( serialINTERRUPT_PRIORITY_TX, prvTxBufferInterruptHandler, 0 ) ) { ASC0_TBSRC.reg = serialINTERRUPT_PRIORITY_TX | 0x5000UL; xTransmitStatus = 0UL; } /* Install the Rx interrupt. */ - if ( 0 != _install_int_handler( serialINTERRUPT_PRIORITY_RX, vSerialReceiveInterrupt, 0 ) ) + if( 0 != _install_int_handler( serialINTERRUPT_PRIORITY_RX, prvRxInterruptHandler, 0 ) ) { ASC0_RSRC.reg = serialINTERRUPT_PRIORITY_RX | 0x5000UL; } @@ -147,17 +158,20 @@ unsigned long ulReloadValue = 0UL; void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength ) { unsigned short usChar; - for ( usChar = 0; usChar < usStringLength; usChar++ ) + + for( usChar = 0; usChar < usStringLength; usChar++ ) { - (void)xSerialPutChar( pxPort, pcString[ usChar ], portMAX_DELAY ); + xSerialPutChar( pxPort, pcString[ usChar ], portMAX_DELAY ); } } /*---------------------------------------------------------------------------*/ signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime ) { + /* Just to remove compiler warnings about unused parameters. */ + ( void )pxPort; + return xQueueReceive( xSerialReceiveQueue, pcRxedChar, xBlockTime ); - (void)pxPort; } /*---------------------------------------------------------------------------*/ @@ -165,6 +179,9 @@ signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar { portBASE_TYPE xReturn = pdPASS; + /* Just to remove compiler warnings about unused parameters. */ + ( void )pxPort; + /* Send the character to the interrupt handler. */ xReturn = xQueueSend( xSerialTransmitQueue, &cOutChar, xBlockTime ); @@ -172,75 +189,66 @@ portBASE_TYPE xReturn = pdPASS; prvCheckTransmit(); return xReturn; - - (void)pxPort; } /*---------------------------------------------------------------------------*/ -void vSerialTransmitBufferInterrupt( int iArg ) +static void prvTxBufferInterruptHandler( int iArg ) { portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; unsigned char ucTx; + /* Just to remove compiler warnings about unused parameters. */ + ( void ) iArg; + /* ACK. */ ASC0_TBSRC.reg |= 0x4000UL; xTransmitStatus = 1UL; - /* Enter the Critical Section. */ - portINTERRUPT_ENTER_CRITICAL(); + /* TBUF Can be refilled. */ + if( pdPASS == xQueueReceiveFromISR( xSerialTransmitQueue, &ucTx, &xHigherPriorityTaskWoken ) ) { - /* TBUF Can be refilled. */ - if ( pdPASS == xQueueReceiveFromISR( xSerialTransmitQueue, &ucTx, &xHigherPriorityTaskWoken ) ) - { - ASC0_TBUF.reg = ucTx; - } - else - { - /* Failed to get a character out of the Queue. No longer busy. */ - xTransmitStatus = 0UL; - } + ASC0_TBUF.reg = ucTx; + } + else + { + /* Failed to get a character out of the Queue. No longer busy. */ + xTransmitStatus = 0UL; } - portINTERRUPT_EXIT_CRITICAL(); /* Finally end ISR and switch Task. */ portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); - - (void)iArg; } /*---------------------------------------------------------------------------*/ -void vSerialReceiveInterrupt( int iArg ) +static void prvRxInterruptHandler( int iArg ) { portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; unsigned char ucRx; + /* Just to remove compiler warnings about unused parameters. */ + ( void ) iArg; + /* Grab the character as early as possible. */ - ucRx = (unsigned char)ASC0_RBUF.reg; + ucRx = ( unsigned char ) ASC0_RBUF.reg; /* ACK. */ ASC0_RSRC.reg |= 0x4000UL; - /* Enter the Critical Section. */ - portINTERRUPT_ENTER_CRITICAL(); + /* Frame available in RBUF. */ + if( pdPASS != xQueueSendFromISR( xSerialReceiveQueue, &ucRx, &xHigherPriorityTaskWoken ) ) { - /* Frame available in RBUF. */ - if ( pdPASS != xQueueSendFromISR( xSerialReceiveQueue, &ucRx, &xHigherPriorityTaskWoken ) ) - { - /* Need some error handling code. */ - } + /* Error handling code can go here. */ } - portINTERRUPT_EXIT_CRITICAL(); /* Finally end ISR and switch Task. */ portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); - - (void)iArg; } /*---------------------------------------------------------------------------*/ void prvCheckTransmit( void ) { - /* Check to see if the interrupt handler is working its way through the buffer. */ + /* Check to see if the interrupt handler is working its way through the + buffer. */ if ( 0 == xTransmitStatus ) { /* Not currently operational so kick off the first byte. */