Prepare the MSP430X IAR demo for release.

This commit is contained in:
Richard Barry 2011-01-01 11:27:48 +00:00
parent eb94f856a8
commit 34f15ddecd
12 changed files with 797 additions and 532 deletions

View file

@ -54,9 +54,11 @@
/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER.
*
* This file only supports UART A0 in loopback mode, and has not been tested
* for real UART operation (only loopback mode) so is not guaranteed to have
* a correct baud rate configuration.
* This is not a proper UART driver. It only supports one port, uses loopback
* mode, and is used to test interrupts that use the FreeRTOS API as part of
* a wider test suite. Nor is it intended to show an efficient implementation
* of a UART interrupt service routine as queues are used to pass individual
* characters one at a time!
*/
/* Standard includes. */
@ -70,9 +72,6 @@
/* Demo application includes. */
#include "serial.h"
/* Constants required to setup the hardware. */
#define serTX_AND_RX ( ( unsigned portCHAR ) 0x03 )
/* Misc. constants. */
#define serNO_BLOCK ( ( portTickType ) 0 )
@ -123,9 +122,8 @@ unsigned portLONG ulBaudRateCount;
}
portEXIT_CRITICAL();
/* Unlike other ports, this serial code does not allow for more than one
com port. We therefore don't return a pointer to a port structure and can
instead just return NULL. */
/* Note the comments at the top of this file about this not being a generic
UART driver. */
return NULL;
}
/*-----------------------------------------------------------*/
@ -149,6 +147,9 @@ signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOut
{
signed portBASE_TYPE xReturn;
/* Send the next character to the queue of characters waiting transmission,
then enable the UART Tx interrupt, just in case UART transmission has already
completed and switched itself off. */
xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime );
UCA1IE |= UCTXIE;
@ -190,6 +191,14 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
}
__bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF );
/* If writing to a queue caused a task to unblock, and the unblocked task
has a priority equal to or above the task that this interrupt interrupted,
then lHigherPriorityTaskWoken will have been set to pdTRUE internally within
xQueuesendFromISR(), and portEND_SWITCHING_ISR() will ensure that this
interrupt returns directly to the higher priority unblocked task.
THIS MUST BE THE LAST THING DONE IN THE ISR. */
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}