diff --git a/.github/scripts/core_checker.py b/.github/scripts/core_checker.py index f029e3b76..7c4c50d19 100755 --- a/.github/scripts/core_checker.py +++ b/.github/scripts/core_checker.py @@ -306,7 +306,6 @@ FREERTOS_IGNORED_FILES = [ 'interrupt_vector.s', 'reg_test.S', 'gdbinit', - ] FREERTOS_HEADER = [ @@ -358,4 +357,3 @@ def main(): if __name__ == '__main__': exit(main()) - diff --git a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/FreeRTOSConfig.h index 4af6874e4..1f9cca0f2 100644 --- a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/FreeRTOSConfig.h @@ -38,7 +38,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html */ @@ -59,6 +59,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/ParTest/ParTest.c index 8fb159963..c67019270 100644 --- a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/ParTest/ParTest.c @@ -64,7 +64,7 @@ void vParTestInitialise( void ) { /* This is performed from main() as the io bits are shared with other setup functions. Ensure the outputs are off to start. */ - ulLEDReg = partstALL_OUTPUTS_OFF; + ulLEDReg = partstALL_OUTPUTS_OFF; /* Enable clock to PIO... */ AT91C_BASE_PS->PS_PCER = AT91C_PS_PIO; diff --git a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serial.c b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serial.c index 8e74dbefc..38472470f 100644 --- a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serial.c +++ b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serial.c @@ -24,8 +24,8 @@ * */ -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART0. +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART0. This file contains all the serial port components that can be compiled to either ARM or THUMB mode. Components that must be compiled to ARM mode are @@ -60,14 +60,14 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /*-----------------------------------------------------------*/ -/* +/* * The queues are created in serialISR.c as they are used from the ISR. - * Obtain references to the queues and THRE Empty flag. + * Obtain references to the queues and THRE Empty flag. */ extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx ); @@ -84,10 +84,10 @@ extern void ( vUART_ISR_Wrapper )( void ); serialISR.c (which is always compiled to ARM mode. */ vSerialISRCreateQueues( uxQueueLength, &xRxedChars, &xCharsForTx ); - if( - ( xRxedChars != serINVALID_QUEUE ) && - ( xCharsForTx != serINVALID_QUEUE ) && - ( ulWantedBaud != ( unsigned long ) 0 ) + if( + ( xRxedChars != serINVALID_QUEUE ) && + ( xCharsForTx != serINVALID_QUEUE ) && + ( ulWantedBaud != ( unsigned long ) 0 ) ) { portENTER_CRITICAL(); @@ -109,10 +109,10 @@ extern void ( vUART_ISR_Wrapper )( void ); AT91C_BASE_US0->US_TCR = 0; /* Input clock to baud rate generator is MCK */ - ulSpeed = configCPU_CLOCK_HZ * 10; + ulSpeed = configCPU_CLOCK_HZ * 10; ulSpeed = ulSpeed / 16; ulSpeed = ulSpeed / ulWantedBaud; - + /* compute the error */ ulCD = ulSpeed / 10; if ((ulSpeed - (ulCD * 10)) >= 5) @@ -131,10 +131,10 @@ extern void ( vUART_ISR_Wrapper )( void ); Store interrupt handler function address in USART0 vector register... */ AT91C_BASE_AIC->AIC_SVR[ portUSART0_AIC_CHANNEL ] = (unsigned long)vUART_ISR_Wrapper; - + /* USART0 interrupt level-sensitive, priority 1... */ AT91C_BASE_AIC->AIC_SMR[ portUSART0_AIC_CHANNEL ] = AIC_SRCTYPE_INT_LEVEL_SENSITIVE | 1; - + /* Clear some pending USART0 interrupts (just in case)... */ AT91C_BASE_US0->US_CR = US_RSTSTA; diff --git a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serialISR.c b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serialISR.c index e20987121..0c1b521ed 100644 --- a/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serialISR.c +++ b/FreeRTOS/Demo/ARM7_AT91FR40008_GCC/serial/serialISR.c @@ -25,8 +25,8 @@ */ -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART0. +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART0. This file contains all the serial port components that must be compiled to ARM mode. The components that can be compiled to either ARM or THUMB @@ -61,8 +61,8 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /*-----------------------------------------------------------*/ @@ -70,7 +70,7 @@ static QueueHandle_t xCharsForTx; be declared "naked". */ void vUART_ISR_Wrapper( void ) __attribute__ ((naked)); -/* The ISR function that actually performs the work. This must be separate +/* The ISR function that actually performs the work. This must be separate from the wrapper to ensure the correct stack frame is set up. */ void vUART_ISR_Handler( void ) __attribute__ ((noinline)); @@ -81,7 +81,7 @@ void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - /* Pass back a reference to the queues so the serial API file can + /* Pass back a reference to the queues so the serial API file can post/receive characters. */ *pxRxedChars = xRxedChars; *pxCharsForTx = xCharsForTx; @@ -93,7 +93,7 @@ void vUART_ISR_Wrapper( void ) /* Save the context of the interrupted task. */ portSAVE_CONTEXT(); - /* Call the handler. This must be a separate function to ensure the + /* Call the handler. This must be a separate function to ensure the stack frame is correctly set up. */ __asm volatile( "bl vUART_ISR_Handler" ); @@ -126,7 +126,7 @@ unsigned long ulStatus; { /* Queue empty, nothing to send so turn off the Tx interrupt. */ AT91C_BASE_US0->US_IDR = US_TXRDY; - } + } } if (ulStatus & US_RXRDY) diff --git a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/FreeRTOSConfig.h index ae9d0c1c8..3c89e24db 100644 --- a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/FreeRTOSConfig.h @@ -37,7 +37,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html -----------------------------------------------------------*/ @@ -55,6 +55,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/ParTest/ParTest.c index be0e2adcc..b116faff9 100644 --- a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/ParTest/ParTest.c @@ -35,9 +35,9 @@ const unsigned long led_mask[ NB_LED ]= { LED1, LED2, LED3, LED4 }; void vParTestInitialise( void ) -{ +{ /* Start with all LED's off. */ - AT91F_PIO_SetOutput( AT91C_BASE_PIOA, LED_MASK ); + AT91F_PIO_SetOutput( AT91C_BASE_PIOA, LED_MASK ); } /*-----------------------------------------------------------*/ @@ -67,7 +67,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) } else { - AT91F_PIO_SetOutput( AT91C_BASE_PIOA, led_mask[ uxLED ] ); + AT91F_PIO_SetOutput( AT91C_BASE_PIOA, led_mask[ uxLED ] ); } } } diff --git a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/USB/USBSample.c b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/USB/USBSample.c index 261795891..927f28e10 100644 --- a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/USB/USBSample.c +++ b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/USB/USBSample.c @@ -28,7 +28,7 @@ Sample interrupt driven USB device driver. This is a minimal implementation for demonstration only. Although functional, it is not a full and compliant implementation. - + The USB device enumerates as a simple 3 axis joystick, and once configured transmits 3 axis of data which can be viewed from the USB host machine. @@ -36,13 +36,13 @@ task. The interrupt service routine handles the USB hardware - taking a snapshot of the USB status at the point of the interrupt. The task receives the status information from the interrupt for processing at the task level. - + See the FreeRTOS.org WEB documentation for more information. */ /* Changes from V2.5.5 - + + Descriptors that have a length that is an exact multiple of usbFIFO_LENGTH can now be transmitted. To this end an extra parameter has been added to the prvSendControlData() function, and the state @@ -332,7 +332,7 @@ const char pxManufacturerStringDescriptor[] = 'R', 0x00, 'T', 0x00, 'O', 0x00, - 'S', 0x00 + 'S', 0x00 }; const char pxProductStringDescriptor[] = @@ -571,18 +571,18 @@ unsigned long ulTemp, ulRxBytes; /* Clear the interrupts from the ICR register. The bus end interrupt is cleared separately as it does not appear in the mask register. */ AT91C_BASE_UDP->UDP_ICR = AT91C_BASE_UDP->UDP_IMR | AT91C_UDP_ENDBUSRES; - + /* If there are bytes in the FIFO then we have to retrieve them here. Ideally this would be done at the task level. However we need to clear the RXSETUP interrupt before leaving the ISR, and this may cause the data in the FIFO to be overwritten. Also the DIR bit has to be changed before the RXSETUP bit is cleared (as per the SAM7 manual). */ ulTemp = pxMessage->ulCSR0; - + /* Are there any bytes in the FIFO? */ ulRxBytes = ulTemp >> 16; ulRxBytes &= usbRX_COUNT_MASK; - + /* With this minimal implementation we are only interested in receiving setup bytes on the control end point. */ if( ( ulRxBytes > 0 ) && ( ulTemp & AT91C_UDP_RXSETUP ) ) @@ -591,14 +591,14 @@ unsigned long ulTemp, ulRxBytes; while( ulRxBytes > 0 ) { ulRxBytes--; - pxMessage->ucFifoData[ ulRxBytes ] = AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_0 ]; + pxMessage->ucFifoData[ ulRxBytes ] = AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_0 ]; } - + /* The direction must be changed first. */ usbCSR_SET_BIT( &ulTemp, ( AT91C_UDP_DIR ) ); AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_0 ] = ulTemp; } - + /* Must write zero's to TXCOMP, STALLSENT, RXSETUP, and the RX DATA registers to clear the interrupts in the CSR register. */ usbCSR_CLEAR_BIT( &ulTemp, usbINT_CLEAR_MASK ); @@ -606,7 +606,7 @@ unsigned long ulTemp, ulRxBytes; /* Also clear the interrupts in the CSR1 register. */ ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ]; - usbCSR_CLEAR_BIT( &ulTemp, usbINT_CLEAR_MASK ); + usbCSR_CLEAR_BIT( &ulTemp, usbINT_CLEAR_MASK ); AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] = ulTemp; /* The message now contains the entire state and optional data from @@ -618,7 +618,7 @@ unsigned long ulTemp, ulRxBytes; it the highest priority task that is ready to execute. */ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); - /* Clear the AIC ready for the next interrupt. */ + /* Clear the AIC ready for the next interrupt. */ AT91C_BASE_AIC->AIC_EOICR = 0; } /*-----------------------------------------------------------*/ @@ -652,7 +652,7 @@ xISRStatus *pxMessage; if( pxMessage->ulISR & AT91C_UDP_ENDBUSRES ) { /* Process an end of bus reset interrupt. */ - prvResetEndPoints(); + prvResetEndPoints(); } } else @@ -685,21 +685,21 @@ static signed char x = 0, y = 0, z = 0; lState = usbYUP; } break; - + case usbXDOWN : x -= usbDATA_INC; if( x <= -usbMAX_COORD ) { lState = usbYDOWN; } break; - + case usbYUP : y += usbDATA_INC; if( y >= usbMAX_COORD ) { lState = usbXDOWN; } break; - + case usbYDOWN : y -= usbDATA_INC; if( y <= -usbMAX_COORD ) { @@ -718,7 +718,7 @@ static signed char x = 0, y = 0, z = 0; AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_1 ] = x; AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_1 ] = y; AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_1 ] = z; - + /* Send the data. */ portENTER_CRITICAL(); { @@ -801,10 +801,10 @@ unsigned long ulTemp; static void prvProcessEndPoint0Interrupt( xISRStatus *pxMessage ) { if( pxMessage->ulCSR0 & AT91C_UDP_RX_DATA_BK0 ) - { + { /* We only expect to receive zero length data here as ACK's. Set the data pointer to the end of the current Tx packet to - ensure we don't send out any more data. */ + ensure we don't send out any more data. */ pxCharsForTx.ulNextCharIndex = pxCharsForTx.ulTotalDataLength; } @@ -824,33 +824,33 @@ static void prvProcessEndPoint0Interrupt( xISRStatus *pxMessage ) { unsigned long ulTemp; - ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ]; + ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ]; usbCSR_SET_BIT( &ulTemp, AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_INT_IN ); - AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] = ulTemp; + AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] = ulTemp; AT91F_UDP_EnableIt( AT91C_BASE_UDP, AT91C_UDP_EPINT1 ); } portEXIT_CRITICAL(); eDriverState = eREADY_TO_SEND; - } + } else if( eDriverState == eJUST_GOT_ADDRESS ) { /* We sent an acknowledgement of a SET_ADDRESS request. Move to the addressed state. */ if( ulReceivedAddress != ( unsigned long ) 0 ) - { + { AT91C_BASE_UDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; } else { AT91C_BASE_UDP->UDP_GLBSTATE = 0; - } + } - AT91C_BASE_UDP->UDP_FADDR = ( AT91C_UDP_FEN | ulReceivedAddress ); + AT91C_BASE_UDP->UDP_FADDR = ( AT91C_UDP_FEN | ulReceivedAddress ); eDriverState = eNOTHING; } else - { + { /* The TXCOMP was not for any special type of transmission. See if there is any more data to send. */ prvSendNextSegment(); @@ -863,7 +863,7 @@ static void prvProcessEndPoint0Interrupt( xISRStatus *pxMessage ) unsigned char ucRequest; unsigned long ulRxBytes; - /* A data packet is available. */ + /* A data packet is available. */ ulRxBytes = pxMessage->ulCSR0 >> 16; ulRxBytes &= usbRX_COUNT_MASK; @@ -878,15 +878,15 @@ static void prvProcessEndPoint0Interrupt( xISRStatus *pxMessage ) xRequest.usValue = pxMessage->ucFifoData[ usbVALUE_HIGH_BYTE ]; xRequest.usValue <<= 8; xRequest.usValue |= pxMessage->ucFifoData[ usbVALUE_LOW_BYTE ]; - + xRequest.usIndex = pxMessage->ucFifoData[ usbINDEX_HIGH_BYTE ]; xRequest.usIndex <<= 8; xRequest.usIndex |= pxMessage->ucFifoData[ usbINDEX_LOW_BYTE ]; - + xRequest.usLength = pxMessage->ucFifoData[ usbLENGTH_HIGH_BYTE ]; xRequest.usLength <<= 8; xRequest.usLength |= pxMessage->ucFifoData[ usbLENGTH_LOW_BYTE ]; - + /* Manipulate the ucRequestType and the ucRequest parameters to generate a zero based request selection. This is just done to break up the requests into subsections for clarity. The @@ -897,28 +897,28 @@ static void prvProcessEndPoint0Interrupt( xISRStatus *pxMessage ) switch( ucRequest ) { - case usbSTANDARD_DEVICE_REQUEST: + case usbSTANDARD_DEVICE_REQUEST: /* Standard Device request */ prvHandleStandardDeviceRequest( &xRequest ); break; - - case usbSTANDARD_INTERFACE_REQUEST: + + case usbSTANDARD_INTERFACE_REQUEST: /* Standard Interface request */ prvHandleStandardInterfaceRequest( &xRequest ); break; - - case usbSTANDARD_END_POINT_REQUEST: + + case usbSTANDARD_END_POINT_REQUEST: /* Standard Endpoint request */ prvHandleStandardEndPointRequest( &xRequest ); break; - - case usbCLASS_INTERFACE_REQUEST: + + case usbCLASS_INTERFACE_REQUEST: /* Class Interface request */ prvHandleClassInterfaceRequest( &xRequest ); break; - + default: /* This is not something we want to respond to. */ - prvSendStall(); + prvSendStall(); } } } @@ -933,7 +933,7 @@ static void prvGetStandardDeviceDescriptor( xUSB_REQUEST *pxRequest ) case usbDESCRIPTOR_TYPE_DEVICE: prvSendControlData( ( unsigned char * ) &pxDeviceDescriptor, pxRequest->usLength, sizeof( pxDeviceDescriptor ), pdTRUE ); break; - + case usbDESCRIPTOR_TYPE_CONFIGURATION: prvSendControlData( ( unsigned char * ) &( pxConfigDescriptor ), pxRequest->usLength, sizeof( pxConfigDescriptor ), pdTRUE ); break; @@ -942,7 +942,7 @@ static void prvGetStandardDeviceDescriptor( xUSB_REQUEST *pxRequest ) /* The index to the string descriptor is the lower byte. */ switch( pxRequest->usValue & 0xff ) - { + { case usbLANGUAGE_STRING: prvSendControlData( ( unsigned char * ) &pxLanguageStringDescriptor, pxRequest->usLength, sizeof(pxLanguageStringDescriptor), pdTRUE ); break; @@ -1005,13 +1005,13 @@ unsigned short usStatus = 0; break; case usbSET_ADDRESS_REQUEST: - + /* Acknowledge the SET_ADDRESS, but (according to the manual) we cannot actually move to the addressed state until we get a TXCOMP interrupt from this NULL packet. Therefore we just remember the address and set our state so we know we have received the address. */ - prvUSBTransmitNull(); - eDriverState = eJUST_GOT_ADDRESS; + prvUSBTransmitNull(); + eDriverState = eJUST_GOT_ADDRESS; ulReceivedAddress = ( unsigned long ) pxRequest->usValue; break; @@ -1020,7 +1020,7 @@ unsigned short usStatus = 0; /* Acknowledge the SET_CONFIGURATION, but (according to the manual) we cannot actually move to the configured state until we get a TXCOMP interrupt from this NULL packet. Therefore we just remember the - config and set our state so we know we have received the go ahead. */ + config and set our state so we know we have received the go ahead. */ ucUSBConfig = ( unsigned char ) ( pxRequest->usValue & 0xff ); eDriverState = eJUST_GOT_CONFIG; prvUSBTransmitNull(); @@ -1048,7 +1048,7 @@ static void prvHandleClassInterfaceRequest( xUSB_REQUEST *pxRequest ) case usbGET_IDLE_REQUEST: case usbGET_PROTOCOL_REQUEST: case usbSET_REPORT_REQUEST: - case usbSET_PROTOCOL_REQUEST: + case usbSET_PROTOCOL_REQUEST: default: prvSendStall(); @@ -1092,7 +1092,7 @@ unsigned short usStatus = 0; /* This minimal implementation does not respond to these. */ case usbGET_INTERFACE_REQUEST: case usbSET_FEATURE_REQUEST: - case usbSET_INTERFACE_REQUEST: + case usbSET_INTERFACE_REQUEST: default: prvSendStall(); @@ -1110,7 +1110,7 @@ static void prvHandleStandardEndPointRequest( xUSB_REQUEST *pxRequest ) case usbCLEAR_FEATURE_REQUEST: case usbSET_FEATURE_REQUEST: - default: + default: prvSendStall(); break; } @@ -1214,7 +1214,7 @@ volatile unsigned long ulNextLength, ulStatus, ulLengthLeftToSend; if( pxCharsForTx.ulTotalDataLength > pxCharsForTx.ulNextCharIndex ) { ulLengthLeftToSend = pxCharsForTx.ulTotalDataLength - pxCharsForTx.ulNextCharIndex; - + /* We can only send 8 bytes to the fifo at a time. */ if( ulLengthLeftToSend > usbFIFO_LENGTH ) { @@ -1236,11 +1236,11 @@ volatile unsigned long ulNextLength, ulStatus, ulLengthLeftToSend; while( ulNextLength > ( unsigned long ) 0 ) { AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_0 ] = pxCharsForTx.ucTxBuffer[ pxCharsForTx.ulNextCharIndex ]; - + ulNextLength--; pxCharsForTx.ulNextCharIndex++; } - + /* Start the transmission. */ portENTER_CRITICAL(); { diff --git a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/main.c b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/main.c index 2537237d1..92bfa084d 100644 --- a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/main.c +++ b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/main.c @@ -24,9 +24,9 @@ * */ -/* +/* NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode. - The processor MUST be in supervisor mode when vTaskStartScheduler is + The processor MUST be in supervisor mode when vTaskStartScheduler is called. The demo applications included in the FreeRTOS.org download switch to supervisor mode prior to main being called. If you are not using one of these demo application projects then ensure Supervisor mode is used. @@ -36,17 +36,17 @@ * Creates all the demo application tasks, then starts the scheduler. The WEB * documentation provides more details of the demo application tasks. The SAM7 * includes a sample USB that emulates a Joystick input to a USB host. - * - * Main.c also creates a task called "Check". This only executes every three - * seconds but has the highest priority so is guaranteed to get processor time. + * + * Main.c also creates a task called "Check". This only executes every three + * seconds but has the highest priority so is guaranteed to get processor time. * Its main function is to check that all the other tasks are still operational. - * Each task (other than the "flash" tasks) maintains a unique count that is - * incremented each time the task successfully completes its function. Should - * any error occur within such a task the count is permanently halted. The + * Each task (other than the "flash" tasks) maintains a unique count that is + * incremented each time the task successfully completes its function. Should + * any error occur within such a task the count is permanently halted. The * check task inspects the count of each task to ensure it has changed since - * the last time the check task executed. If all the count variables have + * the last time the check task executed. If all the count variables have * changed all the tasks are still executing error free, and the check task - * toggles the onboard LED. Should any task contain an error at any time + * toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * */ @@ -88,7 +88,7 @@ #define mainCOM_TEST_LED ( 4 ) /* Off the board. */ /* - * The task that executes at the highest priority and calls + * The task that executes at the highest priority and calls * prvCheckOtherTasksAreStillRunning(). See the description at the top * of the file. */ @@ -111,7 +111,7 @@ static long prvCheckOtherTasksAreStillRunning( void ); /*-----------------------------------------------------------*/ /* - * Starts all the other tasks, then starts the scheduler. + * Starts all the other tasks, then starts the scheduler. */ void main( void ) { @@ -130,17 +130,17 @@ void main( void ) vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartDynamicPriorityTasks(); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); - + /* Also start the USB demo which is just for the SAM7. */ xTaskCreate( vUSBDemoTask, "USB", configMINIMAL_STACK_SIZE, NULL, mainUSB_PRIORITY, NULL ); - + /* Start the check task - which is defined in this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); /* Start the scheduler. NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode. - The processor MUST be in supervisor mode when vTaskStartScheduler is + The processor MUST be in supervisor mode when vTaskStartScheduler is called. The demo applications included in the FreeRTOS.org download switch to supervisor mode prior to main being called. If you are not using one of these demo application projects then ensure Supervisor mode is used here. */ @@ -158,14 +158,14 @@ static void prvSetupHardware( void ) the correct default state. This line just ensures that this does not cause all interrupts to be masked at the start. */ AT91C_BASE_AIC->AIC_EOICR = 0; - - /* Most setup is performed by the low level init function called from the + + /* Most setup is performed by the low level init function called from the startup asm file. */ - /* Configure the PIO Lines corresponding to LED1 to LED4 to be outputs as + /* Configure the PIO Lines corresponding to LED1 to LED4 to be outputs as well as the UART Tx line. */ AT91F_PIO_CfgOutput( AT91C_BASE_PIOA, LED_MASK ); - + /* Enable the peripheral clock. */ AT91F_PMC_EnablePeriphClock( AT91C_BASE_PMC, 1 << AT91C_ID_PIOA ); } @@ -187,15 +187,15 @@ TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD; { /* Delay until it is time to execute again. */ vTaskDelay( xDelayPeriod ); - - /* Check all the standard demo application tasks are executing without + + /* Check all the standard demo application tasks are executing without error. */ if( prvCheckOtherTasksAreStillRunning() != pdPASS ) { /* An error has been detected in one of the tasks - flash faster. */ xDelayPeriod = mainERROR_FLASH_PERIOD; } - + vParTestToggleLED( mainCHECK_TASK_LED ); } } diff --git a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/serial/serial.c b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/serial/serial.c index ab09088ac..d777cf6b7 100644 --- a/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/serial/serial.c +++ b/FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/serial/serial.c @@ -24,11 +24,11 @@ * */ -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. */ -/* Standard includes. */ +/* Standard includes. */ #include /* Scheduler includes. */ @@ -58,8 +58,8 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /*-----------------------------------------------------------*/ @@ -83,7 +83,7 @@ extern void ( vUART_ISR )( void ); xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - /* If the queues were created correctly then setup the serial port + /* If the queues were created correctly then setup the serial port hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) { @@ -115,7 +115,7 @@ extern void ( vUART_ISR )( void ); xReturn = ( xComPortHandle ) 0; } - /* This demo file only supports a single port but we have to return + /* This demo file only supports a single port but we have to return something to comply with the standard demo header file. */ return xReturn; } @@ -214,19 +214,19 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { /* Queue empty, nothing to send so turn off the Tx interrupt. */ vInterruptOff(); - } + } } if( ulStatus & AT91C_US_RXRDY ) { /* The interrupt was caused by a character being received. Grab the - character from the RHR and place it in the queue or received + character from the RHR and place it in the queue or received characters. */ cChar = serCOM0->US_RHR; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); } - /* If a task was woken by either a character being received or a character + /* If a task was woken by either a character being received or a character being transmitted then we may need to switch to another task. */ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); @@ -237,4 +237,4 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + diff --git a/FreeRTOS/Demo/ARM7_LPC2106_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_LPC2106_GCC/FreeRTOSConfig.h index b4532a976..27e1e9c55 100644 --- a/FreeRTOS/Demo/ARM7_LPC2106_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_LPC2106_GCC/FreeRTOSConfig.h @@ -37,7 +37,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -56,6 +56,9 @@ #define configIDLE_SHOULD_YIELD 1 #define configQUEUE_REGISTRY_SIZE 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_LPC2106_GCC/Makefile b/FreeRTOS/Demo/ARM7_LPC2106_GCC/Makefile index 2c429a621..5e615572f 100644 --- a/FreeRTOS/Demo/ARM7_LPC2106_GCC/Makefile +++ b/FreeRTOS/Demo/ARM7_LPC2106_GCC/Makefile @@ -107,6 +107,6 @@ clean : - + diff --git a/FreeRTOS/Demo/ARM7_LPC2106_GCC/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_LPC2106_GCC/ParTest/ParTest.c index b8c56c2d7..0a91c7e9e 100644 --- a/FreeRTOS/Demo/ARM7_LPC2106_GCC/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_LPC2106_GCC/ParTest/ParTest.c @@ -26,7 +26,7 @@ /* Changes from V2.5.2 - + + All LED's are turned off to start. */ @@ -69,9 +69,9 @@ unsigned long ulLED = partstFIRST_IO; } else { - GPIO_IOSET = ulLED; + GPIO_IOSET = ulLED; } - } + } } /*-----------------------------------------------------------*/ @@ -93,8 +93,8 @@ unsigned long ulLED = partstFIRST_IO, ulCurrentState; } else { - GPIO_IOSET = ulLED; + GPIO_IOSET = ulLED; } - } + } } diff --git a/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serial.c b/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serial.c index 505b6097a..c5a7eaca8 100644 --- a/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serial.c +++ b/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serial.c @@ -31,7 +31,7 @@ Changes from V2.4.1 - + Split serial.c into serial.c and serialISR.c. serial.c can be + + Split serial.c into serial.c and serialISR.c. serial.c can be compiled using ARM or THUMB modes. serialISR.c must always be compiled in ARM mode. + Another small change to cSerialPutChar(). @@ -44,8 +44,8 @@ */ -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. This file contains all the serial port components that can be compiled to either ARM or THUMB mode. Components that must be compiled to ARM mode are @@ -89,17 +89,17 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /*-----------------------------------------------------------*/ /* Communication flag between the interrupt service routine and serial API. */ static volatile long *plTHREEmpty; -/* +/* * The queues are created in serialISR.c as they are used from the ISR. - * Obtain references to the queues and THRE Empty flag. + * Obtain references to the queues and THRE Empty flag. */ extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx, long volatile **pplTHREEmptyFlag ); @@ -115,10 +115,10 @@ extern void ( vUART_ISR_Wrapper )( void ); serialISR.c (which is always compiled to ARM mode. */ vSerialISRCreateQueues( uxQueueLength, &xRxedChars, &xCharsForTx, &plTHREEmpty ); - if( - ( xRxedChars != serINVALID_QUEUE ) && - ( xCharsForTx != serINVALID_QUEUE ) && - ( ulWantedBaud != ( unsigned long ) 0 ) + if( + ( xRxedChars != serINVALID_QUEUE ) && + ( xCharsForTx != serINVALID_QUEUE ) && + ( ulWantedBaud != ( unsigned long ) 0 ) ) { portENTER_CRITICAL(); @@ -212,21 +212,21 @@ signed portBASE_TYPE xReturn; /* Is there space to write directly to the UART? */ if( *plTHREEmpty == ( long ) pdTRUE ) { - /* We wrote the character directly to the UART, so was + /* We wrote the character directly to the UART, so was successful. */ *plTHREEmpty = pdFALSE; UART0_THR = cOutChar; xReturn = pdPASS; } - else + else { /* We cannot write directly to the UART, so queue the character. Block for a maximum of xBlockTime if there is no space in the queue. */ xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime ); - /* Depending on queue sizing and task prioritisation: While we - were blocked waiting to post interrupts were not disabled. It is + /* Depending on queue sizing and task prioritisation: While we + were blocked waiting to post interrupts were not disabled. It is possible that the serial ISR has emptied the Tx queue, in which case we need to start the Tx off again. */ if( ( *plTHREEmpty == ( long ) pdTRUE ) && ( xReturn == pdPASS ) ) @@ -254,4 +254,4 @@ void vSerialClose( xComPortHandle xPort ) - + diff --git a/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serialISR.c b/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serialISR.c index 792e53c40..1a4762fbe 100644 --- a/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serialISR.c +++ b/FreeRTOS/Demo/ARM7_LPC2106_GCC/serial/serialISR.c @@ -25,8 +25,8 @@ */ -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. This file contains all the serial port components that must be compiled to ARM mode. The components that can be compiled to either ARM or THUMB @@ -59,15 +59,15 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; static volatile long lTHREEmpty; /*-----------------------------------------------------------*/ -/* +/* * The queues are created in serialISR.c as they are used from the ISR. - * Obtain references to the queues and THRE Empty flag. + * Obtain references to the queues and THRE Empty flag. */ void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx, long volatile **pplTHREEmptyFlag ); @@ -78,14 +78,14 @@ void vUART_ISR_Wrapper( void ) __attribute__ ((naked)); void vUART_ISR_Handler( void ) __attribute__ ((noinline)); /*-----------------------------------------------------------*/ -void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, +void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx, long volatile **pplTHREEmptyFlag ) { /* Create the queues used to hold Rx and Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - /* Pass back a reference to the queues so the serial API file can + /* Pass back a reference to the queues so the serial API file can post/receive characters. */ *pxRxedChars = xRxedChars; *pxCharsForTx = xCharsForTx; @@ -130,15 +130,15 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; } else { - /* There are no further characters - queued to send so we can indicate + /* There are no further characters + queued to send so we can indicate that the THRE is available. */ lTHREEmpty = pdTRUE; } break; case serSOURCE_RX_TIMEOUT : - case serSOURCE_RX : /* A character was received. Place it in + case serSOURCE_RX : /* A character was received. Place it in the queue of received characters. */ cChar = UART0_RBR; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); @@ -162,4 +162,4 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + diff --git a/FreeRTOS/Demo/ARM7_LPC2129_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_LPC2129_IAR/FreeRTOSConfig.h index 4e283f115..2402ab627 100644 --- a/FreeRTOS/Demo/ARM7_LPC2129_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_LPC2129_IAR/FreeRTOSConfig.h @@ -57,6 +57,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_LPC2129_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_LPC2129_IAR/ParTest/ParTest.c index c79f433bf..2097204e9 100644 --- a/FreeRTOS/Demo/ARM7_LPC2129_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_LPC2129_IAR/ParTest/ParTest.c @@ -42,7 +42,7 @@ /*-----------------------------------------------------------*/ void vParTestInitialise( void ) -{ +{ /* The ports are setup within prvInitialiseHardware(), called by main(). */ } /*-----------------------------------------------------------*/ @@ -64,9 +64,9 @@ unsigned long ulLED = partstFIRST_IO; } else { - IO1CLR = ulLED; + IO1CLR = ulLED; } - } + } } /*-----------------------------------------------------------*/ @@ -88,9 +88,9 @@ unsigned long ulLED = partstFIRST_IO, ulCurrentState; } else { - IO1SET = ulLED; + IO1SET = ulLED; } - } + } } diff --git a/FreeRTOS/Demo/ARM7_LPC2129_IAR/main.c b/FreeRTOS/Demo/ARM7_LPC2129_IAR/main.c index 5f8c079d6..7bb5f826c 100644 --- a/FreeRTOS/Demo/ARM7_LPC2129_IAR/main.c +++ b/FreeRTOS/Demo/ARM7_LPC2129_IAR/main.c @@ -144,7 +144,7 @@ void main( void ) vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartDynamicPriorityTasks(); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); - + /* Start the check task - which is defined in this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); @@ -190,7 +190,7 @@ static void prvSetupHardware( void ) /* Setup the peripheral bus to be the same as the PLL output. */ APBDIV = mainBUS_CLK_FULL; - + /* Configure the RS2332 pins. All other pins remain at their default of 0. */ PINSEL0 |= mainTX_ENABLE; PINSEL0 |= mainRX_ENABLE; @@ -219,7 +219,7 @@ TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD; { /* Delay until it is time to execute again. */ vTaskDelay( xDelayPeriod ); - + /* Check all the standard demo application tasks are executing without error. */ if( prvCheckOtherTasksAreStillRunning() != pdPASS ) @@ -227,7 +227,7 @@ TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD; /* An error has been detected in one of the tasks - flash faster. */ xDelayPeriod = mainERROR_FLASH_PERIOD; } - + vParTestToggleLED( mainCHECK_TASK_LED ); } } diff --git a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/FreeRTOSConfig.h index 78309df1b..4c1cd9d08 100644 --- a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -56,6 +56,9 @@ #define configQUEUE_REGISTRY_SIZE 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/ParTest/ParTest.c index 5abc3777a..7c9b057ab 100644 --- a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/ParTest/ParTest.c @@ -60,9 +60,9 @@ unsigned long ulLED = partstFIRST_IO; } else { - IOCLR1 = ulLED; + IOCLR1 = ulLED; } - } + } } /*-----------------------------------------------------------*/ @@ -84,8 +84,8 @@ unsigned long ulLED = partstFIRST_IO, ulCurrentState; } else { - IOSET1 = ulLED; + IOSET1 = ulLED; } - } + } } diff --git a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/main.c b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/main.c index 2ae0c14f9..386a6fcfa 100644 --- a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/main.c +++ b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/main.c @@ -24,9 +24,9 @@ * */ -/* +/* NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode. - The processor MUST be in supervisor mode when vTaskStartScheduler is + The processor MUST be in supervisor mode when vTaskStartScheduler is called. The demo applications included in the FreeRTOS.org download switch to supervisor mode prior to main being called. If you are not using one of these demo application projects then ensure Supervisor mode is used. @@ -36,17 +36,17 @@ /* * Creates all the demo application tasks, then starts the scheduler. The WEB * documentation provides more details of the demo application tasks. - * - * Main.c also creates a task called "Check". This only executes every three - * seconds but has the highest priority so is guaranteed to get processor time. + * + * Main.c also creates a task called "Check". This only executes every three + * seconds but has the highest priority so is guaranteed to get processor time. * Its main function is to check that all the other tasks are still operational. - * Each task (other than the "flash" tasks) maintains a unique count that is - * incremented each time the task successfully completes its function. Should - * any error occur within such a task the count is permanently halted. The + * Each task (other than the "flash" tasks) maintains a unique count that is + * incremented each time the task successfully completes its function. Should + * any error occur within such a task the count is permanently halted. The * check task inspects the count of each task to ensure it has changed since - * the last time the check task executed. If all the count variables have + * the last time the check task executed. If all the count variables have * changed all the tasks are still executing error free, and the check task - * toggles the onboard LED. Should any task contain an error at any time + * toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * */ @@ -106,7 +106,7 @@ then an error has been detected in at least one of the demo application tasks. * static long prvCheckOtherTasksAreStillRunning( void ); /* - * The task that executes at the highest priority and calls + * The task that executes at the highest priority and calls * prvCheckOtherTasksAreStillRunning(). See the description at the top * of the file. */ @@ -125,7 +125,7 @@ static void prvSetupHardware( void ); /* * Application entry point: - * Starts all the other tasks, then starts the scheduler. + * Starts all the other tasks, then starts the scheduler. */ int main( void ) { @@ -141,14 +141,14 @@ int main( void ) vStartDynamicPriorityTasks(); /* Start the check task - which is defined in this file. This is the task - that periodically checks to see that all the other tasks are executing + that periodically checks to see that all the other tasks are executing without error. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); /* Now all the tasks have been started - start the scheduler. NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode. - The processor MUST be in supervisor mode when vTaskStartScheduler is + The processor MUST be in supervisor mode when vTaskStartScheduler is called. The demo applications included in the FreeRTOS.org download switch to supervisor mode prior to main being called. If you are not using one of these demo application projects then ensure Supervisor mode is used here. */ @@ -176,7 +176,7 @@ TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD; for( ;; ) { - /* The period of the delay depends on whether an error has been + /* The period of the delay depends on whether an error has been detected or not. If an error has been detected then the period is reduced to increase the LED flash rate. */ vTaskDelay( xDelayPeriod ); diff --git a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/serial/serial.c b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/serial/serial.c index 7549146cf..74a7bd752 100644 --- a/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/serial/serial.c +++ b/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/serial/serial.c @@ -25,8 +25,8 @@ */ -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. Note this driver is used to test the FreeRTOS port. It is NOT intended to be an example of an efficient implementation! @@ -83,8 +83,8 @@ */ extern void vUART_ISREntry( void ); -/* - * The C function called from the asm wrapper. +/* + * The C function called from the asm wrapper. */ void vUART_ISRHandler( void ); @@ -92,8 +92,8 @@ void vUART_ISRHandler( void ); /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /* Communication flag between the interrupt service routine and serial API. */ static volatile long lTHREEmpty; @@ -112,10 +112,10 @@ xComPortHandle xReturn = serHANDLE; /* Initialise the THRE empty flag. */ lTHREEmpty = pdTRUE; - if( - ( xRxedChars != serINVALID_QUEUE ) && - ( xCharsForTx != serINVALID_QUEUE ) && - ( ulWantedBaud != ( unsigned long ) 0 ) + if( + ( xRxedChars != serINVALID_QUEUE ) && + ( xCharsForTx != serINVALID_QUEUE ) && + ( ulWantedBaud != ( unsigned long ) 0 ) ) { portENTER_CRITICAL() @@ -209,13 +209,13 @@ signed portBASE_TYPE xReturn; /* Is there space to write directly to the UART? */ if( lTHREEmpty == ( long ) pdTRUE ) { - /* We wrote the character directly to the UART, so was + /* We wrote the character directly to the UART, so was successful. */ lTHREEmpty = pdFALSE; U1THR = cOutChar; xReturn = pdPASS; } - else + else { /* We cannot write directly to the UART, so queue the character. Block for a maximum of xBlockTime if there is no space in the @@ -223,8 +223,8 @@ signed portBASE_TYPE xReturn; task has it's own critical section management. */ xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime ); - /* Depending on queue sizing and task prioritisation: While we - were blocked waiting to post interrupts were not disabled. It is + /* Depending on queue sizing and task prioritisation: While we + were blocked waiting to post interrupts were not disabled. It is possible that the serial ISR has emptied the Tx queue, in which case we need to start the Tx off again. */ if( lTHREEmpty == ( long ) pdTRUE ) @@ -258,7 +258,7 @@ unsigned char ucInterrupt; case serSOURCE_ERROR : /* Not handling this, but clear the interrupt. */ cChar = U1LSR; break; - + case serSOURCE_THRE : /* The THRE is empty. If there is another character in the Tx queue, send it now. */ if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) @@ -267,20 +267,20 @@ unsigned char ucInterrupt; } else { - /* There are no further characters - queued to send so we can indicate + /* There are no further characters + queued to send so we can indicate that the THRE is available. */ lTHREEmpty = pdTRUE; } break; - + case serSOURCE_RX_TIMEOUT : - case serSOURCE_RX : /* A character was received. Place it in + case serSOURCE_RX : /* A character was received. Place it in the queue of received characters. */ cChar = U1RBR; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); break; - + default : /* There is nothing to do, leave the ISR. */ break; } @@ -302,4 +302,4 @@ unsigned char ucInterrupt; - + diff --git a/FreeRTOS/Demo/ARM7_LPC2138_Rowley/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_LPC2138_Rowley/FreeRTOSConfig.h index d2529378f..3c5e696f2 100644 --- a/FreeRTOS/Demo/ARM7_LPC2138_Rowley/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_LPC2138_Rowley/FreeRTOSConfig.h @@ -69,6 +69,9 @@ the CPU frequency. */ #define configUSE_RECURSIVE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_LPC2138_Rowley/mainISR.c b/FreeRTOS/Demo/ARM7_LPC2138_Rowley/mainISR.c index 154465b1f..a914b50db 100644 --- a/FreeRTOS/Demo/ARM7_LPC2138_Rowley/mainISR.c +++ b/FreeRTOS/Demo/ARM7_LPC2138_Rowley/mainISR.c @@ -29,7 +29,7 @@ #define isrCLEAR_EINT_1 2 /* - * Interrupt routine that simply wakes vButtonHandlerTask on each interrupt + * Interrupt routine that simply wakes vButtonHandlerTask on each interrupt * generated by a push of the built in button. The wrapper takes care of * the ISR entry. This then calls the actual handler function to perform * the work. This work should not be done in the wrapper itself unless diff --git a/FreeRTOS/Demo/ARM7_STR71x_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_STR71x_IAR/FreeRTOSConfig.h index 22c302672..a9a8d463f 100644 --- a/FreeRTOS/Demo/ARM7_STR71x_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_STR71x_IAR/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -53,6 +53,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_STR71x_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_STR71x_IAR/ParTest/ParTest.c index 64942fabc..a093ec87b 100644 --- a/FreeRTOS/Demo/ARM7_STR71x_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_STR71x_IAR/ParTest/ParTest.c @@ -48,10 +48,10 @@ #define partstFIRST_LED_BIT 4 -/* This demo application uses files that are common to all port demo +/* This demo application uses files that are common to all port demo applications. These files assume 6 LED's are available, whereas I have only 5 (including the LED built onto the development board). To prevent -two tasks trying to use the same LED a bit of remapping is performed. +two tasks trying to use the same LED a bit of remapping is performed. The ComTest tasks will try and use LED's 6 and 7. LED 6 is ignored and has no effect, LED 7 is mapped to LED3. The LED usage is described in the port documentation available from the FreeRTOS.org WEB site. */ @@ -61,7 +61,7 @@ the port documentation available from the FreeRTOS.org WEB site. */ /*-----------------------------------------------------------*/ void vParTestInitialise( void ) -{ +{ /* Configure the bits used to flash LED's on port 1 as output. */ GPIO_Config(GPIO1, partstALL_LEDs, GPIO_OUT_OD); } diff --git a/FreeRTOS/Demo/ARM7_STR71x_IAR/main.c b/FreeRTOS/Demo/ARM7_STR71x_IAR/main.c index 7dbad442b..633ba37d9 100644 --- a/FreeRTOS/Demo/ARM7_STR71x_IAR/main.c +++ b/FreeRTOS/Demo/ARM7_STR71x_IAR/main.c @@ -181,7 +181,7 @@ TickType_t xLastWakeTime; /* Delay until it is time to execute again. The delay period is shorter following an error so the LED flashes faster. */ vTaskDelayUntil( &xLastWakeTime, xDelayPeriod ); - + /* Check all the standard demo application tasks are executing without error. */ if( prvCheckOtherTasksAreStillRunning() != pdPASS ) @@ -189,7 +189,7 @@ TickType_t xLastWakeTime; /* An error has been detected in one of the tasks - flash faster. */ xDelayPeriod = mainERROR_FLASH_PERIOD; } - + vParTestToggleLED( mainCHECK_TASK_LED ); } } diff --git a/FreeRTOS/Demo/ARM7_STR71x_IAR/serial/serial.c b/FreeRTOS/Demo/ARM7_STR71x_IAR/serial/serial.c index 013943fc8..9f83338d6 100644 --- a/FreeRTOS/Demo/ARM7_STR71x_IAR/serial/serial.c +++ b/FreeRTOS/Demo/ARM7_STR71x_IAR/serial/serial.c @@ -73,7 +73,7 @@ __arm void vSerialISR( void ); xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) { xComPortHandle xReturn; - + /* Create the queues used to hold Rx and Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); @@ -209,7 +209,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { /* Queue empty, nothing to send so turn off the Tx interrupt. */ serINTERRUPT_OFF(); - } + } } if( usStatus & UART_RxBufFull ) @@ -233,4 +233,4 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + diff --git a/FreeRTOS/Demo/ARM7_STR75x_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_STR75x_GCC/FreeRTOSConfig.h index a1836b9d2..8f9852335 100644 --- a/FreeRTOS/Demo/ARM7_STR75x_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_STR75x_GCC/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -55,6 +55,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_STR75x_GCC/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_STR75x_GCC/ParTest/ParTest.c index 2529bd171..f6ccae659 100644 --- a/FreeRTOS/Demo/ARM7_STR75x_GCC/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_STR75x_GCC/ParTest/ParTest.c @@ -35,7 +35,7 @@ #include "partest.h" /*----------------------------------------------------------- - * Simple parallel port IO routines for the LED's + * Simple parallel port IO routines for the LED's *-----------------------------------------------------------*/ #define partstNUM_LEDS 4 @@ -51,14 +51,14 @@ static GPIO_MAP xLEDMap[ partstNUM_LEDS ] = { { ( GPIO_TypeDef * )GPIO1_BASE, GPIO_Pin_1, 0UL }, { ( GPIO_TypeDef * )GPIO0_BASE, GPIO_Pin_16, 0UL }, - { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_18, 0UL }, - { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_19, 0UL } + { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_18, 0UL }, + { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_19, 0UL } }; /*-----------------------------------------------------------*/ void vParTestInitialise( void ) -{ +{ GPIO_InitTypeDef GPIO_InitStructure ; /* Configure the bits used to flash LED's on port 1 as output. */ @@ -97,7 +97,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) else { GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET ); - xLEDMap[ uxLED ].ulValue = 1; + xLEDMap[ uxLED ].ulValue = 1; } } portEXIT_CRITICAL(); @@ -119,7 +119,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) else { GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET ); - xLEDMap[ uxLED ].ulValue = 1; + xLEDMap[ uxLED ].ulValue = 1; } } portEXIT_CRITICAL(); diff --git a/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serial.c b/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serial.c index eabfe1a38..55b9d45af 100644 --- a/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serial.c +++ b/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serial.c @@ -78,7 +78,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port xComPortHandle xReturn; UART_InitTypeDef UART_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; -EIC_IRQInitTypeDef EIC_IRQInitStructure; +EIC_IRQInitTypeDef EIC_IRQInitStructure; /* Create the queues used to hold Rx and Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); @@ -88,24 +88,24 @@ EIC_IRQInitTypeDef EIC_IRQInitStructure; hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) { - + vConfigureQueues( xRxedChars, xCharsForTx, &xQueueEmpty ); - + portENTER_CRITICAL(); { /* Enable the UART0 Clock. */ MRCC_PeripheralClockConfig( MRCC_Peripheral_UART0, ENABLE ); - + /* Configure the UART0_Tx as alternate function */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11; GPIO_Init(GPIO0, &GPIO_InitStructure); - + /* Configure the UART0_Rx as input floating */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_Init(GPIO0, &GPIO_InitStructure); - + /* Configure UART0. */ UART_InitStructure.UART_WordLength = UART_WordLength_8D; UART_InitStructure.UART_StopBits = UART_StopBits_1; @@ -120,12 +120,12 @@ EIC_IRQInitTypeDef EIC_IRQInitStructure; /* Enable the UART0 */ UART_Cmd(UART0, ENABLE); - /* Configure the IEC for the UART interrupts. */ + /* Configure the IEC for the UART interrupts. */ EIC_IRQInitStructure.EIC_IRQChannelCmd = ENABLE; EIC_IRQInitStructure.EIC_IRQChannel = UART0_IRQChannel; EIC_IRQInitStructure.EIC_IRQChannelPriority = 1; EIC_IRQInit(&EIC_IRQInitStructure); - + xQueueEmpty = pdTRUE; UART_ITConfig( UART0, UART_IT_Transmit | UART_IT_Receive, ENABLE ); } @@ -201,13 +201,13 @@ portBASE_TYPE xReturn; if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) { xReturn = pdFAIL; - } + } else { - xReturn = pdPASS; + xReturn = pdPASS; } } - + xQueueEmpty = pdFALSE; } portEXIT_CRITICAL(); @@ -226,4 +226,4 @@ void vSerialClose( xComPortHandle xPort ) - + diff --git a/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serialISR.c b/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serialISR.c index b445579b5..b3d58168f 100644 --- a/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serialISR.c +++ b/FreeRTOS/Demo/ARM7_STR75x_GCC/serial/serialISR.c @@ -70,12 +70,12 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; } else { - *pxQueueEmpty = pdTRUE; - } + *pxQueueEmpty = pdTRUE; + } UART_ClearITPendingBit( UART0, UART_IT_Transmit ); } - + if( UART0->MIS & UART_IT_Receive ) { /* The interrupt was caused by a character being received. Grab the diff --git a/FreeRTOS/Demo/ARM7_STR75x_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM7_STR75x_IAR/FreeRTOSConfig.h index bbcebde4e..8fbdf7ace 100644 --- a/FreeRTOS/Demo/ARM7_STR75x_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM7_STR75x_IAR/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -53,6 +53,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM7_STR75x_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/ARM7_STR75x_IAR/ParTest/ParTest.c index 2529bd171..f6ccae659 100644 --- a/FreeRTOS/Demo/ARM7_STR75x_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM7_STR75x_IAR/ParTest/ParTest.c @@ -35,7 +35,7 @@ #include "partest.h" /*----------------------------------------------------------- - * Simple parallel port IO routines for the LED's + * Simple parallel port IO routines for the LED's *-----------------------------------------------------------*/ #define partstNUM_LEDS 4 @@ -51,14 +51,14 @@ static GPIO_MAP xLEDMap[ partstNUM_LEDS ] = { { ( GPIO_TypeDef * )GPIO1_BASE, GPIO_Pin_1, 0UL }, { ( GPIO_TypeDef * )GPIO0_BASE, GPIO_Pin_16, 0UL }, - { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_18, 0UL }, - { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_19, 0UL } + { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_18, 0UL }, + { ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_19, 0UL } }; /*-----------------------------------------------------------*/ void vParTestInitialise( void ) -{ +{ GPIO_InitTypeDef GPIO_InitStructure ; /* Configure the bits used to flash LED's on port 1 as output. */ @@ -97,7 +97,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) else { GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET ); - xLEDMap[ uxLED ].ulValue = 1; + xLEDMap[ uxLED ].ulValue = 1; } } portEXIT_CRITICAL(); @@ -119,7 +119,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) else { GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET ); - xLEDMap[ uxLED ].ulValue = 1; + xLEDMap[ uxLED ].ulValue = 1; } } portEXIT_CRITICAL(); diff --git a/FreeRTOS/Demo/ARM7_STR75x_IAR/serial/serial.c b/FreeRTOS/Demo/ARM7_STR75x_IAR/serial/serial.c index b679feab7..457bb5a6b 100644 --- a/FreeRTOS/Demo/ARM7_STR75x_IAR/serial/serial.c +++ b/FreeRTOS/Demo/ARM7_STR75x_IAR/serial/serial.c @@ -68,7 +68,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port xComPortHandle xReturn; UART_InitTypeDef UART_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; -EIC_IRQInitTypeDef EIC_IRQInitStructure; +EIC_IRQInitTypeDef EIC_IRQInitStructure; /* Create the queues used to hold Rx and Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); @@ -82,17 +82,17 @@ EIC_IRQInitTypeDef EIC_IRQInitStructure; { /* Enable the UART0 Clock. */ MRCC_PeripheralClockConfig( MRCC_Peripheral_UART0, ENABLE ); - + /* Configure the UART0_Tx as alternate function */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11; GPIO_Init(GPIO0, &GPIO_InitStructure); - + /* Configure the UART0_Rx as input floating */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_Init(GPIO0, &GPIO_InitStructure); - + /* Configure UART0. */ UART_InitStructure.UART_WordLength = UART_WordLength_8D; UART_InitStructure.UART_StopBits = UART_StopBits_1; @@ -107,12 +107,12 @@ EIC_IRQInitTypeDef EIC_IRQInitStructure; /* Enable the UART0 */ UART_Cmd(UART0, ENABLE); - /* Configure the IEC for the UART interrupts. */ + /* Configure the IEC for the UART interrupts. */ EIC_IRQInitStructure.EIC_IRQChannelCmd = ENABLE; EIC_IRQInitStructure.EIC_IRQChannel = UART0_IRQChannel; EIC_IRQInitStructure.EIC_IRQChannelPriority = 1; EIC_IRQInit(&EIC_IRQInitStructure); - + xQueueEmpty = pdTRUE; UART_ITConfig( UART0, UART_IT_Transmit | UART_IT_Receive, ENABLE ); } @@ -188,13 +188,13 @@ portBASE_TYPE xReturn; if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) { xReturn = pdFAIL; - } + } else { - xReturn = pdPASS; + xReturn = pdPASS; } } - + xQueueEmpty = pdFALSE; } portEXIT_CRITICAL(); @@ -228,12 +228,12 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; } else { - xQueueEmpty = pdTRUE; - } + xQueueEmpty = pdTRUE; + } UART_ClearITPendingBit( UART0, UART_IT_Transmit ); } - + if( UART0->MIS & UART_IT_Receive ) { /* The interrupt was caused by a character being received. Grab the @@ -254,4 +254,4 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + diff --git a/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/FreeRTOSConfig.h index 9c6a8dd0b..cb5fe4de8 100644 --- a/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/FreeRTOSConfig.h @@ -52,6 +52,7 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 0 #define configUSE_RECURSIVE_MUTEXES 1 @@ -59,6 +60,7 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 6 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/ParTest/ParTest.c index a30188d6a..b986496b8 100644 --- a/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/ParTest/ParTest.c @@ -35,7 +35,7 @@ *-----------------------------------------------------------*/ void vParTestInitialise( void ) -{ +{ unsigned long ul; for( ul = 0; ul < partstNUM_LEDS; ul++ ) diff --git a/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/serial/serial.c b/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/serial/serial.c index b83498b3c..7c85386e8 100644 --- a/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/serial/serial.c +++ b/FreeRTOS/Demo/ARM9_AT91SAM9XE_IAR/serial/serial.c @@ -88,7 +88,7 @@ xComPortHandle xReturn = serHANDLE; hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) { - PMC_EnablePeripheral( AT91C_ID_US0 ); + PMC_EnablePeripheral( AT91C_ID_US0 ); portENTER_CRITICAL(); { USART_Configure( serCOM0, ( AT91C_US_CHRL_8_BITS | AT91C_US_PAR_NONE ), ulWantedBaud, configCPU_CLOCK_HZ ); @@ -164,7 +164,7 @@ signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar { /* Just to remove compiler warning. */ ( void ) pxPort; - + /* Place the character in the queue of characters to be transmitted. */ if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) { @@ -215,7 +215,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { /* Queue empty, nothing to send so turn off the Tx interrupt. */ vInterruptOff(); - } + } } if( ulStatus & AT91C_US_RXRDY ) @@ -238,4 +238,4 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + diff --git a/FreeRTOS/Demo/AVR32_UC3/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR32_UC3/FreeRTOSConfig.h index faf843db0..4a029f70c 100644 --- a/FreeRTOS/Demo/AVR32_UC3/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR32_UC3/FreeRTOSConfig.h @@ -53,7 +53,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -73,6 +73,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 0 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/AVR_ATMega323_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_ATMega323_IAR/FreeRTOSConfig.h index 1ab9cefbe..9f14b996f 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_ATMega323_IAR/FreeRTOSConfig.h @@ -38,7 +38,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -56,6 +56,10 @@ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/AVR_ATMega323_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/AVR_ATMega323_IAR/ParTest/ParTest.c index 01228244c..3ba67e40a 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/AVR_ATMega323_IAR/ParTest/ParTest.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V2.0.0 + Use scheduler suspends in place of critical sections. @@ -110,7 +110,7 @@ unsigned char ucBit; PORTB = ucCurrentOutputValue; } - xTaskResumeAll(); + xTaskResumeAll(); } } diff --git a/FreeRTOS/Demo/AVR_ATMega323_IAR/main.c b/FreeRTOS/Demo/AVR_ATMega323_IAR/main.c index 16f0c8afb..4e4e75d01 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_IAR/main.c +++ b/FreeRTOS/Demo/AVR_ATMega323_IAR/main.c @@ -45,7 +45,7 @@ /* Changes from V1.2.0 - + + Changed the baud rate for the serial test from 19200 to 57600. Changes from V1.2.3 @@ -71,6 +71,10 @@ Changes from V2.2.0 Changes from V2.6.1 + The IAR and WinAVR AVR ports are now maintained separately. + +Changes from V4.0.5 + + + Modified to demonstrate the use of co-routines. */ #include @@ -84,12 +88,14 @@ Changes from V2.6.1 /* Scheduler include files. */ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" /* Demo file headers. */ #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "print.h" #include "partest.h" #include "regtest.h" @@ -121,6 +127,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( ( void * ) 0x50 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -139,9 +148,9 @@ static void prvCheckOtherTasksAreStillRunning( void ); static void prvIncrementResetCount( void ); /* - * Idle hook (empty) + * Idle hook is used to scheduler co-routines. */ -void vApplicationIdleHook( void ); +void vApplicationIdleHook( void ); short main( void ) { @@ -155,10 +164,13 @@ short main( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartRegTestTasks(); - + /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -185,7 +197,7 @@ static volatile unsigned long ulDummyVariable = 3UL; integer tasks get some exercise. The result here is not important - see the demo application documentation for more info. */ ulDummyVariable *= 3; - + prvCheckOtherTasksAreStillRunning(); } } @@ -214,7 +226,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; { xErrorHasOccurred = pdTRUE; } - + if( xErrorHasOccurred == pdFALSE ) { /* Toggle the LED if everything is okay so we know if an error occurs even if not @@ -232,20 +244,20 @@ const unsigned char ucWrite1 = ( unsigned char ) 0x04; const unsigned char ucWrite2 = ( unsigned char ) 0x02; /* Increment the EEPROM value at 0x00. - + Setup the EEPROM address. */ EEARH = 0x00; EEARL = 0x00; - + /* Set the read enable bit. */ EECR |= ucReadBit; /* Wait for the read. */ while( EECR & ucReadBit ); - + /* The byte is ready. */ ucCount = EEDR; - + /* Increment the reset count, then write the byte back. */ ucCount++; EEDR = ucCount; @@ -256,5 +268,6 @@ const unsigned char ucWrite2 = ( unsigned char ) 0x02; void vApplicationIdleHook( void ) { + vCoRoutineSchedule(); } diff --git a/FreeRTOS/Demo/AVR_ATMega323_IAR/regtest.c b/FreeRTOS/Demo/AVR_ATMega323_IAR/regtest.c index 0834b1a67..a0f43976d 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_IAR/regtest.c +++ b/FreeRTOS/Demo/AVR_ATMega323_IAR/regtest.c @@ -46,7 +46,7 @@ portBASE_TYPE xRegTestError = pdFALSE; void vStartRegTestTasks( void ) { xTaskCreate( prvRegisterCheck1, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - xTaskCreate( prvRegisterCheck2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvRegisterCheck2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); } /*-----------------------------------------------------------*/ @@ -64,7 +64,7 @@ portBASE_TYPE xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ @@ -75,7 +75,7 @@ static void prvRegisterCheck1( void *pvParameters ) for( ;; ) { - asm( "LDI r31, 5" ); + asm( "LDI r31, 5" ); asm( "MOV r0, r31" ); asm( "LDI r31, 6" ); asm( "MOV r1, r31" ); @@ -218,7 +218,7 @@ static void prvRegisterCheck2( void *pvParameters ) for( ;; ) { - asm( "LDI r31, 1" ); + asm( "LDI r31, 1" ); asm( "MOV r0, r31" ); asm( "LDI r31, 2" ); asm( "MOV r1, r31" ); diff --git a/FreeRTOS/Demo/AVR_ATMega323_IAR/rtosdemo.ewp b/FreeRTOS/Demo/AVR_ATMega323_IAR/rtosdemo.ewp index e17a7a7b7..3b2bcc5bd 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_IAR/rtosdemo.ewp +++ b/FreeRTOS/Demo/AVR_ATMega323_IAR/rtosdemo.ewp @@ -971,6 +971,9 @@ $PROJ_DIR$\..\Common\Minimal\comtest.c + + $PROJ_DIR$\..\Common\Minimal\crflash.c + $PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c @@ -995,6 +998,9 @@ Kernel Source + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\list.c @@ -1012,3 +1018,5 @@ + + diff --git a/FreeRTOS/Demo/AVR_ATMega323_IAR/serial/serial.c b/FreeRTOS/Demo/AVR_ATMega323_IAR/serial/serial.c index 979dade96..2a5a448c3 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_IAR/serial/serial.c +++ b/FreeRTOS/Demo/AVR_ATMega323_IAR/serial/serial.c @@ -56,7 +56,7 @@ static QueueHandle_t xCharsForTx; ucByte = UCSRB; \ ucByte |= serTX_INT_ENABLE; \ outb( UCSRB, ucByte ); \ -} +} /*-----------------------------------------------------------*/ #define vInterruptOff() \ @@ -84,12 +84,12 @@ unsigned char ucByte; data sheet. */ ulBaudRateCounter = ( configCPU_CLOCK_HZ / ( serBAUD_DIV_CONSTANT * ulWantedBaud ) ) - ( unsigned long ) 1; - /* Set the baud rate. */ - ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); + /* Set the baud rate. */ + ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); outb( UBRRL, ucByte ); ulBaudRateCounter >>= ( unsigned long ) 8; - ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); + ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); outb( UBRRH, ucByte ); /* Enable the Rx interrupt. The Tx interrupt will get enabled @@ -100,7 +100,7 @@ unsigned char ucByte; outb( UCSRC, serUCSRC_SELECT | serEIGHT_DATA_BITS ); } 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. */ diff --git a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/FreeRTOSConfig.h index 982a6d104..55538b9a8 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -55,6 +55,10 @@ #define configIDLE_SHOULD_YIELD 1 #define configQUEUE_REGISTRY_SIZE 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/ParTest/ParTest.c b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/ParTest/ParTest.c index 2d709badf..34a57d428 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/ParTest/ParTest.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V2.0.0 + Use scheduler suspends in place of critical sections. @@ -39,7 +39,6 @@ Changes from V2.6.0 #include "FreeRTOS.h" #include "task.h" #include "partest.h" -#include /*----------------------------------------------------------- * Simple parallel port IO routines. @@ -69,7 +68,7 @@ unsigned char ucBit = ( unsigned char ) 1; if( uxLED <= partstMAX_OUTPUT_LED ) { - ucBit <<= uxLED; + ucBit <<= uxLED; vTaskSuspendAll(); { @@ -111,7 +110,7 @@ unsigned char ucBit; PORTB = ucCurrentOutputValue; } - xTaskResumeAll(); + xTaskResumeAll(); } } diff --git a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/main.c b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/main.c index b3e9bb86f..4221e680b 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/main.c +++ b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/main.c @@ -68,6 +68,10 @@ Changes from V2.6.1 + The IAR and WinAVR AVR ports are now maintained separately. +Changes from V4.0.5 + + + Modified to demonstrate the use of co-routines. + */ #include @@ -81,12 +85,14 @@ Changes from V2.6.1 /* Scheduler include files. */ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" /* Demo file headers. */ #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "print.h" #include "partest.h" #include "regtest.h" @@ -118,6 +124,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( ( void * ) 0x50 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -136,7 +145,7 @@ static void prvCheckOtherTasksAreStillRunning( void ); static void prvIncrementResetCount( void ); /* - * The idle hook is unused. + * The idle hook is used to scheduler co-routines. */ void vApplicationIdleHook( void ); @@ -158,6 +167,9 @@ short main( void ) /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -235,5 +247,6 @@ unsigned char ucCount; void vApplicationIdleHook( void ) { + vCoRoutineSchedule(); } diff --git a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/makefile b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/makefile index 27f9b8f9d..9bd557d1b 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/makefile +++ b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/makefile @@ -1,4 +1,4 @@ -# WinAVR Sample makefile written by Eric B. Weddington, J�rg Wunsch, et al. +# WinAVR Sample makefile written by Eric B. Weddington, Jörg Wunsch, et al. # Released to the Public Domain # Please read the make user manual! # @@ -57,8 +57,10 @@ regtest.c \ $(SOURCE_DIR)/tasks.c \ $(SOURCE_DIR)/queue.c \ $(SOURCE_DIR)/list.c \ +$(SOURCE_DIR)/croutine.c \ $(SOURCE_DIR)/portable/MemMang/heap_1.c \ $(PORT_DIR)/port.c \ +$(DEMO_DIR)/crflash.c \ $(DEMO_DIR)/integer.c \ $(DEMO_DIR)/PollQ.c \ $(DEMO_DIR)/comtest.c @@ -81,12 +83,12 @@ $(DEMO_DIR)/comtest.c # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = +ASRC = # List any extra directories to look for include files here. # Each directory must be seperated by a space. -EXTRAINCDIRS = +EXTRAINCDIRS = # Optional compiler flags. @@ -126,7 +128,7 @@ CFLAGS += -std=gnu99 # for use in COFF files, additional information about filenames # and function names needs to be present in the assembler source # files -- see avr-libc docs [FIXME: not yet described there] -ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs +ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs @@ -154,7 +156,7 @@ LDFLAGS += -lm # Programming support using avrdude. Settings and variables. -# Programming hardware: alf avr910 avrisp bascom bsd +# Programming hardware: alf avr910 avrisp bascom bsd # dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 # # Type: avrdude -c ? @@ -181,7 +183,7 @@ AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) #AVRDUDE_FLAGS += -V # Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See +# reports about avrdude. See # to submit bug reports. #AVRDUDE_FLAGS += -v -v @@ -225,7 +227,7 @@ ELFSIZE = $(SIZE) -A $(TARGET).elf MSG_ERRORS_NONE = Errors: none MSG_BEGIN = -------- begin -------- MSG_END = -------- end -------- -MSG_SIZE_BEFORE = Size before: +MSG_SIZE_BEFORE = Size before: MSG_SIZE_AFTER = Size after: MSG_COFF = Converting to AVR COFF: MSG_EXTENDED_COFF = Converting to AVR Extended COFF: @@ -242,7 +244,7 @@ MSG_CLEANING = Cleaning project: # Define all object files. -OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) +OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) # Define all listing files. LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) @@ -284,7 +286,7 @@ sizeafter: # Display compiler version information. -gccversion : +gccversion : @$(CC) --version @@ -296,7 +298,7 @@ COFFCONVERT=$(OBJCOPY) --debugging \ --change-section-address .data-0x800000 \ --change-section-address .bss-0x800000 \ --change-section-address .noinit-0x800000 \ - --change-section-address .eeprom-0x810000 + --change-section-address .eeprom-0x810000 coff: $(TARGET).elf @@ -313,7 +315,7 @@ extcoff: $(TARGET).elf -# Program the device. +# Program the device. program: $(TARGET).hex $(TARGET).eep $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) @@ -322,26 +324,26 @@ program: $(TARGET).hex $(TARGET).eep # Create final output files (.hex, .eep) from ELF output file. %.hex: %.elf - @echo - @echo $(MSG_FLASH) $@ + @echo + @echo $(MSG_FLASH) $@ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ %.eep: %.elf - @echo - @echo $(MSG_EEPROM) $@ + @echo + @echo $(MSG_EEPROM) $@ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ # Create extended listing file from ELF output file. %.lss: %.elf - @echo - @echo $(MSG_EXTENDED_LISTING) $@ + @echo + @echo $(MSG_EXTENDED_LISTING) $@ $(OBJDUMP) -h -S $< > $@ -# Create a symbol table from ELF output file. -%.sym: %.elf - @echo - @echo $(MSG_SYMBOL_TABLE) $@ +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ avr-nm -n $< > $@ @@ -382,8 +384,8 @@ program: $(TARGET).hex $(TARGET).eep clean: begin clean_list finished end clean_list : - @echo - @echo $(MSG_CLEANING) + @echo + @echo $(MSG_CLEANING) $(REMOVE) $(TARGET).hex $(REMOVE) $(TARGET).eep $(REMOVE) $(TARGET).obj @@ -401,8 +403,8 @@ clean_list : $(REMOVE) $(SRC:.c=.d) -# Automatically generate C source code dependencies. -# (Code originally taken from the GNU make user manual and modified +# Automatically generate C source code dependencies. +# (Code originally taken from the GNU make user manual and modified # (See README.txt Credits).) # # Note that this will work with sh (bash) and sed that is shipped with WinAVR diff --git a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/serial/serial.c b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/serial/serial.c index b82250547..788cd51c0 100644 --- a/FreeRTOS/Demo/AVR_ATMega323_WinAVR/serial/serial.c +++ b/FreeRTOS/Demo/AVR_ATMega323_WinAVR/serial/serial.c @@ -27,7 +27,7 @@ /* Changes from V1.2.3 - + The function xPortInitMinimal() has been renamed to + + The function xPortInitMinimal() has been renamed to xSerialPortInitMinimal() and the function xPortInit() has been renamed to xSerialPortInit(). @@ -66,8 +66,8 @@ Changes from V2.6.0 #define serUCSRC_SELECT ( ( unsigned char ) 0x80 ) #define serEIGHT_DATA_BITS ( ( unsigned char ) 0x06 ) -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; #define vInterruptOn() \ { \ @@ -76,7 +76,7 @@ static QueueHandle_t xCharsForTx; ucByte = UCSRB; \ ucByte |= serTX_INT_ENABLE; \ UCSRB = ucByte; \ -} +} /*-----------------------------------------------------------*/ #define vInterruptOff() \ @@ -104,12 +104,12 @@ unsigned char ucByte; data sheet. */ ulBaudRateCounter = ( configCPU_CLOCK_HZ / ( serBAUD_DIV_CONSTANT * ulWantedBaud ) ) - ( unsigned long ) 1; - /* Set the baud rate. */ - ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); + /* Set the baud rate. */ + ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); UBRRL = ucByte; ulBaudRateCounter >>= ( unsigned long ) 8; - ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); + ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff ); UBRRH = ucByte; /* Enable the Rx interrupt. The Tx interrupt will get enabled @@ -120,7 +120,7 @@ unsigned char ucByte; UCSRC = ( serUCSRC_SELECT | serEIGHT_DATA_BITS ); } 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. */ diff --git a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h index bac4a3d91..09084506b 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h @@ -39,18 +39,18 @@ /* * Timer instance | Value * ----------------|--------- - * TCB0 | 0 - * TCB1 | 1 - * TCB2 | 2 + * TCB0 | 0 + * TCB1 | 1 + * TCB2 | 2 * TCB3 | 3 - * RTC | 4 + * RTC | 4 */ #define configUSE_TIMER_INSTANCE 0 #define configUSE_PREEMPTION 1 /* NOTE: You can choose the following clock frequencies (Hz): -20000000, 10000000, 5000000, 2000000. +20000000, 10000000, 5000000, 2000000. For other frequency values, update clock_config.h with your own settings. */ #define configCPU_CLOCK_HZ 10000000 @@ -89,6 +89,10 @@ For other frequency values, update clock_config.h with your own settings. */ #define configUSE_TRACE_FACILITY 0 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/RTOSDemo.cproj b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/RTOSDemo.cproj index 1153c5e1c..1124bc269 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/RTOSDemo.cproj +++ b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/RTOSDemo.cproj @@ -155,6 +155,10 @@ compile + + compile + Source\croutine.c + compile Source\event_groups.c @@ -199,6 +203,10 @@ compile Source\include\atomic.h + + compile + Source\include\croutine.h + compile Source\include\deprecated_definitions.h @@ -304,6 +312,14 @@ compile Common\Minimal\PollQ.c + + compile + Common\include\crflash.h + + + compile + Common\Minimal\crflash.c + compile Common\include\recmutex.h diff --git a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_blinky.c b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_blinky.c index fe4e34de8..bc457b262 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_blinky.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_blinky.c @@ -88,7 +88,7 @@ void main_blinky( void ) { /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); - + if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this diff --git a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_minimal.c b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_minimal.c index 2f3851a87..9593b0425 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_minimal.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main_minimal.c @@ -28,10 +28,12 @@ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "partest.h" #include "regtest.h" @@ -61,6 +63,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( 0x1400 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -87,10 +92,13 @@ void main_minimal( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartRegTestTasks(); - + /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -102,7 +110,7 @@ void init_minimal( void ) /* Configure UART pins: PB0 Rx, PB1 Tx */ PORTB.DIR &= ~PIN1_bm; PORTB.DIR |= PIN0_bm; - + vParTestInitialise(); } @@ -123,7 +131,7 @@ static volatile unsigned long ulDummyVariable = 3UL; integer tasks get some exercise. The result here is not important - see the demo application documentation for more info. */ ulDummyVariable *= 3; - + prvCheckOtherTasksAreStillRunning(); } } @@ -152,7 +160,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; { xErrorHasOccurred = pdTRUE; } - + if( xErrorHasOccurred == pdFALSE ) { /* Toggle the LED if everything is okay so we know if an error occurs even if not @@ -174,4 +182,5 @@ unsigned char ucResetCount; void vApplicationIdleHook( void ) { + vCoRoutineSchedule(); } diff --git a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/regtest.c b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/regtest.c index 80372446a..83acef705 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/regtest.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/regtest.c @@ -62,7 +62,7 @@ portBASE_TYPE xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/AVR_ATMega4809_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_ATMega4809_IAR/FreeRTOSConfig.h index cdb925f3c..e0519588a 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_ATMega4809_IAR/FreeRTOSConfig.h @@ -39,23 +39,23 @@ /* * Timer instance | Value * ----------------|--------- - * TCB0 | 0 - * TCB1 | 1 - * TCB2 | 2 - * TCB3 | 3 - * RTC | 4 + * TCB0 | 0 + * TCB1 | 1 + * TCB2 | 2 + * TCB3 | 3 + * RTC | 4 */ #define configUSE_TIMER_INSTANCE 0 #define configCALL_STACK_SIZE 30 #define configUSE_PREEMPTION 1 - + /* NOTE: You can choose the following clock frequencies (Hz): -20000000, 10000000, 5000000, 2000000. +20000000, 10000000, 5000000, 2000000. For other frequency values, update clock_config.h with your own settings. */ #define configCPU_CLOCK_HZ 10000000 - + #define configTICK_RATE_HZ 1000 #define configMAX_PRIORITIES 4 #define configMINIMAL_STACK_SIZE 110 @@ -91,6 +91,10 @@ For other frequency values, update clock_config.h with your own settings. */ #define configUSE_TRACE_FACILITY 0 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewp b/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewp index eaf1f450f..73bb9de4e 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewp +++ b/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewp @@ -2121,6 +2121,9 @@ $PROJ_DIR$\..\Common\include\comtest.h + + $PROJ_DIR$\..\Common\include\crflash.h + $PROJ_DIR$\..\Common\include\integer.h @@ -2145,6 +2148,9 @@ $PROJ_DIR$\..\Common\Minimal\comtest.c + + $PROJ_DIR$\..\Common\Minimal\crflash.c + $PROJ_DIR$\..\Common\Minimal\integer.c @@ -2193,6 +2199,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h @@ -2269,6 +2278,9 @@ + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewt b/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewt index d09e2a256..80e9412ab 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewt +++ b/FreeRTOS/Demo/AVR_ATMega4809_IAR/RTOSDemo.ewt @@ -2169,6 +2169,9 @@ $PROJ_DIR$\..\Common\include\comtest.h + + $PROJ_DIR$\..\Common\include\crflash.h + $PROJ_DIR$\..\Common\include\integer.h @@ -2193,6 +2196,9 @@ $PROJ_DIR$\..\Common\Minimal\comtest.c + + $PROJ_DIR$\..\Common\Minimal\crflash.c + $PROJ_DIR$\..\Common\Minimal\integer.c @@ -2241,6 +2247,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h @@ -2317,6 +2326,9 @@ + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_blinky.c b/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_blinky.c index 450fc1fd2..9c10ef242 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_blinky.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_blinky.c @@ -88,7 +88,7 @@ void main_blinky( void ) { /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); - + if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this @@ -114,7 +114,7 @@ void main_blinky( void ) more details on the FreeRTOS heap http://www.freertos.org/a00111.html. The mode from which main() is called is set in the C start up code and must be a privileged mode (not user mode). */ - for( ;; ); + for( ;; ); } void init_blinky( void ) diff --git a/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_minimal.c b/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_minimal.c index 9cc3e08fd..21860a96e 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_minimal.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_IAR/main_minimal.c @@ -26,11 +26,13 @@ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "partest.h" #include "regtest.h" @@ -60,6 +62,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( 0x1400 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -86,10 +91,13 @@ void main_minimal( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartRegTestTasks(); - + /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -101,7 +109,7 @@ void init_minimal( void ) /* Configure UART pins: PB0 Rx, PB1 Tx */ PORTB.DIR &= ~PIN1_bm; PORTB.DIR |= PIN0_bm; - + vParTestInitialise(); } @@ -122,7 +130,7 @@ static volatile unsigned long ulDummyVariable = 3UL; integer tasks get some exercise. The result here is not important - see the demo application documentation for more info. */ ulDummyVariable *= 3; - + prvCheckOtherTasksAreStillRunning(); } } @@ -151,7 +159,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; { xErrorHasOccurred = pdTRUE; } - + if( xErrorHasOccurred == pdFALSE ) { /* Toggle the LED if everything is okay so we know if an error occurs even if not @@ -171,4 +179,5 @@ static unsigned char __eeprom ucResetCount @ mainRESET_COUNT_ADDRESS; void vApplicationIdleHook( void ) { -} \ No newline at end of file + vCoRoutineSchedule(); +} diff --git a/FreeRTOS/Demo/AVR_ATMega4809_IAR/regtest.c b/FreeRTOS/Demo/AVR_ATMega4809_IAR/regtest.c index e35ab63df..c159de453 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_IAR/regtest.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_IAR/regtest.c @@ -62,7 +62,7 @@ portBASE_TYPE xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/FreeRTOSConfig.h index bac4a3d91..09084506b 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/FreeRTOSConfig.h @@ -39,18 +39,18 @@ /* * Timer instance | Value * ----------------|--------- - * TCB0 | 0 - * TCB1 | 1 - * TCB2 | 2 + * TCB0 | 0 + * TCB1 | 1 + * TCB2 | 2 * TCB3 | 3 - * RTC | 4 + * RTC | 4 */ #define configUSE_TIMER_INSTANCE 0 #define configUSE_PREEMPTION 1 /* NOTE: You can choose the following clock frequencies (Hz): -20000000, 10000000, 5000000, 2000000. +20000000, 10000000, 5000000, 2000000. For other frequency values, update clock_config.h with your own settings. */ #define configCPU_CLOCK_HZ 10000000 @@ -89,6 +89,10 @@ For other frequency values, update clock_config.h with your own settings. */ #define configUSE_TRACE_FACILITY 0 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_blinky.c b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_blinky.c index fe4e34de8..bc457b262 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_blinky.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_blinky.c @@ -88,7 +88,7 @@ void main_blinky( void ) { /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); - + if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this diff --git a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_minimal.c b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_minimal.c index 2f3851a87..9593b0425 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_minimal.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main_minimal.c @@ -28,10 +28,12 @@ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "partest.h" #include "regtest.h" @@ -61,6 +63,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( 0x1400 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -87,10 +92,13 @@ void main_minimal( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartRegTestTasks(); - + /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -102,7 +110,7 @@ void init_minimal( void ) /* Configure UART pins: PB0 Rx, PB1 Tx */ PORTB.DIR &= ~PIN1_bm; PORTB.DIR |= PIN0_bm; - + vParTestInitialise(); } @@ -123,7 +131,7 @@ static volatile unsigned long ulDummyVariable = 3UL; integer tasks get some exercise. The result here is not important - see the demo application documentation for more info. */ ulDummyVariable *= 3; - + prvCheckOtherTasksAreStillRunning(); } } @@ -152,7 +160,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; { xErrorHasOccurred = pdTRUE; } - + if( xErrorHasOccurred == pdFALSE ) { /* Toggle the LED if everything is okay so we know if an error occurs even if not @@ -174,4 +182,5 @@ unsigned char ucResetCount; void vApplicationIdleHook( void ) { + vCoRoutineSchedule(); } diff --git a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/nbproject/configurations.xml b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/nbproject/configurations.xml index f09d43741..7ad930ec6 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/nbproject/configurations.xml +++ b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/nbproject/configurations.xml @@ -30,6 +30,8 @@ ../Common/include/comtest2.h ../Common/include/comtest_strings.h ../Common/include/countsem.h + ../Common/include/crflash.h + ../Common/include/crhook.h ../Common/include/death.h ../Common/include/dynamic.h ../Common/include/fileIO.h @@ -48,6 +50,7 @@ ../Common/Minimal/PollQ.c ../Common/Minimal/TaskNotify.c ../Common/Minimal/comtest.c + ../Common/Minimal/crflash.c ../Common/Minimal/integer.c ../Common/Minimal/recmutex.c @@ -57,6 +60,7 @@ ../../Source/include/FreeRTOS.h ../../Source/include/StackMacros.h ../../Source/include/atomic.h + ../../Source/include/croutine.h ../../Source/include/deprecated_definitions.h ../../Source/include/event_groups.h ../../Source/include/list.h @@ -85,6 +89,7 @@ ../../Source/portable/MemMang/heap_1.c + ../../Source/croutine.c ../../Source/event_groups.c ../../Source/list.c ../../Source/queue.c diff --git a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/regtest.c b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/regtest.c index a7563fa17..7e01a663d 100644 --- a/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/regtest.c +++ b/FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/regtest.c @@ -63,7 +63,7 @@ portBASE_TYPE xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/FreeRTOSConfig.h index 02664ed6a..f69f5a1ab 100644 --- a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* FreeRTOS software timer. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY 2 -#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_QUEUE_LENGTH 5 #define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE /* FreeRTOS memory allocation scheme. */ diff --git a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/ParTest.c b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/ParTest.c index 7b83b25e1..240a339b3 100644 --- a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/ParTest.c +++ b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/ParTest.c @@ -28,8 +28,8 @@ #include "task.h" #include "partest.h" -/* - * ATmega328PB Xplained Mini board has a user LED at PB5. +/* + * ATmega328PB Xplained Mini board has a user LED at PB5. * Everything below is specific for this setup only. * LED is lit when PB5 is set to a high. */ @@ -55,11 +55,11 @@ void vParTestSetLED( UBaseType_t uxLED, BaseType_t xValue ) { /* There's only one LED on this board. */ ( void ) uxLED; - - /* Turn on user LED. + + /* Turn on user LED. The compound action is guaranteed to be not interrupted by other tasks. */ vTaskSuspendAll(); - + if ( xValue == 0 ) { /* Turn off, only when input value is zero. */ @@ -74,7 +74,7 @@ void vParTestSetLED( UBaseType_t uxLED, BaseType_t xValue ) PORTB |= partestLED_PORTB_DIR_REG_BIT; uCurrentLedOutputVal = partestLED_ON; } - + xTaskResumeAll(); } @@ -84,11 +84,11 @@ void vParTestToggleLED( UBaseType_t uxLED ) { /* There's only one LED on this board. */ ( void ) uxLED; - - /* Toggle user LED. + + /* Toggle user LED. The compound action is guaranteed to be not interrupted by other tasks. */ vTaskSuspendAll(); - + if ( uCurrentLedOutputVal == partestLED_ON ) { /* Turn off. */ @@ -103,7 +103,7 @@ void vParTestToggleLED( UBaseType_t uxLED ) PORTB |= partestLED_PORTB_DIR_REG_BIT; uCurrentLedOutputVal = partestLED_ON; } - + xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/RTOSDemo.cproj b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/RTOSDemo.cproj index c58dfd796..b0c87be7a 100644 --- a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/RTOSDemo.cproj +++ b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/RTOSDemo.cproj @@ -204,6 +204,10 @@ + + compile + FreeRTOS\croutine.c + compile FreeRTOS\event_groups.c @@ -212,6 +216,10 @@ compile FreeRTOS\include\atomic.h + + compile + FreeRTOS\include\croutine.h + compile FreeRTOS\include\deprecated_definitions.h diff --git a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/regtest.c b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/regtest.c index 615dee331..a57fe8b36 100644 --- a/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/regtest.c +++ b/FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/regtest.c @@ -31,13 +31,13 @@ /* Demo file headers. */ #include "regtest.h" -/* The minimum stack size required by a register test task. - * - * The value should be at least the sum of: - * - Number of bytes used to save register context. +/* The minimum stack size required by a register test task. + * + * The value should be at least the sum of: + * - Number of bytes used to save register context. * Refer to port.c, r0-r31 and/or RAMPZ and/or EIND. * - Number of bytes used in nested function call. - * Refer to GCC Developer Option -fstack-usage. + * Refer to GCC Developer Option -fstack-usage. */ #define REGTEST_MIN_STACK_SIZE ( ( unsigned short ) 50 ) @@ -48,8 +48,8 @@ static void prvRegisterCheck1( void *pvParameters ); static void prvRegisterCheck2( void *pvParameters ); -/* Set to a none zero value should an error be found. - * Using two variables to identify offending task and register combination. +/* Set to a none zero value should an error be found. + * Using two variables to identify offending task and register combination. */ UBaseType_t uxRegTestError1 = 0; UBaseType_t uxRegTestError2 = 0; @@ -63,7 +63,7 @@ void vStartRegTestTasks( void ) * context is not restored correctly, error is more likely to be caught. */ xTaskCreate( prvRegisterCheck1, "Reg1", REGTEST_MIN_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - xTaskCreate( prvRegisterCheck2, "Reg2", REGTEST_MIN_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvRegisterCheck2, "Reg2", REGTEST_MIN_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); } /*-----------------------------------------------------------*/ @@ -72,14 +72,14 @@ BaseType_t xAreRegTestTasksStillRunning( void ) BaseType_t xReturn; /* If a register was found to contain an unexpected value then the - * uxRegTestError variable would have been set to a none zero value. + * uxRegTestError variable would have been set to a none zero value. * * This check guarantees no false positive, but does not guarantee test * has actually run. Could have a counter to track how many times the loop - * has been entered and ensure that the number is monotonically incrementing. - * And then it'll subject to integer overflow issue. To make things simple - * straight forward, set a breakpoint at the end of the loop in prvRegisterCheck1() - * and prvRegisterCheck2(). Make sure both can be hit. + * has been entered and ensure that the number is monotonically incrementing. + * And then it'll subject to integer overflow issue. To make things simple + * straight forward, set a breakpoint at the end of the loop in prvRegisterCheck1() + * and prvRegisterCheck2(). Make sure both can be hit. */ if( uxRegTestError1 == 0 && uxRegTestError2 == 0 ) { @@ -89,7 +89,7 @@ BaseType_t xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ @@ -100,13 +100,13 @@ static void prvRegisterCheck1( void *pvParameters ) for( ;; ) { - /* Load register r0-r30 with known value. - * r31 is used to first load immediate value then copy into r0-15. + /* Load register r0-r30 with known value. + * r31 is used to first load immediate value then copy into r0-15. * * LDI Rd,K * Rd<--K (16 <= d <= 31, 0 <= K <= 255) */ - asm( "LDI r31, 0x80" ); + asm( "LDI r31, 0x80" ); asm( "MOV r0, r31" ); asm( "LDI r31, 0x81" ); asm( "MOV r1, r31" ); @@ -155,7 +155,7 @@ static void prvRegisterCheck1( void *pvParameters ) asm( "LDI r30, 0x9E" ); /* Check whether register r0-30 still contain known good values. - * If not, update uxRegTestError1 with the unique value. + * If not, update uxRegTestError1 with the unique value. */ asm( "LDI r31, 0x80" ); asm( "CPSE r31, r0" ); @@ -250,7 +250,7 @@ static void prvRegisterCheck1( void *pvParameters ) asm( "LDI r31, 0x9E" ); asm( "CPSE r31, r30" ); asm( "STS uxRegTestError1, r30" ); - + /* Give other tasks of the same priority a chance to run. */ taskYIELD(); } @@ -263,13 +263,13 @@ static void prvRegisterCheck2( void *pvParameters ) for( ;; ) { - /* Load register r0-r30 with known value. - * r31 is used to first load immediate value then copy into r0-15. + /* Load register r0-r30 with known value. + * r31 is used to first load immediate value then copy into r0-15. * * LDI Rd,K * Rd<--K (16 <= d <= 31, 0 <= K <= 255) */ - asm( "LDI r31, 0" ); + asm( "LDI r31, 0" ); asm( "MOV r0, r31" ); asm( "LDI r31, 1" ); asm( "MOV r1, r31" ); @@ -316,9 +316,9 @@ static void prvRegisterCheck2( void *pvParameters ) asm( "LDI r28, 28" ); asm( "LDI r29, 29" ); asm( "LDI r30, 30" ); - + /* Check whether register r0-30 still contain known good values. - * If not, update uxRegTestError2 with the unique value. + * If not, update uxRegTestError2 with the unique value. */ asm( "LDI r31, 0" ); asm( "CPSE r31, r0" ); @@ -413,7 +413,7 @@ static void prvRegisterCheck2( void *pvParameters ) asm( "LDI r31, 30" ); asm( "CPSE r31, r30" ); asm( "STS uxRegTestError2, r30" ); - + /* Give other tasks of the same priority a chance to run. */ taskYIELD(); } diff --git a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h index 593e4c819..544b54eae 100644 --- a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/FreeRTOSConfig.h @@ -39,12 +39,12 @@ /* * Timer instance | Value * ----------------|--------- - * TCB0 | 0 - * TCB1 | 1 - * TCB2 | 2 - * TCB3 | 3 + * TCB0 | 0 + * TCB1 | 1 + * TCB2 | 2 + * TCB3 | 3 * TCB4 | 4 - * RTC | 5 + * RTC | 5 */ #define configUSE_TIMER_INSTANCE 0 @@ -91,6 +91,10 @@ For other frequency values, update clock_config.h with your own settings */ #define configUSE_TRACE_FACILITY 0 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/RTOSDemo.cproj b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/RTOSDemo.cproj index 8f20b0624..dc745410f 100644 --- a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/RTOSDemo.cproj +++ b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/RTOSDemo.cproj @@ -152,6 +152,10 @@ compile + + compile + freeRTOS\croutine.c + compile freeRTOS\event_groups.c @@ -196,6 +200,10 @@ compile freeRTOS\include\atomic.h + + compile + freeRTOS\include\croutine.h + compile freeRTOS\include\deprecated_definitions.h @@ -308,6 +316,14 @@ compile Common\Minimal\PollQ.c + + compile + Common\include\crflash.h + + + compile + Common\Minimal\crflash.c + compile Common\include\serial.h diff --git a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_blinky.c b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_blinky.c index 00b6b5813..b941f928a 100644 --- a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_blinky.c +++ b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_blinky.c @@ -88,7 +88,7 @@ void main_blinky( void ) { /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); - + if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this diff --git a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_minimal.c b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_minimal.c index cb3ab4c09..bf54d4b5c 100644 --- a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_minimal.c +++ b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main_minimal.c @@ -27,10 +27,12 @@ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "partest.h" #include "regtest.h" @@ -60,6 +62,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( 0x1400 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -86,10 +91,13 @@ void main_minimal( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartRegTestTasks(); - + /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -101,7 +109,7 @@ void init_minimal( void ) /* Configure UART pins: PC1 Rx, PC0 Tx */ PORTC.DIR &= ~PIN0_bm; PORTC.DIR |= PIN1_bm; - + vParTestInitialise(); } @@ -122,7 +130,7 @@ static volatile unsigned long ulDummyVariable = 3UL; integer tasks get some exercise. The result here is not important - see the demo application documentation for more info. */ ulDummyVariable *= 3; - + prvCheckOtherTasksAreStillRunning(); } } @@ -151,7 +159,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; { xErrorHasOccurred = pdTRUE; } - + if( xErrorHasOccurred == pdFALSE ) { /* Toggle the LED if everything is okay so we know if an error occurs even if not @@ -173,4 +181,5 @@ unsigned char ucResetCount; void vApplicationIdleHook( void ) { + vCoRoutineSchedule(); } diff --git a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/regtest.c b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/regtest.c index 80372446a..83acef705 100644 --- a/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/regtest.c +++ b/FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/regtest.c @@ -62,7 +62,7 @@ portBASE_TYPE xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/AVR_Dx_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_Dx_IAR/FreeRTOSConfig.h index 4ac757818..b38ad18cd 100644 --- a/FreeRTOS/Demo/AVR_Dx_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_Dx_IAR/FreeRTOSConfig.h @@ -39,12 +39,12 @@ /* * Timer instance | Value * ----------------|--------- - * TCB0 | 0 - * TCB1 | 1 - * TCB2 | 2 - * TCB3 | 3 - * TCB4 | 4 - * RTC | 5 + * TCB0 | 0 + * TCB1 | 1 + * TCB2 | 2 + * TCB3 | 3 + * TCB4 | 4 + * RTC | 5 */ #define configUSE_TIMER_INSTANCE 0 @@ -93,6 +93,10 @@ For other frequency values, update clock_config.h with your own settings */ #define configUSE_TRACE_FACILITY 0 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewp b/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewp index 903fafe23..fc945f31f 100644 --- a/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewp +++ b/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewp @@ -2126,6 +2126,9 @@ $PROJ_DIR$\..\Common\include\comtest.h + + $PROJ_DIR$\..\Common\include\crflash.h + $PROJ_DIR$\..\Common\include\integer.h @@ -2156,6 +2159,9 @@ $PROJ_DIR$\..\Common\Minimal\comtest.c + + $PROJ_DIR$\..\Common\Minimal\crflash.c + $PROJ_DIR$\..\Common\Minimal\integer.c @@ -2177,6 +2183,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h @@ -2253,6 +2262,9 @@ + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewt b/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewt index 9996fda3f..4ccad4f35 100644 --- a/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewt +++ b/FreeRTOS/Demo/AVR_Dx_IAR/RTOSDemo.ewt @@ -2169,6 +2169,9 @@ $PROJ_DIR$\..\Common\include\comtest.h + + $PROJ_DIR$\..\Common\include\crflash.h + $PROJ_DIR$\..\Common\include\integer.h @@ -2199,6 +2202,9 @@ $PROJ_DIR$\..\Common\Minimal\comtest.c + + $PROJ_DIR$\..\Common\Minimal\crflash.c + $PROJ_DIR$\..\Common\Minimal\integer.c @@ -2220,6 +2226,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h @@ -2296,6 +2305,9 @@ + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/AVR_Dx_IAR/RegTest.c b/FreeRTOS/Demo/AVR_Dx_IAR/RegTest.c index e35ab63df..c159de453 100644 --- a/FreeRTOS/Demo/AVR_Dx_IAR/RegTest.c +++ b/FreeRTOS/Demo/AVR_Dx_IAR/RegTest.c @@ -62,7 +62,7 @@ portBASE_TYPE xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/AVR_Dx_IAR/main_blinky.c b/FreeRTOS/Demo/AVR_Dx_IAR/main_blinky.c index 61e7f1576..5a2fac95f 100644 --- a/FreeRTOS/Demo/AVR_Dx_IAR/main_blinky.c +++ b/FreeRTOS/Demo/AVR_Dx_IAR/main_blinky.c @@ -88,7 +88,7 @@ void main_blinky( void ) { /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); - + if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this diff --git a/FreeRTOS/Demo/AVR_Dx_IAR/main_minimal.c b/FreeRTOS/Demo/AVR_Dx_IAR/main_minimal.c index 1faac79c7..60999311b 100644 --- a/FreeRTOS/Demo/AVR_Dx_IAR/main_minimal.c +++ b/FreeRTOS/Demo/AVR_Dx_IAR/main_minimal.c @@ -26,11 +26,13 @@ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "partest.h" #include "regtest.h" @@ -60,6 +62,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( 0x1400 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -86,10 +91,13 @@ void main_minimal( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartRegTestTasks(); - + /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -101,7 +109,7 @@ void init_minimal( void ) /* Configure UART pins: PC1 Rx, PC0 Tx */ PORTC.DIR &= ~PIN0_bm; PORTC.DIR |= PIN1_bm; - + vParTestInitialise(); } @@ -122,7 +130,7 @@ static volatile unsigned long ulDummyVariable = 3UL; integer tasks get some exercise. The result here is not important - see the demo application documentation for more info. */ ulDummyVariable *= 3; - + prvCheckOtherTasksAreStillRunning(); } } @@ -151,7 +159,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; { xErrorHasOccurred = pdTRUE; } - + if( xErrorHasOccurred == pdFALSE ) { /* Toggle the LED if everything is okay so we know if an error occurs even if not @@ -171,4 +179,5 @@ static unsigned char __eeprom ucResetCount @ mainRESET_COUNT_ADDRESS; void vApplicationIdleHook( void ) { + vCoRoutineSchedule(); } diff --git a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/FreeRTOSConfig.h b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/FreeRTOSConfig.h index 153b20241..87f8ec460 100644 --- a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/FreeRTOSConfig.h @@ -39,12 +39,12 @@ /* * Timer instance | Value * ----------------|--------- - * TCB0 | 0 - * TCB1 | 1 - * TCB2 | 2 - * TCB3 | 3 + * TCB0 | 0 + * TCB1 | 1 + * TCB2 | 2 + * TCB3 | 3 * TCB4 | 4 - * RTC | 5 + * RTC | 5 */ #define configUSE_TIMER_INSTANCE 0 @@ -91,6 +91,10 @@ For other frequency values, update clock_config.h with your own settings */ #define configUSE_TRACE_FACILITY 0 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/RegTest.c b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/RegTest.c index a7563fa17..7e01a663d 100644 --- a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/RegTest.c +++ b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/RegTest.c @@ -63,7 +63,7 @@ portBASE_TYPE xReturn; { xReturn = pdFALSE; } - + return xReturn; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_blinky.c b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_blinky.c index 12f7ea11b..8e4c7f3a3 100644 --- a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_blinky.c +++ b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_blinky.c @@ -88,7 +88,7 @@ void main_blinky( void ) { /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); - + if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this diff --git a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_minimal.c b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_minimal.c index cb3ab4c09..bf54d4b5c 100644 --- a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_minimal.c +++ b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/main_minimal.c @@ -27,10 +27,12 @@ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" #include "PollQ.h" #include "integer.h" #include "serial.h" #include "comtest.h" +#include "crflash.h" #include "partest.h" #include "regtest.h" @@ -60,6 +62,9 @@ again. */ the demo application is not unexpectedly resetting. */ #define mainRESET_COUNT_ADDRESS ( 0x1400 ) +/* The number of coroutines to create. */ +#define mainNUM_FLASH_COROUTINES ( 3 ) + /* * The task function for the "Check" task. */ @@ -86,10 +91,13 @@ void main_minimal( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartRegTestTasks(); - + /* Create the tasks defined within this file. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + /* In this port, to use preemptive scheduler define configUSE_PREEMPTION as 1 in portmacro.h. To use the cooperative scheduler define configUSE_PREEMPTION as 0. */ @@ -101,7 +109,7 @@ void init_minimal( void ) /* Configure UART pins: PC1 Rx, PC0 Tx */ PORTC.DIR &= ~PIN0_bm; PORTC.DIR |= PIN1_bm; - + vParTestInitialise(); } @@ -122,7 +130,7 @@ static volatile unsigned long ulDummyVariable = 3UL; integer tasks get some exercise. The result here is not important - see the demo application documentation for more info. */ ulDummyVariable *= 3; - + prvCheckOtherTasksAreStillRunning(); } } @@ -151,7 +159,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; { xErrorHasOccurred = pdTRUE; } - + if( xErrorHasOccurred == pdFALSE ) { /* Toggle the LED if everything is okay so we know if an error occurs even if not @@ -173,4 +181,5 @@ unsigned char ucResetCount; void vApplicationIdleHook( void ) { + vCoRoutineSchedule(); } diff --git a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/nbproject/configurations.xml b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/nbproject/configurations.xml index 88964f148..fb26eab9c 100644 --- a/FreeRTOS/Demo/AVR_Dx_MPLAB.X/nbproject/configurations.xml +++ b/FreeRTOS/Demo/AVR_Dx_MPLAB.X/nbproject/configurations.xml @@ -10,6 +10,7 @@ ../Common/include/PollQ.h ../Common/include/TaskNotify.h ../Common/include/comtest.h + ../Common/include/crflash.h ../Common/include/integer.h ../Common/include/partest.h ../Common/include/print.h @@ -21,6 +22,7 @@ ../Common/Minimal/PollQ.c ../Common/Minimal/TaskNotify.c ../Common/Minimal/comtest.c + ../Common/Minimal/crflash.c ../Common/Minimal/integer.c ../Common/Minimal/recmutex.c @@ -30,6 +32,7 @@ ../../Source/include/FreeRTOS.h ../../Source/include/StackMacros.h ../../Source/include/atomic.h + ../../Source/include/croutine.h ../../Source/include/deprecated_definitions.h ../../Source/include/event_groups.h ../../Source/include/list.h @@ -57,6 +60,7 @@ ../../Source/portable/MemMang/heap_1.c + ../../Source/croutine.c ../../Source/event_groups.c ../../Source/list.c ../../Source/queue.c diff --git a/FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53/src/FreeRTOSConfig.h index 95d218215..48f59c00b 100644 --- a/FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53/src/FreeRTOSConfig.h @@ -93,6 +93,9 @@ #define configSUPPORT_STATIC_ALLOCATION 1 #define configSUPPORT_DYNAMIC_ALLOCATION 1 /* Defaults to 1 anyway. */ +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h index 11e2198a5..2b94c6aa6 100644 --- a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h @@ -61,6 +61,9 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D3x_Xplained_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D3x_Xplained_IAR/FreeRTOSConfig.h index fdac20dc8..6d5e0a0b2 100644 --- a/FreeRTOS/Demo/CORTEX_A5_SAMA5D3x_Xplained_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D3x_Xplained_IAR/FreeRTOSConfig.h @@ -61,6 +61,9 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D4x_EK_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D4x_EK_IAR/FreeRTOSConfig.h index 2e1eaf5db..c50a3c464 100644 --- a/FreeRTOS/Demo/CORTEX_A5_SAMA5D4x_EK_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D4x_EK_IAR/FreeRTOSConfig.h @@ -61,6 +61,9 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/FreeRTOSConfig.h index 88988c811..b3565b1f3 100644 --- a/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/FreeRTOSConfig.h @@ -108,6 +108,9 @@ uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; #define configUSE_TICK_HOOK 1 #define configUSE_DAEMON_TASK_STARTUP_HOOK 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/main_blinky.c b/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/main_blinky.c index fef113fe7..6296a61f0 100644 --- a/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/main_blinky.c +++ b/FreeRTOS/Demo/CORTEX_A9_Cyclone_V_SoC_DK/main_blinky.c @@ -26,8 +26,8 @@ /****************************************************************************** * NOTE 1: This project provides two demo applications. A simple blinky - * style project, and a more comprehensive test and demo application. The - * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select + * style project, and a more comprehensive test and demo application. The + * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY * in main.c. This file implements the simply blinky style version. * diff --git a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/FreeRTOSConfig.h index 73f489902..053bf406b 100644 --- a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/FreeRTOSConfig.h @@ -95,6 +95,9 @@ /* Include the query-heap CLI command to query the free heap space. */ #define configINCLUDE_QUERY_HEAP_COMMAND 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c index f401f56d3..00effb7fa 100644 --- a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c +++ b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c @@ -44,8 +44,8 @@ /* include the port-dependent configuration */ #include "lwipcfg_msvc.h" -/* Dimensions the cTxBuffer array - which is itself used to hold replies from -command line commands. cTxBuffer is a shared buffer, so protected by the +/* Dimensions the cTxBuffer array - which is itself used to hold replies from +command line commands. cTxBuffer is a shared buffer, so protected by the xTxBufferMutex mutex. */ #define lwipappsTX_BUFFER_SIZE 1024 @@ -53,7 +53,7 @@ xTxBufferMutex mutex. */ available. */ #define lwipappsMAX_TIME_TO_WAIT_FOR_TX_BUFFER_MS ( 100 / portTICK_RATE_MS ) -/* Definitions of the various SSI callback functions within the pccSSITags +/* Definitions of the various SSI callback functions within the pccSSITags array. If pccSSITags is updated, then these definitions must also be updated. */ #define ssiTASK_STATS_INDEX 0 #define ssiRUN_TIME_STATS_INDEX 1 @@ -74,9 +74,9 @@ static unsigned short uslwIPAppsSSIHandler( int iIndex, char *pcBuffer, int iBuf /*-----------------------------------------------------------*/ /* The SSI strings that are embedded in the served html files. If this array -is changed, then the index position defined by the #defines such as +is changed, then the index position defined by the #defines such as ssiTASK_STATS_INDEX above must also be updated. */ -static const char *pccSSITags[] = +static const char *pccSSITags[] = { "rtos_stats", "run_stats" @@ -85,11 +85,11 @@ static const char *pccSSITags[] = /* Semaphore used to guard the Tx buffer. */ static xSemaphoreHandle xTxBufferMutex = NULL; -/* The Tx buffer itself. This is used to hold the text generated by the -execution of command line commands, and (hopefully) the execution of +/* The Tx buffer itself. This is used to hold the text generated by the +execution of command line commands, and (hopefully) the execution of server side include callbacks. It is a shared buffer so protected by the -xTxBufferMutex mutex. pcLwipAppsBlockingGetTxBuffer() and -vLwipAppsReleaseTxBuffer() are provided to obtain and release the +xTxBufferMutex mutex. pcLwipAppsBlockingGetTxBuffer() and +vLwipAppsReleaseTxBuffer() are provided to obtain and release the xTxBufferMutex respectively. pcLwipAppsBlockingGetTxBuffer() must be used with caution as it has the potential to block. */ static signed char cTxBuffer[ lwipappsTX_BUFFER_SIZE ]; @@ -157,7 +157,7 @@ static struct netif xNetIf; /* Install the server side include handler. */ http_set_ssi_handler( uslwIPAppsSSIHandler, pccSSITags, sizeof( pccSSITags ) / sizeof( char * ) ); - /* Create the mutex used to ensure mutual exclusive access to the Tx + /* Create the mutex used to ensure mutual exclusive access to the Tx buffer. */ xTxBufferMutex = xSemaphoreCreateMutex(); configASSERT( xTxBufferMutex ); @@ -185,7 +185,7 @@ extern char *pcMainGetTaskStatusMessage( void ); /* The SSI handler function that generates text depending on the index of the SSI tag encountered. */ - + switch( iIndex ) { case ssiTASK_STATS_INDEX : diff --git a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702_Vitis_QEMU/RTOSDemo/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702_Vitis_QEMU/RTOSDemo/src/FreeRTOSConfig.h index 740ab1bd7..d10defcbf 100644 --- a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702_Vitis_QEMU/RTOSDemo/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702_Vitis_QEMU/RTOSDemo/src/FreeRTOSConfig.h @@ -102,6 +102,9 @@ LEDs are not visible in QEMU. */ /* Include the query-heap CLI command to query the free heap space. */ #define configINCLUDE_QUERY_HEAP_COMMAND 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/FreeRTOSConfig.h index 88c8817a9..e2375916d 100644 --- a/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/FreeRTOSConfig.h @@ -50,11 +50,13 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 #define configMAX_PRIORITIES ( 5 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configQUEUE_REGISTRY_SIZE 10 /* Set the following definitions to 1 to include the API function, or zero diff --git a/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/ParTest/ParTest.c index 678d0eeee..b85c654aa 100644 --- a/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/ParTest/ParTest.c @@ -66,11 +66,11 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) portENTER_CRITICAL(); { if( xLEDPins[ uxLED ].type == PIO_OUTPUT_0 ) - { + { PIO_Set( &( xLEDPins[ uxLED ]) ); } else - { + { PIO_Clear( &( xLEDPins[ uxLED ] ) ); } } @@ -82,11 +82,11 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) portENTER_CRITICAL(); { if( xLEDPins[ uxLED ].type == PIO_OUTPUT_0 ) - { + { PIO_Clear( &( xLEDPins[ uxLED ] ) ); } else - { + { PIO_Set( &( xLEDPins[ uxLED ] ) ); } } @@ -101,15 +101,15 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) if( uxLED < partestNUM_LEDS ) { if( PIO_GetOutputDataStatus( &( xLEDPins[ uxLED ] ) ) ) - { + { PIO_Clear( &( xLEDPins[ uxLED ] ) ); } else - { + { PIO_Set( &( xLEDPins[ uxLED ] ) ); - } + } } } - + diff --git a/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/serial/serial.c b/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/serial/serial.c index 5afb28b09..e07c45409 100644 --- a/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/serial/serial.c +++ b/FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/serial/serial.c @@ -93,19 +93,19 @@ const Pin xUSART_Pins[] = { BOARD_PIN_USART_RXD, BOARD_PIN_USART_TXD }; { /* Enable the peripheral clock in the PMC. */ PMC_EnablePeripheral( BOARD_ID_USART ); - + /* Configure the USART. */ USART_Configure( BOARD_USART_BASE, AT91C_US_CHRL_8_BITS | AT91C_US_PAR_NONE | AT91C_US_NBSTOP_1_BIT, ulWantedBaud, configCPU_CLOCK_HZ ); - + /* Configure the interrupt. Note the pre-emption priority is set in bits [8:15] of the priority value passed as the parameter. */ IRQ_ConfigureIT( BOARD_ID_USART, ( configMAX_SYSCALL_INTERRUPT_PRIORITY << 8 ), vSerialISR ); IRQ_EnableIT( BOARD_ID_USART ); - + /* Enable receiver & transmitter. */ USART_SetTransmitterEnabled( BOARD_USART_BASE, pdTRUE ); USART_SetReceiverEnabled( BOARD_USART_BASE, pdTRUE ); - + /* Configure IO for USART use. */ PIO_Configure( xUSART_Pins, PIO_LISTSIZE( xUSART_Pins ) ); } @@ -211,7 +211,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { /* Queue empty, nothing to send so turn off the Tx interrupt. */ vInterruptOff(); - } + } } if( ulStatus & AT91C_US_RXRDY ) @@ -231,4 +231,4 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + diff --git a/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/RTOSDemo.cproj b/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/RTOSDemo.cproj index 2251cd218..f74f881fc 100644 --- a/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/RTOSDemo.cproj +++ b/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/RTOSDemo.cproj @@ -354,6 +354,9 @@ + + compile + compile diff --git a/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h b/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h index 000b4aef5..2c7134c8d 100644 --- a/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h +++ b/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h @@ -30,58 +30,58 @@ typedef void * xComPortHandle; typedef enum -{ - serCOM1, - serCOM2, - serCOM3, - serCOM4, - serCOM5, - serCOM6, - serCOM7, - serCOM8 +{ + serCOM1, + serCOM2, + serCOM3, + serCOM4, + serCOM5, + serCOM6, + serCOM7, + serCOM8 } eCOMPort; -typedef enum -{ - serNO_PARITY, - serODD_PARITY, - serEVEN_PARITY, - serMARK_PARITY, - serSPACE_PARITY +typedef enum +{ + serNO_PARITY, + serODD_PARITY, + serEVEN_PARITY, + serMARK_PARITY, + serSPACE_PARITY } eParity; -typedef enum -{ - serSTOP_1, - serSTOP_2 +typedef enum +{ + serSTOP_1, + serSTOP_2 } eStopBits; -typedef enum -{ - serBITS_5, - serBITS_6, - serBITS_7, - serBITS_8 +typedef enum +{ + serBITS_5, + serBITS_6, + serBITS_7, + serBITS_8 } eDataBits; -typedef enum -{ - ser50, - ser75, - ser110, - ser134, - ser150, +typedef enum +{ + ser50, + ser75, + ser110, + ser134, + ser150, ser200, - ser300, - ser600, - ser1200, - ser1800, - ser2400, + ser300, + ser600, + ser1200, + ser1800, + ser2400, ser4800, - ser9600, - ser19200, - ser38400, - ser57600, + ser9600, + ser19200, + ser38400, + ser57600, ser115200 } eBaud; diff --git a/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/FreeRTOSConfig.h index cecee57db..8de086ea8 100644 --- a/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/FreeRTOSConfig.h @@ -71,6 +71,9 @@ extern uint32_t SystemCoreClock; #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/RTOSDemo.cproj b/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/RTOSDemo.cproj index b77e62141..2a07538de 100644 --- a/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/RTOSDemo.cproj +++ b/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/RTOSDemo.cproj @@ -442,6 +442,9 @@ compile + + compile + compile @@ -547,6 +550,12 @@ compile + + compile + + + compile + compile diff --git a/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h b/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h index 000b4aef5..2c7134c8d 100644 --- a/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h +++ b/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h @@ -30,58 +30,58 @@ typedef void * xComPortHandle; typedef enum -{ - serCOM1, - serCOM2, - serCOM3, - serCOM4, - serCOM5, - serCOM6, - serCOM7, - serCOM8 +{ + serCOM1, + serCOM2, + serCOM3, + serCOM4, + serCOM5, + serCOM6, + serCOM7, + serCOM8 } eCOMPort; -typedef enum -{ - serNO_PARITY, - serODD_PARITY, - serEVEN_PARITY, - serMARK_PARITY, - serSPACE_PARITY +typedef enum +{ + serNO_PARITY, + serODD_PARITY, + serEVEN_PARITY, + serMARK_PARITY, + serSPACE_PARITY } eParity; -typedef enum -{ - serSTOP_1, - serSTOP_2 +typedef enum +{ + serSTOP_1, + serSTOP_2 } eStopBits; -typedef enum -{ - serBITS_5, - serBITS_6, - serBITS_7, - serBITS_8 +typedef enum +{ + serBITS_5, + serBITS_6, + serBITS_7, + serBITS_8 } eDataBits; -typedef enum -{ - ser50, - ser75, - ser110, - ser134, - ser150, +typedef enum +{ + ser50, + ser75, + ser110, + ser134, + ser150, ser200, - ser300, - ser600, - ser1200, - ser1800, - ser2400, + ser300, + ser600, + ser1200, + ser1800, + ser2400, ser4800, - ser9600, - ser19200, - ser38400, - ser57600, + ser9600, + ser19200, + ser38400, + ser57600, ser115200 } eBaud; diff --git a/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/FreeRTOSConfig.h index cecee57db..8de086ea8 100644 --- a/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_ATSAM3X_Atmel_Studio/src/FreeRTOSConfig.h @@ -71,6 +71,9 @@ extern uint32_t SystemCoreClock; #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h index 192d69662..3ebda65ed 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h @@ -51,8 +51,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_ALTERNATIVE_API 0 diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj index f7bf6ea74..0b1cd766e 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj @@ -63,6 +63,13 @@ + + + + + + + @@ -173,6 +180,13 @@ + + + + + + + @@ -400,6 +414,13 @@ + + + + + + + diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/ParTest.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/ParTest.c index 021413b7e..9bc3bbedd 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/ParTest.c @@ -72,7 +72,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) } } taskEXIT_CRITICAL(); - + /* Record the output for the sake of toggling. */ if( uxLED < partstMAX_LED ) { diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/Serial.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/Serial.c index a377e46f5..1e48d1611 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/Serial.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/Serial.c @@ -45,7 +45,7 @@ static QueueHandle_t xSerialRxQueue = NULL; xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) { /* Configure Rx. */ - xSerialRxQueue = xQueueCreate( uxQueueLength, sizeof( signed char ) ); + xSerialRxQueue = xQueueCreate( uxQueueLength, sizeof( signed char ) ); isr_UART1_RX_BYTE_RECEIVED_ClearPending(); isr_UART1_RX_BYTE_RECEIVED_StartEx(vUartRxISR); @@ -73,7 +73,7 @@ unsigned short usIndex = 0; { break; } - + /* Send out, one character at a time. */ if( pdTRUE != xSerialPutChar( NULL, pcString[ usIndex ], serialSTRING_DELAY_TICKS ) ) { @@ -102,7 +102,7 @@ portBASE_TYPE xReturn = pdFALSE; /* The ISR is processing characters is so just add to the end of the queue. */ if( pdTRUE == xQueueSend( xSerialTxQueue, &cOutChar, xBlockTime ) ) - { + { xReturn = pdTRUE; } else @@ -117,7 +117,7 @@ portBASE_TYPE xReturn = pdFALSE; taskENTER_CRITICAL(); UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE | UART_1_TX_STS_FIFO_EMPTY ); taskEXIT_CRITICAL(); - + return xReturn; } /*---------------------------------------------------------------------------*/ @@ -137,7 +137,7 @@ unsigned long ulMask = 0; { /* Get the character. */ cInChar = UART_1_GetChar(); - + /* Mask off the other RTOS interrupts to interact with the queue. */ ulMask = portSET_INTERRUPT_MASK_FROM_ISR(); { @@ -151,7 +151,7 @@ unsigned long ulMask = 0; } /* If we delivered the character then a context switch might be required. - xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling + xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling xQueueSendFromISR() caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently running task (the task this ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and @@ -170,17 +170,17 @@ unsigned long ulMask = 0; /* Read the status to acknowledge. */ ucStatus = UART_1_ReadTxStatus(); - + /* Check to see whether this is a genuine interrupt. */ if( ( 0 != ( ucStatus & UART_1_TX_STS_COMPLETE ) ) || ( 0 != ( ucStatus & UART_1_TX_STS_FIFO_EMPTY ) ) ) - { + { /* Mask off the other RTOS interrupts to interact with the queue. */ ulMask = portSET_INTERRUPT_MASK_FROM_ISR(); { if( pdTRUE == xQueueReceiveFromISR( xSerialTxQueue, &cOutChar, &xHigherPriorityTaskWoken ) ) { /* Send the next character. */ - UART_1_PutChar( cOutChar ); + UART_1_PutChar( cOutChar ); /* If we are firing, then the only interrupt we are interested in is the Complete. The application code will add the Empty interrupt @@ -189,7 +189,7 @@ unsigned long ulMask = 0; } else { - /* There is no work left so disable the interrupt until the application + /* There is no work left so disable the interrupt until the application puts more into the queue. */ UART_1_SetTxInterruptMode( 0 ); } @@ -198,7 +198,7 @@ unsigned long ulMask = 0; } /* If we delivered the character then a context switch might be required. - xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling + xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling xQueueSendFromISR() caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently running task (the task this ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/TimerTest.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/TimerTest.c index 7e7cdf59e..e9fa6dc20 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/TimerTest.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_GCC/FreeRTOS_Demo.cydsn/TimerTest.c @@ -68,7 +68,7 @@ unsigned short usThisCount, usDifference; /* Capture the free running timer value as we enter the interrupt. */ usThisCount = Timer_48MHz_ReadCounter(); - + if( usSettleCount >= timerSETTLE_TIME ) { /* What is the difference between the timer value in this interrupt @@ -82,7 +82,7 @@ unsigned short usThisCount, usDifference; if( usDifference > usMaxDifference ) { usMaxDifference = usDifference; - + /* Calculate the Jitter based on the difference we expect. */ usMaxJitter = usMaxDifference - timerEXPECTED_DIFFERENCE_VALUE; } diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h index 192d69662..3ebda65ed 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h @@ -51,8 +51,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_ALTERNATIVE_API 0 diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj index 524617117..ff529603f 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj @@ -173,6 +173,20 @@ + + + + + + + + + + + + + + @@ -393,6 +407,13 @@ + + + + + + + diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/ParTest.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/ParTest.c index 021413b7e..9bc3bbedd 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/ParTest.c @@ -72,7 +72,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) } } taskEXIT_CRITICAL(); - + /* Record the output for the sake of toggling. */ if( uxLED < partstMAX_LED ) { diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/Serial.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/Serial.c index a377e46f5..1e48d1611 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/Serial.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/Serial.c @@ -45,7 +45,7 @@ static QueueHandle_t xSerialRxQueue = NULL; xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) { /* Configure Rx. */ - xSerialRxQueue = xQueueCreate( uxQueueLength, sizeof( signed char ) ); + xSerialRxQueue = xQueueCreate( uxQueueLength, sizeof( signed char ) ); isr_UART1_RX_BYTE_RECEIVED_ClearPending(); isr_UART1_RX_BYTE_RECEIVED_StartEx(vUartRxISR); @@ -73,7 +73,7 @@ unsigned short usIndex = 0; { break; } - + /* Send out, one character at a time. */ if( pdTRUE != xSerialPutChar( NULL, pcString[ usIndex ], serialSTRING_DELAY_TICKS ) ) { @@ -102,7 +102,7 @@ portBASE_TYPE xReturn = pdFALSE; /* The ISR is processing characters is so just add to the end of the queue. */ if( pdTRUE == xQueueSend( xSerialTxQueue, &cOutChar, xBlockTime ) ) - { + { xReturn = pdTRUE; } else @@ -117,7 +117,7 @@ portBASE_TYPE xReturn = pdFALSE; taskENTER_CRITICAL(); UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE | UART_1_TX_STS_FIFO_EMPTY ); taskEXIT_CRITICAL(); - + return xReturn; } /*---------------------------------------------------------------------------*/ @@ -137,7 +137,7 @@ unsigned long ulMask = 0; { /* Get the character. */ cInChar = UART_1_GetChar(); - + /* Mask off the other RTOS interrupts to interact with the queue. */ ulMask = portSET_INTERRUPT_MASK_FROM_ISR(); { @@ -151,7 +151,7 @@ unsigned long ulMask = 0; } /* If we delivered the character then a context switch might be required. - xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling + xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling xQueueSendFromISR() caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently running task (the task this ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and @@ -170,17 +170,17 @@ unsigned long ulMask = 0; /* Read the status to acknowledge. */ ucStatus = UART_1_ReadTxStatus(); - + /* Check to see whether this is a genuine interrupt. */ if( ( 0 != ( ucStatus & UART_1_TX_STS_COMPLETE ) ) || ( 0 != ( ucStatus & UART_1_TX_STS_FIFO_EMPTY ) ) ) - { + { /* Mask off the other RTOS interrupts to interact with the queue. */ ulMask = portSET_INTERRUPT_MASK_FROM_ISR(); { if( pdTRUE == xQueueReceiveFromISR( xSerialTxQueue, &cOutChar, &xHigherPriorityTaskWoken ) ) { /* Send the next character. */ - UART_1_PutChar( cOutChar ); + UART_1_PutChar( cOutChar ); /* If we are firing, then the only interrupt we are interested in is the Complete. The application code will add the Empty interrupt @@ -189,7 +189,7 @@ unsigned long ulMask = 0; } else { - /* There is no work left so disable the interrupt until the application + /* There is no work left so disable the interrupt until the application puts more into the queue. */ UART_1_SetTxInterruptMode( 0 ); } @@ -198,7 +198,7 @@ unsigned long ulMask = 0; } /* If we delivered the character then a context switch might be required. - xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling + xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling xQueueSendFromISR() caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently running task (the task this ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/TimerTest.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/TimerTest.c index 7e7cdf59e..e9fa6dc20 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/TimerTest.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_Keil/FreeRTOS_Demo.cydsn/TimerTest.c @@ -68,7 +68,7 @@ unsigned short usThisCount, usDifference; /* Capture the free running timer value as we enter the interrupt. */ usThisCount = Timer_48MHz_ReadCounter(); - + if( usSettleCount >= timerSETTLE_TIME ) { /* What is the difference between the timer value in this interrupt @@ -82,7 +82,7 @@ unsigned short usThisCount, usDifference; if( usDifference > usMaxDifference ) { usMaxDifference = usDifference; - + /* Calculate the Jitter based on the difference we expect. */ usMaxJitter = usMaxDifference - timerEXPECTED_DIFFERENCE_VALUE; } diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h index 192d69662..3ebda65ed 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOSConfig.h @@ -51,8 +51,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_ALTERNATIVE_API 0 diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj index 9b8e01d5c..d00e7ed6d 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/FreeRTOS_Demo.cyprj @@ -173,6 +173,13 @@ + + + + + + + @@ -400,6 +407,13 @@ + + + + + + + diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/ParTest.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/ParTest.c index 021413b7e..9bc3bbedd 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/ParTest.c @@ -72,7 +72,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) } } taskEXIT_CRITICAL(); - + /* Record the output for the sake of toggling. */ if( uxLED < partstMAX_LED ) { diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/Serial.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/Serial.c index a377e46f5..1e48d1611 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/Serial.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/Serial.c @@ -45,7 +45,7 @@ static QueueHandle_t xSerialRxQueue = NULL; xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) { /* Configure Rx. */ - xSerialRxQueue = xQueueCreate( uxQueueLength, sizeof( signed char ) ); + xSerialRxQueue = xQueueCreate( uxQueueLength, sizeof( signed char ) ); isr_UART1_RX_BYTE_RECEIVED_ClearPending(); isr_UART1_RX_BYTE_RECEIVED_StartEx(vUartRxISR); @@ -73,7 +73,7 @@ unsigned short usIndex = 0; { break; } - + /* Send out, one character at a time. */ if( pdTRUE != xSerialPutChar( NULL, pcString[ usIndex ], serialSTRING_DELAY_TICKS ) ) { @@ -102,7 +102,7 @@ portBASE_TYPE xReturn = pdFALSE; /* The ISR is processing characters is so just add to the end of the queue. */ if( pdTRUE == xQueueSend( xSerialTxQueue, &cOutChar, xBlockTime ) ) - { + { xReturn = pdTRUE; } else @@ -117,7 +117,7 @@ portBASE_TYPE xReturn = pdFALSE; taskENTER_CRITICAL(); UART_1_SetTxInterruptMode( UART_1_TX_STS_COMPLETE | UART_1_TX_STS_FIFO_EMPTY ); taskEXIT_CRITICAL(); - + return xReturn; } /*---------------------------------------------------------------------------*/ @@ -137,7 +137,7 @@ unsigned long ulMask = 0; { /* Get the character. */ cInChar = UART_1_GetChar(); - + /* Mask off the other RTOS interrupts to interact with the queue. */ ulMask = portSET_INTERRUPT_MASK_FROM_ISR(); { @@ -151,7 +151,7 @@ unsigned long ulMask = 0; } /* If we delivered the character then a context switch might be required. - xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling + xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling xQueueSendFromISR() caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently running task (the task this ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and @@ -170,17 +170,17 @@ unsigned long ulMask = 0; /* Read the status to acknowledge. */ ucStatus = UART_1_ReadTxStatus(); - + /* Check to see whether this is a genuine interrupt. */ if( ( 0 != ( ucStatus & UART_1_TX_STS_COMPLETE ) ) || ( 0 != ( ucStatus & UART_1_TX_STS_FIFO_EMPTY ) ) ) - { + { /* Mask off the other RTOS interrupts to interact with the queue. */ ulMask = portSET_INTERRUPT_MASK_FROM_ISR(); { if( pdTRUE == xQueueReceiveFromISR( xSerialTxQueue, &cOutChar, &xHigherPriorityTaskWoken ) ) { /* Send the next character. */ - UART_1_PutChar( cOutChar ); + UART_1_PutChar( cOutChar ); /* If we are firing, then the only interrupt we are interested in is the Complete. The application code will add the Empty interrupt @@ -189,7 +189,7 @@ unsigned long ulMask = 0; } else { - /* There is no work left so disable the interrupt until the application + /* There is no work left so disable the interrupt until the application puts more into the queue. */ UART_1_SetTxInterruptMode( 0 ); } @@ -198,7 +198,7 @@ unsigned long ulMask = 0; } /* If we delivered the character then a context switch might be required. - xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling + xHigherPriorityTaskWoken was set to pdFALSE on interrupt entry. If calling xQueueSendFromISR() caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently running task (the task this ISR interrupted), then xHigherPriorityTaskWoken will have been set to pdTRUE and diff --git a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/TimerTest.c b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/TimerTest.c index 7e7cdf59e..e9fa6dc20 100644 --- a/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/TimerTest.c +++ b/FreeRTOS/Demo/CORTEX_CY8C5588_PSoC_Creator_RVDS/FreeRTOS_Demo.cydsn/TimerTest.c @@ -68,7 +68,7 @@ unsigned short usThisCount, usDifference; /* Capture the free running timer value as we enter the interrupt. */ usThisCount = Timer_48MHz_ReadCounter(); - + if( usSettleCount >= timerSETTLE_TIME ) { /* What is the difference between the timer value in this interrupt @@ -82,7 +82,7 @@ unsigned short usThisCount, usDifference; if( usDifference > usMaxDifference ) { usMaxDifference = usDifference; - + /* Calculate the Jitter based on the difference we expect. */ usMaxJitter = usMaxDifference - timerEXPECTED_DIFFERENCE_VALUE; } diff --git a/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/.project b/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/.project index 47aaf47e7..be99e9ac1 100644 --- a/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/.project +++ b/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/.project @@ -42,6 +42,15 @@ + + 1456936861071 + FreeRTOS_Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 1456936886134 FreeRTOS_Source/portable diff --git a/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/FreeRTOSConfig.h index 3e8c70ca5..d70bbff55 100644 --- a/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/FreeRTOSConfig.h @@ -145,6 +145,10 @@ extern "C" { /* Run time stats gathering related definitions. */ #define configGENERATE_RUN_TIME_STATS ( 0 ) +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES ( 0 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 1 ) + /* Software timer related definitions. */ #define configUSE_TIMERS ( 1 ) #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) /* Highest priority */ diff --git a/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/FreeRTOSConfig.h index 41d8f462c..9b39c760d 100644 --- a/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/FreeRTOSConfig.h @@ -122,6 +122,10 @@ extern "C" { /* Run time stats gathering related definitions. */ #define configGENERATE_RUN_TIME_STATS ( 0 ) +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES ( 0 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 1 ) + /* Software timer related definitions. */ #define configUSE_TIMERS ( 1 ) #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) /* Highest priority */ diff --git a/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/Full_Demo/RegTest.c b/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/Full_Demo/RegTest.c index 0d36c2c52..e4742d5c4 100644 --- a/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/Full_Demo/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_EFM32_Pearl_Gecko_Simplicity_Studio/Full_Demo/RegTest.c @@ -411,7 +411,7 @@ void vRegTest2Implementation( void ) /* If this line is hit then there was an error in a core register value. This loop ensures the loop counter variable stops incrementing. */ "b reg2_error_loop \n" - + ); /* __asm volatile */ } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/.gitignore b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/.gitignore new file mode 100644 index 000000000..e53f9cac5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/.gitignore @@ -0,0 +1,2 @@ +# Build Artifacts. +gcc/ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/FreeRTOSConfig.h index e90323941..af5a23973 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/FreeRTOSConfig.h @@ -34,13 +34,13 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ #define configUSE_PREEMPTION 1 -#define configUSE_IDLE_HOOK 0 +#define configUSE_IDLE_HOOK 1 #define configUSE_TICK_HOOK 0 #define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) @@ -50,8 +50,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 #define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -64,4 +66,7 @@ to exclude the API function. */ #define INCLUDE_vTaskDelayUntil 0 #define INCLUDE_vTaskDelay 1 + + + #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/main.c b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/main.c index 491e0caa7..6afe63bea 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/main.c +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo1/main.c @@ -24,29 +24,44 @@ * */ -/* - * This demo application creates two tasks (three including - * the idle task). +/* + * This demo application creates six co-routines and two tasks (three including + * the idle task). The co-routines execute as part of the idle task hook. + * + * Five of the created co-routines are the standard 'co-routine flash' + * co-routines contained within the Demo/Common/Minimal/crflash.c file and + * documented on the FreeRTOS.org WEB site. * * The 'LCD Task' rotates a string on the LCD, delaying between each character * as necessitated by the slow interface, and delaying between each string just * long enough to enable the text to be read. * + * The sixth co-routine and final task control the transmission and reception + * of a string to UART 0. The co-routine periodically sends the first + * character of the string to the UART, with the UART's TxEnd interrupt being + * used to transmit the remaining characters. The UART's RxEnd interrupt + * receives the characters and places them on a queue to be processed by the + * 'COMs Rx' task. An error is latched should an unexpected character be + * received, or any character be received out of sequence. * - * A loopback connector is required to ensure that each character transmitted + * A loopback connector is required to ensure that each character transmitted * on the UART is also received on the same UART. For test purposes the UART * FIFO's are not utalised in order to maximise the interrupt overhead. Also - * a pseudo random interval is used between the start of each transmission in - * order that the resultant interrupts are more randomly distributed and + * a pseudo random interval is used between the start of each transmission in + * order that the resultant interrupts are more randomly distributed and * therefore more likely to highlight any problems. * + * The flash co-routines control LED's zero to four. LED five is toggled each + * time the string is transmitted on the UART. LED six is toggled each time + * the string is CORRECTLY received on the UART. LED seven is latched on should + * an error be detected in any task or co-routine. * - * In addition the idle task makes repetitive calls to - * prvSetAndCheckRegisters(). This simply loads the general purpose registers - * with a known value, then checks each register to ensure the held value is - * still correct. As a low priority task this checking routine is likely to - * get repeatedly swapped in and out. A register being found to contain an - * incorrect value is therefore indicative of an error in the task switching + * In addition the idle task makes repetitive calls to + * prvSetAndCheckRegisters(). This simply loads the general purpose registers + * with a known value, then checks each register to ensure the held value is + * still correct. As a low priority task this checking routine is likely to + * get repeatedly swapped in and out. A register being found to contain an + * incorrect value is therefore indicative of an error in the task switching * mechansim. * */ @@ -55,9 +70,11 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "croutine.h" /* Demo application include files. */ #include "partest.h" +#include "crflash.h" /* Library include files. */ #include "DriverLib.h" @@ -68,10 +85,20 @@ /* The time to delay between writing each string to the LCD. */ #define mainSTRING_WRITE_DELAY ( 400 / portTICK_PERIOD_MS ) +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_CO_ROUTINES ( 5 ) + /* The length of the queue used to pass received characters to the Comms Rx task. */ #define mainRX_QUEUE_LEN ( 5 ) +/* The priority of the co-routine used to initiate the transmission of the +string on UART 0. */ +#define mainTX_CO_ROUTINE_PRIORITY ( 1 ) + +/* Only one co-routine is created so its index is not important. */ +#define mainTX_CO_ROUTINE_INDEX ( 0 ) + /* The time between transmissions of the string on UART 0. This is pseudo random in order to generate a bit or randomness to when the interrupts occur.*/ #define mainMIN_TX_DELAY ( 40 / portTICK_PERIOD_MS ) @@ -93,13 +120,13 @@ the timing of the transmission. */ #define mainCOMMS_RX_LED ( 6 ) #define mainCOMMS_TX_LED ( 5 ) -/* The baud rate used by the UART comms tasks. */ +/* The baud rate used by the UART comms tasks/co-routine. */ #define mainBAUD_RATE ( 57600 ) /* FIFO setting for the UART. The FIFO is not used to create a better test. */ #define mainFIFO_SET ( 0x10 ) -/* The string that is transmitted on the UART contains sequentially the +/* The string that is transmitted on the UART contains sequentially the characters from mainFIRST_TX_CHAR to mainLAST_TX_CHAR. */ #define mainFIRST_TX_CHAR '0' #define mainLAST_TX_CHAR 'z' @@ -130,6 +157,12 @@ static void vLCDTask( void * pvParameters ); static void vCommsRxTask( void * pvParameters ); /* + * The co-routine that periodically initiates the transmission of the string on + * the UART. + */ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* * Writes a string the the LCD. */ static void prvWriteString( const char *pcString ); @@ -152,7 +185,7 @@ static void prvPDCWrite( char cAddress, char cData ); void prvSetAndCheckRegisters( void ); /* - * Latch the LED that indicates that an error has occurred. + * Latch the LED that indicates that an error has occurred. */ void vSetErrorLED( void ); @@ -163,7 +196,7 @@ static void prvSetupHardware( void ); /*-----------------------------------------------------------*/ -/* Error flag set to pdFAIL if an error is encountered in the tasks +/* Error flag set to pdFAIL if an error is encountered in the tasks/co-routines defined within this file. */ unsigned portBASE_TYPE uxErrorStatus = pdPASS; @@ -185,11 +218,18 @@ void Main( void ) /* Setup the ports used by the demo and the clock. */ prvSetupHardware(); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); + + /* Create the co-routine that initiates the transmission of characters + on the UART. */ + xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX ); + /* Create the LCD and Comms Rx tasks. */ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL ); xTaskCreate( vCommsRxTask, "CMS", configMINIMAL_STACK_SIZE, NULL, mainCOMMS_RX_TASK_PRIORITY, NULL ); - /* Start the scheduler running the tasks just created. */ + /* Start the scheduler running the tasks and co-routines just created. */ vTaskStartScheduler(); /* Should not get here unless we did not have enough memory to start the @@ -208,13 +248,27 @@ static void prvSetupHardware( void ) vParTestInitialise(); vSerialInit(); } +/*-----------------------------------------------------------*/ +void vApplicationIdleHook( void ) +{ + /* The co-routines are executed in the idle task using the idle task + hook. */ + for( ;; ) + { + /* Schedule the co-routines. */ + vCoRoutineSchedule(); + + /* Run the register check function between each co-routine. */ + prvSetAndCheckRegisters(); + } +} /*-----------------------------------------------------------*/ static void prvWriteString( const char *pcString ) { /* Write pcString to the LED, pausing between each character. */ - prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); + prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); while( *pcString ) { vTaskDelay( mainCHAR_WRITE_DELAY ); @@ -227,7 +281,7 @@ static void prvWriteString( const char *pcString ) void vLCDTask( void * pvParameters ) { unsigned portBASE_TYPE uxIndex; -const unsigned char ucCFGData[] = { +const unsigned char ucCFGData[] = { 0x30, /* Set data bus to 8-bits. */ 0x30, 0x30, @@ -236,10 +290,10 @@ const unsigned char ucCFGData[] = { 0x01, /* Display clear. */ 0x06, /* Entry mode [cursor dir][shift]. */ 0x0C /* Display on [display on][curson on][blinking on]. */ - }; + }; /* The strings that are written to the LCD. */ -const char *pcStringsToDisplay[] = { +const char *pcStringsToDisplay[] = { "Stellaris", "Demo", "One", @@ -261,14 +315,14 @@ const char *pcStringsToDisplay[] = { /* Clear display. */ vTaskDelay( mainCHAR_WRITE_DELAY ); - prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); + prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); uxIndex = 0; - for( ;; ) + for( ;; ) { /* Display the string on the LCD. */ prvWriteString( pcStringsToDisplay[ uxIndex ] ); - + /* Move on to the next string - wrapping if necessary. */ uxIndex++; if( *( pcStringsToDisplay[ uxIndex ] ) == 0x00 ) @@ -317,8 +371,8 @@ static char cRxedChar, cExpectedChar; { if( cExpectedChar == mainLAST_TX_CHAR ) { - /* We have reached the end of the string - we now expect to - receive the first character in the string again. The LED is + /* We have reached the end of the string - we now expect to + receive the first character in the string again. The LED is toggled to indicate that the entire string was received without error. */ vParTestToggleLED( mainCOMMS_RX_LED ); @@ -333,7 +387,71 @@ static char cRxedChar, cExpectedChar; } } } +/*-----------------------------------------------------------*/ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +TickType_t xDelayPeriod; +static unsigned long *pulRandomBytes = mainFIRST_PROGRAM_BYTES; + + /* Co-routine MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for(;;) + { + /* Was the previously transmitted string received correctly? */ + if( uxErrorStatus != pdPASS ) + { + /* An error was encountered so set the error LED. */ + vSetErrorLED(); + } + + /* The next character to Tx is the first in the string. */ + cNextChar = mainFIRST_TX_CHAR; + + UARTIntDisable( UART0_BASE, UART_INT_TX ); + { + /* Send the first character. */ + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + + /* Move the variable to the char to Tx on so the ISR transmits + the next character in the string once this one has completed. */ + cNextChar++; + } + UARTIntEnable(UART0_BASE, UART_INT_TX); + + /* Toggle the LED to show a new string is being transmitted. */ + vParTestToggleLED( mainCOMMS_TX_LED ); + + /* Delay before we start the string off again. A pseudo-random delay + is used as this will provide a better test. */ + xDelayPeriod = xTaskGetTickCount() + ( *pulRandomBytes ); + + pulRandomBytes++; + if( pulRandomBytes > mainTOTAL_PROGRAM_MEMORY ) + { + pulRandomBytes = mainFIRST_PROGRAM_BYTES; + } + + /* Make sure we don't wait too long... */ + xDelayPeriod &= mainMAX_TX_DELAY; + + /* ...but we do want to wait. */ + if( xDelayPeriod < mainMIN_TX_DELAY ) + { + xDelayPeriod = mainMIN_TX_DELAY; + } + + /* Block for the random(ish) time. */ + crDELAY( xHandle, xDelayPeriod ); + } + + /* Co-routine MUST end with a call to crEND. */ + crEND(); +} /*-----------------------------------------------------------*/ static void vSerialInit( void ) @@ -376,11 +494,11 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( ( HWREG(UART0_BASE + UART_O_FR ) & UART_FR_RXFF ) ) { /* Get the char from the buffer and post it onto the queue of - Rxed chars. Posting the character should wake the task that is + Rxed chars. Posting the character should wake the task that is blocked on the queue waiting for characters. */ cRxedChar = ( char ) HWREG( UART0_BASE + UART_O_DR ); xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken ); - } + } } /* Was a Tx interrupt pending? */ @@ -396,10 +514,10 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; cNextChar++; } } - + /* If a task was woken by the character being received then we force a context switch to occur in case the task is of higher priority than - the currently executing task (i.e. the task that this interrupt + the currently executing task (i.e. the task that this interrupt interrupted.) */ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/FreeRTOSConfig.h new file mode 100644 index 000000000..61088db8a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/FreeRTOSConfig.h @@ -0,0 +1,72 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) +#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 59 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 1240 ) ) +#define configMAX_TASK_NAME_LEN ( 3 ) +#define configUSE_TRACE_FACILITY 0 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 + +#define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 3 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ + +#define INCLUDE_vTaskPrioritySet 0 +#define INCLUDE_uxTaskPriorityGet 0 +#define INCLUDE_vTaskDelete 0 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 0 +#define INCLUDE_vTaskDelayUntil 0 +#define INCLUDE_vTaskDelay 1 + + + + +#endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/main.c b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/main.c new file mode 100644 index 000000000..f51cc09f1 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/main.c @@ -0,0 +1,594 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/* + * This demo application creates seven co-routines and one task (two including + * the idle task). The co-routines execute as part of the idle task hook. + * + * Five of the created co-routines are the standard 'co-routine flash' + * co-routines contained within the Demo/Common/Minimal/crflash.c file and + * documented on the FreeRTOS.org WEB site. + * + * The 'LCD Task' rotates a string on the LCD, delaying between each character + * as necessitated by the slow interface, and delaying between each string just + * long enough to enable the text to be read. + * + * The sixth co-routine controls the transmission of a string to UART 0. The + * co-routine periodically sends the first character of the string to the UART, + * with the UART's TxEnd interrupt being used to transmit the remaining + * characters. The UART's RxEnd interrupt receives the characters and places + * them on a queue to be processed by the seventh and final co-routine. An + * error is latched should an unexpected character be received, or any + * character be received out of sequence. + * + * A loopback connector is required to ensure that each character transmitted + * on the UART is also received on the same UART. For test purposes the UART + * FIFO's are not utalised in order to maximise the interrupt overhead. Also + * a pseudo random interval is used between the start of each transmission in + * order that the resultant interrupts are more randomly distributed and + * therefore more likely to highlight any problems. + * + * The flash co-routines control LED's zero to four. LED five is toggled each + * time the string is transmitted on the UART. LED six is toggled each time + * the string is CORRECTLY received on the UART. LED seven is latched on should + * an error be detected in any task or co-routine. + * + * In addition the idle task makes repetitive calls to + * prvSetAndCheckRegisters(). This simply loads the general purpose registers + * with a known value, then checks each register to ensure the held value is + * still correct. As a low priority task this checking routine is likely to + * get repeatedly swapped in and out. A register being found to contain an + * incorrect value is therefore indicative of an error in the task switching + * mechansim. + * + */ + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "croutine.h" + +/* Demo application include files. */ +#include "partest.h" +#include "crflash.h" + +/* Library include files. */ +#include "DriverLib.h" + +/* The time to delay between writing each character to the LCD. */ +#define mainCHAR_WRITE_DELAY ( 2 / portTICK_PERIOD_MS ) + +/* The time to delay between writing each string to the LCD. */ +#define mainSTRING_WRITE_DELAY ( 400 / portTICK_PERIOD_MS ) + +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_CO_ROUTINES ( 5 ) + +/* The length of the queue used to pass received characters to the Comms Rx +task. */ +#define mainRX_QUEUE_LEN ( 5 ) + +/* The priority of the co-routine used to initiate the transmission of the +string on UART 0. */ +#define mainTX_CO_ROUTINE_PRIORITY ( 1 ) + +/* The priority of the co-routine used to receive characters from the UART. */ +#define mainRX_CO_ROUTINE_PRIORITY ( 2 ) + +/* Only one co-routine is created so its index is not important. */ +#define mainTX_CO_ROUTINE_INDEX ( 0 ) +#define mainRX_CO_ROUTINE_INDEX ( 0 ) + +/* The time between transmissions of the string on UART 0. This is pseudo +random in order to generate a bit or randomness to when the interrupts occur.*/ +#define mainMIN_TX_DELAY ( 40 / portTICK_PERIOD_MS ) +#define mainMAX_TX_DELAY ( ( TickType_t ) 0x7f ) +#define mainOFFSET_TIME ( ( TickType_t ) 3 ) + +/* The time the Comms Rx task should wait to receive a character. This should +be slightly longer than the time between transmissions. If we do not receive +a character after this time then there must be an error in the transmission or +the timing of the transmission. */ +#define mainCOMMS_RX_DELAY ( mainMAX_TX_DELAY + 20 ) + +/* The task priorities. */ +#define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY ) +#define mainCOMMS_RX_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) + +/* The LED's toggled by the various tasks. */ +#define mainCOMMS_FAIL_LED ( 7 ) +#define mainCOMMS_RX_LED ( 6 ) +#define mainCOMMS_TX_LED ( 5 ) + +/* The baud rate used by the UART comms tasks/co-routine. */ +#define mainBAUD_RATE ( 57600 ) + +/* FIFO setting for the UART. The FIFO is not used to create a better test. */ +#define mainFIFO_SET ( 0x10 ) + +/* The string that is transmitted on the UART contains sequentially the +characters from mainFIRST_TX_CHAR to mainLAST_TX_CHAR. */ +#define mainFIRST_TX_CHAR '0' +#define mainLAST_TX_CHAR 'z' + +/* Just used to walk through the program memory in order that some random data +can be generated. */ +#define mainTOTAL_PROGRAM_MEMORY ( ( unsigned long * ) ( 8 * 1024 ) ) +#define mainFIRST_PROGRAM_BYTES ( ( unsigned long * ) 4 ) + +/* The error routine that is called if the driver library encounters an error. */ +#ifdef DEBUG +void +__error__(char *pcFilename, unsigned long ulLine) +{ +} +#endif + +/*-----------------------------------------------------------*/ + +/* + * The task that rotates text on the LCD. + */ +static void vLCDTask( void * pvParameters ); + +/* + * The task that receives the characters from UART 0. + */ +static void vCommsRxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* + * The co-routine that periodically initiates the transmission of the string on + * the UART. + */ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* + * Writes a string the the LCD. + */ +static void prvWriteString( const char *pcString ); + +/* + * Initialisation routine for the UART. + */ +static void vSerialInit( void ); + +/* + * Thread safe write to the PDC. + */ +static void prvPDCWrite( char cAddress, char cData ); + +/* + * Function to simply set a known value into the general purpose registers + * then read them back to ensure they remain set correctly. An incorrect value + * being indicative of an error in the task switching mechanism. + */ +void prvSetAndCheckRegisters( void ); + +/* + * Latch the LED that indicates that an error has occurred. + */ +void vSetErrorLED( void ); + +/* + * Sets up the PLL and ports used by the demo. + */ +static void prvSetupHardware( void ); + +/*-----------------------------------------------------------*/ + +/* Error flag set to pdFAIL if an error is encountered in the tasks/co-routines +defined within this file. */ +unsigned portBASE_TYPE uxErrorStatus = pdPASS; + +/* The next character to transmit. */ +static char cNextChar; + +/* The queue used to transmit characters from the interrupt to the Comms Rx +task. */ +static QueueHandle_t xCommsQueue; + +/*-----------------------------------------------------------*/ + +void Main( void ) +{ + /* Create the queue used to communicate between the UART ISR and the Comms + Rx task. */ + xCommsQueue = xQueueCreate( mainRX_QUEUE_LEN, sizeof( char ) ); + + /* Setup the ports used by the demo and the clock. */ + prvSetupHardware(); + + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); + + /* Create the co-routine that initiates the transmission of characters + on the UART. */ + xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX ); + + /* Create the co-routine that receives characters from the UART. */ + xCoRoutineCreate( vCommsRxCoRoutine, mainRX_CO_ROUTINE_PRIORITY, mainRX_CO_ROUTINE_INDEX ); + + /* Create the LCD task. */ + xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL ); + + /* Start the scheduler running the tasks and co-routines just created. */ + vTaskStartScheduler(); + + /* Should not get here unless we did not have enough memory to start the + scheduler. */ + for( ;; ); +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ + /* Setup the PLL. */ + SysCtlClockSet( SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ ); + + /* Initialise the hardware used to talk to the LCD, LED's and UART. */ + PDCInit(); + vParTestInitialise(); + vSerialInit(); +} +/*-----------------------------------------------------------*/ + +void vApplicationIdleHook( void ) +{ + /* The co-routines are executed in the idle task using the idle task + hook. */ + for( ;; ) + { + /* Schedule the co-routines. */ + vCoRoutineSchedule(); + + /* Run the register check function between each co-routine. */ + prvSetAndCheckRegisters(); + } +} +/*-----------------------------------------------------------*/ + +static void prvWriteString( const char *pcString ) +{ + /* Write pcString to the LED, pausing between each character. */ + prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); + while( *pcString ) + { + vTaskDelay( mainCHAR_WRITE_DELAY ); + prvPDCWrite( PDC_LCD_RAM, *pcString ); + pcString++; + } +} +/*-----------------------------------------------------------*/ + +void vLCDTask( void * pvParameters ) +{ +unsigned portBASE_TYPE uxIndex; +const unsigned char ucCFGData[] = { + 0x30, /* Set data bus to 8-bits. */ + 0x30, + 0x30, + 0x3C, /* Number of lines/font. */ + 0x08, /* Display off. */ + 0x01, /* Display clear. */ + 0x06, /* Entry mode [cursor dir][shift]. */ + 0x0C /* Display on [display on][curson on][blinking on]. */ + }; + +/* The strings that are written to the LCD. */ +const char *pcStringsToDisplay[] = { + "Stellaris", + "Demo", + "Two", + "www.FreeRTOS.org", + "" + }; + + /* Configure the LCD. */ + uxIndex = 0; + while( uxIndex < sizeof( ucCFGData ) ) + { + prvPDCWrite( PDC_LCD_CSR, ucCFGData[ uxIndex ] ); + uxIndex++; + vTaskDelay( mainCHAR_WRITE_DELAY ); + } + + /* Turn the LCD Backlight on. */ + prvPDCWrite( PDC_CSR, 0x01 ); + + /* Clear display. */ + vTaskDelay( mainCHAR_WRITE_DELAY ); + prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); + + uxIndex = 0; + for( ;; ) + { + /* Display the string on the LCD. */ + prvWriteString( pcStringsToDisplay[ uxIndex ] ); + + /* Move on to the next string - wrapping if necessary. */ + uxIndex++; + if( *( pcStringsToDisplay[ uxIndex ] ) == 0x00 ) + { + uxIndex = 0; + /* Longer pause on the last string to be sent. */ + vTaskDelay( mainSTRING_WRITE_DELAY * 2 ); + } + + /* Wait until it is time to move onto the next string. */ + vTaskDelay( mainSTRING_WRITE_DELAY ); + } +} +/*-----------------------------------------------------------*/ + +static void vCommsRxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +static char cRxedChar, cExpectedChar = mainFIRST_TX_CHAR; +portBASE_TYPE xResult; + + crSTART( xHandle ); + + for( ;; ) + { + /* Wait for a character to be received. */ + crQUEUE_RECEIVE( xHandle, xCommsQueue, ( void * ) &cRxedChar, mainCOMMS_RX_DELAY, &xResult ); + + /* Was the character received (if any) the expected character. */ + if( ( cRxedChar != cExpectedChar ) || ( xResult != pdPASS ) ) + { + /* Got an unexpected character. This can sometimes occur when + reseting the system using the debugger leaving characters already + in the UART registers. */ + uxErrorStatus = pdFAIL; + + /* Resync by waiting for the end of the current string. */ + while( cRxedChar != mainLAST_TX_CHAR ) + { + crQUEUE_RECEIVE( xHandle, xCommsQueue, ( void * ) &cRxedChar, mainCOMMS_RX_DELAY, &xResult ); + } + + /* The next expected character is the start of the string again. */ + cExpectedChar = mainFIRST_TX_CHAR; + } + else + { + if( cExpectedChar == mainLAST_TX_CHAR ) + { + /* We have reached the end of the string - we now expect to + receive the first character in the string again. The LED is + toggled to indicate that the entire string was received without + error. */ + vParTestToggleLED( mainCOMMS_RX_LED ); + cExpectedChar = mainFIRST_TX_CHAR; + } + else + { + /* We got the expected character, we now expect to receive the + next character in the string. */ + cExpectedChar++; + } + } + } + + crEND(); +} +/*-----------------------------------------------------------*/ + +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +TickType_t xDelayPeriod; +static unsigned long *pulRandomBytes = mainFIRST_PROGRAM_BYTES; + + /* Co-routine MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for(;;) + { + /* Was the previously transmitted string received correctly? */ + if( uxErrorStatus != pdPASS ) + { + /* An error was encountered so set the error LED. */ + vSetErrorLED(); + } + + /* The next character to Tx is the first in the string. */ + cNextChar = mainFIRST_TX_CHAR; + + UARTIntDisable( UART0_BASE, UART_INT_TX ); + { + /* Send the first character. */ + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + + /* Move the variable to the char to Tx on so the ISR transmits + the next character in the string once this one has completed. */ + cNextChar++; + } + UARTIntEnable(UART0_BASE, UART_INT_TX); + + /* Toggle the LED to show a new string is being transmitted. */ + vParTestToggleLED( mainCOMMS_TX_LED ); + + /* Delay before we start the string off again. A pseudo-random delay + is used as this will provide a better test. */ + xDelayPeriod = xTaskGetTickCount() + ( *pulRandomBytes ); + + pulRandomBytes++; + if( pulRandomBytes > mainTOTAL_PROGRAM_MEMORY ) + { + pulRandomBytes = mainFIRST_PROGRAM_BYTES; + } + + /* Make sure we don't wait too long... */ + xDelayPeriod &= mainMAX_TX_DELAY; + + /* ...but we do want to wait. */ + if( xDelayPeriod < mainMIN_TX_DELAY ) + { + xDelayPeriod = mainMIN_TX_DELAY; + } + + /* Block for the random(ish) time. */ + crDELAY( xHandle, xDelayPeriod ); + } + + /* Co-routine MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + +static void vSerialInit( void ) +{ + /* Enable the UART. GPIOA has already been initialised. */ + SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); + + /* Set GPIO A0 and A1 as peripheral function. They are used to output the + UART signals. */ + GPIODirModeSet( GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1, GPIO_DIR_MODE_HW ); + + /* Configure the UART for 8-N-1 operation. */ + UARTConfigSet( UART0_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE ); + + /* We dont want to use the fifo. This is for test purposes to generate + as many interrupts as possible. */ + HWREG( UART0_BASE + UART_O_LCR_H ) &= ~mainFIFO_SET; + + /* Enable both Rx and Tx interrupts. */ + HWREG( UART0_BASE + UART_O_IM ) |= ( UART_INT_TX | UART_INT_RX ); + IntEnable( INT_UART0 ); +} +/*-----------------------------------------------------------*/ + +void vUART_ISR(void) +{ +unsigned long ulStatus; +char cRxedChar; +portBASE_TYPE xTaskWokenByPost = pdFALSE; + + /* What caused the interrupt. */ + ulStatus = UARTIntStatus( UART0_BASE, pdTRUE ); + + /* Clear the interrupt. */ + UARTIntClear( UART0_BASE, ulStatus ); + + /* Was an Rx interrupt pending? */ + if( ulStatus & UART_INT_RX ) + { + if( ( HWREG(UART0_BASE + UART_O_FR ) & UART_FR_RXFF ) ) + { + /* Get the char from the buffer and post it onto the queue of + Rxed chars. Posting the character should wake the task that is + blocked on the queue waiting for characters. */ + cRxedChar = ( char ) HWREG( UART0_BASE + UART_O_DR ); + xTaskWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsQueue, &cRxedChar, xTaskWokenByPost ); + } + } + + /* Was a Tx interrupt pending? */ + if( ulStatus & UART_INT_TX ) + { + /* Send the next character in the string. We are not using the FIFO. */ + if( cNextChar <= mainLAST_TX_CHAR ) + { + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + cNextChar++; + } + } + + if( xTaskWokenByPost ) + { + /* We are posting to a co-routine rather than a task so don't bother + causing a task switch. */ + } +} +/*-----------------------------------------------------------*/ + +static void prvPDCWrite( char cAddress, char cData ) +{ + vTaskSuspendAll(); + { + PDCWrite( cAddress, cData ); + } + xTaskResumeAll(); +} +/*-----------------------------------------------------------*/ + +void vSetErrorLED( void ) +{ + vParTestSetLED( mainCOMMS_FAIL_LED, pdTRUE ); +} +/*-----------------------------------------------------------*/ + +void prvSetAndCheckRegisters( void ) +{ + /* Fill the general purpose registers with known values. */ + __asm volatile( " mov r11, #10\n" + " add r0, r11, #1\n" + " add r1, r11, #2\n" + " add r2, r11, #3\n" + " add r3, r11, #4\n" + " add r4, r11, #5\n" + " add r5, r11, #6\n" + " add r6, r11, #7\n" + " add r7, r11, #8\n" + " add r12, r11, #12" ); + + /* Check the values are as expected. */ + __asm volatile( " cmp r11, #10\n" + " bne set_error_led\n" + " cmp r0, #11\n" + " bne set_error_led\n" + " cmp r1, #12\n" + " bne set_error_led\n" + " cmp r2, #13\n" + " bne set_error_led\n" + " cmp r3, #14\n" + " bne set_error_led\n" + " cmp r4, #15\n" + " bne set_error_led\n" + " cmp r5, #16\n" + " bne set_error_led\n" + " cmp r6, #17\n" + " bne set_error_led\n" + " cmp r7, #18\n" + " bne set_error_led\n" + " cmp r12, #22\n" + " bne set_error_led\n" + " bx lr" ); + + __asm volatile( "set_error_led:\n" + " push {r14}\n" + " ldr r1, =vSetErrorLED\n" + " blx r1\n" + " pop {r14}\n" + " bx lr" ); +} +/*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/readme.txt b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/readme.txt new file mode 100644 index 000000000..e22c810ac --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Demo2/readme.txt @@ -0,0 +1,3 @@ +Move these two fines into the Demo/CORTEX_LM3S102_GCC directory to run Demo 2. + +See the port documentation on the www.FreeRTOS.org site for more information. diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/FreeRTOSConfig.h index b6d9c4e42..f40fc8b4c 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -50,8 +50,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 #define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Makefile b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Makefile index 3feb20a88..de0a4c6f4 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Makefile +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/Makefile @@ -29,21 +29,27 @@ RTOS_SOURCE_DIR=../../Source DEMO_SOURCE_DIR=../Common/Minimal CFLAGS+=-I hw_include -I . -I ${RTOS_SOURCE_DIR}/include -I ${RTOS_SOURCE_DIR}/portable/GCC/ARM_CM3 -I ../Common/include -D GCC_ARMCM3_LM3S102 + VPATH=${RTOS_SOURCE_DIR}:${RTOS_SOURCE_DIR}/portable/MemMang:${RTOS_SOURCE_DIR}/portable/GCC/ARM_CM3:${DEMO_SOURCE_DIR}:init:ParTest:hw_include + OBJS= ${COMPILER}/main.o \ ${COMPILER}/pdc.o \ - ${COMPILER}/list.o \ + ${COMPILER}/list.o \ ${COMPILER}/queue.o \ ${COMPILER}/tasks.o \ ${COMPILER}/port.o \ ${COMPILER}/heap_1.o \ - ${COMPILER}/ParTest.o + ${COMPILER}/ParTest.o \ + ${COMPILER}/crflash.o \ + ${COMPILER}/croutine.o +# ${COMPILER}/pendsv_handler.o INIT_OBJS= ${COMPILER}/startup.o LIBS= hw_include/libdriver.a + # # The default rule, which causes init to be built. # @@ -53,6 +59,7 @@ all: ${COMPILER} \ # # The rule to clean out all the build products # + clean: @rm -rf ${COMPILER} ${wildcard *.bin} RTOSDemo.axf @@ -71,3 +78,9 @@ ENTRY_RTOSDemo=ResetISR # Include the automatically generated dependency files. # -include ${wildcard ${COMPILER}/*.d} __dummy__ + + + + + + diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/ParTest/ParTest.c b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/ParTest/ParTest.c index 1e16d6966..d5da78b98 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/ParTest/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/ParTest/ParTest.c @@ -73,7 +73,7 @@ unsigned char ucBit = ( unsigned char ) 1; } PDCWrite( PDC_LED, ucOutputValue ); - } + } } xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/main.c b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/main.c index 498eae3a3..6afe63bea 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/main.c +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/main.c @@ -24,27 +24,44 @@ * */ -/* - * This demo application creates two tasks (three including - * the idle task). +/* + * This demo application creates six co-routines and two tasks (three including + * the idle task). The co-routines execute as part of the idle task hook. + * + * Five of the created co-routines are the standard 'co-routine flash' + * co-routines contained within the Demo/Common/Minimal/crflash.c file and + * documented on the FreeRTOS.org WEB site. * * The 'LCD Task' rotates a string on the LCD, delaying between each character * as necessitated by the slow interface, and delaying between each string just * long enough to enable the text to be read. * - * A loopback connector is required to ensure that each character transmitted + * The sixth co-routine and final task control the transmission and reception + * of a string to UART 0. The co-routine periodically sends the first + * character of the string to the UART, with the UART's TxEnd interrupt being + * used to transmit the remaining characters. The UART's RxEnd interrupt + * receives the characters and places them on a queue to be processed by the + * 'COMs Rx' task. An error is latched should an unexpected character be + * received, or any character be received out of sequence. + * + * A loopback connector is required to ensure that each character transmitted * on the UART is also received on the same UART. For test purposes the UART * FIFO's are not utalised in order to maximise the interrupt overhead. Also - * a pseudo random interval is used between the start of each transmission in - * order that the resultant interrupts are more randomly distributed and + * a pseudo random interval is used between the start of each transmission in + * order that the resultant interrupts are more randomly distributed and * therefore more likely to highlight any problems. * - * In addition the idle task makes repetitive calls to - * prvSetAndCheckRegisters(). This simply loads the general purpose registers - * with a known value, then checks each register to ensure the held value is - * still correct. As a low priority task this checking routine is likely to - * get repeatedly swapped in and out. A register being found to contain an - * incorrect value is therefore indicative of an error in the task switching + * The flash co-routines control LED's zero to four. LED five is toggled each + * time the string is transmitted on the UART. LED six is toggled each time + * the string is CORRECTLY received on the UART. LED seven is latched on should + * an error be detected in any task or co-routine. + * + * In addition the idle task makes repetitive calls to + * prvSetAndCheckRegisters(). This simply loads the general purpose registers + * with a known value, then checks each register to ensure the held value is + * still correct. As a low priority task this checking routine is likely to + * get repeatedly swapped in and out. A register being found to contain an + * incorrect value is therefore indicative of an error in the task switching * mechansim. * */ @@ -53,9 +70,11 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "croutine.h" /* Demo application include files. */ #include "partest.h" +#include "crflash.h" /* Library include files. */ #include "DriverLib.h" @@ -66,10 +85,20 @@ /* The time to delay between writing each string to the LCD. */ #define mainSTRING_WRITE_DELAY ( 400 / portTICK_PERIOD_MS ) +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_CO_ROUTINES ( 5 ) + /* The length of the queue used to pass received characters to the Comms Rx task. */ #define mainRX_QUEUE_LEN ( 5 ) +/* The priority of the co-routine used to initiate the transmission of the +string on UART 0. */ +#define mainTX_CO_ROUTINE_PRIORITY ( 1 ) + +/* Only one co-routine is created so its index is not important. */ +#define mainTX_CO_ROUTINE_INDEX ( 0 ) + /* The time between transmissions of the string on UART 0. This is pseudo random in order to generate a bit or randomness to when the interrupts occur.*/ #define mainMIN_TX_DELAY ( 40 / portTICK_PERIOD_MS ) @@ -91,13 +120,13 @@ the timing of the transmission. */ #define mainCOMMS_RX_LED ( 6 ) #define mainCOMMS_TX_LED ( 5 ) -/* The baud rate used by the UART comms tasks. */ +/* The baud rate used by the UART comms tasks/co-routine. */ #define mainBAUD_RATE ( 57600 ) /* FIFO setting for the UART. The FIFO is not used to create a better test. */ #define mainFIFO_SET ( 0x10 ) -/* The string that is transmitted on the UART contains sequentially the +/* The string that is transmitted on the UART contains sequentially the characters from mainFIRST_TX_CHAR to mainLAST_TX_CHAR. */ #define mainFIRST_TX_CHAR '0' #define mainLAST_TX_CHAR 'z' @@ -128,6 +157,12 @@ static void vLCDTask( void * pvParameters ); static void vCommsRxTask( void * pvParameters ); /* + * The co-routine that periodically initiates the transmission of the string on + * the UART. + */ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* * Writes a string the the LCD. */ static void prvWriteString( const char *pcString ); @@ -150,7 +185,7 @@ static void prvPDCWrite( char cAddress, char cData ); void prvSetAndCheckRegisters( void ); /* - * Latch the LED that indicates that an error has occurred. + * Latch the LED that indicates that an error has occurred. */ void vSetErrorLED( void ); @@ -161,7 +196,7 @@ static void prvSetupHardware( void ); /*-----------------------------------------------------------*/ -/* Error flag set to pdFAIL if an error is encountered in the tasks. +/* Error flag set to pdFAIL if an error is encountered in the tasks/co-routines defined within this file. */ unsigned portBASE_TYPE uxErrorStatus = pdPASS; @@ -183,11 +218,18 @@ void Main( void ) /* Setup the ports used by the demo and the clock. */ prvSetupHardware(); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); + + /* Create the co-routine that initiates the transmission of characters + on the UART. */ + xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX ); + /* Create the LCD and Comms Rx tasks. */ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL ); xTaskCreate( vCommsRxTask, "CMS", configMINIMAL_STACK_SIZE, NULL, mainCOMMS_RX_TASK_PRIORITY, NULL ); - /* Start the scheduler running the tasks just created. */ + /* Start the scheduler running the tasks and co-routines just created. */ vTaskStartScheduler(); /* Should not get here unless we did not have enough memory to start the @@ -210,13 +252,23 @@ static void prvSetupHardware( void ) void vApplicationIdleHook( void ) { + /* The co-routines are executed in the idle task using the idle task + hook. */ + for( ;; ) + { + /* Schedule the co-routines. */ + vCoRoutineSchedule(); + + /* Run the register check function between each co-routine. */ + prvSetAndCheckRegisters(); + } } /*-----------------------------------------------------------*/ static void prvWriteString( const char *pcString ) { /* Write pcString to the LED, pausing between each character. */ - prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); + prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); while( *pcString ) { vTaskDelay( mainCHAR_WRITE_DELAY ); @@ -229,7 +281,7 @@ static void prvWriteString( const char *pcString ) void vLCDTask( void * pvParameters ) { unsigned portBASE_TYPE uxIndex; -const unsigned char ucCFGData[] = { +const unsigned char ucCFGData[] = { 0x30, /* Set data bus to 8-bits. */ 0x30, 0x30, @@ -238,10 +290,10 @@ const unsigned char ucCFGData[] = { 0x01, /* Display clear. */ 0x06, /* Entry mode [cursor dir][shift]. */ 0x0C /* Display on [display on][curson on][blinking on]. */ - }; + }; /* The strings that are written to the LCD. */ -const char *pcStringsToDisplay[] = { +const char *pcStringsToDisplay[] = { "Stellaris", "Demo", "One", @@ -263,14 +315,14 @@ const char *pcStringsToDisplay[] = { /* Clear display. */ vTaskDelay( mainCHAR_WRITE_DELAY ); - prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); + prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); uxIndex = 0; - for( ;; ) + for( ;; ) { /* Display the string on the LCD. */ prvWriteString( pcStringsToDisplay[ uxIndex ] ); - + /* Move on to the next string - wrapping if necessary. */ uxIndex++; if( *( pcStringsToDisplay[ uxIndex ] ) == 0x00 ) @@ -319,8 +371,8 @@ static char cRxedChar, cExpectedChar; { if( cExpectedChar == mainLAST_TX_CHAR ) { - /* We have reached the end of the string - we now expect to - receive the first character in the string again. The LED is + /* We have reached the end of the string - we now expect to + receive the first character in the string again. The LED is toggled to indicate that the entire string was received without error. */ vParTestToggleLED( mainCOMMS_RX_LED ); @@ -337,6 +389,71 @@ static char cRxedChar, cExpectedChar; } /*-----------------------------------------------------------*/ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +TickType_t xDelayPeriod; +static unsigned long *pulRandomBytes = mainFIRST_PROGRAM_BYTES; + + /* Co-routine MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for(;;) + { + /* Was the previously transmitted string received correctly? */ + if( uxErrorStatus != pdPASS ) + { + /* An error was encountered so set the error LED. */ + vSetErrorLED(); + } + + /* The next character to Tx is the first in the string. */ + cNextChar = mainFIRST_TX_CHAR; + + UARTIntDisable( UART0_BASE, UART_INT_TX ); + { + /* Send the first character. */ + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + + /* Move the variable to the char to Tx on so the ISR transmits + the next character in the string once this one has completed. */ + cNextChar++; + } + UARTIntEnable(UART0_BASE, UART_INT_TX); + + /* Toggle the LED to show a new string is being transmitted. */ + vParTestToggleLED( mainCOMMS_TX_LED ); + + /* Delay before we start the string off again. A pseudo-random delay + is used as this will provide a better test. */ + xDelayPeriod = xTaskGetTickCount() + ( *pulRandomBytes ); + + pulRandomBytes++; + if( pulRandomBytes > mainTOTAL_PROGRAM_MEMORY ) + { + pulRandomBytes = mainFIRST_PROGRAM_BYTES; + } + + /* Make sure we don't wait too long... */ + xDelayPeriod &= mainMAX_TX_DELAY; + + /* ...but we do want to wait. */ + if( xDelayPeriod < mainMIN_TX_DELAY ) + { + xDelayPeriod = mainMIN_TX_DELAY; + } + + /* Block for the random(ish) time. */ + crDELAY( xHandle, xDelayPeriod ); + } + + /* Co-routine MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + static void vSerialInit( void ) { /* Enable the UART. GPIOA has already been initialised. */ @@ -377,11 +494,11 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( ( HWREG(UART0_BASE + UART_O_FR ) & UART_FR_RXFF ) ) { /* Get the char from the buffer and post it onto the queue of - Rxed chars. Posting the character should wake the task that is + Rxed chars. Posting the character should wake the task that is blocked on the queue waiting for characters. */ cRxedChar = ( char ) HWREG( UART0_BASE + UART_O_DR ); xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken ); - } + } } /* Was a Tx interrupt pending? */ @@ -397,10 +514,10 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; cNextChar++; } } - + /* If a task was woken by the character being received then we force a context switch to occur in case the task is of higher priority than - the currently executing task (i.e. the task that this interrupt + the currently executing task (i.e. the task that this interrupt interrupted.) */ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/makedefs b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/makedefs index d9549c741..7e361114f 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/makedefs +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/makedefs @@ -63,11 +63,12 @@ AFLAGS=-mthumb \ # # The flags passed to the compiler. # -CFLAGS=-mthumb \ - -mcpu=cortex-m3 \ - -fdata-sections -ffunction-sections \ - -MD \ - -g +CFLAGS=-mthumb \ + -mcpu=cortex-m3 \ + -O2 \ + -fdata-sections \ + -ffunction-sections \ + -MD # # The command for calling the library archiver. diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/standalone.ld b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/standalone.ld index 1f1d7baab..a776c8a23 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_GCC/standalone.ld +++ b/FreeRTOS/Demo/CORTEX_LM3S102_GCC/standalone.ld @@ -35,7 +35,7 @@ SECTIONS .text : { *(vectors) - *(.text) + *(.text*) *(.rodata*) *(.constdata*) _etext = .; diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/FreeRTOSConfig.h index b6d9c4e42..f40fc8b4c 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -50,8 +50,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 #define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/ParTest.c b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/ParTest.c index 1e16d6966..d5da78b98 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/ParTest.c @@ -73,7 +73,7 @@ unsigned char ucBit = ( unsigned char ) 1; } PDCWrite( PDC_LED, ucOutputValue ); - } + } } xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c index d7522473a..a2396ef46 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c @@ -24,28 +24,44 @@ * */ -/* - * This demo application creates two tasks (three including - * the idle task). +/* + * This demo application creates six co-routines and two tasks (three including + * the idle task). The co-routines execute as part of the idle task hook. + * + * Five of the created co-routines are the standard 'co-routine flash' + * co-routines contained within the Demo/Common/Minimal/crflash.c file and + * documented on the FreeRTOS.org WEB site. * * The 'LCD Task' rotates a string on the LCD, delaying between each character * as necessitated by the slow interface, and delaying between each string just * long enough to enable the text to be read. * + * The sixth co-routine and final task control the transmission and reception + * of a string to UART 0. The co-routine periodically sends the first + * character of the string to the UART, with the UART's TxEnd interrupt being + * used to transmit the remaining characters. The UART's RxEnd interrupt + * receives the characters and places them on a queue to be processed by the + * 'COMs Rx' task. An error is latched should an unexpected character be + * received, or any character be received out of sequence. * - * A loopback connector is required to ensure that each character transmitted + * A loopback connector is required to ensure that each character transmitted * on the UART is also received on the same UART. For test purposes the UART * FIFO's are not utalised in order to maximise the interrupt overhead. Also - * a pseudo random interval is used between the start of each transmission in - * order that the resultant interrupts are more randomly distributed and + * a pseudo random interval is used between the start of each transmission in + * order that the resultant interrupts are more randomly distributed and * therefore more likely to highlight any problems. * - * In addition the idle task makes repetitive calls to - * prvSetAndCheckRegisters(). This simply loads the general purpose registers - * with a known value, then checks each register to ensure the held value is - * still correct. As a low priority task this checking routine is likely to - * get repeatedly swapped in and out. A register being found to contain an - * incorrect value is therefore indicative of an error in the task switching + * The flash co-routines control LED's zero to four. LED five is toggled each + * time the string is transmitted on the UART. LED six is toggled each time + * the string is CORRECTLY received on the UART. LED seven is latched on should + * an error be detected in any task or co-routine. + * + * In addition the idle task makes repetitive calls to + * prvSetAndCheckRegisters(). This simply loads the general purpose registers + * with a known value, then checks each register to ensure the held value is + * still correct. As a low priority task this checking routine is likely to + * get repeatedly swapped in and out. A register being found to contain an + * incorrect value is therefore indicative of an error in the task switching * mechansim. * */ @@ -54,9 +70,11 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "croutine.h" /* Demo application include files. */ #include "partest.h" +#include "crflash.h" /* Library include files. */ #include "DriverLib.h" @@ -67,10 +85,20 @@ /* The time to delay between writing each string to the LCD. */ #define mainSTRING_WRITE_DELAY ( 400 / portTICK_PERIOD_MS ) +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_CO_ROUTINES ( 5 ) + /* The length of the queue used to pass received characters to the Comms Rx task. */ #define mainRX_QUEUE_LEN ( 5 ) +/* The priority of the co-routine used to initiate the transmission of the +string on UART 0. */ +#define mainTX_CO_ROUTINE_PRIORITY ( 1 ) + +/* Only one co-routine is created so its index is not important. */ +#define mainTX_CO_ROUTINE_INDEX ( 0 ) + /* The time between transmissions of the string on UART 0. This is pseudo random in order to generate a bit or randomness to when the interrupts occur.*/ #define mainMIN_TX_DELAY ( 40 / portTICK_PERIOD_MS ) @@ -92,13 +120,13 @@ the timing of the transmission. */ #define mainCOMMS_RX_LED ( 6 ) #define mainCOMMS_TX_LED ( 5 ) -/* The baud rate used by the UART comms tasks. */ +/* The baud rate used by the UART comms tasks/co-routine. */ #define mainBAUD_RATE ( 57600 ) /* FIFO setting for the UART. The FIFO is not used to create a better test. */ #define mainFIFO_SET ( 0x10 ) -/* The string that is transmitted on the UART contains sequentially the +/* The string that is transmitted on the UART contains sequentially the characters from mainFIRST_TX_CHAR to mainLAST_TX_CHAR. */ #define mainFIRST_TX_CHAR '0' #define mainLAST_TX_CHAR 'z' @@ -129,6 +157,12 @@ static void vLCDTask( void * pvParameters ); static void vCommsRxTask( void * pvParameters ); /* + * The co-routine that periodically initiates the transmission of the string on + * the UART. + */ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* * Writes a string the the LCD. */ static void prvWriteString( const char *pcString ); @@ -151,7 +185,7 @@ static void prvPDCWrite( char cAddress, char cData ); void prvSetAndCheckRegisters( void ); /* - * Latch the LED that indicates that an error has occurred. + * Latch the LED that indicates that an error has occurred. */ void vSetErrorLED( void ); @@ -162,7 +196,7 @@ static void prvSetupHardware( void ); /*-----------------------------------------------------------*/ -/* Error flag set to pdFAIL if an error is encountered in the tasks +/* Error flag set to pdFAIL if an error is encountered in the tasks/co-routines defined within this file. */ unsigned portBASE_TYPE uxErrorStatus = pdPASS; @@ -184,11 +218,18 @@ int main( void ) /* Setup the ports used by the demo and the clock. */ prvSetupHardware(); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); + + /* Create the co-routine that initiates the transmission of characters + on the UART. */ + xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX ); + /* Create the LCD and Comms Rx tasks. */ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL ); xTaskCreate( vCommsRxTask, "CMS", configMINIMAL_STACK_SIZE, NULL, mainCOMMS_RX_TASK_PRIORITY, NULL ); - /* Start the scheduler running the tasks just created. */ + /* Start the scheduler running the tasks and co-routines just created. */ vTaskStartScheduler(); /* Should not get here unless we did not have enough memory to start the @@ -212,9 +253,14 @@ static void prvSetupHardware( void ) void vApplicationIdleHook( void ) { + /* The co-routines are executed in the idle task using the idle task + hook. */ for( ;; ) { - /* Run the register check function */ + /* Schedule the co-routines. */ + vCoRoutineSchedule(); + + /* Run the register check function between each co-routine. */ prvSetAndCheckRegisters(); } } @@ -223,7 +269,7 @@ void vApplicationIdleHook( void ) static void prvWriteString( const char *pcString ) { /* Write pcString to the LED, pausing between each character. */ - prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); + prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); while( *pcString ) { vTaskDelay( mainCHAR_WRITE_DELAY ); @@ -236,7 +282,7 @@ static void prvWriteString( const char *pcString ) void vLCDTask( void * pvParameters ) { unsigned portBASE_TYPE uxIndex; -const unsigned char ucCFGData[] = { +const unsigned char ucCFGData[] = { 0x30, /* Set data bus to 8-bits. */ 0x30, 0x30, @@ -245,10 +291,10 @@ const unsigned char ucCFGData[] = { 0x01, /* Display clear. */ 0x06, /* Entry mode [cursor dir][shift]. */ 0x0C /* Display on [display on][curson on][blinking on]. */ - }; + }; /* The strings that are written to the LCD. */ -const char *pcStringsToDisplay[] = { +const char *pcStringsToDisplay[] = { "Stellaris", "Demo", "One", @@ -270,14 +316,14 @@ const char *pcStringsToDisplay[] = { /* Clear display. */ vTaskDelay( mainCHAR_WRITE_DELAY ); - prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); + prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); uxIndex = 0; - for( ;; ) + for( ;; ) { /* Display the string on the LCD. */ prvWriteString( pcStringsToDisplay[ uxIndex ] ); - + /* Move on to the next string - wrapping if necessary. */ uxIndex++; if( *( pcStringsToDisplay[ uxIndex ] ) == 0x00 ) @@ -326,8 +372,8 @@ static char cRxedChar, cExpectedChar; { if( cExpectedChar == mainLAST_TX_CHAR ) { - /* We have reached the end of the string - we now expect to - receive the first character in the string again. The LED is + /* We have reached the end of the string - we now expect to + receive the first character in the string again. The LED is toggled to indicate that the entire string was received without error. */ vParTestToggleLED( mainCOMMS_RX_LED ); @@ -344,6 +390,71 @@ static char cRxedChar, cExpectedChar; } /*-----------------------------------------------------------*/ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +TickType_t xDelayPeriod; +static unsigned long *pulRandomBytes = mainFIRST_PROGRAM_BYTES; + + /* Co-routine MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for(;;) + { + /* Was the previously transmitted string received correctly? */ + if( uxErrorStatus != pdPASS ) + { + /* An error was encountered so set the error LED. */ + vSetErrorLED(); + } + + /* The next character to Tx is the first in the string. */ + cNextChar = mainFIRST_TX_CHAR; + + UARTIntDisable( UART0_BASE, UART_INT_TX ); + { + /* Send the first character. */ + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + + /* Move the variable to the char to Tx on so the ISR transmits + the next character in the string once this one has completed. */ + cNextChar++; + } + UARTIntEnable(UART0_BASE, UART_INT_TX); + + /* Toggle the LED to show a new string is being transmitted. */ + vParTestToggleLED( mainCOMMS_TX_LED ); + + /* Delay before we start the string off again. A pseudo-random delay + is used as this will provide a better test. */ + xDelayPeriod = xTaskGetTickCount() + ( *pulRandomBytes ); + + pulRandomBytes++; + if( pulRandomBytes > mainTOTAL_PROGRAM_MEMORY ) + { + pulRandomBytes = mainFIRST_PROGRAM_BYTES; + } + + /* Make sure we don't wait too long... */ + xDelayPeriod &= mainMAX_TX_DELAY; + + /* ...but we do want to wait. */ + if( xDelayPeriod < mainMIN_TX_DELAY ) + { + xDelayPeriod = mainMIN_TX_DELAY; + } + + /* Block for the random(ish) time. */ + crDELAY( xHandle, xDelayPeriod ); + } + + /* Co-routine MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + static void vSerialInit( void ) { /* Enable the UART. GPIOA has already been initialised. */ @@ -384,11 +495,11 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( ( HWREG(UART0_BASE + UART_O_FR ) & UART_FR_RXFF ) ) { /* Get the char from the buffer and post it onto the queue of - Rxed chars. Posting the character should wake the task that is + Rxed chars. Posting the character should wake the task that is blocked on the queue waiting for characters. */ cRxedChar = ( char ) HWREG( UART0_BASE + UART_O_DR ); xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken ); - } + } } /* Was a Tx interrupt pending? */ @@ -404,10 +515,10 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; cNextChar++; } } - + /* If a task was woken by the character being received then we force a context switch to occur in case the task is of higher priority than - the currently executing task (i.e. the task that this interrupt + the currently executing task (i.e. the task that this interrupt interrupted.) */ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } @@ -433,7 +544,7 @@ void prvSetAndCheckRegisters( void ) { /* Fill the general purpose registers with known values. */ __asm volatile - ( + ( " mov r11, #10 \n" " add r0, r11, #1 \n" " add r1, r11, #2 \n" @@ -446,12 +557,12 @@ void prvSetAndCheckRegisters( void ) " add r8, r11, #9 \n" " add r9, r11, #10 \n" " add r10, r11, #11 \n" - " add r12, r11, #12" + " add r12, r11, #12" ); /* Check the values are as expected. */ __asm volatile - ( + ( " cmp r11, #10 \n" " bne set_error_led \n" " cmp r0, #11 \n" @@ -478,7 +589,7 @@ void prvSetAndCheckRegisters( void ) " bne set_error_led \n" " cmp r12, #22 \n" " bne set_error_led \n" - " bx lr" + " bx lr" ); __asm volatile diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/FreeRTOSConfig.h new file mode 100644 index 000000000..2e47fc415 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/FreeRTOSConfig.h @@ -0,0 +1,76 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) +#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 59 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 1240 ) ) +#define configMAX_TASK_NAME_LEN ( 3 ) +#define configUSE_TRACE_FACILITY 0 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 + +#define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 3 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ + +#define INCLUDE_vTaskPrioritySet 0 +#define INCLUDE_uxTaskPriorityGet 0 +#define INCLUDE_vTaskDelete 0 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 0 +#define INCLUDE_vTaskDelayUntil 0 +#define INCLUDE_vTaskDelay 1 + + +#define configKERNEL_INTERRUPT_PRIORITY 255 +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xa0, or priority 5. */ + + +#endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/ParTest.c b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/ParTest.c new file mode 100644 index 000000000..d5da78b98 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/ParTest.c @@ -0,0 +1,106 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/*----------------------------------------------------------- + * Simple parallel port IO routines. + *-----------------------------------------------------------*/ + +/* +*/ + + +#include "FreeRTOS.h" +#include "task.h" +#include "partest.h" + +#include "pdc.h" + +#define partstPINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 Z | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7) + +#define partstALL_OUTPUTS_OFF ( ( unsigned char ) 0x00 ) +#define partstMAX_OUTPUT_LED ( ( unsigned char ) 8 ) + +static volatile unsigned char ucOutputValue = partstALL_OUTPUTS_OFF; + +void vParTestInitialise( void ) +{ + PDCInit(); + PDCWrite( PDC_LED, ucOutputValue ); +} +/*-----------------------------------------------------------*/ + +void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) +{ +unsigned char ucBit = ( unsigned char ) 1; + + vTaskSuspendAll(); + { + if( uxLED < partstMAX_OUTPUT_LED ) + { + ucBit = ( ( unsigned char ) 1 ) << uxLED; + + if( xValue == pdFALSE ) + { + ucBit ^= ( unsigned char ) 0xff; + ucOutputValue &= ucBit; + } + else + { + ucOutputValue |= ucBit; + } + + PDCWrite( PDC_LED, ucOutputValue ); + } + } + xTaskResumeAll(); +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) +{ +unsigned char ucBit; + + vTaskSuspendAll(); + { + if( uxLED < partstMAX_OUTPUT_LED ) + { + ucBit = ( ( unsigned char ) 1 ) << uxLED; + + if( ucOutputValue & ucBit ) + { + ucOutputValue &= ~ucBit; + } + else + { + ucOutputValue |= ucBit; + } + + PDCWrite( PDC_LED, ucOutputValue ); + } + } + xTaskResumeAll(); +} + diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/main.c b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/main.c new file mode 100644 index 000000000..57964efbd --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/main.c @@ -0,0 +1,616 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/* + * This demo application creates seven co-routines and one task (two including + * the idle task). The co-routines execute as part of the idle task hook. + * + * Five of the created co-routines are the standard 'co-routine flash' + * co-routines contained within the Demo/Common/Minimal/crflash.c file and + * documented on the FreeRTOS.org WEB site. + * + * The 'LCD Task' rotates a string on the LCD, delaying between each character + * as necessitated by the slow interface, and delaying between each string just + * long enough to enable the text to be read. + * + * The sixth co-routine controls the transmission of a string to UART 0. The + * co-routine periodically sends the first character of the string to the UART, + * with the UART's TxEnd interrupt being used to transmit the remaining + * characters. The UART's RxEnd interrupt receives the characters and places + * them on a queue to be processed by the seventh and final co-routine. An + * error is latched should an unexpected character be received, or any + * character be received out of sequence. + * + * A loopback connector is required to ensure that each character transmitted + * on the UART is also received on the same UART. For test purposes the UART + * FIFO's are not utalised in order to maximise the interrupt overhead. Also + * a pseudo random interval is used between the start of each transmission in + * order that the resultant interrupts are more randomly distributed and + * therefore more likely to highlight any problems. + * + * The flash co-routines control LED's zero to four. LED five is toggled each + * time the string is transmitted on the UART. LED six is toggled each time + * the string is CORRECTLY received on the UART. LED seven is latched on should + * an error be detected in any task or co-routine. + * + * In addition the idle task makes repetitive calls to + * prvSetAndCheckRegisters(). This simply loads the general purpose registers + * with a known value, then checks each register to ensure the held value is + * still correct. As a low priority task this checking routine is likely to + * get repeatedly swapped in and out. A register being found to contain an + * incorrect value is therefore indicative of an error in the task switching + * mechansim. + * + */ + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "croutine.h" + +/* Demo application include files. */ +#include "partest.h" +#include "crflash.h" + +/* Library include files. */ +#include "DriverLib.h" + +/* The time to delay between writing each character to the LCD. */ +#define mainCHAR_WRITE_DELAY ( 2 / portTICK_PERIOD_MS ) + +/* The time to delay between writing each string to the LCD. */ +#define mainSTRING_WRITE_DELAY ( 400 / portTICK_PERIOD_MS ) + +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_CO_ROUTINES ( 5 ) + +/* The length of the queue used to pass received characters to the Comms Rx +task. */ +#define mainRX_QUEUE_LEN ( 5 ) + +/* The priority of the co-routine used to initiate the transmission of the +string on UART 0. */ +#define mainTX_CO_ROUTINE_PRIORITY ( 1 ) + +/* The priority of the co-routine used to receive characters from the UART. */ +#define mainRX_CO_ROUTINE_PRIORITY ( 2 ) + +/* Only one co-routine is created so its index is not important. */ +#define mainTX_CO_ROUTINE_INDEX ( 0 ) +#define mainRX_CO_ROUTINE_INDEX ( 0 ) + +/* The time between transmissions of the string on UART 0. This is pseudo +random in order to generate a bit or randomness to when the interrupts occur.*/ +#define mainMIN_TX_DELAY ( 40 / portTICK_PERIOD_MS ) +#define mainMAX_TX_DELAY ( ( TickType_t ) 0x7f ) +#define mainOFFSET_TIME ( ( TickType_t ) 3 ) + +/* The time the Comms Rx task should wait to receive a character. This should +be slightly longer than the time between transmissions. If we do not receive +a character after this time then there must be an error in the transmission or +the timing of the transmission. */ +#define mainCOMMS_RX_DELAY ( mainMAX_TX_DELAY + 20 ) + +/* The task priorities. */ +#define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY ) +#define mainCOMMS_RX_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) + +/* The LED's toggled by the various tasks. */ +#define mainCOMMS_FAIL_LED ( 7 ) +#define mainCOMMS_RX_LED ( 6 ) +#define mainCOMMS_TX_LED ( 5 ) + +/* The baud rate used by the UART comms tasks/co-routine. */ +#define mainBAUD_RATE ( 57600 ) + +/* FIFO setting for the UART. The FIFO is not used to create a better test. */ +#define mainFIFO_SET ( 0x10 ) + +/* The string that is transmitted on the UART contains sequentially the +characters from mainFIRST_TX_CHAR to mainLAST_TX_CHAR. */ +#define mainFIRST_TX_CHAR '0' +#define mainLAST_TX_CHAR 'z' + +/* Just used to walk through the program memory in order that some random data +can be generated. */ +#define mainTOTAL_PROGRAM_MEMORY ( ( unsigned long * ) ( 8 * 1024 ) ) +#define mainFIRST_PROGRAM_BYTES ( ( unsigned long * ) 4 ) + +/* The error routine that is called if the driver library encounters an error. */ +#ifdef DEBUG +void +__error__(char *pcFilename, unsigned long ulLine) +{ +} +#endif + +/*-----------------------------------------------------------*/ + +/* + * The task that rotates text on the LCD. + */ +static void vLCDTask( void * pvParameters ); + +/* + * The task that receives the characters from UART 0. + */ +static void vCommsRxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* + * The co-routine that periodically initiates the transmission of the string on + * the UART. + */ +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* + * Writes a string the the LCD. + */ +static void prvWriteString( const char *pcString ); + +/* + * Initialisation routine for the UART. + */ +static void vSerialInit( void ); + +/* + * Thread safe write to the PDC. + */ +static void prvPDCWrite( char cAddress, char cData ); + +/* + * Function to simply set a known value into the general purpose registers + * then read them back to ensure they remain set correctly. An incorrect value + * being indicative of an error in the task switching mechanism. + */ +void prvSetAndCheckRegisters( void ); + +/* + * Latch the LED that indicates that an error has occurred. + */ +void vSetErrorLED( void ); + +/* + * Sets up the PLL and ports used by the demo. + */ +static void prvSetupHardware( void ); + +/*-----------------------------------------------------------*/ + +/* Error flag set to pdFAIL if an error is encountered in the tasks/co-routines +defined within this file. */ +unsigned portBASE_TYPE uxErrorStatus = pdPASS; + +/* The next character to transmit. */ +static char cNextChar; + +/* The queue used to transmit characters from the interrupt to the Comms Rx +task. */ +static QueueHandle_t xCommsQueue; + +/*-----------------------------------------------------------*/ + +int main( void ) +{ + /* Create the queue used to communicate between the UART ISR and the Comms + Rx task. */ + xCommsQueue = xQueueCreate( mainRX_QUEUE_LEN, sizeof( char ) ); + + /* Setup the ports used by the demo and the clock. */ + prvSetupHardware(); + + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); + + /* Create the co-routine that initiates the transmission of characters + on the UART. */ + xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX ); + + /* Create the co-routine that receives characters from the UART. */ + xCoRoutineCreate( vCommsRxCoRoutine, mainRX_CO_ROUTINE_PRIORITY, mainRX_CO_ROUTINE_INDEX ); + + /* Create the LCD task. */ + xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL ); + + /* Start the scheduler running the tasks and co-routines just created. */ + vTaskStartScheduler(); + + /* Should not get here unless we did not have enough memory to start the + scheduler. */ + for( ;; ); + return 0; +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ + /* Setup the PLL. */ + SysCtlClockSet( SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ ); + + /* Initialise the hardware used to talk to the LCD, LED's and UART. */ + PDCInit(); + vParTestInitialise(); + vSerialInit(); +} +/*-----------------------------------------------------------*/ + +void vApplicationIdleHook( void ) +{ + /* The co-routines are executed in the idle task using the idle task + hook. */ + for( ;; ) + { + /* Schedule the co-routines. */ + vCoRoutineSchedule(); + + /* Run the register check function between each co-routine. */ + prvSetAndCheckRegisters(); + } +} +/*-----------------------------------------------------------*/ + +static void prvWriteString( const char *pcString ) +{ + /* Write pcString to the LED, pausing between each character. */ + prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR); + while( *pcString ) + { + vTaskDelay( mainCHAR_WRITE_DELAY ); + prvPDCWrite( PDC_LCD_RAM, *pcString ); + pcString++; + } +} +/*-----------------------------------------------------------*/ + +void vLCDTask( void * pvParameters ) +{ +unsigned portBASE_TYPE uxIndex; +const unsigned char ucCFGData[] = { + 0x30, /* Set data bus to 8-bits. */ + 0x30, + 0x30, + 0x3C, /* Number of lines/font. */ + 0x08, /* Display off. */ + 0x01, /* Display clear. */ + 0x06, /* Entry mode [cursor dir][shift]. */ + 0x0C /* Display on [display on][curson on][blinking on]. */ + }; + +/* The strings that are written to the LCD. */ +const char *pcStringsToDisplay[] = { + "Stellaris", + "Demo", + "Two", + "www.FreeRTOS.org", + "" + }; + + /* Configure the LCD. */ + uxIndex = 0; + while( uxIndex < sizeof( ucCFGData ) ) + { + prvPDCWrite( PDC_LCD_CSR, ucCFGData[ uxIndex ] ); + uxIndex++; + vTaskDelay( mainCHAR_WRITE_DELAY ); + } + + /* Turn the LCD Backlight on. */ + prvPDCWrite( PDC_CSR, 0x01 ); + + /* Clear display. */ + vTaskDelay( mainCHAR_WRITE_DELAY ); + prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); + + uxIndex = 0; + for( ;; ) + { + /* Display the string on the LCD. */ + prvWriteString( pcStringsToDisplay[ uxIndex ] ); + + /* Move on to the next string - wrapping if necessary. */ + uxIndex++; + if( *( pcStringsToDisplay[ uxIndex ] ) == 0x00 ) + { + uxIndex = 0; + /* Longer pause on the last string to be sent. */ + vTaskDelay( mainSTRING_WRITE_DELAY * 2 ); + } + + /* Wait until it is time to move onto the next string. */ + vTaskDelay( mainSTRING_WRITE_DELAY ); + } +} +/*-----------------------------------------------------------*/ + +static void vCommsRxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +static char cRxedChar, cExpectedChar = mainFIRST_TX_CHAR; +portBASE_TYPE xResult; + + crSTART( xHandle ); + + for( ;; ) + { + /* Wait for a character to be received. */ + crQUEUE_RECEIVE( xHandle, xCommsQueue, ( void * ) &cRxedChar, mainCOMMS_RX_DELAY, &xResult ); + + /* Was the character received (if any) the expected character. */ + if( ( cRxedChar != cExpectedChar ) || ( xResult != pdPASS ) ) + { + /* Got an unexpected character. This can sometimes occur when + reseting the system using the debugger leaving characters already + in the UART registers. */ + uxErrorStatus = pdFAIL; + + /* Resync by waiting for the end of the current string. */ + while( cRxedChar != mainLAST_TX_CHAR ) + { + crQUEUE_RECEIVE( xHandle, xCommsQueue, ( void * ) &cRxedChar, mainCOMMS_RX_DELAY, &xResult ); + } + + /* The next expected character is the start of the string again. */ + cExpectedChar = mainFIRST_TX_CHAR; + } + else + { + if( cExpectedChar == mainLAST_TX_CHAR ) + { + /* We have reached the end of the string - we now expect to + receive the first character in the string again. The LED is + toggled to indicate that the entire string was received without + error. */ + vParTestToggleLED( mainCOMMS_RX_LED ); + cExpectedChar = mainFIRST_TX_CHAR; + } + else + { + /* We got the expected character, we now expect to receive the + next character in the string. */ + cExpectedChar++; + } + } + } + + crEND(); +} +/*-----------------------------------------------------------*/ + +static void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +TickType_t xDelayPeriod; +static unsigned long *pulRandomBytes = mainFIRST_PROGRAM_BYTES; + + /* Co-routine MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for(;;) + { + /* Was the previously transmitted string received correctly? */ + if( uxErrorStatus != pdPASS ) + { + /* An error was encountered so set the error LED. */ + vSetErrorLED(); + } + + /* The next character to Tx is the first in the string. */ + cNextChar = mainFIRST_TX_CHAR; + + UARTIntDisable( UART0_BASE, UART_INT_TX ); + { + /* Send the first character. */ + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + + /* Move the variable to the char to Tx on so the ISR transmits + the next character in the string once this one has completed. */ + cNextChar++; + } + UARTIntEnable(UART0_BASE, UART_INT_TX); + + /* Toggle the LED to show a new string is being transmitted. */ + vParTestToggleLED( mainCOMMS_TX_LED ); + + /* Delay before we start the string off again. A pseudo-random delay + is used as this will provide a better test. */ + xDelayPeriod = xTaskGetTickCount() + ( *pulRandomBytes ); + + pulRandomBytes++; + if( pulRandomBytes > mainTOTAL_PROGRAM_MEMORY ) + { + pulRandomBytes = mainFIRST_PROGRAM_BYTES; + } + + /* Make sure we don't wait too long... */ + xDelayPeriod &= mainMAX_TX_DELAY; + + /* ...but we do want to wait. */ + if( xDelayPeriod < mainMIN_TX_DELAY ) + { + xDelayPeriod = mainMIN_TX_DELAY; + } + + /* Block for the random(ish) time. */ + crDELAY( xHandle, xDelayPeriod ); + } + + /* Co-routine MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + +static void vSerialInit( void ) +{ + /* Enable the UART. GPIOA has already been initialised. */ + SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); + + /* Set GPIO A0 and A1 as peripheral function. They are used to output the + UART signals. */ + GPIODirModeSet( GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1, GPIO_DIR_MODE_HW ); + + /* Configure the UART for 8-N-1 operation. */ + UARTConfigSet( UART0_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE ); + + /* We dont want to use the fifo. This is for test purposes to generate + as many interrupts as possible. */ + HWREG( UART0_BASE + UART_O_LCR_H ) &= ~mainFIFO_SET; + + /* Enable both Rx and Tx interrupts. */ + HWREG( UART0_BASE + UART_O_IM ) |= ( UART_INT_TX | UART_INT_RX ); + IntEnable( INT_UART0 ); +} +/*-----------------------------------------------------------*/ + +void vUART_ISR(void) +{ +unsigned long ulStatus; +char cRxedChar; +portBASE_TYPE xTaskWokenByPost = pdFALSE; + + /* What caused the interrupt. */ + ulStatus = UARTIntStatus( UART0_BASE, pdTRUE ); + + /* Clear the interrupt. */ + UARTIntClear( UART0_BASE, ulStatus ); + + /* Was an Rx interrupt pending? */ + if( ulStatus & UART_INT_RX ) + { + if( ( HWREG(UART0_BASE + UART_O_FR ) & UART_FR_RXFF ) ) + { + /* Get the char from the buffer and post it onto the queue of + Rxed chars. Posting the character should wake the task that is + blocked on the queue waiting for characters. */ + cRxedChar = ( char ) HWREG( UART0_BASE + UART_O_DR ); + xTaskWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsQueue, &cRxedChar, xTaskWokenByPost ); + } + } + + /* Was a Tx interrupt pending? */ + if( ulStatus & UART_INT_TX ) + { + /* Send the next character in the string. We are not using the FIFO. */ + if( cNextChar <= mainLAST_TX_CHAR ) + { + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + cNextChar++; + } + } + + if( xTaskWokenByPost ) + { + /* We are posting to a co-routine rather than a task so don't bother + causing a task switch. */ + } +} +/*-----------------------------------------------------------*/ + +static void prvPDCWrite( char cAddress, char cData ) +{ + vTaskSuspendAll(); + { + PDCWrite( cAddress, cData ); + } + xTaskResumeAll(); +} +/*-----------------------------------------------------------*/ + +void vSetErrorLED( void ) +{ + vParTestSetLED( mainCOMMS_FAIL_LED, pdTRUE ); +} +/*-----------------------------------------------------------*/ + +void prvSetAndCheckRegisters( void ) +{ + /* Fill the general purpose registers with known values. */ + __asm volatile + ( + " mov r11, #10 \n" + " add r0, r11, #1 \n" + " add r1, r11, #2 \n" + " add r2, r11, #3 \n" + " add r3, r11, #4 \n" + " add r4, r11, #5 \n" + " add r5, r11, #6 \n" + " add r6, r11, #7 \n" + " add r7, r11, #8 \n" + " add r8, r11, #9 \n" + " add r9, r11, #10 \n" + " add r10, r11, #11 \n" + " add r12, r11, #12" + ); + + /* Check the values are as expected. */ + __asm volatile + ( + " cmp r11, #10 \n" + " bne set_error_led \n" + " cmp r0, #11 \n" + " bne set_error_led \n" + " cmp r1, #12 \n" + " bne set_error_led \n" + " cmp r2, #13 \n" + " bne set_error_led \n" + " cmp r3, #14 \n" + " bne set_error_led \n" + " cmp r4, #15 \n" + " bne set_error_led \n" + " cmp r5, #16 \n" + " bne set_error_led \n" + " cmp r6, #17 \n" + " bne set_error_led \n" + " cmp r7, #18 \n" + " bne set_error_led \n" + " cmp r8, #19 \n" + " bne set_error_led \n" + " cmp r9, #20 \n" + " bne set_error_led \n" + " cmp r10, #21 \n" + " bne set_error_led \n" + " cmp r12, #22 \n" + " bne set_error_led \n" + " bx lr" + ); + + __asm volatile + ( + "set_error_led: \n" + " push {r14} \n" + " ldr r1, vSetErrorLEDConst\n" + " blx r1 \n" + " pop {r14} \n" + " bx lr \n" + " \n" + " .align 2 \n" + "vSetErrorLEDConst: .word vSetErrorLED" + ); +} +/*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/vectors.s b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/vectors.s new file mode 100644 index 000000000..900b2bbb9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo2/vectors.s @@ -0,0 +1,120 @@ +/***************************************************************************** + * Copyright (c) 2006 Rowley Associates Limited. * + * * + * This file may be distributed under the terms of the License Agreement * + * provided with this software. * + * * + * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE * + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * + *****************************************************************************/ + .section .vectors, "ax" + .code 16 + .align 0 + .global _vectors + + .extern xPortPendSVHandler + .extern xPortSysTickHandler + .extern vUART_ISR + .extern vPortSVCHandler + +.macro DEFAULT_ISR_HANDLER name= + .thumb_func + .weak \name +\name: +1: b 1b /* endless loop */ +.endm + +_vectors: + .word __stack_end__ +#ifdef STARTUP_FROM_RESET + .word _start +#else + .word reset_wait +#endif /* STARTUP_FROM_RESET */ + .word NmiISR + .word FaultISR + .word 0 // Populate if using MemManage (MPU) + .word 0 // Populate if using Bus fault + .word 0 // Populate if using Usage fault + .word 0 // Reserved + .word 0 // Reserved + .word 0 // Reserved + .word 0 // Reserved + .word vPortSVCHandler + .word 0 // Populate if using a debug monitor + .word 0 // Reserved + .word xPortPendSVHandler // Populate if using pendable service request + .word xPortSysTickHandler + // External interrupts start her + .word GPIO_Port_A_ISR + .word GPIO_Port_B_ISR + .word GPIO_Port_C_ISR + .word GPIO_Port_D_ISR + .word GPIO_Port_E_ISR + .word vUART_ISR + .word UART1_ISR + .word SSI_ISR + .word I2C_ISR + .word PWM_Fault_ISR + .word PWM_Generator_0_ISR + .word PWM_Generator_1_ISR + .word PWM_Generator_2_ISR + .word QEI_ISR + .word ADC_Sequence_0_ISR + .word ADC_Sequence_1_ISR + .word ADC_Sequence_2_ISR + .word ADC_Sequence_3_ISR + .word Watchdog_timer_ISR + .word Timer0a_ISR + .word Timer0b_ISR + .word Timer1a_ISR + .word Timer1b_ISR + .word Timer2a_ISR + .word Timer2b_ISR + .word Analog_Comparator_0_ISR + .word Analog_Comparator_1_ISR + .word Analog_Comparator_2_ISR + .word System_Control_ISR + .word FLASH_Control_ISR + + .section .init, "ax" + .thumb_func + +DEFAULT_ISR_HANDLER NmiISR +DEFAULT_ISR_HANDLER FaultISR +DEFAULT_ISR_HANDLER SVCallISR +DEFAULT_ISR_HANDLER SysTickISR +DEFAULT_ISR_HANDLER GPIO_Port_A_ISR +DEFAULT_ISR_HANDLER GPIO_Port_B_ISR +DEFAULT_ISR_HANDLER GPIO_Port_C_ISR +DEFAULT_ISR_HANDLER GPIO_Port_D_ISR +DEFAULT_ISR_HANDLER GPIO_Port_E_ISR +DEFAULT_ISR_HANDLER UART0_ISR +DEFAULT_ISR_HANDLER UART1_ISR +DEFAULT_ISR_HANDLER SSI_ISR +DEFAULT_ISR_HANDLER I2C_ISR +DEFAULT_ISR_HANDLER PWM_Fault_ISR +DEFAULT_ISR_HANDLER PWM_Generator_0_ISR +DEFAULT_ISR_HANDLER PWM_Generator_1_ISR +DEFAULT_ISR_HANDLER PWM_Generator_2_ISR +DEFAULT_ISR_HANDLER QEI_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_0_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_1_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_2_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_3_ISR +DEFAULT_ISR_HANDLER Watchdog_timer_ISR +DEFAULT_ISR_HANDLER Timer0a_ISR +DEFAULT_ISR_HANDLER Timer0b_ISR +DEFAULT_ISR_HANDLER Timer1a_ISR +DEFAULT_ISR_HANDLER Timer1b_ISR +DEFAULT_ISR_HANDLER Timer2a_ISR +DEFAULT_ISR_HANDLER Timer2b_ISR +DEFAULT_ISR_HANDLER Analog_Comparator_0_ISR +DEFAULT_ISR_HANDLER Analog_Comparator_1_ISR +DEFAULT_ISR_HANDLER Analog_Comparator_2_ISR +DEFAULT_ISR_HANDLER System_Control_ISR +DEFAULT_ISR_HANDLER FLASH_Control_ISR + +#ifndef STARTUP_FROM_RESET +DEFAULT_ISR_HANDLER reset_wait +#endif /* STARTUP_FROM_RESET */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/FreeRTOSConfig.h new file mode 100644 index 000000000..036253935 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/FreeRTOSConfig.h @@ -0,0 +1,76 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 0 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) +#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 59 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 1240 ) ) +#define configMAX_TASK_NAME_LEN ( 3 ) +#define configUSE_TRACE_FACILITY 0 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 + +#define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ + +#define INCLUDE_vTaskPrioritySet 0 +#define INCLUDE_uxTaskPriorityGet 0 +#define INCLUDE_vTaskDelete 0 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 0 +#define INCLUDE_vTaskDelayUntil 0 +#define INCLUDE_vTaskDelay 0 + +#define configKERNEL_INTERRUPT_PRIORITY 255 +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xa0, or priority 5. */ + + + +#endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/ParTest.c b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/ParTest.c new file mode 100644 index 000000000..0a9c46302 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/ParTest.c @@ -0,0 +1,106 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/*----------------------------------------------------------- + * Simple parallel port IO routines. + *-----------------------------------------------------------*/ + +/* +*/ + +/* Kernel include files. */ +#include "FreeRTOS.h" +#include "task.h" +#include "partest.h" + +/* Hardware specific include files. */ +#include "DriverLib.h" + +static const unsigned long ulLEDs[] = +{ + GPIO_PIN_6, GPIO_PIN_1, GPIO_PIN_0 +}; + +#define partstLED_PINS ( GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_6 ) + +#define partstMAX_OUTPUT_LED ( ( unsigned char ) 3 ) + +/*-----------------------------------------------------------*/ +void vParTestInitialise( void ) +{ +portBASE_TYPE xLED; + + /* The LED's are on port B. */ + GPIODirModeSet( GPIO_PORTB_BASE, partstLED_PINS, GPIO_DIR_MODE_OUT ); + + for( xLED = 0; xLED < partstMAX_OUTPUT_LED; xLED++ ) + { + vParTestSetLED( xLED, pdFALSE ); + } +} +/*-----------------------------------------------------------*/ + +void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) +{ + vTaskSuspendAll(); + { + if( uxLED < partstMAX_OUTPUT_LED ) + { + if( xValue == pdFALSE ) + { + GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ulLEDs[ uxLED ] ); + } + else + { + GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ~ulLEDs[ uxLED ] ); + } + } + } + xTaskResumeAll(); +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) +{ +portBASE_TYPE xCurrentValue; + + vTaskSuspendAll(); + { + if( uxLED < partstMAX_OUTPUT_LED ) + { + xCurrentValue = GPIOPinRead( GPIO_PORTB_BASE, ulLEDs[ uxLED ] ); + if( xCurrentValue ) + { + GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ~ulLEDs[ uxLED ] ); + } + else + { + GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ulLEDs[ uxLED ] ); + } + } + } + xTaskResumeAll(); +} diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/main.c b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/main.c new file mode 100644 index 000000000..e962859e1 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/main.c @@ -0,0 +1,284 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + + +/* + * This is a mini co-routine demo for the Rowley CrossFire LM3S102 development + * board. It makes use of the boards tri-colour LED and analogue input. + * + * Four co-routines are created - an 'I2C' co-routine and three 'flash' + * co-routines. + * + * The I2C co-routine triggers an ADC conversion then blocks on a queue to + * wait for the conversion result - which it receives on the queue directly + * from the I2C interrupt service routine. The conversion result is then + * scalled to a delay period. The I2C interrupt then wakes each of the + * flash co-routines before itself delaying for the calculated period and + * then repeating the whole process. + * + * When woken by the I2C co-routine the flash co-routines each block for + * a given period, illuminate an LED for a fixed period, then go back to + * sleep to wait for the next cycle. The uxIndex parameter of the flash + * co-routines is used to ensure that each flashes a different LED, and that + * the delay periods are such that the LED's get flashed in sequence. + */ + + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "croutine.h" + +/* Demo application include files. */ +#include "partest.h" + +/* Library include files. */ +#include "DriverLib.h" + +/* States of the I2C master interface. */ +#define mainI2C_IDLE 0 +#define mainI2C_READ_1 1 +#define mainI2C_READ_2 2 +#define mainI2C_READ_DONE 3 + +#define mainZERO_LENGTH 0 + +/* Address of the A2D IC on the CrossFire board. */ +#define mainI2CAddress 0x4D + +/* The queue used to send data from the I2C ISR to the co-routine should never +contain more than one item as the same co-routine is used to trigger the I2C +activity. */ +#define mainQUEUE_LENGTH 1 + +/* The CrossFire board contains a tri-colour LED. */ +#define mainNUM_LEDs 3 + +/* The I2C co-routine has a higher priority than the flash co-routines. This +is not really necessary as when the I2C co-routine is active the other +co-routines are delaying. */ +#define mainI2c_CO_ROUTINE_PRIORITY 1 + + +/* The current state of the I2C master. */ +static volatile unsigned portBASE_TYPE uxState = mainI2C_IDLE; + +/* The delay period derived from the A2D value. */ +static volatile portBASE_TYPE uxDelay = 250; + +/* The queue used to communicate between the I2C interrupt and the I2C +co-routine. */ +static QueueHandle_t xADCQueue; + +/* The queue used to synchronise the flash co-routines. */ +static QueueHandle_t xDelayQueue; + +/* + * Sets up the PLL, I2C and GPIO used by the demo. + */ +static void prvSetupHardware( void ); + +/* The co-routines as described at the top of the file. */ +static void vI2CCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); +static void vFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/*-----------------------------------------------------------*/ + +int main( void ) +{ +unsigned portBASE_TYPE uxCoRoutine; + + /* Setup all the hardware used by this demo. */ + prvSetupHardware(); + + /* Create the queue used to communicate between the ISR and I2C co-routine. + This can only ever contain one value. */ + xADCQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( TickType_t ) ); + + /* Create the queue used to synchronise the flash co-routines. The queue + is used to trigger three tasks, but is for synchronisation only and does + not pass any data. It therefore has three position each of zero length. */ + xDelayQueue = xQueueCreate( mainNUM_LEDs, mainZERO_LENGTH ); + + /* Create the co-routine that initiates the i2c. */ + xCoRoutineCreate( vI2CCoRoutine, mainI2c_CO_ROUTINE_PRIORITY, 0 ); + + /* Create the flash co-routines. */ + for( uxCoRoutine = 0; uxCoRoutine < mainNUM_LEDs; uxCoRoutine++ ) + { + xCoRoutineCreate( vFlashCoRoutine, tskIDLE_PRIORITY, uxCoRoutine ); + } + + /* Start the scheduler. From this point on the co-routines should + execute. */ + vTaskStartScheduler(); + + /* Should not get here unless we did not have enough memory to start the + scheduler. */ + for( ;; ); + return 0; +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ + /* Setup the PLL. */ + SysCtlClockSet( SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ ); + + /* Enable the I2C used to read the pot. */ + SysCtlPeripheralEnable( SYSCTL_PERIPH_I2C ); + SysCtlPeripheralEnable( SYSCTL_PERIPH_GPIOB ); + GPIOPinTypeI2C( GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3 ); + + /* Initialize the I2C master. */ + I2CMasterInit( I2C_MASTER_BASE, pdFALSE ); + + /* Enable the I2C master interrupt. */ + I2CMasterIntEnable( I2C_MASTER_BASE ); + IntEnable( INT_I2C ); + + /* Initialise the hardware used to talk to the LED's. */ + vParTestInitialise(); +} +/*-----------------------------------------------------------*/ + +static void vI2CCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +TickType_t xADCResult; +static portBASE_TYPE xResult = 0, xMilliSecs, xLED; + + crSTART( xHandle ); + + for( ;; ) + { + /* Start the I2C off to read the ADC. */ + uxState = mainI2C_READ_1; + I2CMasterSlaveAddrSet( I2C_MASTER_BASE, mainI2CAddress, pdTRUE ); + I2CMasterControl( I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START ); + + /* Wait to receive the conversion result. */ + crQUEUE_RECEIVE( xHandle, xADCQueue, &xADCResult, portMAX_DELAY, &xResult ); + + /* Scale the result to give a useful range of values for a visual + demo. */ + xADCResult >>= 2; + xMilliSecs = xADCResult / portTICK_PERIOD_MS; + + /* The delay is split between the four co-routines so they remain in + synch. */ + uxDelay = xMilliSecs / ( mainNUM_LEDs + 1 ); + + /* Trigger each of the flash co-routines. */ + for( xLED = 0; xLED < mainNUM_LEDs; xLED++ ) + { + crQUEUE_SEND( xHandle, xDelayQueue, &xLED, 0, &xResult ); + } + + /* Wait for the full delay time then start again. This delay is long + enough to ensure the flash co-routines have done their thing and gone + back to sleep. */ + crDELAY( xHandle, xMilliSecs ); + } + + crEND(); +} +/*-----------------------------------------------------------*/ + +static void vFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +portBASE_TYPE xResult, xNothing; + + crSTART( xHandle ); + + for( ;; ) + { + /* Wait for start of next round. */ + crQUEUE_RECEIVE( xHandle, xDelayQueue, &xNothing, portMAX_DELAY, &xResult ); + + /* Wait until it is this co-routines turn to flash. */ + crDELAY( xHandle, uxDelay * uxIndex ); + + /* Turn on the LED for a fixed period. */ + vParTestSetLED( uxIndex, pdTRUE ); + crDELAY( xHandle, uxDelay ); + vParTestSetLED( uxIndex, pdFALSE ); + + /* Go back and wait for the next round. */ + } + + crEND(); +} +/*-----------------------------------------------------------*/ + +void vI2C_ISR(void) +{ +static TickType_t xReading; + + /* Clear the interrupt. */ + I2CMasterIntClear( I2C_MASTER_BASE ); + + /* Determine what to do based on the current uxState. */ + switch (uxState) + { + case mainI2C_IDLE: break; + + case mainI2C_READ_1: /* Read ADC result high byte. */ + xReading = I2CMasterDataGet( I2C_MASTER_BASE ); + xReading <<= 8; + + /* Continue the burst read. */ + I2CMasterControl( I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_CONT ); + uxState = mainI2C_READ_2; + break; + + case mainI2C_READ_2: /* Read ADC result low byte. */ + xReading |= I2CMasterDataGet( I2C_MASTER_BASE ); + + /* Finish the burst read. */ + I2CMasterControl( I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH ); + uxState = mainI2C_READ_DONE; + break; + + case mainI2C_READ_DONE: /* Complete. */ + I2CMasterDataGet( I2C_MASTER_BASE ); + uxState = mainI2C_IDLE; + + /* Send the result to the co-routine. */ + crQUEUE_SEND_FROM_ISR( xADCQueue, &xReading, pdFALSE ); + break; + } +} +/*-----------------------------------------------------------*/ + +void vApplicationIdleHook( void ) +{ + for( ;; ) + { + vCoRoutineSchedule(); + } +} + diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/vectors.s b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/vectors.s new file mode 100644 index 000000000..2cc260894 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/vectors.s @@ -0,0 +1,121 @@ +/***************************************************************************** + * Copyright (c) 2006 Rowley Associates Limited. * + * * + * This file may be distributed under the terms of the License Agreement * + * provided with this software. * + * * + * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE * + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * + *****************************************************************************/ + .section .vectors, "ax" + .code 16 + .align 0 + .global _vectors + + .extern xPortPendSVHandler + .extern xPortSysTickHandler + .extern vI2C_ISR + .extern faultisr + .extern vPortSVCHandler + +.macro DEFAULT_ISR_HANDLER name= + .thumb_func + .weak \name +\name: +1: b 1b /* endless loop */ +.endm + +_vectors: + .word __stack_end__ +#ifdef STARTUP_FROM_RESET + .word _start +#else + .word reset_wait +#endif /* STARTUP_FROM_RESET */ + .word NmiISR + .word FaultISR + .word 0 // Populate if using MemManage (MPU) + .word 0 // Populate if using Bus fault + .word 0 // Populate if using Usage fault + .word 0 // Reserved + .word 0 // Reserved + .word 0 // Reserved + .word 0 // Reserved + .word vPortSVCHandler + .word 0 // Populate if using a debug monitor + .word 0 // Reserved + .word xPortPendSVHandler // Populate if using pendable service request + .word xPortSysTickHandler + // External interrupts start her + .word GPIO_Port_A_ISR + .word GPIO_Port_B_ISR + .word GPIO_Port_C_ISR + .word GPIO_Port_D_ISR + .word GPIO_Port_E_ISR + .word UART0_ISR + .word UART1_ISR + .word SSI_ISR + .word vI2C_ISR + .word PWM_Fault_ISR + .word PWM_Generator_0_ISR + .word PWM_Generator_1_ISR + .word PWM_Generator_2_ISR + .word QEI_ISR + .word ADC_Sequence_0_ISR + .word ADC_Sequence_1_ISR + .word ADC_Sequence_2_ISR + .word ADC_Sequence_3_ISR + .word Watchdog_timer_ISR + .word Timer0a_ISR + .word Timer0b_ISR + .word Timer1a_ISR + .word Timer1b_ISR + .word Timer2a_ISR + .word Timer2b_ISR + .word Analog_Comparator_0_ISR + .word Analog_Comparator_1_ISR + .word Analog_Comparator_2_ISR + .word System_Control_ISR + .word FLASH_Control_ISR + + .section .init, "ax" + .thumb_func + +DEFAULT_ISR_HANDLER NmiISR +DEFAULT_ISR_HANDLER FaultISR +DEFAULT_ISR_HANDLER SVCallISR +DEFAULT_ISR_HANDLER SysTickISR +DEFAULT_ISR_HANDLER GPIO_Port_A_ISR +DEFAULT_ISR_HANDLER GPIO_Port_B_ISR +DEFAULT_ISR_HANDLER GPIO_Port_C_ISR +DEFAULT_ISR_HANDLER GPIO_Port_D_ISR +DEFAULT_ISR_HANDLER GPIO_Port_E_ISR +DEFAULT_ISR_HANDLER UART0_ISR +DEFAULT_ISR_HANDLER UART1_ISR +DEFAULT_ISR_HANDLER SSI_ISR +DEFAULT_ISR_HANDLER I2C_ISR +DEFAULT_ISR_HANDLER PWM_Fault_ISR +DEFAULT_ISR_HANDLER PWM_Generator_0_ISR +DEFAULT_ISR_HANDLER PWM_Generator_1_ISR +DEFAULT_ISR_HANDLER PWM_Generator_2_ISR +DEFAULT_ISR_HANDLER QEI_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_0_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_1_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_2_ISR +DEFAULT_ISR_HANDLER ADC_Sequence_3_ISR +DEFAULT_ISR_HANDLER Watchdog_timer_ISR +DEFAULT_ISR_HANDLER Timer0a_ISR +DEFAULT_ISR_HANDLER Timer0b_ISR +DEFAULT_ISR_HANDLER Timer1a_ISR +DEFAULT_ISR_HANDLER Timer1b_ISR +DEFAULT_ISR_HANDLER Timer2a_ISR +DEFAULT_ISR_HANDLER Timer2b_ISR +DEFAULT_ISR_HANDLER Analog_Comparator_0_ISR +DEFAULT_ISR_HANDLER Analog_Comparator_1_ISR +DEFAULT_ISR_HANDLER Analog_Comparator_2_ISR +DEFAULT_ISR_HANDLER System_Control_ISR +DEFAULT_ISR_HANDLER FLASH_Control_ISR + +#ifndef STARTUP_FROM_RESET +DEFAULT_ISR_HANDLER reset_wait +#endif /* STARTUP_FROM_RESET */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/RTOSDemo.hzp b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/RTOSDemo.hzp index 36b6c768e..dc51429e9 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/RTOSDemo.hzp +++ b/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/RTOSDemo.hzp @@ -7,11 +7,13 @@ + + @@ -43,11 +45,13 @@ + + @@ -81,6 +85,7 @@ + diff --git a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/FreeRTOSConfig.h index 1ca46a2ad..d072f6355 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -50,8 +50,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 #define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -69,4 +71,6 @@ to exclude the API function. */ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xa0, or priority 5. */ + + #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/ParTest/ParTest.c index 1e16d6966..d5da78b98 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/ParTest/ParTest.c @@ -73,7 +73,7 @@ unsigned char ucBit = ( unsigned char ) 1; } PDCWrite( PDC_LED, ucOutputValue ); - } + } } xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/RTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/RTOSDemo.ewp index 8e7e6814c..530a98f52 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/RTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/RTOSDemo.ewp @@ -907,6 +907,9 @@ $PROJ_DIR$\commstest.c + + $PROJ_DIR$\..\Common\Minimal\crflash.c + $PROJ_DIR$\main.c @@ -919,6 +922,9 @@ FreeRTOS Source + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c @@ -951,3 +957,5 @@ + + diff --git a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.c b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.c index b2bfbdb22..8642c3743 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.c +++ b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.c @@ -25,7 +25,7 @@ */ /* - * The comms test Rx and Tx task. See the comments at the top + * The comms test Rx and Tx task and co-routine. See the comments at the top * of main.c for full information. */ @@ -34,6 +34,7 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "croutine.h" /* Demo application include files. */ #include "partest.h" @@ -42,7 +43,7 @@ #include "DriverLib.h" /* The LED's toggled by the various tasks. */ -#define commsFAIL_LED ( 7 ) +#define commsFAIL_LED ( 7 ) #define commsRX_LED ( 6 ) #define commsTX_LED ( 5 ) @@ -50,7 +51,7 @@ task. */ #define commsRX_QUEUE_LEN ( 5 ) -/* The baud rate used by the UART comms tasks. */ +/* The baud rate used by the UART comms tasks/co-routine. */ #define commsBAUD_RATE ( 57600 ) /* FIFO setting for the UART. The FIFO is not used to create a better test. */ @@ -116,6 +117,71 @@ void vSerialInit( void ) } /*-----------------------------------------------------------*/ +void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +TickType_t xDelayPeriod; +static unsigned long *pulRandomBytes = commsFIRST_PROGRAM_BYTES; + + /* Co-routine MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for(;;) + { + /* Was the previously transmitted string received correctly? */ + if( uxCommsErrorStatus != pdPASS ) + { + /* An error was encountered so set the error LED. */ + vParTestSetLED( commsFAIL_LED, pdTRUE ); + } + + /* The next character to Tx is the first in the string. */ + cNextChar = commsFIRST_TX_CHAR; + + UARTIntDisable( UART0_BASE, UART_INT_TX ); + { + /* Send the first character. */ + if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) ) + { + HWREG( UART0_BASE + UART_O_DR ) = cNextChar; + } + + /* Move the variable to the char to Tx on so the ISR transmits + the next character in the string once this one has completed. */ + cNextChar++; + } + UARTIntEnable(UART0_BASE, UART_INT_TX); + + /* Toggle the LED to show a new string is being transmitted. */ + vParTestToggleLED( commsTX_LED ); + + /* Delay before we start the string off again. A pseudo-random delay + is used as this will provide a better test. */ + xDelayPeriod = xTaskGetTickCount() + ( *pulRandomBytes ); + + pulRandomBytes++; + if( pulRandomBytes > commsTOTAL_PROGRAM_MEMORY ) + { + pulRandomBytes = commsFIRST_PROGRAM_BYTES; + } + + /* Make sure we don't wait too long... */ + xDelayPeriod &= commsMAX_TX_DELAY; + + /* ...but we do want to wait. */ + if( xDelayPeriod < commsMIN_TX_DELAY ) + { + xDelayPeriod = commsMIN_TX_DELAY; + } + + /* Block for the random(ish) time. */ + crDELAY( xHandle, xDelayPeriod ); + } + + /* Co-routine MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + void vUART_ISR( void ) { unsigned long ulStatus; @@ -138,7 +204,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; blocked on the queue waiting for characters. */ cRxedChar = ( char ) HWREG( UART0_BASE + UART_O_DR ); xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken ); - } + } } /* Was a Tx interrupt pending? */ @@ -154,7 +220,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; cNextChar++; } } - + /* If a task was woken by the character being received then we force a context switch to occur in case the task is of higher priority than the currently executing task (i.e. the task that this interrupt diff --git a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.h b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.h index ebe6c9729..da5ed000e 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.h +++ b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/commstest.h @@ -37,6 +37,12 @@ void vSerialInit( void ); */ void vCommsRxTask( void * pvParameters ); +/* + * The co-routine that periodically initiates the transmission of the string on + * the UART. + */ +void vSerialTxCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + unsigned portBASE_TYPE uxGetCommsStatus( void ); #endif diff --git a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/main.c b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/main.c index 56ddf56ab..548bfa4e0 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S316_IAR/main.c +++ b/FreeRTOS/Demo/CORTEX_LM3S316_IAR/main.c @@ -24,11 +24,16 @@ * */ -/* - * This demo application creates four tasks (five including the idle task). - * The application is limited in size to allow its compilation using +/* + * This demo application creates eight co-routines and four tasks (five + * including the idle task). The co-routines execute as part of the idle task + * hook. The application is limited in size to allow its compilation using * the KickStart version of the IAR compiler. * + * Six of the created co-routines are the standard 'co-routine flash' + * co-routines contained within the Demo/Common/Minimal/crflash.c file and + * documented on the FreeRTOS.org WEB site. + * * The 'LCD Task' waits on a message queue for messages informing it what and * where to display text. This is the only task that accesses the LCD * so mutual exclusion is guaranteed. @@ -37,19 +42,37 @@ * the message queue. The strings are rotated to form a short message and * are written to the top row of the LCD. * - * A loopback connector is required to ensure that each character transmitted + * The 'ADC Co-routine' periodically reads the ADC input that is connected to + * the light sensor, forms a short message from the value, and then sends this + * message to the LCD Task using the same message queue. The ADC readings are + * displayed on the bottom row of the LCD. + * + * The eighth co-routine and final task control the transmission and reception + * of a string to UART 0. The co-routine periodically sends the first + * character of the string to the UART, with the UART's TxEnd interrupt being + * used to transmit the remaining characters. The UART's RxEnd interrupt + * receives the characters and places them on a queue to be processed by the + * 'COMs Rx' task. An error is latched should an unexpected character be + * received, or any character be received out of sequence. + * + * A loopback connector is required to ensure that each character transmitted * on the UART is also received on the same UART. For test purposes the UART * FIFO's are not utalised in order to maximise the interrupt overhead. Also - * a pseudo random interval is used between the start of each transmission in - * order that the resultant interrupts are more randomly distributed and + * a pseudo random interval is used between the start of each transmission in + * order that the resultant interrupts are more randomly distributed and * therefore more likely to highlight any problems. * - * In addition the idle task makes repetitive calls to - * vSetAndCheckRegisters(). This simply loads the general purpose registers - * with a known value, then checks each register to ensure the held value is - * still correct. As a low priority task this checking routine is likely to - * get repeatedly swapped in and out. A register being found to contain an - * incorrect value is therefore indicative of an error in the task switching + * The flash co-routines control LED's zero to four. LED five is toggled each + * time the string is transmitted on the UART. LED six is toggled each time + * the string is CORRECTLY received on the UART. LED seven is latched on + * should an error be detected in any task or co-routine. + * + * In addition the idle task makes repetitive calls to + * vSetAndCheckRegisters(). This simply loads the general purpose registers + * with a known value, then checks each register to ensure the held value is + * still correct. As a low priority task this checking routine is likely to + * get repeatedly swapped in and out. A register being found to contain an + * incorrect value is therefore indicative of an error in the task switching * mechanism. * */ @@ -61,9 +84,11 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "croutine.h" /* Demo application include files. */ #include "partest.h" +#include "crflash.h" #include "commstest.h" /* Library include files. */ @@ -77,9 +102,21 @@ #define mainADC_DELAY ( 200 / portTICK_PERIOD_MS ) +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_CO_ROUTINES ( 5 ) + /* The length of the queue used to send messages to the LCD task. */ #define mainLCD_QUEUE_LEN ( 3 ) +/* The priority of the co-routine used to initiate the transmission of the +string on UART 0. */ +#define mainTX_CO_ROUTINE_PRIORITY ( 1 ) +#define mainADC_CO_ROUTINE_PRIORITY ( 2 ) + +/* Only one of each co-routine is created so its index is not important. */ +#define mainTX_CO_ROUTINE_INDEX ( 0 ) +#define mainADC_CO_ROUTINE_INDEX ( 0 ) + /* The task priorities. */ #define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define mainMSG_TASK_PRIORITY ( mainLCD_TASK_PRIORITY - 1 ) @@ -92,7 +129,8 @@ /* Dimension for the buffer into which the ADC value string is written. */ #define mainMAX_ADC_STRING_LEN 20 -/* The LED that is lit should an error be detected in any of the tasks */ +/* The LED that is lit should an error be detected in any of the tasks or +co-routines. */ #define mainFAIL_LED ( 7 ) /*-----------------------------------------------------------*/ @@ -107,6 +145,12 @@ static void prvLCDTask( void * pvParameters ); */ static void prvLCDMessageTask( void * pvParameters ); +/* + * The co-routine that reads the ADC and sends messages for display on the + * bottom row of the LCD. + */ +static void prvADCCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + /* * Function to simply set a known value into the general purpose registers * then read them back to ensure they remain set correctly. An incorrect value @@ -115,7 +159,7 @@ static void prvLCDMessageTask( void * pvParameters ); extern void vSetAndCheckRegisters( void ); /* - * Latch the LED that indicates that an error has occurred. + * Latch the LED that indicates that an error has occurred. */ void vSetErrorLED( void ); @@ -139,7 +183,7 @@ typedef struct portBASE_TYPE xRow; /*<< The row on which the message should be displayed. */ } xLCDMessage; -/* Error flag set to pdFAIL if an error is encountered in the tasks +/* Error flag set to pdFAIL if an error is encountered in the tasks/co-routines defined within this file. */ unsigned portBASE_TYPE uxErrorStatus = pdPASS; @@ -149,7 +193,7 @@ static QueueHandle_t xLCDQueue; /*-----------------------------------------------------------*/ /* - * Setup the hardware, create the tasks, then start the scheduler. + * Setup the hardware, create the tasks/co-routines, then start the scheduler. */ void main( void ) { @@ -159,15 +203,23 @@ void main( void ) /* Setup the ports used by the demo and the clock. */ prvSetupHardware(); + /* Create the co-routines that flash the LED's. */ + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); + + /* Create the co-routine that initiates the transmission of characters + on the UART and the task that receives them, as described at the top of + this file. */ + xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX ); xTaskCreate( vCommsRxTask, "CMS", configMINIMAL_STACK_SIZE, NULL, mainCOMMS_RX_TASK_PRIORITY, NULL ); /* Create the task that waits for messages to display on the LCD, plus the - task that sends messages for display (as described at the top + task and co-routine that send messages for display (as described at the top of this file. */ xTaskCreate( prvLCDTask, "LCD", configMINIMAL_STACK_SIZE, ( void * ) &xLCDQueue, mainLCD_TASK_PRIORITY, NULL ); xTaskCreate( prvLCDMessageTask, "MSG", configMINIMAL_STACK_SIZE, ( void * ) &xLCDQueue, mainMSG_TASK_PRIORITY, NULL ); + xCoRoutineCreate( prvADCCoRoutine, mainADC_CO_ROUTINE_PRIORITY, mainADC_CO_ROUTINE_INDEX ); - /* Start the scheduler running the tasks just created. */ + /* Start the scheduler running the tasks and co-routines just created. */ vTaskStartScheduler(); /* Should not get here unless we did not have enough memory to start the @@ -179,7 +231,7 @@ void main( void ) static void prvLCDMessageTask( void * pvParameters ) { /* The strings that are written to the LCD. */ -char *pcStringsToDisplay[] = { +char *pcStringsToDisplay[] = { "IAR ", "Stellaris ", "Demo ", @@ -187,7 +239,7 @@ char *pcStringsToDisplay[] = { "" }; -QueueHandle_t *pxLCDQueue; +QueueHandle_t *pxLCDQueue; xLCDMessage xMessageToSend; portBASE_TYPE xIndex = 0; @@ -199,20 +251,20 @@ portBASE_TYPE xIndex = 0; for( ;; ) { /* Wait until it is time to move onto the next string. */ - vTaskDelay( mainSTRING_WRITE_DELAY ); - + vTaskDelay( mainSTRING_WRITE_DELAY ); + /* Create the message object to send to the LCD task. */ xMessageToSend.ppcMessageToDisplay = &pcStringsToDisplay[ xIndex ]; xMessageToSend.xRow = mainTOP_ROW; - + /* Post the message to be displayed. */ if( !xQueueSend( *pxLCDQueue, ( void * ) &xMessageToSend, 0 ) ) { uxErrorStatus = pdFAIL; } - + /* Move onto the next message, wrapping when necessary. */ - xIndex++; + xIndex++; if( *( pcStringsToDisplay[ xIndex ] ) == 0x00 ) { xIndex = 0; @@ -230,7 +282,7 @@ unsigned portBASE_TYPE uxIndex; QueueHandle_t *pxLCDQueue; xLCDMessage xReceivedMessage; char *pcString; -const unsigned char ucCFGData[] = { +const unsigned char ucCFGData[] = { 0x30, /* Set data bus to 8-bits. */ 0x30, 0x30, @@ -239,7 +291,7 @@ const unsigned char ucCFGData[] = { 0x01, /* Display clear. */ 0x06, /* Entry mode [cursor dir][shift]. */ 0x0C /* Display on [display on][curson on][blinking on]. */ - }; + }; /* To test the parameter passing mechanism, the queue on which messages are received is passed in as a parameter even though it is available as a file @@ -260,10 +312,10 @@ const unsigned char ucCFGData[] = { /* Clear display. */ vTaskDelay( mainCHAR_WRITE_DELAY ); - prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); + prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); uxIndex = 0; - for( ;; ) + for( ;; ) { /* Wait for a message to arrive. */ if( xQueueReceive( *pxLCDQueue, &xReceivedMessage, portMAX_DELAY ) ) @@ -273,26 +325,67 @@ const unsigned char ucCFGData[] = { /* Where is the string we are going to display? */ pcString = *xReceivedMessage.ppcMessageToDisplay; - + while( *pcString ) { - /* Don't write out the string too quickly as LCD's are usually + /* Don't write out the string too quickly as LCD's are usually pretty slow devices. */ vTaskDelay( mainCHAR_WRITE_DELAY ); prvPDCWrite( PDC_LCD_RAM, *pcString ); pcString++; - } + } } } } +/*-----------------------------------------------------------*/ +static void prvADCCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +static unsigned long ulADCValue; +static char cMessageBuffer[ mainMAX_ADC_STRING_LEN ]; +static char *pcMessage; +static xLCDMessage xMessageToSend; + + /* Co-routines MUST start with a call to crSTART(). */ + crSTART( xHandle ); + + for( ;; ) + { + /* Start an ADC conversion. */ + ADCProcessorTrigger( ADC_BASE, 0 ); + + /* Simply delay - when we unblock the result should be available */ + crDELAY( xHandle, mainADC_DELAY ); + + /* Get the ADC result. */ + ADCSequenceDataGet( ADC_BASE, 0, &ulADCValue ); + + /* Create a string with the result. */ + sprintf( cMessageBuffer, "ADC = %d ", ulADCValue ); + pcMessage = cMessageBuffer; + + /* Configure the message we are going to send for display. */ + xMessageToSend.ppcMessageToDisplay = ( char** ) &pcMessage; + xMessageToSend.xRow = mainBOTTOM_ROW; + + /* Send the string to the LCD task for display. We are sending + on a task queue so do not have the option to block. */ + if( !xQueueSend( xLCDQueue, ( void * ) &xMessageToSend, 0 ) ) + { + uxErrorStatus = pdFAIL; + } + } + + /* Co-routines MUST end with a call to crEND(). */ + crEND(); +} /*-----------------------------------------------------------*/ static void prvSetupHardware( void ) { /* Setup the PLL. */ SysCtlClockSet( SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ ); - + /* Initialise the hardware used to talk to the LCD, LED's and UART. */ PDCInit(); vParTestInitialise(); @@ -325,11 +418,17 @@ void vSetErrorLED( void ) void vApplicationIdleHook( void ) { + /* The co-routines are executed in the idle task using the idle task + hook. */ for( ;; ) { - vSetAndCheckRegisters(); + /* Schedule the co-routines. */ + vCoRoutineSchedule(); - /* See if the comms task has found any errors. */ + /* Run the register check function between each co-routine. */ + vSetAndCheckRegisters(); + + /* See if the comms task and co-routine has found any errors. */ if( uxGetCommsStatus() != pdPASS ) { vParTestSetLED( mainFAIL_LED, pdTRUE ); diff --git a/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/FreeRTOSConfig.h index 150cd2238..94dc2edb1 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/FreeRTOSConfig.h @@ -50,6 +50,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -57,6 +58,7 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 6UL ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configQUEUE_REGISTRY_SIZE 10 #define configSUPPORT_STATIC_ALLOCATION 1 diff --git a/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/IntQueueTimer.c b/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/IntQueueTimer.c index 6be7e6948..879de40e1 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/IntQueueTimer.c +++ b/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/IntQueueTimer.c @@ -51,7 +51,7 @@ uint32_t ulFrequency; SysCtlPeripheralEnable( SYSCTL_PERIPH_TIMER3 ); TimerConfigure( TIMER2_BASE, TIMER_CFG_32_BIT_PER ); TimerConfigure( TIMER3_BASE, TIMER_CFG_32_BIT_PER ); - + /* Set the timer interrupts to be above the kernel. The interrupts are assigned different priorities so they nest with each other. */ IntPrioritySet( INT_TIMER2A, configMAX_SYSCALL_INTERRUPT_PRIORITY + ( 1 << 5 ) ); /* Shift left 5 as only the top 3 bits are implemented. */ @@ -59,20 +59,20 @@ uint32_t ulFrequency; /* Ensure interrupts do not start until the scheduler is running. */ portDISABLE_INTERRUPTS(); - + /* The rate at which the timers will interrupt. */ - ulFrequency = configCPU_CLOCK_HZ / tmrTIMER_2_FREQUENCY; + ulFrequency = configCPU_CLOCK_HZ / tmrTIMER_2_FREQUENCY; TimerLoadSet( TIMER2_BASE, TIMER_A, ulFrequency ); IntEnable( INT_TIMER2A ); TimerIntEnable( TIMER2_BASE, TIMER_TIMA_TIMEOUT ); /* The rate at which the timers will interrupt. */ - ulFrequency = configCPU_CLOCK_HZ / tmrTIMER_3_FREQUENCY; + ulFrequency = configCPU_CLOCK_HZ / tmrTIMER_3_FREQUENCY; TimerLoadSet( TIMER3_BASE, TIMER_A, ulFrequency ); IntEnable( INT_TIMER3A ); TimerIntEnable( TIMER3_BASE, TIMER_TIMA_TIMEOUT ); - /* Enable both timers. */ + /* Enable both timers. */ TimerEnable( TIMER2_BASE, TIMER_A ); TimerEnable( TIMER3_BASE, TIMER_A ); } @@ -80,7 +80,7 @@ uint32_t ulFrequency; void vT2InterruptHandler( void ) { - TimerIntClear( TIMER2_BASE, TIMER_TIMA_TIMEOUT ); + TimerIntClear( TIMER2_BASE, TIMER_TIMA_TIMEOUT ); portEND_SWITCHING_ISR( xFirstTimerHandler() ); } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/timertest.c b/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/timertest.c index 8217be1c5..e2aa5f260 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/timertest.c +++ b/FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/LocalDemoFiles/timertest.c @@ -73,23 +73,23 @@ uint32_t ulFrequency; SysCtlPeripheralEnable( SYSCTL_PERIPH_TIMER1 ); TimerConfigure( TIMER0_BASE, TIMER_CFG_32_BIT_PER ); TimerConfigure( TIMER1_BASE, TIMER_CFG_32_BIT_PER ); - + /* Set the timer interrupt to be above the kernel - highest. */ IntPrioritySet( INT_TIMER0A, timerHIGHEST_PRIORITY ); /* Just used to measure time. */ TimerLoadSet(TIMER1_BASE, TIMER_A, timerMAX_32BIT_VALUE ); - + /* Ensure interrupts do not start until the scheduler is running. */ portDISABLE_INTERRUPTS(); - + /* The rate at which the timer will interrupt. */ - ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; + ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; TimerLoadSet( TIMER0_BASE, TIMER_A, ulFrequency ); IntEnable( INT_TIMER0A ); TimerIntEnable( TIMER0_BASE, TIMER_TIMA_TIMEOUT ); - /* Enable both timers. */ + /* Enable both timers. */ TimerEnable( TIMER0_BASE, TIMER_A ); TimerEnable( TIMER1_BASE, TIMER_A ); } @@ -108,10 +108,10 @@ static uint32_t ulMaxDifference = 0, ulLastCount = 0; TimerIntClear( TIMER0_BASE, TIMER_TIMA_TIMEOUT ); if( ulCurrentCount < ulLastCount ) - { + { /* How many times has timer 1 counted since the last interrupt? */ ulDifference = ulLastCount - ulCurrentCount; - + /* Is this the largest difference we have measured yet? */ if( ulDifference > ulMaxDifference ) { @@ -119,7 +119,7 @@ static uint32_t ulMaxDifference = 0, ulLastCount = 0; ulMaxJitter = ulMaxDifference - timerEXPECTED_DIFFERENCE_VALUE; } } - + ulLastCount = ulCurrentCount; } diff --git a/FreeRTOS/Demo/CORTEX_LM3S811_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S811_GCC/FreeRTOSConfig.h index 51ea328ab..51a78debf 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S811_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S811_GCC/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -50,8 +50,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configMAX_PRIORITIES ( 5 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S811_GCC/main.c b/FreeRTOS/Demo/CORTEX_LM3S811_GCC/main.c index 6a931e1b3..c0e29d0ff 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S811_GCC/main.c +++ b/FreeRTOS/Demo/CORTEX_LM3S811_GCC/main.c @@ -190,12 +190,12 @@ const char *pcFailMessage = "FAIL"; { xErrorOccurred = pdTRUE; } - + if( xArePollingQueuesStillRunning() != pdTRUE ) { xErrorOccurred = pdTRUE; } - + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) { xErrorOccurred = pdTRUE; diff --git a/FreeRTOS/Demo/CORTEX_LM3S811_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S811_IAR/FreeRTOSConfig.h index a25578269..3b70ce506 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S811_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S811_IAR/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -50,8 +50,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 #define configMAX_PRIORITIES ( 5 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S811_IAR/main.c b/FreeRTOS/Demo/CORTEX_LM3S811_IAR/main.c index 7197c4287..21d881556 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S811_IAR/main.c +++ b/FreeRTOS/Demo/CORTEX_LM3S811_IAR/main.c @@ -190,12 +190,12 @@ const char *pcFailMessage = "FAIL"; { xErrorOccurred = pdTRUE; } - + if( xArePollingQueuesStillRunning() != pdTRUE ) { xErrorOccurred = pdTRUE; } - + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) { xErrorOccurred = pdTRUE; diff --git a/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/FreeRTOSConfig.h index 590bc3300..618834c62 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -50,8 +50,10 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configMAX_PRIORITIES ( 2 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/heap/heap_1.c b/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/heap/heap_1.c index 9449895a2..e4dc81721 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/heap/heap_1.c +++ b/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/heap/heap_1.c @@ -51,7 +51,7 @@ static size_t xNextFreeByte = ( size_t ) 0; void *pvPortMalloc( size_t xWantedSize ) { -void *pvReturn = NULL; +void *pvReturn = NULL; /* Ensure that blocks are always aligned to the required number of bytes. */ #if portBYTE_ALIGNMENT != 1 @@ -71,8 +71,8 @@ void *pvReturn = NULL; /* Return the next free byte then increment the index past this block. */ pvReturn = &( xHeap.ucHeap[ xNextFreeByte ] ); - xNextFreeByte += xWantedSize; - } + xNextFreeByte += xWantedSize; + } } xTaskResumeAll(); @@ -82,8 +82,8 @@ void *pvReturn = NULL; void vPortFree( void *pv ) { - /* Memory cannot be freed using this scheme. See heap_2.c and heap_3.c - for alternative implementations, and the memory management pages of + /* Memory cannot be freed using this scheme. See heap_2.c and heap_3.c + for alternative implementations, and the memory management pages of http://www.FreeRTOS.org for more information. */ ( void ) pv; } diff --git a/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/main.c b/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/main.c index 266f7cad7..f9df97d52 100644 --- a/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/main.c +++ b/FreeRTOS/Demo/CORTEX_LM3S811_KEIL/main.c @@ -26,16 +26,16 @@ /* - * This project contains an application demonstrating the use of the + * This project contains an application demonstrating the use of the * FreeRTOS.org mini real time scheduler on the Luminary Micro LM3S811 Eval * board. See http://www.FreeRTOS.org for more information. * - * main() simply sets up the hardware, creates all the demo application tasks, + * main() simply sets up the hardware, creates all the demo application tasks, * then starts the scheduler. http://www.freertos.org/a00102.html provides - * more information on the standard demo tasks. + * more information on the standard demo tasks. * * In addition to a subset of the standard demo application tasks, main.c also - * defines the following tasks: + * defines the following tasks: * * + A 'Print' task. The print task is the only task permitted to access the * LCD - thus ensuring mutual exclusion and consistent access to the resource. @@ -44,12 +44,12 @@ * blocked - only waking when a message is queued for display. * * + A 'Button handler' task. The eval board contains a user push button that - * is configured to generate interrupts. The interrupt handler uses a - * semaphore to wake the button handler task - demonstrating how the priority + * is configured to generate interrupts. The interrupt handler uses a + * semaphore to wake the button handler task - demonstrating how the priority * mechanism can be used to defer interrupt processing to the task level. The * button handler task sends a message both to the LCD (via the print task) and * the UART where it can be viewed using a dumb terminal (via the UART to USB - * converter on the eval board). NOTES: The dumb terminal must be closed in + * converter on the eval board). NOTES: The dumb terminal must be closed in * order to reflash the microcontroller. A very basic interrupt driven UART * driver is used that does not use the FIFO. 19200 baud is used. * @@ -82,7 +82,7 @@ /* Delay between cycles of the 'check' task. */ #define mainCHECK_DELAY ( ( TickType_t ) 5000 / portTICK_PERIOD_MS ) -/* UART configuration - note this does not use the FIFO so is not very +/* UART configuration - note this does not use the FIFO so is not very efficient. */ #define mainBAUD_RATE ( 19200 ) #define mainFIFO_SET ( 0x10 ) @@ -101,7 +101,7 @@ efficient. */ #define mainDEBOUNCE_DELAY ( ( TickType_t ) 150 / portTICK_PERIOD_MS ) #define mainNO_DELAY ( ( TickType_t ) 0 ) /* - * Configure the processor and peripherals for this demo. + * Configure the processor and peripherals for this demo. */ static void prvSetupHardware( void ); @@ -163,7 +163,7 @@ int main( void ) /* Start the scheduler. */ vTaskStartScheduler(); - /* Will only get here if there was insufficient heap to start the + /* Will only get here if there was insufficient heap to start the scheduler. */ return 0; @@ -192,12 +192,12 @@ const char *pcFailMessage = "FAIL"; { xErrorOccurred = pdTRUE; } - + if( xArePollingQueuesStillRunning() != pdTRUE ) { xErrorOccurred = pdTRUE; } - + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) { xErrorOccurred = pdTRUE; diff --git a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/RegTest.c b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/RegTest.c index b8c6e1b86..b586e787f 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/RegTest.c @@ -24,7 +24,7 @@ * */ -/* +/* * "Reg test" tasks - These fill the registers with known values, then check * that each register maintains its expected value for the lifetime of the * task. Each task uses a different set of values. The reg test tasks execute diff --git a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/config/FreeRTOSConfig.h index e22ccf829..7dc4074e6 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/config/FreeRTOSConfig.h @@ -70,6 +70,9 @@ unsigned long ulMainGetRunTimeCounterValue( void ); #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vMainConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue() +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main-full.c b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main-full.c index 563ed6ed4..07e968a34 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main-full.c +++ b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main-full.c @@ -50,7 +50,7 @@ * use the CLI: * - Power the SAMD20 XPlained board through the USB debugger connector. This * will create a virtual COM port through the USB. - * - Build and run the demo application. + * - Build and run the demo application. * - Start a dumb terminal program such as TerraTerm or Hyper Terminal. * - In the dumb terminal select the UART port associated with the XPlained * debugger connection, using 19200 baud. @@ -162,9 +162,9 @@ const size_t xRegTestStackSize = 25U; vStartQueueSetTasks(); vStartGenericQueueTasks( tskIDLE_PRIORITY ); vStartQueuePeekTasks(); - + /* Start the task that manages the command console for FreeRTOS+CLI. */ - vUARTCommandConsoleStart( ( configMINIMAL_STACK_SIZE * 3 ), tskIDLE_PRIORITY ); + vUARTCommandConsoleStart( ( configMINIMAL_STACK_SIZE * 3 ), tskIDLE_PRIORITY ); /* Create the register test tasks as described at the top of this file. These are naked functions that don't use any stack. A stack still has @@ -257,7 +257,7 @@ unsigned long ulErrorFound = pdFALSE; } ulLastRegTest2Value = ulRegTest2LoopCounter; - + if( xAreQueueSetTasksStillRunning() != pdPASS ) { ulErrorFound = pdTRUE; @@ -267,12 +267,12 @@ unsigned long ulErrorFound = pdFALSE; { ulErrorFound = pdTRUE; } - + if( xAreGenericQueueTasksStillRunning() != pdPASS ) { ulErrorFound = pdTRUE; } - + if( xAreQueuePeekTasksStillRunning() != pdPASS ) { ulErrorFound = pdTRUE; diff --git a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main.c b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main.c index 06aa07907..fc898ba74 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main.c +++ b/FreeRTOS/Demo/CORTEX_M0+_Atmel_SAMD20_XPlained/RTOSDemo/src/main.c @@ -60,11 +60,11 @@ or 0 to run the more comprehensive test and demo application. */ /*-----------------------------------------------------------*/ /* - * Perform any application specific hardware configuration. + * Perform any application specific hardware configuration. */ static void prvSetupHardware( void ); -/* +/* * Prototypes for the FreeRTOS hook/callback functions. See the comments in * the implementation of each function for more information. */ @@ -180,7 +180,7 @@ void vApplicationTickHook( void ) void vMainConfigureTimerForRunTimeStats( void ) { /* Used by the optional run-time stats gathering functionality. */ - + /* How many clocks are there per tenth of a millisecond? */ ulClocksPer10thOfAMilliSecond = configCPU_CLOCK_HZ / 10000UL; } @@ -205,7 +205,7 @@ const unsigned long ulSysTickPendingBit = 0x04000000UL; /* The SysTick is a down counter. How many clocks have passed since it was last reloaded? */ ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount; - + /* How many times has it overflowed? */ ulTickCount = xTaskGetTickCountFromISR(); @@ -214,28 +214,28 @@ const unsigned long ulSysTickPendingBit = 0x04000000UL; section, and the ISR safe critical sections are not designed to nest, so reset the critical section. */ portSET_INTERRUPT_MASK_FROM_ISR(); - + /* Is there a SysTick interrupt pending? */ if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL ) { /* There is a SysTick interrupt pending, so the SysTick has overflowed but the tick count not yet incremented. */ ulTickCount++; - + /* Read the SysTick again, as the overflow might have occurred since it was read last. */ ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount; - } - + } + /* Convert the tick count into tenths of a millisecond. THIS ASSUMES configTICK_RATE_HZ is 1000! */ ulReturn = ( ulTickCount * 10UL ) ; - + /* Add on the number of tenths of a millisecond that have passed since the tick count last got updated. */ ulReturn += ( ulSysTickCounts / ulClocksPer10thOfAMilliSecond ); - - return ulReturn; + + return ulReturn; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/.project b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/.project index 696d2282b..226716e4f 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/.project +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/.project @@ -55,6 +55,11 @@ 1 PARENT-1-PROJECT_LOC/Common/Minimal/recmutex.c + + FreeRTOS_source/croutine.c + 1 + PARENT-2-PROJECT_LOC/Source/croutine.c + FreeRTOS_source/event_groups.c 1 @@ -110,6 +115,11 @@ 1 PARENT-2-PROJECT_LOC/Source/include/atomic.h + + FreeRTOS_source/include/croutine.h + 1 + PARENT-2-PROJECT_LOC/Source/include/croutine.h + FreeRTOS_source/include/deprecated_definitions.h 1 diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewp b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewp index fcf08ffba..40a7a482e 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewp +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewp @@ -2318,6 +2318,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h @@ -2388,6 +2391,9 @@ + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewt b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewt index e018706ed..f39471c64 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewt +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_IAR.ewt @@ -2573,6 +2573,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h @@ -2643,6 +2646,9 @@ + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvoptx b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvoptx index a099587ac..15f146c56 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvoptx +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvoptx @@ -1074,6 +1074,18 @@ 0 0 0 + + 11 + 66 + 1 + 0 + 0 + 0 + ..\..\Source\croutine.c + croutine.c + 0 + 0 + 11 67 @@ -1158,6 +1170,18 @@ 0 0 + + 11 + 74 + 5 + 0 + 0 + 0 + ..\..\Source\include\croutine.h + croutine.h + 0 + 0 + 11 75 diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvprojx b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvprojx index b76ab6500..c758e267a 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvprojx +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/CORTEX_M0+_LPC51U68_Keil.uvprojx @@ -757,6 +757,11 @@ FreeRTOS_Source + + croutine.c + 1 + ..\..\Source\croutine.c + event_groups.c 1 @@ -792,6 +797,11 @@ 5 ..\..\Source\include\atomic.h + + croutine.h + 5 + ..\..\Source\include\croutine.h + deprecated_definitions.h 5 diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/IAR_specific/RegTest_IAR.s b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/IAR_specific/RegTest_IAR.s index 82074481b..eb92e04c7 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/IAR_specific/RegTest_IAR.s +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/IAR_specific/RegTest_IAR.s @@ -24,7 +24,7 @@ * */ -/* +/* * "Reg test" tasks - These fill the registers with known values, then check * that each register maintains its expected value for the lifetime of the * task. Each task uses a different set of values. The reg test tasks execute @@ -32,7 +32,7 @@ * containing an unexpected value is indicative of an error in the context * switching mechanism. */ - + RSEG CODE:CODE(2) thumb diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/Keil_specific/compiler_attributes.h b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/Keil_specific/compiler_attributes.h index 1403ef611..cd466aec9 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/Keil_specific/compiler_attributes.h +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/Keil_specific/compiler_attributes.h @@ -24,13 +24,13 @@ * */ -/* Placing variable at specified address. -todo: -this is commented out intentionally, as it doesn't seem to work. +/* Placing variable at specified address. +todo: +this is commented out intentionally, as it doesn't seem to work. Clean up is needed*/ -/* Attribute to place the second FreeRTOS heap in another memory bank, if present. +/* Attribute to place the second FreeRTOS heap in another memory bank, if present. This is defined as empty, as the linker file (LPC51U68_flash.scf) provided only - one bank as heap. Could still have two FreeRTOS heap regions, as long as they fit. + one bank as heap. Could still have two FreeRTOS heap regions, as long as they fit. */ #define COMPILER_ATTRIBUTE_PLACE_IN_2ND_MEMORY_BANK diff --git a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/app/main_full.c b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/app/main_full.c index 0f2a70edc..02afdb276 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/app/main_full.c +++ b/FreeRTOS/Demo/CORTEX_M0+_LPC51U68_GCC_IAR_KEIL/app/main_full.c @@ -209,7 +209,7 @@ unsigned long ulErrorFound = pdFALSE; #endif /* mainNO_TASK_NO_CHECK */ #if ( mainNO_TASK_NO_CHECK == 0 ) - + /* Check all the demo and test tasks to ensure that they are all still running, and that none have detected an error. */ if( xAreBlockTimeTestTasksStillRunning() != pdPASS ) diff --git a/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Config/FreeRTOSConfig.h index 038fae3cd..447dc868a 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Config/FreeRTOSConfig.h @@ -70,6 +70,9 @@ #define configTASK_NOTIFICATION_ARRAY_ENTRIES 3 #define configMESSAGE_BUFFER_LENGTH_TYPE size_t +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/GCC/.project b/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/GCC/.project index 2281d91a9..3017f64ee 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/GCC/.project +++ b/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/GCC/.project @@ -84,6 +84,15 @@ 1.0-name-matches-false-false-comtest_strings.c + + 1649345202745 + Demo/Standard_Demos + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-crhook.c + + 1649345202750 Demo/Standard_Demos @@ -93,6 +102,15 @@ 1.0-name-matches-false-false-comtest.c + + 1649345202755 + Demo/Standard_Demos + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-crflash.c + + 1649345202759 Demo/Standard_Demos diff --git a/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/IAR/FreeRTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/IAR/FreeRTOSDemo.ewp index 7113e1a0c..0f4c5a95b 100644 --- a/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/IAR/FreeRTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_M0+_NUCLEO_L010RB_GCC_IAR/Projects/IAR/FreeRTOSDemo.ewp @@ -1192,6 +1192,9 @@ $PROJ_DIR$\..\..\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\..\..\Source\include\deprecated_definitions.h @@ -1265,6 +1268,9 @@ + + $PROJ_DIR$\..\..\..\..\Source\croutine.c + $PROJ_DIR$\..\..\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c index b8c6e1b86..3abe65c1e 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c @@ -24,7 +24,7 @@ * */ -/* +/* * "Reg test" tasks - These fill the registers with known values, then check * that each register maintains its expected value for the lifetime of the * task. Each task uses a different set of values. The reg test tasks execute @@ -32,7 +32,7 @@ * containing an unexpected value is indicative of an error in the context * switching mechanism. */ - + void vRegTest1Task( void ) __attribute__((naked)); void vRegTest2Task( void ) __attribute__((naked)); diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h index 1d4bfe66f..5868a2b5d 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h @@ -68,6 +68,9 @@ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_QUEUE_SETS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s index 82074481b..eb92e04c7 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s @@ -24,7 +24,7 @@ * */ -/* +/* * "Reg test" tasks - These fill the registers with known values, then check * that each register maintains its expected value for the lifetime of the * task. Each task uses a different set of values. The reg test tasks execute @@ -32,7 +32,7 @@ * containing an unexpected value is indicative of an error in the context * switching mechanism. */ - + RSEG CODE:CODE(2) thumb diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1200.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1200.c index 60045cb48..d8fde2051 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1200.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1200.c @@ -39,8 +39,8 @@ #include "partest.h" /* The port bits on which LEDs are connected. */ -static const unsigned long ulLEDBits[] = -{ +static const unsigned long ulLEDBits[] = +{ 1UL << 0, /* P0.0 */ 1UL << 2, /* P0.2 */ 1UL << 5, /* P0.5 */ @@ -60,7 +60,7 @@ perform the desired operation. */ void vParTestInitialise( void ) { /* Configure relevant port P0 to push pull output to drive LEDs. */ - + /* P0.0 */ PORT0->IOCR0 &= ~( ( 0xFFUL << 0 ) ); PORT0->IOCR0 |= ( 0x80UL << 0 ); @@ -94,12 +94,12 @@ void vParTestSetLED( unsigned long ulLED, signed portBASE_TYPE xValue ) { if( xValue == pdTRUE ) { - /* Turn the LED on. */ + /* Turn the LED on. */ PORT0->OMR = ( ulLEDBits[ ulLED ] << partstON_SHIFT ); } else { - /* Turn the LED off. */ + /* Turn the LED off. */ PORT0->OMR = ( ulLEDBits[ ulLED ] << partstOFF_SHIFT ); } } diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c index c770f7908..fc2d2c3ca 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c @@ -39,8 +39,8 @@ #include "partest.h" /* The port bits on which LEDs are connected. */ -static const unsigned long ulLEDBits[] = -{ +static const unsigned long ulLEDBits[] = +{ 1UL << 0, /* P0.0 */ 1UL << 1, /* P0.1 */ 1UL << 6, /* P0.6 */ @@ -60,7 +60,7 @@ perform the desired operation. */ void vParTestInitialise( void ) { /* Configure relevant port P0 to push pull output to drive LEDs. */ - + /* P0.0 */ PORT0->IOCR0 &= ~( ( 0xFFUL << 0 ) ); PORT0->IOCR0 |= ( 0x80UL << 0 ); @@ -94,12 +94,12 @@ void vParTestSetLED( unsigned long ulLED, signed portBASE_TYPE xValue ) { if( xValue == pdTRUE ) { - /* Turn the LED on. */ + /* Turn the LED on. */ PORT0->OMR = ( ulLEDBits[ ulLED ] << partstON_SHIFT ); } else { - /* Turn the LED off. */ + /* Turn the LED off. */ PORT0->OMR = ( ulLEDBits[ ulLED ] << partstOFF_SHIFT ); } } diff --git a/FreeRTOS/Demo/CORTEX_M0_LPC1114_LPCXpresso/RTOSDemo/Source/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M0_LPC1114_LPCXpresso/RTOSDemo/Source/FreeRTOSConfig.h index 51f0c761b..2f6a9f1aa 100644 --- a/FreeRTOS/Demo/CORTEX_M0_LPC1114_LPCXpresso/RTOSDemo/Source/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M0_LPC1114_LPCXpresso/RTOSDemo/Source/FreeRTOSConfig.h @@ -72,6 +72,9 @@ extern uint32_t SystemCoreClock; #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/FreeRTOSConfig.h index d1ed28894..16842cc05 100644 --- a/FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/FreeRTOSConfig.h @@ -67,6 +67,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h index 40836abe0..f95e3a97d 100644 --- a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h @@ -75,8 +75,10 @@ extern void vAssertCalled( const char * pcFileName, #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configMAX_PRIORITIES ( 10 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configTIMER_QUEUE_LENGTH 20 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) #define configUSE_COUNTING_SEMAPHORES 1 diff --git a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/FreeRTOSConfig.h index 593e8144d..a33a6d572 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/FreeRTOSConfig.h @@ -112,6 +112,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/Keil_Specific/RegTest.c b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/Keil_Specific/RegTest.c index bdbfe93d8..9420227f2 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/Keil_Specific/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/Keil_Specific/RegTest.c @@ -32,8 +32,8 @@ * containing an unexpected value is indicative of an error in the context * switching mechanism. */ - - + + __asm void vRegTest1Implementation( void ) { PRESERVE8 @@ -76,7 +76,7 @@ reg1_loop /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #100 bne reg1_error_loopf @@ -157,10 +157,10 @@ reg1_loop bne reg1_error_loopf cmp r1, #107 bne reg1_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass @@ -197,7 +197,7 @@ reg1_loopf_pass bne reg1_error_loop cmp r12, #112 bne reg1_error_loop - + /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter @@ -205,7 +205,7 @@ reg1_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg1_loop @@ -256,11 +256,11 @@ __asm void vRegTest2Implementation( void ) vmov d15, r6, r7 reg2_loop - + /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #-1 bne reg2_error_loopf @@ -341,10 +341,10 @@ reg2_loop bne reg2_error_loopf cmp r1, #7 bne reg2_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass @@ -381,7 +381,7 @@ reg2_loopf_pass bne reg2_error_loop cmp r12, #12 bne reg2_error_loop - + /* Increment the loop counter to indicate this test is still functioning correctly. */ push { r0-r1 } @@ -389,16 +389,16 @@ reg2_loopf_pass ldr r1, [r0] adds r1, r1, #1 str r1, [r0] - + /* Yield to increase test coverage. */ movs r0, #0x01 ldr r1, =0xe000ed04 /*NVIC_INT_CTRL */ lsl r0, r0, #28 /* Shift to PendSV bit */ str r0, [r1] dsb - + pop { r0-r1 } - + /* Start again. */ b reg2_loop diff --git a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/main_full/IntQueueTimer.c b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/main_full/IntQueueTimer.c index 76a850ed1..9b85da820 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/main_full/IntQueueTimer.c +++ b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/main_full/IntQueueTimer.c @@ -74,7 +74,7 @@ timers must still be above the tick interrupt priority. */ #define tmrMEDIUM_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 0 ) #define tmrHIGHER_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY - 1 ) -/* Hardware register locations and bit definitions to enable the btimer +/* Hardware register locations and bit definitions to enable the btimer interrupts. */ #define tmrGIRQ23_ENABLE_SET ( * ( volatile uint32_t * ) 0x4000C130 ) #define tmrGIRQ23_BIT_TIMER0 ( 1UL << 0UL ) diff --git a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_MikroC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_MikroC/FreeRTOSConfig.h index 2011ccc7c..da54c2eac 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_CEC1302_MikroC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_CEC1302_MikroC/FreeRTOSConfig.h @@ -112,6 +112,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M4F_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h index 5cdd03aaf..92c3851a6 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h @@ -92,6 +92,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 0 diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h index d3a5f826d..f70d68fbe 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h @@ -71,6 +71,9 @@ errata. */ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/FreeRTOSConfig.h index bc62ec1a5..ee26f774d 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/FreeRTOSConfig.h @@ -75,6 +75,9 @@ errata. */ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_QUEUE_SETS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/FreeRTOSConfig.h index 25710822b..709a94150 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/FreeRTOSConfig.h @@ -72,6 +72,9 @@ errata. */ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -113,11 +116,11 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - + /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } - +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. WORKAROUND_PMU_CM001 is defined at the top of this file. */ #if WORKAROUND_PMU_CM001 == 1 diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RegTest.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RegTest.c index ab0c37ede..bc1813c11 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RegTest.c @@ -67,7 +67,7 @@ reg1_loop /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #100 bne reg1_error_loopf @@ -148,10 +148,10 @@ reg1_loop bne reg1_error_loopf cmp r1, #107 bne reg1_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass @@ -188,7 +188,7 @@ reg1_loopf_pass bne reg1_error_loop cmp r12, #112 bne reg1_error_loop - + /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter @@ -196,7 +196,7 @@ reg1_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg1_loop @@ -247,11 +247,11 @@ __asm vRegTest2Task( void ) vmov d15, r6, r7 reg2_loop - + /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #-1 bne reg2_error_loopf @@ -332,10 +332,10 @@ reg2_loop bne reg2_error_loopf cmp r1, #7 bne reg2_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass @@ -372,7 +372,7 @@ reg2_loopf_pass bne reg2_error_loop cmp r12, #12 bne reg2_error_loop - + /* Increment the loop counter to indicate this test is still functioning correctly. */ push { r0-r1 } @@ -380,16 +380,16 @@ reg2_loopf_pass ldr r1, [r0] adds r1, r1, #1 str r1, [r0] - + /* Yield to increase test coverage. */ movs r0, #0x01 ldr r1, =0xe000ed04 /*NVIC_INT_CTRL */ lsl r0, r0, #28 /* Shift to PendSV bit */ str r0, [r1] dsb - + pop { r0-r1 } - + /* Start again. */ b reg2_loop @@ -469,7 +469,7 @@ __asm ulRegTestCheckFlopRegistersContainParameterValue( unsigned long ulValue ) vmov r1, s15 cmp r0, r1 bne return_error - + return_pass mov r0, #1 bx lr @@ -479,4 +479,4 @@ return_error bx lr } - + diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/main.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/main.c index faeee5d87..92609f517 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/main.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/main.c @@ -35,9 +35,9 @@ * This file implements the code that is not demo specific, including the * hardware setup and FreeRTOS hook functions. * - * + * * Additional code: - * + * * This demo does not contain a non-kernel interrupt service routine that * can be used as an example for application writers to use as a reference. * Therefore, the framework of a dummy (not installed) handler is provided @@ -65,9 +65,9 @@ or 0 to run the more comprehensive test and demo application. */ */ static void prvSetupHardware( void ); -/* +/* * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1. - * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0. + * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0. */ extern void main_blinky( void ); extern void main_full( void ); @@ -98,7 +98,7 @@ int main( void ) static void prvSetupHardware( void ) { configCONFIGURE_LED(); - + /* Ensure all priority bits are assigned as preemption priority bits. */ NVIC_SetPriorityGrouping( 0 ); } @@ -150,7 +150,7 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) void vApplicationTickHook( void ) { - /* This function will be called by each tick interrupt if + /* This function will be called by each tick interrupt if configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be added here, but the tick hook is called from an interrupt context, so code must not attempt to block, and only the interrupt safe FreeRTOS API @@ -166,19 +166,19 @@ long lHigherPriorityTaskWoken = pdFALSE; /* Clear the interrupt if necessary. */ Dummy_ClearITPendingBit(); - + /* This interrupt does nothing more than demonstrate how to synchronise a task with an interrupt. A semaphore is used for this purpose. Note lHigherPriorityTaskWoken is initialised to zero. */ xSemaphoreGiveFromISR( xTestSemaphore, &lHigherPriorityTaskWoken ); - + /* If there was a task that was blocked on the semaphore, and giving the semaphore caused the task to unblock, and the unblocked task has a priority higher than the current Running state task (the task that this interrupt interrupted), then lHigherPriorityTaskWoken will have been set to pdTRUE - internally within xSemaphoreGiveFromISR(). Passing pdTRUE into the + internally within xSemaphoreGiveFromISR(). Passing pdTRUE into the portEND_SWITCHING_ISR() macro will result in a context switch being pended to - ensure this interrupt returns directly to the unblocked, higher priority, + ensure this interrupt returns directly to the unblocked, higher priority, task. Passing pdFALSE into portEND_SWITCHING_ISR() has no effect. */ portEND_SWITCHING_ISR( lHigherPriorityTaskWoken ); } diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/FreeRTOSConfig.h index 9b1589329..ad8002720 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/FreeRTOSConfig.h @@ -66,6 +66,9 @@ extern uint32_t SystemCoreClock; #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_QUEUE_SETS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -112,7 +115,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ /* Normal assert() semantics without relying on the provision of an assert.h header file. */ #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ) __asm volatile( "NOP" ); } - + /* Demo application specific settings. */ #if defined( PART_XMC4500 ) /* Hardware includes. */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c index 1cbcd91bb..1400b86d1 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c @@ -47,10 +47,10 @@ * that is found on the FreeRTOS.org web site. */ -/* +/* * The following #error directive is to remind users that a batch file must be - * executed prior to this project being built. The batch file *cannot* be - * executed from within the IDE! Once it has been executed, re-open or refresh + * executed prior to this project being built. The batch file *cannot* be + * executed from within the IDE! Once it has been executed, re-open or refresh * the Eclipse project and remove the #error line below. */ #error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above. diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/FreeRTOSConfig.h index 4216d4f16..ab48d59d0 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/FreeRTOSConfig.h @@ -28,10 +28,10 @@ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H -/* +/* * The following #error directive is to remind users that a batch file must be - * executed prior to this project being built. The batch file *cannot* be - * executed from within the IDE! Once it has been executed, re-open or refresh + * executed prior to this project being built. The batch file *cannot* be + * executed from within the IDE! Once it has been executed, re-open or refresh * the Eclipse project and remove the #error line below. */ #error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above. @@ -72,6 +72,9 @@ extern uint32_t SystemCoreClock; #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -113,11 +116,11 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - + /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } - +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ #define vPortSVCHandler SVC_Handler diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main.c index 0ea27935d..2533b196d 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main.c @@ -35,9 +35,9 @@ * This file implements the code that is not demo specific, including the * hardware setup and FreeRTOS hook functions. * - * + * * Additional code: - * + * * This demo does not contain a non-kernel interrupt service routine that * can be used as an example for application writers to use as a reference. * Therefore, the framework of a dummy (not installed) handler is provided @@ -69,9 +69,9 @@ or 0 to run the more comprehensive test and demo application. */ */ static void prvSetupHardware( void ); -/* +/* * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1. - * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0. + * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0. */ extern void main_blinky( void ); extern void main_full( void ); @@ -160,7 +160,7 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) void vApplicationTickHook( void ) { - /* This function will be called by each tick interrupt if + /* This function will be called by each tick interrupt if configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be added here, but the tick hook is called from an interrupt context, so code must not attempt to block, and only the interrupt safe FreeRTOS API @@ -176,19 +176,19 @@ long lHigherPriorityTaskWoken = pdFALSE; /* Clear the interrupt if necessary. */ Dummy_ClearITPendingBit(); - + /* This interrupt does nothing more than demonstrate how to synchronise a task with an interrupt. A semaphore is used for this purpose. Note lHigherPriorityTaskWoken is initialised to zero. */ xSemaphoreGiveFromISR( xTestSemaphore, &lHigherPriorityTaskWoken ); - + /* If there was a task that was blocked on the semaphore, and giving the semaphore caused the task to unblock, and the unblocked task has a priority higher than the current Running state task (the task that this interrupt interrupted), then lHigherPriorityTaskWoken will have been set to pdTRUE - internally within xSemaphoreGiveFromISR(). Passing pdTRUE into the + internally within xSemaphoreGiveFromISR(). Passing pdTRUE into the portEND_SWITCHING_ISR() macro will result in a context switch being pended to - ensure this interrupt returns directly to the unblocked, higher priority, + ensure this interrupt returns directly to the unblocked, higher priority, task. Passing pdFALSE into portEND_SWITCHING_ISR() has no effect. */ portEND_SWITCHING_ISR( lHigherPriorityTaskWoken ); } diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main_full.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main_full.c index 217f07ac1..f27a01f3b 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main_full.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/main_full.c @@ -37,8 +37,8 @@ ****************************************************************************** * * main_full() creates all the demo application tasks and a software timer, then - * starts the scheduler. The web documentation provides more details of the - * standard demo application tasks, which provide no particular functionality, + * starts the scheduler. The web documentation provides more details of the + * standard demo application tasks, which provide no particular functionality, * but do provide a good example of how to use the FreeRTOS API. * * In addition to the standard demo tasks, the following tasks and tests are @@ -155,7 +155,7 @@ TimerHandle_t xCheckTimer = NULL; vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); vStartMathTasks( mainFLOP_TASK_PRIORITY ); - + /* Create the register check tasks, as described at the top of this file */ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL ); @@ -168,27 +168,27 @@ TimerHandle_t xCheckTimer = NULL; pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */ ( void * ) 0, /* The ID is not used, so can be set to anything. */ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */ - ); - + ); + if( xCheckTimer != NULL ) { xTimerStart( xCheckTimer, mainDONT_BLOCK ); } - /* The set of tasks created by the following function call have to be - created last as they keep account of the number of tasks they expect to see + /* The set of tasks created by the following function call have to be + created last as they keep account of the number of tasks they expect to see running. */ vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY ); /* Start the scheduler. */ vTaskStartScheduler(); - + /* If all is well, the scheduler will now be running, and the following line will never be reached. If the following line does execute, then there was insufficient FreeRTOS heap memory available for the idle and/or timer tasks to be created. See the memory management section on the FreeRTOS web site for more details. */ - for( ;; ); + for( ;; ); } /*-----------------------------------------------------------*/ @@ -250,7 +250,7 @@ unsigned long ulErrorFound = pdFALSE; { ulErrorFound = pdTRUE; } - + /* Check that the register test 1 task is still running. */ if( ulLastRegTest1Value == ulRegTest1LoopCounter ) { @@ -268,8 +268,8 @@ unsigned long ulErrorFound = pdFALSE; /* Toggle the check LED to give an indication of the system status. If the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then everything is ok. A faster toggle indicates an error. */ - mainTOGGLE_LED(); - + mainTOGGLE_LED(); + /* Have any errors been latch in ulErrorFound? If so, shorten the period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds. This will result in an increase in the rate at which mainCHECK_LED @@ -279,7 +279,7 @@ unsigned long ulErrorFound = pdFALSE; if( lChangedTimerPeriodAlready == pdFALSE ) { lChangedTimerPeriodAlready = pdTRUE; - + /* This call to xTimerChangePeriod() uses a zero block time. Functions called from inside of a timer callback function must *never* attempt to block. */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/FreeRTOSConfig.h index 61902d538..a6b183c4b 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/FreeRTOSConfig.h @@ -64,6 +64,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. This example uses I2C to write to the LEDs. As this takes a finite time, and because a timer callback writes to an LED, the @@ -108,11 +111,11 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - + /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } - +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ #define vPortSVCHandler SVC_Handler diff --git a/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/RegTest.c b/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/RegTest.c index 49da4cf54..d77cd279e 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M4F_M0_LPC43xx_Keil/M4/RegTest.c @@ -67,7 +67,7 @@ reg1_loop /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #100 bne reg1_error_loopf @@ -148,10 +148,10 @@ reg1_loop bne reg1_error_loopf cmp r1, #107 bne reg1_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass @@ -188,7 +188,7 @@ reg1_loopf_pass bne reg1_error_loop cmp r12, #112 bne reg1_error_loop - + /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter @@ -196,7 +196,7 @@ reg1_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg1_loop @@ -247,11 +247,11 @@ __asm vRegTest2Task( void ) vmov d15, r6, r7 reg2_loop - + /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #-1 bne reg2_error_loopf @@ -332,10 +332,10 @@ reg2_loop bne reg2_error_loopf cmp r1, #7 bne reg2_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass @@ -372,7 +372,7 @@ reg2_loopf_pass bne reg2_error_loop cmp r12, #12 bne reg2_error_loop - + /* Increment the loop counter to indicate this test is still functioning correctly. */ push { r0-r1 } @@ -381,7 +381,7 @@ reg2_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg2_loop @@ -462,7 +462,7 @@ __asm ulRegTestCheckFlopRegistersContainParameterValue( unsigned long ulValue ) vmov r1, s15 cmp r0, r1 bne return_error - + return_pass mov r0, #1 bx lr @@ -472,4 +472,4 @@ return_error bx lr } - + diff --git a/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/FreeRTOSConfig.h index 6bcdaddbe..a3f89533b 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/FreeRTOSConfig.h @@ -84,6 +84,7 @@ in main.c. */ #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/Full_Demo/RegTest.c b/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/Full_Demo/RegTest.c index a49cf79e7..9bf2730e5 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/Full_Demo/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/Full_Demo/RegTest.c @@ -67,7 +67,7 @@ reg1_loop /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #100 bne reg1_error_loopf @@ -148,10 +148,10 @@ reg1_loop bne reg1_error_loopf cmp r1, #107 bne reg1_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass @@ -188,7 +188,7 @@ reg1_loopf_pass bne reg1_error_loop cmp r12, #112 bne reg1_error_loop - + /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter @@ -196,7 +196,7 @@ reg1_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg1_loop @@ -247,11 +247,11 @@ __asm void vRegTest2Implementation( void ) vmov d15, r6, r7 reg2_loop - + /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #-1 bne reg2_error_loopf @@ -332,10 +332,10 @@ reg2_loop bne reg2_error_loopf cmp r1, #7 bne reg2_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass @@ -372,7 +372,7 @@ reg2_loopf_pass bne reg2_error_loop cmp r12, #12 bne reg2_error_loop - + /* Increment the loop counter to indicate this test is still functioning correctly. */ push { r0-r1 } @@ -380,16 +380,16 @@ reg2_loopf_pass ldr r1, [r0] adds r1, r1, #1 str r1, [r0] - + /* Yield to increase test coverage. */ movs r0, #0x01 ldr r1, =0xe000ed04 /*NVIC_INT_CTRL */ lsl r0, r0, #28 /* Shift to PendSV bit */ str r0, [r1] dsb - + pop { r0-r1 } - + /* Start again. */ b reg2_loop @@ -469,7 +469,7 @@ __asm void ulRegTestCheckFlopRegistersContainParameterValue( unsigned long ulVal vmov r1, s15 cmp r0, r1 bne return_error - + return_pass mov r0, #1 bx lr @@ -479,4 +479,4 @@ return_error bx lr } - + diff --git a/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/FreeRTOSConfig.h index c184243f2..7ce23d402 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/FreeRTOSConfig.h @@ -67,6 +67,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -108,11 +111,11 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - + /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } - +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ #define vPortSVCHandler SVC_Handler diff --git a/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/RegTest.s b/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/RegTest.s index dd519cb3e..b1e39e45b 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/RegTest.s +++ b/FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/RegTest.s @@ -37,7 +37,7 @@ PUBLIC vRegTest2Task PUBLIC vRegTestClearFlopRegistersToParameterValue PUBLIC ulRegTestCheckFlopRegistersContainParameterValue - + /*-----------------------------------------------------------*/ vRegTest1Task @@ -79,7 +79,7 @@ reg1_loop: /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #100 bne reg1_error_loopf @@ -160,10 +160,10 @@ reg1_loop: bne reg1_error_loopf cmp r1, #107 bne reg1_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass @@ -200,7 +200,7 @@ reg1_loopf_pass bne reg1_error_loop cmp r12, #112 bne reg1_error_loop - + /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter @@ -208,7 +208,7 @@ reg1_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg1_loop @@ -256,11 +256,11 @@ vRegTest2Task vmov d15, r6, r7 reg2_loop: - + /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #-1 bne reg2_error_loopf @@ -341,10 +341,10 @@ reg2_loop: bne reg2_error_loopf cmp r1, #7 bne reg2_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass @@ -381,7 +381,7 @@ reg2_loopf_pass bne reg2_error_loop cmp r12, #12 bne reg2_error_loop - + /* Increment the loop counter to indicate this test is still functioning correctly. */ push { r0-r1 } @@ -390,7 +390,7 @@ reg2_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg2_loop @@ -466,7 +466,7 @@ ulRegTestCheckFlopRegistersContainParameterValue vmov r1, s15 cmp r0, r1 bne return_error - + return_pass mov r0, #1 bx lr @@ -476,4 +476,4 @@ return_error bx lr END - + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj index dff66b064..ea65cfc6b 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj @@ -120,6 +120,7 @@ + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h index c1f2e68d4..0a67d27f9 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h @@ -75,6 +75,9 @@ or 0 to run the more comprehensive test and demo application. */ #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c index ab24217a5..6e67891e6 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c @@ -106,10 +106,10 @@ static void prvButtonISR( void ) { /* The button doesn't do anything other than providing a means for brining the MCU out of sleep mode early. */ - if( eic_line_interrupt_is_pending( EIC, GPIO_PUSH_BUTTON_EIC_LINE ) ) + if( eic_line_interrupt_is_pending( EIC, GPIO_PUSH_BUTTON_EIC_LINE ) ) { eic_line_clear_interrupt( EIC, GPIO_PUSH_BUTTON_EIC_LINE ); - } + } } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.cproj b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.cproj index b25983864..daf4a9e43 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.cproj +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.cproj @@ -508,6 +508,9 @@ compile + + compile + compile diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h index 000b4aef5..2c7134c8d 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/Common-Demo-Source/include/demo_serial.h @@ -30,58 +30,58 @@ typedef void * xComPortHandle; typedef enum -{ - serCOM1, - serCOM2, - serCOM3, - serCOM4, - serCOM5, - serCOM6, - serCOM7, - serCOM8 +{ + serCOM1, + serCOM2, + serCOM3, + serCOM4, + serCOM5, + serCOM6, + serCOM7, + serCOM8 } eCOMPort; -typedef enum -{ - serNO_PARITY, - serODD_PARITY, - serEVEN_PARITY, - serMARK_PARITY, - serSPACE_PARITY +typedef enum +{ + serNO_PARITY, + serODD_PARITY, + serEVEN_PARITY, + serMARK_PARITY, + serSPACE_PARITY } eParity; -typedef enum -{ - serSTOP_1, - serSTOP_2 +typedef enum +{ + serSTOP_1, + serSTOP_2 } eStopBits; -typedef enum -{ - serBITS_5, - serBITS_6, - serBITS_7, - serBITS_8 +typedef enum +{ + serBITS_5, + serBITS_6, + serBITS_7, + serBITS_8 } eDataBits; -typedef enum -{ - ser50, - ser75, - ser110, - ser134, - ser150, +typedef enum +{ + ser50, + ser75, + ser110, + ser134, + ser150, ser200, - ser300, - ser600, - ser1200, - ser1800, - ser2400, + ser300, + ser600, + ser1200, + ser1800, + ser2400, ser4800, - ser9600, - ser19200, - ser38400, - ser57600, + ser9600, + ser19200, + ser38400, + ser57600, ser115200 } eBaud; diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h index 5a8dd1926..c572d38d4 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h @@ -73,6 +73,9 @@ extern uint32_t SystemCoreClock; #define configUSE_QUEUE_SETS 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/IntQueueTimer.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/IntQueueTimer.c index 4550d6e18..d67a31a72 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/IntQueueTimer.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/IntQueueTimer.c @@ -91,22 +91,22 @@ uint32_t ulInputFrequency; ulInputFrequency = configCPU_CLOCK_HZ; ulInputFrequency /= trmDIVIDER; - /* Three channels are used - two that run at or under + /* Three channels are used - two that run at or under configMAX_SYSCALL_INTERRUPT_PRIORITY, and one that runs over configMAX_SYSCALL_INTERRUPT_PRIORITY. */ sysclk_enable_peripheral_clock( ID_TC0 ); sysclk_enable_peripheral_clock( ID_TC1 ); sysclk_enable_peripheral_clock( ID_TC2 ); - + /* Init TC channels to waveform mode - up mode clean on RC match. */ tc_init( TC0, tmrTIMER_0_CHANNEL, TC_CMR_TCCLKS_TIMER_CLOCK4 | TC_CMR_WAVE | TC_CMR_ACPC_CLEAR | TC_CMR_CPCTRG ); tc_init( TC0, tmrTIMER_1_CHANNEL, TC_CMR_TCCLKS_TIMER_CLOCK4 | TC_CMR_WAVE | TC_CMR_ACPC_CLEAR | TC_CMR_CPCTRG ); tc_init( TC0, tmrTIMER_2_CHANNEL, TC_CMR_TCCLKS_TIMER_CLOCK4 | TC_CMR_WAVE | TC_CMR_ACPC_CLEAR | TC_CMR_CPCTRG ); - + tc_enable_interrupt( TC0, tmrTIMER_0_CHANNEL, tmrTRIGGER_ON_RC ); tc_enable_interrupt( TC0, tmrTIMER_1_CHANNEL, tmrTRIGGER_ON_RC ); tc_enable_interrupt( TC0, tmrTIMER_2_CHANNEL, tmrTRIGGER_ON_RC ); - + tc_write_rc( TC0, tmrTIMER_0_CHANNEL, ( ulInputFrequency / tmrTIMER_0_FREQUENCY ) ); tc_write_rc( TC0, tmrTIMER_1_CHANNEL, ( ulInputFrequency / tmrTIMER_1_FREQUENCY ) ); tc_write_rc( TC0, tmrTIMER_2_CHANNEL, ( ulInputFrequency / tmrTIMER_2_FREQUENCY ) ); @@ -131,7 +131,7 @@ void TC0_Handler( void ) caused by a compare on RC? */ if( ( tc_get_status( TC0, tmrTIMER_0_CHANNEL ) & ~TC_SR_CPCS ) != 0 ) { - portYIELD_FROM_ISR( xFirstTimerHandler() ); + portYIELD_FROM_ISR( xFirstTimerHandler() ); } } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/ParTest.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/ParTest.c index 8134a6455..e41bc54b8 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/ParTest.c @@ -50,7 +50,7 @@ the power LED. */ #define partstsINVERTED_LED ( 0UL ) /* The index of the pins to which the LEDs are connected. The ordering of the -LEDs in this array is intentional and matches the order they appear on the +LEDs in this array is intentional and matches the order they appear on the hardware. */ static const uint32_t ulLED[] = { LED2_GPIO, LED0_GPIO, LED1_GPIO }; @@ -70,14 +70,14 @@ unsigned long ul; /*-----------------------------------------------------------*/ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) -{ +{ if( uxLED < partestNUM_LEDS ) { if( uxLED == partstsINVERTED_LED ) { - xValue = !xValue; + xValue = !xValue; } - + if( xValue != pdFALSE ) { /* Turn the LED on. */ @@ -105,12 +105,12 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) if( uxLED < partestNUM_LEDS ) { taskENTER_CRITICAL(); - { + { gpio_toggle_pin( ulLED[ uxLED ] ); } - taskEXIT_CRITICAL(); + taskEXIT_CRITICAL(); } } - + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c index f606f4548..a5f5650fc 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c @@ -141,11 +141,11 @@ void vApplicationIdleHook( void ) important that vApplicationIdleHook() is permitted to return to its calling function, because it is the responsibility of the idle task to clean up memory allocated by the kernel to any task that has since been deleted. */ - + #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 ) { extern void vFullDemoIdleHook( void ); - + vFullDemoIdleHook(); } #endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */ @@ -176,7 +176,7 @@ void vApplicationTickHook( void ) #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 ) { extern void vFullDemoTickHook( void ); - + vFullDemoTickHook(); } #endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main_full.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main_full.c index 61cbc796e..9bc65b72a 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main_full.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main_full.c @@ -260,27 +260,27 @@ unsigned long ulErrorFound = pdFALSE; { ulErrorFound |= 1UL << 11UL; } - + if( xAreTaskNotificationTasksStillRunning() != pdTRUE ) { ulErrorFound |= 1UL << 12UL; } - + if( xAreTimerDemoTasksStillRunning( mainCHECK_TIMER_PERIOD_MS ) != pdTRUE ) { ulErrorFound |= 1UL << 13UL; } - + if( xAreEventGroupTasksStillRunning() != pdTRUE ) { ulErrorFound |= 1UL << 14UL; } - + if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE ) { ulErrorFound |= 1UL << 15UL; } - + /* Toggle the check LED to give an indication of the system status. If the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then @@ -309,10 +309,10 @@ unsigned long ulErrorFound = pdFALSE; void vFullDemoIdleHook( void ) { static TimerHandle_t xCheckTimer = NULL; - + if( xCheckTimer == NULL ) { - /* Create the software timer that performs the 'check' + /* Create the software timer that performs the 'check' functionality, in the full demo. This is not done before the scheduler is started as to do so would prevent the standard demo timer tasks from passing their tests (they expect the timer @@ -328,7 +328,7 @@ static TimerHandle_t xCheckTimer = NULL; { xTimerStart( xCheckTimer, mainDONT_BLOCK ); } - + /* Also start some timers that just flash LEDs. */ vStartLEDFlashTimers( mainNUMBER_OF_FLASH_TIMERS_LEDS ); } @@ -339,16 +339,16 @@ void vFullDemoTickHook( void ) { /* In this case the tick hook is used as part of the queue set test. */ vQueueSetAccessQueueSetFromISR(); - + /* Use task notifications from an interrupt. */ xNotifyTaskFromISR(); - + /* Use timers from an interrupt. */ vTimerPeriodicISRTests(); - + /* Use event groups from an interrupt. */ vPeriodicEventGroupsProcessing(); - + /* Use mutexes from interrupts. */ vInterruptSemaphorePeriodicTest(); } diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/serial.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/serial.c index 4a56a7c17..19db7df9f 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/serial.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/serial.c @@ -26,13 +26,13 @@ /* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART1. - + ***Note*** This example uses queues to send each character into an interrupt service routine and out of an interrupt service routine individually. This is done to demonstrate queues being used in an interrupt, and to deliberately - load the system to test the FreeRTOS port. It is *NOT* meant to be an + load the system to test the FreeRTOS port. It is *NOT* meant to be an example of an efficient implementation. An efficient implementation should - use FIFO's or DMA if available, and only use FreeRTOS API functions when + use FIFO's or DMA if available, and only use FreeRTOS API functions when enough has been received to warrant a task being unblocked to process the data. */ @@ -78,20 +78,20 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port { uint32_t ulChar; xComPortHandle xReturn; -const sam_usart_opt_t xUSARTSettings = +const sam_usart_opt_t xUSARTSettings = { ulWantedBaud, US_MR_CHRL_8_BIT, US_MR_PAR_NO, US_MR_NBSTOP_1_BIT, - US_MR_CHMODE_NORMAL, + US_MR_CHMODE_NORMAL, 0 /* Only used in IrDA mode. */ }; /* Create the queues used to hold Rx/Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - + /* If the queues were created correctly then setup the serial port hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) @@ -108,10 +108,10 @@ const sam_usart_opt_t xUSARTSettings = /* Enable the receiver and transmitter. */ usart_enable_tx( serUSART_PORT ); usart_enable_rx( serUSART_PORT ); - + /* Clear any characters before enabling interrupt. */ usart_getchar( serUSART_PORT, &ulChar ); - + /* Enable Rx end interrupt. */ usart_enable_interrupt( serUSART_PORT, US_IER_RXRDY ); @@ -165,7 +165,7 @@ signed char *pxNext; /* Send each character in the string, one at a time. */ pxNext = ( signed char * ) pcString; while( *pxNext ) - { + { xSerialPutChar( pxPort, *pxNext, serNO_BLOCK ); pxNext++; } @@ -200,12 +200,12 @@ void vSerialClose( xComPortHandle xPort ) } /*-----------------------------------------------------------*/ -/* - * It should be noted that the com test tasks (which use make use of this file) - * are included to demonstrate queues being used to communicate between tasks - * and interrupts, and to demonstrate a context switch being performed from - * inside an interrupt service routine. The serial driver used here is *not* - * intended to represent an efficient implementation. Real applications should +/* + * It should be noted that the com test tasks (which use make use of this file) + * are included to demonstrate queues being used to communicate between tasks + * and interrupts, and to demonstrate a context switch being performed from + * inside an interrupt service routine. The serial driver used here is *not* + * intended to represent an efficient implementation. Real applications should * make use of the USARTS peripheral DMA channel (PDC). */ void USART1_Handler( void ) @@ -221,7 +221,7 @@ uint32_t ulUSARTStatus, ulUSARTMask; if( ( ulUSARTStatus & US_CSR_TXRDY ) != 0UL ) { - /* The interrupt was caused by the TX register becoming empty. Are + /* The interrupt was caused by the TX register becoming empty. Are there any more characters to transmit? */ if( xQueueReceiveFromISR( xCharsForTx, &ucChar, &xHigherPriorityTaskWoken ) == pdTRUE ) { @@ -231,10 +231,10 @@ uint32_t ulUSARTStatus, ulUSARTMask; } else { - usart_disable_interrupt( serUSART_PORT, US_IER_TXRDY ); - } + usart_disable_interrupt( serUSART_PORT, US_IER_TXRDY ); + } } - + if( ( ulUSARTStatus & US_CSR_RXRDY ) != 0UL ) { /* A character has been received on the USART, send it to the Rx @@ -242,13 +242,13 @@ uint32_t ulUSARTStatus, ulUSARTMask; usart_getchar( serUSART_PORT, &ulChar ); ucChar = ( uint8_t ) ( ulChar & 0xffUL ); xQueueSendFromISR( xRxedChars, &ucChar, &xHigherPriorityTaskWoken ); - } + } /* If sending or receiving from a queue has caused a task to unblock, and - the unblocked task has a priority equal to or higher than the currently - running task (the task this ISR interrupted), then xHigherPriorityTaskWoken - will have automatically been set to pdTRUE within the queue send or receive - function. portEND_SWITCHING_ISR() will then ensure that this ISR returns + the unblocked task has a priority equal to or higher than the currently + running task (the task this ISR interrupted), then xHigherPriorityTaskWoken + will have automatically been set to pdTRUE within the queue send or receive + function. portEND_SWITCHING_ISR() will then ensure that this ISR returns directly to the higher priority unblocked task. */ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } @@ -257,4 +257,4 @@ uint32_t ulUSARTStatus, ulUSARTMask; - + diff --git a/FreeRTOS/Demo/CORTEX_M4_SimpleLink_CC3220SF_CCS/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4_SimpleLink_CC3220SF_CCS/FreeRTOSConfig.h index 3f9bd3498..da995a418 100644 --- a/FreeRTOS/Demo/CORTEX_M4_SimpleLink_CC3220SF_CCS/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4_SimpleLink_CC3220SF_CCS/FreeRTOSConfig.h @@ -92,6 +92,7 @@ in main.c. */ #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM4/include/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM4/include/FreeRTOSConfig.h index 86bfe3877..b7fae017d 100644 --- a/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM4/include/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM4/include/FreeRTOSConfig.h @@ -68,6 +68,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 0 diff --git a/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM7/include/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM7/include/FreeRTOSConfig.h index 3e355fb22..b29497510 100644 --- a/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM7/include/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/CM7/include/FreeRTOSConfig.h @@ -69,6 +69,9 @@ #define configGENERATE_RUN_TIME_STATS 0 #define configSUPPORT_STATIC_ALLOCATION 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 0 diff --git a/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/MessageBufferLocations.h b/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/MessageBufferLocations.h index 8e1dcc951..2d76c3072 100644 --- a/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/MessageBufferLocations.h +++ b/FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/MessageBufferLocations.h @@ -10,7 +10,8 @@ * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * copies or substantial portions of the Software. If you wish to use our Amazon + * FreeRTOS name, please do so in a fair use way that does not cause confusion. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS diff --git a/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/FreeRTOSConfig.h index c1129bf85..4eddd07c8 100644 --- a/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/FreeRTOSConfig.h @@ -79,6 +79,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -128,7 +131,7 @@ header file. */ #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS -standard names. Defining the constants removes the need to edit the vector +standard names. Defining the constants removes the need to edit the vector table in order to install the RTOS interrupt handlers. */ #define xPortPendSVHandler PendSV_Handler #define vPortSVCHandler SVC_Handler diff --git a/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/main.c b/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/main.c index 0bb7bd47d..25b87554b 100644 --- a/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/main.c +++ b/FreeRTOS/Demo/CORTEX_M7_SAME70_Xplained_AtmelStudio/src/main.c @@ -158,10 +158,10 @@ void vApplicationTickHook( void ) #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 ) { extern void vFullDemoTickHook( void ); - + /* The full demo includes some tests that execute in an interrupt context, and the tick hook is used for this purpose. */ - vFullDemoTickHook(); + vFullDemoTickHook(); } #endif } @@ -349,7 +349,7 @@ static void ProcessButtonEvt(uint8_t uc_button) } } // [main_button1_evnt_process] -#ifdef LED1_GPIO +#ifdef LED1_GPIO else { // [main_button2_evnt_process] g_b_led1_active = !g_b_led1_active; @@ -402,7 +402,7 @@ static void Button1_Handler(uint32_t id, uint32_t mask) * * Handle process led2 status change. */ -// [main_button2_handler] +// [main_button2_handler] static void Button2_Handler(uint32_t id, uint32_t mask) { if (PIN_PUSHBUTTON_2_ID == id && PIN_PUSHBUTTON_2_MASK == mask) { diff --git a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_AtmelStudio/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_AtmelStudio/FreeRTOSConfig.h index 55391cc85..5ab825a02 100644 --- a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_AtmelStudio/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_AtmelStudio/FreeRTOSConfig.h @@ -83,6 +83,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/FreeRTOSConfig.h index 55391cc85..5ab825a02 100644 --- a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/FreeRTOSConfig.h @@ -83,6 +83,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/IntQueueTimer.c b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/IntQueueTimer.c index d35bdcd6c..74df398b8 100644 --- a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/IntQueueTimer.c +++ b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/IntQueueTimer.c @@ -103,18 +103,18 @@ const uint32_t ulDivider = 128UL, ulTCCLKS = 3UL; TC0->TC_CHANNEL[ tmrTC0_CHANNEL_1 ].TC_RC = ( configCPU_CLOCK_HZ / 2 ) / ( tmrTIMER_1_FREQUENCY * ulDivider ); TC0->TC_CHANNEL[ tmrTC0_CHANNEL_1 ].TC_IER = TC_IER_CPCS; - /* Configure and enable TC0 interrupt on RC compare. */ + /* Configure and enable TC0 interrupt on RC compare. */ NVIC_SetPriority( TC0_IRQn, tmrLOWER_PRIORITY ); NVIC_ClearPendingIRQ( TC0_IRQn ); NVIC_EnableIRQ( TC0_IRQn ); - + /* Configure TC1 channel 0 tmrTIMER_2_FREQUENCY frequency and trigger on RC compare. This is the very high frequency timer. */ TC_Configure( TC1, tmrTC1_CHANNEL_0, ulTCCLKS | TC_CMR_CPCTRG ); TC1->TC_CHANNEL[ tmrTC1_CHANNEL_0 ].TC_RC = ( configCPU_CLOCK_HZ / 2 ) / ( tmrTIMER_2_FREQUENCY * ulDivider ); TC1->TC_CHANNEL[ tmrTC1_CHANNEL_0 ].TC_IER = TC_IER_CPCS; - /* Configure and enable TC1 interrupt on RC compare */ + /* Configure and enable TC1 interrupt on RC compare */ // NVIC_SetPriority( TC1_IRQn, tmrHIGHER_PRIORITY ); // NVIC_ClearPendingIRQ( TC1_IRQn ); // NVIC_EnableIRQ( TC1_IRQn ); @@ -153,8 +153,8 @@ volatile uint32_t ulDummy; /* Keep a count of the number of interrupts to use as a time base for the run-time stats. */ ulHighFrequencyTimerCounts++; - - /* Prevent compiler warnings about the variable being set but then + + /* Prevent compiler warnings about the variable being set but then unused. */ ( void ) ulDummy; } diff --git a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/RegTest.c b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/RegTest.c index 3c6da8398..c0c7ed28a 100644 --- a/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained_IAR_Keil/Full_Demo/RegTest.c @@ -66,7 +66,7 @@ reg1_loop /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #100 bne reg1_error_loopf @@ -147,10 +147,10 @@ reg1_loop bne reg1_error_loopf cmp r1, #107 bne reg1_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass @@ -187,7 +187,7 @@ reg1_loopf_pass bne reg1_error_loop cmp r12, #112 bne reg1_error_loop - + /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter @@ -195,7 +195,7 @@ reg1_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg1_loop @@ -246,11 +246,11 @@ __asm void vRegTest2Implementation( void ) vmov d15, r6, r7 reg2_loop - + /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #-1 bne reg2_error_loopf @@ -331,10 +331,10 @@ reg2_loop bne reg2_error_loopf cmp r1, #7 bne reg2_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass @@ -371,7 +371,7 @@ reg2_loopf_pass bne reg2_error_loop cmp r12, #12 bne reg2_error_loop - + /* Increment the loop counter to indicate this test is still functioning correctly. */ push { r0-r1 } @@ -379,16 +379,16 @@ reg2_loopf_pass ldr r1, [r0] adds r1, r1, #1 str r1, [r0] - + /* Yield to increase test coverage. */ movs r0, #0x01 ldr r1, =0xe000ed04 /*NVIC_INT_CTRL */ lsl r0, r0, #28 /* Shift to PendSV bit */ str r0, [r1] dsb - + pop { r0-r1 } - + /* Start again. */ b reg2_loop diff --git a/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/FreeRTOSConfig.h index f5f93cd33..8ed50eab3 100644 --- a/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/FreeRTOSConfig.h @@ -76,6 +76,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/Full_Demo/RegTest_Keil.c b/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/Full_Demo/RegTest_Keil.c index 3c6da8398..c0c7ed28a 100644 --- a/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/Full_Demo/RegTest_Keil.c +++ b/FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/Full_Demo/RegTest_Keil.c @@ -66,7 +66,7 @@ reg1_loop /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #100 bne reg1_error_loopf @@ -147,10 +147,10 @@ reg1_loop bne reg1_error_loopf cmp r1, #107 bne reg1_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass @@ -187,7 +187,7 @@ reg1_loopf_pass bne reg1_error_loop cmp r12, #112 bne reg1_error_loop - + /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter @@ -195,7 +195,7 @@ reg1_loopf_pass adds r1, r1, #1 str r1, [r0] pop { r0-r1 } - + /* Start again. */ b reg1_loop @@ -246,11 +246,11 @@ __asm void vRegTest2Implementation( void ) vmov d15, r6, r7 reg2_loop - + /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } - + vmov r0, r1, d0 cmp r0, #-1 bne reg2_error_loopf @@ -331,10 +331,10 @@ reg2_loop bne reg2_error_loopf cmp r1, #7 bne reg2_error_loopf - + /* Restore the registers that were clobbered by the test. */ pop {r0-r1} - + /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass @@ -371,7 +371,7 @@ reg2_loopf_pass bne reg2_error_loop cmp r12, #12 bne reg2_error_loop - + /* Increment the loop counter to indicate this test is still functioning correctly. */ push { r0-r1 } @@ -379,16 +379,16 @@ reg2_loopf_pass ldr r1, [r0] adds r1, r1, #1 str r1, [r0] - + /* Yield to increase test coverage. */ movs r0, #0x01 ldr r1, =0xe000ed04 /*NVIC_INT_CTRL */ lsl r0, r0, #28 /* Shift to PendSV bit */ str r0, [r1] dsb - + pop { r0-r1 } - + /* Start again. */ b reg2_loop diff --git a/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/FreeRTOSConfig.h index 1d06155d8..222259642 100644 --- a/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/FreeRTOSConfig.h @@ -68,6 +68,9 @@ assembly files that include this header file. */ #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -101,9 +104,9 @@ to exclude the API function. */ /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } - + +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + #define vPortSVCHandler SVC_Handler #define xPortPendSVHandler PendSV_Handler #define vPortSVCHandler SVC_Handler diff --git a/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/ParTest.c b/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/ParTest.c index 133f55700..0f3a46136 100644 --- a/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/ParTest.c @@ -48,7 +48,7 @@ void vParTestInitialise( void ) /* Set to output. */ FM3_GPIO->DDR1 |= 0xFFFF; FM3_GPIO->DDR3 |= 0xFFFF; - + /* Set as GPIO. */ FM3_GPIO->PFR1 &= 0x0000; FM3_GPIO->PFR3 &= 0x0000; diff --git a/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/serial.c b/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/serial.c index 842701e9a..b7b18094d 100644 --- a/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/serial.c +++ b/FreeRTOS/Demo/CORTEX_MB9A310_IAR_Keil/serial.c @@ -26,7 +26,7 @@ /* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. - + ***Note*** This example uses queues to send each character into an interrupt service routine and out of an interrupt service routine individually. This is done to demonstrate queues being used in an interrupt, and to deliberately @@ -81,7 +81,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port /* Create the queues used to hold Rx/Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - + /* If the queues were created correctly then setup the serial port hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) @@ -89,41 +89,41 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port /* Ensure interrupts don't fire during the init process. Interrupts will be enabled automatically when the first task start running. */ portDISABLE_INTERRUPTS(); - + /* Configure P21 and P22 for use by the UART. */ FM3_GPIO->PFR2 |= ( 1 << 0x01 ) | ( 1 << 0x02 ); - + /* SIN0_0 and SOT0_0. */ FM3_GPIO->EPFR07 |= ( 1 << 6 ); - + /* Reset. */ FM3_MFS0_UART->SCR = 0x80; - + /* Enable output in mode 0. */ FM3_MFS0_UART->SMR = 0x01; - + /* Clear all errors that may already be present. */ FM3_MFS0_UART->SSR = 0x00; FM3_MFS0_UART->ESCR = 0x00; - + FM3_MFS0_UART->BGR = ( configCPU_CLOCK_HZ / 2UL ) / ( ulWantedBaud - 1UL ); - /* Enable Rx, Tx, and the Rx interrupt. */ + /* Enable Rx, Tx, and the Rx interrupt. */ FM3_MFS0_UART->SCR |= ( serRX_ENABLE | serTX_ENABLE | serRX_INT_ENABLE ); - + /* Configure the NVIC for UART interrupts. */ NVIC_ClearPendingIRQ( MFS0RX_IRQn ); NVIC_EnableIRQ( MFS0RX_IRQn ); - + /* The priority *MUST* be at or below configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY as FreeRTOS API functions are called in the interrupt handler. */ NVIC_SetPriority( MFS0RX_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); - + /* Do the same for the Tx interrupts. */ NVIC_ClearPendingIRQ( MFS0TX_IRQn ); NVIC_EnableIRQ( MFS0TX_IRQn ); - + /* The priority *MUST* be at or below configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY as FreeRTOS API functions are called in the interrupt handler. */ @@ -185,7 +185,7 @@ signed portBASE_TYPE xReturn; if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) == pdPASS ) { xReturn = pdPASS; - + /* Enable the UART Tx interrupt. */ FM3_MFS0_UART->SCR |= serTX_INT_ENABLE; } @@ -221,7 +221,7 @@ char cChar; handler task. */ cChar = FM3_MFS0_UART->RDR; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - } + } /* If sending or receiving from a queue has caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently @@ -252,8 +252,8 @@ char cChar; { /* Disable the Tx interrupt. */ FM3_MFS0_UART->SCR &= ~serTX_INT_ENABLE; - } - } + } + } /* If sending or receiving from a queue has caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently @@ -268,4 +268,4 @@ char cChar; - + diff --git a/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/FreeRTOSConfig.h index 2c4160562..414af4167 100644 --- a/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/FreeRTOSConfig.h @@ -68,6 +68,9 @@ assembly files that include this header file. */ #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/ParTest.c b/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/ParTest.c index 321afcc47..5f9bfc41e 100644 --- a/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/ParTest.c @@ -50,15 +50,15 @@ const unsigned short usGPIOState = 0xFF00U; /* Analog inputs are not used on the LED outputs. */ FM3_GPIO->ADE = 0x00FF; - + /* LED seg1 to GPIO output (P18->P1F). */ FM3_GPIO->DDR1 = 0xFF00; FM3_GPIO->PFR1 = 0x0000; - + /* LED seg2 to GPIO output (P30->P3F). */ FM3_GPIO->DDR3 = 0xFF00; FM3_GPIO->PFR3 = 0x0000; - + /* Start with all LEDs off. */ FM3_GPIO->PDOR3 = usGPIOState; FM3_GPIO->PDOR1 = usGPIOState; diff --git a/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/serial.c b/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/serial.c index aeb8d814a..9543039cc 100644 --- a/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/serial.c +++ b/FreeRTOS/Demo/CORTEX_MB9B500_IAR_Keil/serial.c @@ -26,7 +26,7 @@ /* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. - + ***Note*** This example uses queues to send each character into an interrupt service routine and out of an interrupt service routine individually. This is done to demonstrate queues being used in an interrupt, and to deliberately @@ -82,7 +82,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port /* Create the queues used to hold Rx/Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - + /* If the queues were created correctly then setup the serial port hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) @@ -90,41 +90,41 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port /* Ensure interrupts don't fire during the init process. Interrupts will be enabled automatically when the first task start running. */ portDISABLE_INTERRUPTS(); - + /* Configure P21 and P22 for use by the UART. */ FM3_GPIO->PFR2 |= ( 1 << 0x01 ) | ( 1 << 0x02 ); - + /* SIN0_0 and SOT0_0. */ FM3_GPIO->EPFR07 |= ( 1 << 6 ); - + /* Reset. */ FM3_MFS0_UART->SCR = 0x80; - + /* Enable output in mode 0. */ FM3_MFS0_UART->SMR = 0x01; - + /* Clear all errors that may already be present. */ FM3_MFS0_UART->SSR = 0x00; FM3_MFS0_UART->ESCR = 0x00; - + FM3_MFS0_UART->BGR = ( configCPU_CLOCK_HZ / 2UL ) / ( ulWantedBaud - 1UL ); - /* Enable Rx, Tx, and the Rx interrupt. */ + /* Enable Rx, Tx, and the Rx interrupt. */ FM3_MFS0_UART->SCR |= ( serRX_ENABLE | serTX_ENABLE | serRX_INT_ENABLE ); - + /* Configure the NVIC for UART interrupts. */ NVIC_ClearPendingIRQ( MFS0RX_IRQn ); NVIC_EnableIRQ( MFS0RX_IRQn ); - + /* The priority *MUST* be at or below configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY as FreeRTOS API functions are called in the interrupt handler. */ NVIC_SetPriority( MFS0RX_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); - + /* Do the same for the Tx interrupts. */ NVIC_ClearPendingIRQ( MFS0TX_IRQn ); NVIC_EnableIRQ( MFS0TX_IRQn ); - + /* The priority *MUST* be at or below configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY as FreeRTOS API functions are called in the interrupt handler. */ @@ -186,7 +186,7 @@ signed portBASE_TYPE xReturn; if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) == pdPASS ) { xReturn = pdPASS; - + /* Enable the UART Tx interrupt. */ FM3_MFS0_UART->SCR |= serTX_INT_ENABLE; } @@ -222,7 +222,7 @@ char cChar; handler task. */ cChar = FM3_MFS0_UART->RDR; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - } + } /* If sending or receiving from a queue has caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently @@ -253,8 +253,8 @@ char cChar; { /* Disable the Tx interrupt. */ FM3_MFS0_UART->SCR &= ~serTX_INT_ENABLE; - } - } + } + } /* If sending or receiving from a queue has caused a task to unblock, and the unblocked task has a priority equal to or higher than the currently @@ -269,4 +269,4 @@ char cChar; - + diff --git a/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/FreeRTOSConfig.h index ed408b2e8..3a122e4a9 100644 --- a/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/FreeRTOSConfig.h @@ -53,6 +53,7 @@ #define configMAX_TASK_NAME_LEN ( 12 ) #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -61,6 +62,7 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 9UL ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configQUEUE_REGISTRY_SIZE 10 #define configSUPPORT_STATIC_ALLOCATION 1 diff --git a/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/mps2_m3.ld b/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/mps2_m3.ld index a08dfcbcc..5a384db04 100644 --- a/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/mps2_m3.ld +++ b/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/mps2_m3.ld @@ -72,7 +72,7 @@ SECTIONS *(.bss) _ebss = .; } > RAM - + .heap : { . = ALIGN(8); @@ -84,14 +84,14 @@ SECTIONS . = . + _Min_Stack_Size; . = ALIGN(8); } >RAM - + /* Set stack top to end of RAM, and stack limit move down by * size of stack_dummy section */ __StackTop = ORIGIN(RAM) + LENGTH(RAM); __StackLimit = __StackTop - _Min_Stack_Size; PROVIDE(__stack = __StackTop); - + /* Check if data + heap + stack exceeds RAM limit */ ASSERT(__StackLimit >= _heap_top, "region RAM overflowed with stack") - + } diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h index 25601c870..868512ea0 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h @@ -47,7 +47,7 @@ extern "C" { /* The MPU version of port.c includes and excludes functions depending on the settings within this file. Therefore, to ensure all the functions in port.c build, this configuration file has all options turned on. */ - + #define configUSE_PREEMPTION 1 #define configTICK_RATE_HZ ( 1000 ) #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 @@ -84,6 +84,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h index 122da08eb..9178e590c 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h @@ -87,6 +87,10 @@ /* Task aware debugging. */ #define configRECORD_STACK_HIGH_ADDRESS 1 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h index b90c057dc..51d626a9f 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h @@ -75,6 +75,7 @@ #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h index 2245ff5dc..05a93655c 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h @@ -70,6 +70,7 @@ extern uint32_t SystemCoreClock; #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h index 87cb86cfe..923bb8179 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h @@ -76,6 +76,7 @@ extern uint32_t SystemCoreClock; #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h index 7d56eee98..d15222fe9 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h @@ -70,6 +70,7 @@ #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h index 160529932..a67deec87 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h @@ -73,6 +73,7 @@ extern uint32_t SystemCoreClock; #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h index aceab43ec..21d185825 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h @@ -70,6 +70,7 @@ extern uint32_t SystemCoreClock; #define configUSE_TICKLESS_IDLE 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h index 1534798a0..3aa4d1962 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h @@ -59,8 +59,10 @@ extern void vAssertCalled( void ); #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configMAX_PRIORITIES ( 10 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configTIMER_QUEUE_LENGTH 5 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) #define configUSE_COUNTING_SEMAPHORES 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h index 90afc7e61..c1d66bfa1 100755 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h @@ -87,6 +87,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp index e7f646ee7..dcaccd7d3 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp @@ -1105,6 +1105,9 @@ $PROJ_DIR$\..\..\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\..\..\Source\include\deprecated_definitions.h diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h index 9be731274..a8393c46a 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h @@ -86,6 +86,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp index 20efbf5c2..73440282a 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp @@ -1061,6 +1061,9 @@ FreeRTOS + + $PROJ_DIR$\..\..\..\..\Source\croutine.c + $PROJ_DIR$\..\..\..\..\Source\event_groups.c diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx index ec23b9893..6cdaf39cd 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx @@ -239,6 +239,18 @@ 0 0 0 + + 2 + 3 + 1 + 0 + 0 + 0 + ../../../../Source/croutine.c + croutine.c + 0 + 0 + 2 4 diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx index 480b0de80..b69de9de1 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx @@ -397,6 +397,11 @@ FreeRTOS + + croutine.c + 1 + ../../../../Source/croutine.c + event_groups.c 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h index e2ac67f0d..2b1e13223 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h @@ -85,6 +85,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h index 46d287735..17d51d7d2 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h @@ -87,6 +87,9 @@ readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_R4F_RZ_T_GCC_IAR/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_R4F_RZ_T_GCC_IAR/src/FreeRTOSConfig.h index 1a9d73c78..92833b4c5 100644 --- a/FreeRTOS/Demo/CORTEX_R4F_RZ_T_GCC_IAR/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_R4F_RZ_T_GCC_IAR/src/FreeRTOSConfig.h @@ -62,6 +62,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/FreeRTOSConfig.h index 292304eb4..d93f4bf64 100644 --- a/FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/FreeRTOSConfig.h @@ -24,9 +24,9 @@ * */ -/* +/* * The following #error directive is to remind users that a batch file must be - * executed prior to this project being built. Once it has been executed + * executed prior to this project being built. Once it has been executed * remove the #error line below. */ #error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above. @@ -42,7 +42,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -65,6 +65,9 @@ #define configCHECK_FOR_STACK_OVERFLOW 2 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Mutexes */ #define configUSE_MUTEXES 1 diff --git a/FreeRTOS/Demo/CORTEX_R5_UltraScale_MPSoC/RTOSDemo_R5/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_R5_UltraScale_MPSoC/RTOSDemo_R5/src/FreeRTOSConfig.h index e183ea54a..a26ffd624 100644 --- a/FreeRTOS/Demo/CORTEX_R5_UltraScale_MPSoC/RTOSDemo_R5/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_R5_UltraScale_MPSoC/RTOSDemo_R5/src/FreeRTOSConfig.h @@ -96,6 +96,9 @@ #define configSUPPORT_STATIC_ALLOCATION 1 #define configSUPPORT_DYNAMIC_ALLOCATION 1 /* Defaults to 1 anyway. */ +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/CORTEX_STM32F100_Atollic/Simple_Demo_Source/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_STM32F100_Atollic/Simple_Demo_Source/FreeRTOSConfig.h index 3241935c2..68afe1a8a 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F100_Atollic/Simple_Demo_Source/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_STM32F100_Atollic/Simple_Demo_Source/FreeRTOSConfig.h @@ -26,8 +26,8 @@ /* The following #error directive is to remind users that a batch file must be - * executed prior to this project being built. The batch file *cannot* be - * executed from within CCS4! Once it has been executed, re-open or refresh + * executed prior to this project being built. The batch file *cannot* be + * executed from within CCS4! Once it has been executed, re-open or refresh * the CCS4 project and remove the #error line below. */ #error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above. @@ -51,7 +51,7 @@ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 1 #define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( 24000000UL ) +#define configCPU_CLOCK_HZ ( 24000000UL ) #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 ) @@ -69,6 +69,9 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -102,9 +105,9 @@ to exclude the API function. */ /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } - + +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + #define vPortSVCHandler SVC_Handler #define xPortPendSVHandler PendSV_Handler #define xPortSysTickHandler SysTick_Handler diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.c b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.c index a8690c4ae..64fb86f56 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.c @@ -55,8 +55,8 @@ constant sets the maximum number of characters that can be contained in such a queue at any one time. */ #define serTX_QUEUE_LEN ( 100 ) -/* Queues are used to hold characters that have been received but not yet -processed. This constant sets the maximum number of characters that can be +/* Queues are used to hold characters that have been received but not yet +processed. This constant sets the maximum number of characters that can be contained in such a queue. */ #define serRX_QUEUE_LEN ( 100 ) @@ -121,27 +121,27 @@ GPIO_InitTypeDef GPIO_InitStructure; xRxedChars[ 0 ] = xQueueCreate( serRX_QUEUE_LEN, sizeof( char ) ); /* Enable COM0 clock - the ST libraries start numbering from UART1. */ - RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE ); + RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE ); /* Configure USART1 Rx (PA10) as input floating */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_Init( GPIOA, &GPIO_InitStructure ); - + /* Configure USART1 Tx (PA9) as alternate function push-pull */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init( GPIOA, &GPIO_InitStructure ); - USART_Init( USART1, &USART_InitStructure ); + USART_Init( USART1, &USART_InitStructure ); USART_ITConfig( USART1, USART_IT_RXNE, ENABLE ); - + NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQChannel; NVIC_Init( &NVIC_InitStructure ); - + USART_DMACmd( USART1, ( USART_DMAReq_Tx | USART_DMAReq_Rx ), ENABLE ); - USART_Cmd( USART1, ENABLE ); + USART_Cmd( USART1, ENABLE ); /* Everything is ok. */ lReturn = pdPASS; @@ -155,37 +155,37 @@ GPIO_InitTypeDef GPIO_InitStructure; xRxedChars[ 1 ] = xQueueCreate( serRX_QUEUE_LEN, sizeof( char ) ); /* Enable COM0 clock - the ST libraries start numbering from 1. */ - RCC_APB2PeriphClockCmd( RCC_APB1Periph_USART2 | RCC_APB2Periph_GPIOA, ENABLE ); + RCC_APB2PeriphClockCmd( RCC_APB1Periph_USART2 | RCC_APB2Periph_GPIOA, ENABLE ); /* Configure USART2 Rx (PA3) as input floating */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_Init( GPIOA, &GPIO_InitStructure ); - + /* Configure USART2 Tx (PA2) as alternate function push-pull */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init( GPIOA, &GPIO_InitStructure ); - USART_Init( USART2, &USART_InitStructure ); + USART_Init( USART2, &USART_InitStructure ); USART_ITConfig( USART2, USART_IT_RXNE, ENABLE ); - + NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQChannel; NVIC_Init( &NVIC_InitStructure ); - + USART_DMACmd( USART2, ( USART_DMAReq_Tx | USART_DMAReq_Rx ), ENABLE ); - USART_Cmd( USART2, ENABLE ); + USART_Cmd( USART2, ENABLE ); /* Everything is ok. */ lReturn = pdPASS; - } + } else { /* Nothing to do unless more than two ports are supported. */ } } - + return lReturn; } /*-----------------------------------------------------------*/ @@ -194,7 +194,7 @@ signed long xSerialGetChar( long lPort, signed char *pcRxedChar, TickType_t xBlo { long lReturn = pdFAIL; - if( lPort < serNUM_COM_PORTS ) + if( lPort < serNUM_COM_PORTS ) { if( xQueueReceive( xRxedChars[ lPort ], pcRxedChar, xBlockTime ) == pdPASS ) { @@ -219,7 +219,7 @@ unsigned long ul; { if( xQueueSend( xCharsForTx[ lPort ], &( pcString[ ul ] ), serPUT_STRING_CHAR_DELAY ) != pdPASS ) { - /* Cannot fit any more in the queue. Try turning the Tx on to + /* Cannot fit any more in the queue. Try turning the Tx on to clear some space. */ USART_ITConfig( xUARTS[ lPort ], USART_IT_TXE, ENABLE ); vTaskDelay( serPUT_STRING_CHAR_DELAY ); @@ -275,16 +275,16 @@ char cChar; } else { - USART_ITConfig( USART1, USART_IT_TXE, DISABLE ); - } + USART_ITConfig( USART1, USART_IT_TXE, DISABLE ); + } } - + if( USART_GetITStatus( USART1, USART_IT_RXNE ) == SET ) { cChar = USART_ReceiveData( USART1 ); xQueueSendFromISR( xRxedChars[ 0 ], &cChar, &xHigherPriorityTaskWoken ); - } - + } + portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } /*-----------------------------------------------------------*/ @@ -296,4 +296,4 @@ void USART2_IRQHandler( void ) - + diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.h b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.h index 99e818f8f..5a9fbc465 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.h +++ b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.h @@ -29,7 +29,7 @@ /* * Initialise a COM port. As supplied 2 COM ports are supported, so ulPort can - * be either 0 or 1. Note that COM 0 is in effect USART1 in ST library + * be either 0 or 1. Note that COM 0 is in effect USART1 in ST library * terminology. The baud rate can be any standard baud rate and has been tested * up to 115200 baud. */ @@ -39,30 +39,30 @@ long lCOMPortInit( unsigned long ulPort, unsigned long ulWantedBaud ); * Output a single char to a COM port. As supplied 2 COM ports are supported, * so ulPort can be 0 or 1. Note that COM 0 is in effect USART1 in ST library * terminology. cOutChar is the character to be transmit, and xBlockTime is - * the time the task should be held in the Blocked state (in ticks) for space - * to become available in the queue of characters waiting transmission. pdPASS - * will be returned if the character is successfully queued (possible after - * waiting in the Blocked state for up to xBlockTime ticks), otherwise pdFAIL + * the time the task should be held in the Blocked state (in ticks) for space + * to become available in the queue of characters waiting transmission. pdPASS + * will be returned if the character is successfully queued (possible after + * waiting in the Blocked state for up to xBlockTime ticks), otherwise pdFAIL * will be returned. */ signed long xSerialPutChar( long lPort, signed char cOutChar, TickType_t xBlockTime ); /* - * Retrieve a character from the queue of received characters. As supplied 2 - * COM ports are supported, so ulPort can be 0 or 1. Note that COM 0 is in + * Retrieve a character from the queue of received characters. As supplied 2 + * COM ports are supported, so ulPort can be 0 or 1. Note that COM 0 is in * effect USART1 in ST library terminology. pcRxedChar is the address into - * which the received character will be copied, and xBlockTime is the time the + * which the received character will be copied, and xBlockTime is the time the * task should be held in the Blocked state (in ticks) for a character to be * available if one is not available immediately. pdPASS will be returned if a - * character is successfully returned (possible after waiting in the Blocked + * character is successfully returned (possible after waiting in the Blocked * state for up to xBlockTime ticks), otherwise pdFAIL will be returned. */ signed long xSerialGetChar( long lPort, signed char *pcRxedChar, TickType_t xBlockTime ); /* - * Send a string of characters to a COM port. As supplied 2 COM ports are - * supported, so ulPort can be 0 or 1. Note that COM 0 is in effect USART1 in - * ST library terminology. pcString contains the address of the first + * Send a string of characters to a COM port. As supplied 2 COM ports are + * supported, so ulPort can be 0 or 1. Note that COM 0 is in effect USART1 in + * ST library terminology. pcString contains the address of the first * character to be transmit, and ulStringLength the total number of characters * from and including *pcString. pdPASS will be returned if the entire string * is queued for transmission successfully, otherwise pdFAIL will be returned. diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/FreeRTOSConfig.h index d9280861b..01bd522fa 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/FreeRTOSConfig.h @@ -52,6 +52,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configUSE_MUTEXES 1 #define configUSE_COUNTING_SEMAPHORES 1 diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/ParTest/ParTest_ST_Eval.c b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/ParTest/ParTest_ST_Eval.c index 7bf87773f..c0c9dc601 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/ParTest/ParTest_ST_Eval.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/ParTest/ParTest_ST_Eval.c @@ -76,7 +76,7 @@ unsigned short usBit; } GPIO_Write( GPIOC, usOutputValue ); - } + } } xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/FreeRTOSConfig.h index 1a624cae8..e7eee4f72 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -42,7 +42,7 @@ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 ) +#define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 ) #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) @@ -52,6 +52,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/ParTest/ParTest.c index 7bf87773f..c0c9dc601 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/ParTest/ParTest.c @@ -76,7 +76,7 @@ unsigned short usBit; } GPIO_Write( GPIOC, usOutputValue ); - } + } } xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c index b556efa1f..7b0274833 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c @@ -71,19 +71,19 @@ GPIO_InitTypeDef GPIO_InitStructure; /* Create the queues used to hold Rx/Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - + /* If the queue/semaphore was created correctly then setup the serial port hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) { /* Enable USART1 clock */ - RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE ); + RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE ); /* Configure USART1 Rx (PA10) as input floating */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_Init( GPIOA, &GPIO_InitStructure ); - + /* Configure USART1 Tx (PA9) as alternate function push-pull */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; @@ -100,18 +100,18 @@ GPIO_InitTypeDef GPIO_InitStructure; USART_InitStructure.USART_CPOL = USART_CPOL_Low; USART_InitStructure.USART_CPHA = USART_CPHA_2Edge; USART_InitStructure.USART_LastBit = USART_LastBit_Disable; - + USART_Init( USART1, &USART_InitStructure ); - + USART_ITConfig( USART1, USART_IT_RXNE, ENABLE ); - + NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_KERNEL_INTERRUPT_PRIORITY; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init( &NVIC_InitStructure ); - - USART_Cmd( USART1, ENABLE ); + + USART_Cmd( USART1, ENABLE ); } else { @@ -207,16 +207,16 @@ char cChar; } else { - USART_ITConfig( USART1, USART_IT_TXE, DISABLE ); - } + USART_ITConfig( USART1, USART_IT_TXE, DISABLE ); + } } - + if( USART_GetITStatus( USART1, USART_IT_RXNE ) == SET ) { cChar = USART_ReceiveData( USART1 ); xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - } - + } + portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } @@ -224,4 +224,4 @@ char cChar; - + diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/timertest.c b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/timertest.c index b9d829f89..b2286980f 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/timertest.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/timertest.c @@ -84,7 +84,7 @@ NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseStructInit( &TIM_TimeBaseStructure ); /* Time base configuration for timer 2 - which generates the interrupts. */ - ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; + ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) ( ulFrequency & 0xffffUL ); TIM_TimeBaseStructure.TIM_Prescaler = 0x0; TIM_TimeBaseStructure.TIM_ClockDivision = 0x0; @@ -92,19 +92,19 @@ NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseInit( TIM2, &TIM_TimeBaseStructure ); TIM_ARRPreloadConfig( TIM2, ENABLE ); - + /* Configuration for timer 3 which is used as a high resolution time measurement. */ TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) 0xffff; TIM_TimeBaseInit( TIM3, &TIM_TimeBaseStructure ); TIM_ARRPreloadConfig( TIM3, ENABLE ); - + /* Enable TIM2 IT. TIM3 does not generate an interrupt. */ NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = timerHIGHEST_PRIORITY; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init( &NVIC_InitStructure ); + NVIC_Init( &NVIC_InitStructure ); TIM_ITConfig( TIM2, TIM_IT_Update, ENABLE ); /* Finally, enable both timers. */ @@ -120,7 +120,7 @@ unsigned short usThisCount, usDifference; /* Capture the free running timer 3 value as we enter the interrupt. */ usThisCount = TIM3->CNT; - + if( usSettleCount >= timerSETTLE_TIME ) { /* What is the difference between the timer value in this interrupt diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/FreeRTOSConfig.h index 1a624cae8..e7eee4f72 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -42,7 +42,7 @@ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 ) +#define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 ) #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) @@ -52,6 +52,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/ParTest/ParTest.c b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/ParTest/ParTest.c index 7bf87773f..c0c9dc601 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/ParTest/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/ParTest/ParTest.c @@ -76,7 +76,7 @@ unsigned short usBit; } GPIO_Write( GPIOC, usOutputValue ); - } + } } xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/serial/serial.c b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/serial/serial.c index b556efa1f..7b0274833 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/serial/serial.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/serial/serial.c @@ -71,19 +71,19 @@ GPIO_InitTypeDef GPIO_InitStructure; /* Create the queues used to hold Rx/Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - + /* If the queue/semaphore was created correctly then setup the serial port hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) { /* Enable USART1 clock */ - RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE ); + RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE ); /* Configure USART1 Rx (PA10) as input floating */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_Init( GPIOA, &GPIO_InitStructure ); - + /* Configure USART1 Tx (PA9) as alternate function push-pull */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; @@ -100,18 +100,18 @@ GPIO_InitTypeDef GPIO_InitStructure; USART_InitStructure.USART_CPOL = USART_CPOL_Low; USART_InitStructure.USART_CPHA = USART_CPHA_2Edge; USART_InitStructure.USART_LastBit = USART_LastBit_Disable; - + USART_Init( USART1, &USART_InitStructure ); - + USART_ITConfig( USART1, USART_IT_RXNE, ENABLE ); - + NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_KERNEL_INTERRUPT_PRIORITY; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init( &NVIC_InitStructure ); - - USART_Cmd( USART1, ENABLE ); + + USART_Cmd( USART1, ENABLE ); } else { @@ -207,16 +207,16 @@ char cChar; } else { - USART_ITConfig( USART1, USART_IT_TXE, DISABLE ); - } + USART_ITConfig( USART1, USART_IT_TXE, DISABLE ); + } } - + if( USART_GetITStatus( USART1, USART_IT_RXNE ) == SET ) { cChar = USART_ReceiveData( USART1 ); xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - } - + } + portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } @@ -224,4 +224,4 @@ char cChar; - + diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/timertest.c b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/timertest.c index b9d829f89..b2286980f 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_Keil/timertest.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_Keil/timertest.c @@ -84,7 +84,7 @@ NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseStructInit( &TIM_TimeBaseStructure ); /* Time base configuration for timer 2 - which generates the interrupts. */ - ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; + ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) ( ulFrequency & 0xffffUL ); TIM_TimeBaseStructure.TIM_Prescaler = 0x0; TIM_TimeBaseStructure.TIM_ClockDivision = 0x0; @@ -92,19 +92,19 @@ NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseInit( TIM2, &TIM_TimeBaseStructure ); TIM_ARRPreloadConfig( TIM2, ENABLE ); - + /* Configuration for timer 3 which is used as a high resolution time measurement. */ TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) 0xffff; TIM_TimeBaseInit( TIM3, &TIM_TimeBaseStructure ); TIM_ARRPreloadConfig( TIM3, ENABLE ); - + /* Enable TIM2 IT. TIM3 does not generate an interrupt. */ NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = timerHIGHEST_PRIORITY; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init( &NVIC_InitStructure ); + NVIC_Init( &NVIC_InitStructure ); TIM_ITConfig( TIM2, TIM_IT_Update, ENABLE ); /* Finally, enable both timers. */ @@ -120,7 +120,7 @@ unsigned short usThisCount, usDifference; /* Capture the free running timer 3 value as we enter the interrupt. */ usThisCount = TIM3->CNT; - + if( usSettleCount >= timerSETTLE_TIME ) { /* What is the difference between the timer value in this interrupt diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/FreeRTOSConfig.h index 0922a514a..b58944792 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/FreeRTOSConfig.h @@ -37,7 +37,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -45,7 +45,7 @@ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 1 -#define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 ) +#define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 ) #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) @@ -56,6 +56,9 @@ #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/ParTest/ParTest.c b/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/ParTest/ParTest.c index 25a7daa8c..b447aa117 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/ParTest/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/ParTest/ParTest.c @@ -77,7 +77,7 @@ unsigned short usBit; } GPIO_Write( GPIOB, usOutputValue ); - } + } } xTaskResumeAll(); } diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/timertest.c b/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/timertest.c index b9d829f89..b2286980f 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/timertest.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_Primer_GCC/timertest.c @@ -84,7 +84,7 @@ NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseStructInit( &TIM_TimeBaseStructure ); /* Time base configuration for timer 2 - which generates the interrupts. */ - ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; + ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY; TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) ( ulFrequency & 0xffffUL ); TIM_TimeBaseStructure.TIM_Prescaler = 0x0; TIM_TimeBaseStructure.TIM_ClockDivision = 0x0; @@ -92,19 +92,19 @@ NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseInit( TIM2, &TIM_TimeBaseStructure ); TIM_ARRPreloadConfig( TIM2, ENABLE ); - + /* Configuration for timer 3 which is used as a high resolution time measurement. */ TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) 0xffff; TIM_TimeBaseInit( TIM3, &TIM_TimeBaseStructure ); TIM_ARRPreloadConfig( TIM3, ENABLE ); - + /* Enable TIM2 IT. TIM3 does not generate an interrupt. */ NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = timerHIGHEST_PRIORITY; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init( &NVIC_InitStructure ); + NVIC_Init( &NVIC_InitStructure ); TIM_ITConfig( TIM2, TIM_IT_Update, ENABLE ); /* Finally, enable both timers. */ @@ -120,7 +120,7 @@ unsigned short usThisCount, usDifference; /* Capture the free running timer 3 value as we enter the interrupt. */ usThisCount = TIM3->CNT; - + if( usSettleCount >= timerSETTLE_TIME ) { /* What is the difference between the timer value in this interrupt diff --git a/FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/include/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/include/FreeRTOSConfig.h index 38b8dae97..cae24499f 100644 --- a/FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/include/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/include/FreeRTOSConfig.h @@ -103,6 +103,9 @@ configCREATE_LOW_POWER_DEMO at the top of this file. */ #define configTIMER_QUEUE_LENGTH 10 #define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_STM32L152_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_STM32L152_IAR/FreeRTOSConfig.h index 659314c0f..a8d8b0557 100644 --- a/FreeRTOS/Demo/CORTEX_STM32L152_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_STM32L152_IAR/FreeRTOSConfig.h @@ -58,6 +58,9 @@ #define configUSE_MALLOC_FAILED_HOOK 1 #define configUSE_APPLICATION_TASK_TAG 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/CORTEX_STM32L152_IAR/ParTest.c b/FreeRTOS/Demo/CORTEX_STM32L152_IAR/ParTest.c index 5cd79617f..05b3f1b68 100644 --- a/FreeRTOS/Demo/CORTEX_STM32L152_IAR/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_STM32L152_IAR/ParTest.c @@ -50,7 +50,7 @@ void vParTestInitialise( void ) STM_EVAL_LEDOff( LED1 ); STM_EVAL_LEDOff( LED2 ); STM_EVAL_LEDOff( LED3 ); - STM_EVAL_LEDOff( LED4 ); + STM_EVAL_LEDOff( LED4 ); } /*-----------------------------------------------------------*/ @@ -64,15 +64,15 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { case 0: STM_EVAL_LEDOn( LED1 ); break; - + case 1: STM_EVAL_LEDOn( LED2 ); break; - + case 2: STM_EVAL_LEDOn( LED3 ); break; - + case 3: STM_EVAL_LEDOn( LED4 ); - break; + break; } } else @@ -81,15 +81,15 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { case 0: STM_EVAL_LEDOff( LED1 ); break; - + case 1: STM_EVAL_LEDOff( LED2 ); break; - + case 2: STM_EVAL_LEDOff( LED3 ); break; - + case 3: STM_EVAL_LEDOff( LED4 ); - break; + break; } } } @@ -113,7 +113,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) break; case 3: STM_EVAL_LEDToggle( LED4 ); - break; + break; } } xTaskResumeAll(); diff --git a/FreeRTOS/Demo/CORTEX_STM32L152_IAR/serial.c b/FreeRTOS/Demo/CORTEX_STM32L152_IAR/serial.c index 198bf7523..674737adc 100644 --- a/FreeRTOS/Demo/CORTEX_STM32L152_IAR/serial.c +++ b/FreeRTOS/Demo/CORTEX_STM32L152_IAR/serial.c @@ -26,13 +26,13 @@ /* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. - + ***Note*** This example uses queues to send each character into an interrupt service routine and out of an interrupt service routine individually. This is done to demonstrate queues being used in an interrupt, and to deliberately - load the system to test the FreeRTOS port. It is *NOT* meant to be an + load the system to test the FreeRTOS port. It is *NOT* meant to be an example of an efficient implementation. An efficient implementation should - use FIFO's or DMA if available, and only use FreeRTOS API functions when + use FIFO's or DMA if available, and only use FreeRTOS API functions when enough has been received to warrant a task being unblocked to process the data. */ @@ -74,7 +74,7 @@ NVIC_InitTypeDef NVIC_InitStructure; /* Create the queues used to hold Rx/Tx characters. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - + /* If the queues were created correctly then setup the serial port hardware. */ if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) ) @@ -85,11 +85,11 @@ NVIC_InitTypeDef NVIC_InitStructure; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; - + /* The Eval board COM2 is being used, which in reality is the STM32 USART3. */ STM_EVAL_COMInit( COM2, &USART_InitStructure ); - + NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; /* Not used as 4 bits are used for the pre-emption priority. */; @@ -181,7 +181,7 @@ char cChar; if( USART_GetITStatus( USART3, USART_IT_TXE ) == SET ) { - /* The interrupt was caused by the TX register becoming empty. Are + /* The interrupt was caused by the TX register becoming empty. Are there any more characters to transmit? */ if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) { @@ -191,23 +191,23 @@ char cChar; } else { - USART_ITConfig( USART3, USART_IT_TXE, DISABLE ); - } + USART_ITConfig( USART3, USART_IT_TXE, DISABLE ); + } } - + if( USART_GetITStatus( USART3, USART_IT_RXNE ) == SET ) { /* A character has been received on the USART, send it to the Rx handler task. */ cChar = USART_ReceiveData( USART3 ); xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - } + } /* If sending or receiving from a queue has caused a task to unblock, and - the unblocked task has a priority equal to or higher than the currently - running task (the task this ISR interrupted), then xHigherPriorityTaskWoken - will have automatically been set to pdTRUE within the queue send or receive - function. portEND_SWITCHING_ISR() will then ensure that this ISR returns + the unblocked task has a priority equal to or higher than the currently + running task (the task this ISR interrupted), then xHigherPriorityTaskWoken + will have automatically been set to pdTRUE within the queue send or receive + function. portEND_SWITCHING_ISR() will then ensure that this ISR returns directly to the higher priority unblocked task. */ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } @@ -216,4 +216,4 @@ char cChar; - + diff --git a/FreeRTOS/Demo/CORTUS_APS3_GCC/.cproject b/FreeRTOS/Demo/CORTUS_APS3_GCC/.cproject index f259b6f6c..fafcfb7fc 100644 --- a/FreeRTOS/Demo/CORTUS_APS3_GCC/.cproject +++ b/FreeRTOS/Demo/CORTUS_APS3_GCC/.cproject @@ -48,7 +48,7 @@ - + @@ -306,7 +306,7 @@ - + diff --git a/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/FreeRTOSConfig.h index d16dafbdf..9fb0b23c8 100644 --- a/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/FreeRTOSConfig.h @@ -58,6 +58,9 @@ #define configUSE_MALLOC_FAILED_HOOK 1 #define configCHECK_FOR_STACK_OVERFLOW 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. diff --git a/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/demoGpio.h b/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/demoGpio.h index 40b8e2a4a..95d1f7021 100644 --- a/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/demoGpio.h +++ b/FreeRTOS/Demo/CORTUS_APS3_GCC/Demo/demoGpio.h @@ -24,7 +24,7 @@ * */ -/* Layout of pins connected to GPIO on Xilinx FPGA evaluation board +/* Layout of pins connected to GPIO on Xilinx FPGA evaluation board */ #include @@ -36,7 +36,7 @@ typedef struct DemoBoardGpioPins { /* Leds on board */ unsigned leds:8; - + /* 7 segment display */ unsigned digit:7; diff --git a/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/FreeRTOSConfig.h b/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/FreeRTOSConfig.h index 8b7245c9d..739593422 100644 --- a/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/FreeRTOSConfig.h @@ -24,11 +24,11 @@ * */ -/* CodeWarrior often thinks it knows better than you which files you want to +/* CodeWarrior often thinks it knows better than you which files you want to build - and changes the port.c and portasm.S files included in the project from the ColdFire V1 versions to the x86 versions. If you get lots of errors output when either file is compiled then delete the files from the project and then -add back in the port.c and portasm.S files that are located in the +add back in the port.c and portasm.S files that are located in the FreeRTOS\Source\portable\GCC\ColdFire_V2 directory. Remove the line below before compiling. */ @@ -47,7 +47,7 @@ before compiling. */ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -63,6 +63,7 @@ before compiling. */ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 1 #define configUSE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 #define configUSE_RECURSIVE_MUTEXES 1 @@ -70,6 +71,7 @@ before compiling. */ #define configUSE_COUNTING_SEMAPHORES 0 #define configMAX_PRIORITIES ( 6 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/ParTest/ParTest.c b/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/ParTest/ParTest.c index bf1d5eda4..4e9195eac 100644 --- a/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/ParTest/ParTest.c @@ -49,7 +49,7 @@ void vParTestInitialise( void ) | MCF_GPIO_PTCPAR_DTIN2_GPIO | MCF_GPIO_PTCPAR_DTIN1_GPIO | MCF_GPIO_PTCPAR_DTIN0_GPIO; - + /* Enable signals as digital outputs */ MCF_GPIO_DDRTC = 0 | MCF_GPIO_DDRTC_DDRTC3 @@ -68,7 +68,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = 1UL << uxLED; - + taskENTER_CRITICAL(); { if( xValue ) @@ -92,7 +92,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = 1UL << uxLED; - + taskENTER_CRITICAL(); { if( MCF_GPIO_PORTTC & uxLEDMask ) diff --git a/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/main.c b/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/main.c index cbb798129..985e5852c 100644 --- a/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/main.c +++ b/FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/main.c @@ -57,6 +57,7 @@ /* Demo app includes. */ #include "BlockQ.h" +#include "crflash.h" #include "partest.h" #include "semtest.h" #include "GenQTest.h" @@ -87,6 +88,9 @@ error have been detected. */ #define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 ) #define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY ) +/* Co-routines are used to flash the LEDs. */ +#define mainNUM_FLASH_CO_ROUTINES ( 3 ) + /* The baud rate used by the comtest tasks. */ #define mainBAUD_RATE ( 38400 ) @@ -130,6 +134,9 @@ int main( void ) vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_RATE, mainCOM_LED ); + /* For demo purposes use some co-routines to flash the LEDs. */ + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); + /* Create the check task. */ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); @@ -249,6 +256,8 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) void vApplicationIdleHook( void ); void vApplicationIdleHook( void ) { + /* The co-routines run in the idle task. */ + vCoRoutineSchedule(); } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/FreeRTOSConfig.h b/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/FreeRTOSConfig.h index aec4be4db..72fca08a1 100644 --- a/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/FreeRTOSConfig.h @@ -24,11 +24,11 @@ * */ -/* CodeWarrior often thinks it knows better than you which files you want to +/* CodeWarrior often thinks it knows better than you which files you want to build - and changes the port.c and portasm.S files included in the project from the ColdFire V1 versions to the x86 versions. If you get lots of errors output when either file is compiled then delete the files from the project and then -add back in the port.c and portasm.S files that are located in the +add back in the port.c and portasm.S files that are located in the FreeRTOS\Source\portable\GCC\ColdFire_V2 directory. Remove the line below before compiling. */ @@ -47,7 +47,7 @@ before compiling. */ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -63,6 +63,7 @@ before compiling. */ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 #define configUSE_RECURSIVE_MUTEXES 1 @@ -70,6 +71,7 @@ before compiling. */ #define configUSE_COUNTING_SEMAPHORES 0 #define configMAX_PRIORITIES ( 6 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -89,7 +91,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/HTTPDemo.h b/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/HTTPDemo.h index 0caf9ec79..d00d5912c 100644 --- a/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/HTTPDemo.h +++ b/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/HTTPDemo.h @@ -30,11 +30,11 @@ /* The function that implements the WEB server task. */ void vBasicWEBServer( void *pvParameters ); - + /* Initialisation required by lwIP. */ void vlwIPInit( void ); - -#endif /* + +#endif /* */ diff --git a/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/ParTest/ParTest.c b/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/ParTest/ParTest.c index bf1d5eda4..4e9195eac 100644 --- a/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/ParTest/ParTest.c +++ b/FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/ParTest/ParTest.c @@ -49,7 +49,7 @@ void vParTestInitialise( void ) | MCF_GPIO_PTCPAR_DTIN2_GPIO | MCF_GPIO_PTCPAR_DTIN1_GPIO | MCF_GPIO_PTCPAR_DTIN0_GPIO; - + /* Enable signals as digital outputs */ MCF_GPIO_DDRTC = 0 | MCF_GPIO_DDRTC_DDRTC3 @@ -68,7 +68,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = 1UL << uxLED; - + taskENTER_CRITICAL(); { if( xValue ) @@ -92,7 +92,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = 1UL << uxLED; - + taskENTER_CRITICAL(); { if( MCF_GPIO_PORTTC & uxLEDMask ) diff --git a/FreeRTOS/Demo/Common/Minimal/crflash.c b/FreeRTOS/Demo/Common/Minimal/crflash.c new file mode 100644 index 000000000..099867ae3 --- /dev/null +++ b/FreeRTOS/Demo/Common/Minimal/crflash.c @@ -0,0 +1,218 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/* + * This demo application file demonstrates the use of queues to pass data + * between co-routines. + * + * N represents the number of 'fixed delay' co-routines that are created and + * is set during initialisation. + * + * N 'fixed delay' co-routines are created that just block for a fixed + * period then post the number of an LED onto a queue. Each such co-routine + * uses a different block period. A single 'flash' co-routine is also created + * that blocks on the same queue, waiting for the number of the next LED it + * should flash. Upon receiving a number it simply toggle the instructed LED + * then blocks on the queue once more. In this manner each LED from LED 0 to + * LED N-1 is caused to flash at a different rate. + * + * The 'fixed delay' co-routines are created with co-routine priority 0. The + * flash co-routine is created with co-routine priority 1. This means that + * the queue should never contain more than a single item. This is because + * posting to the queue will unblock the 'flash' co-routine, and as this has + * a priority greater than the tasks posting to the queue it is guaranteed to + * have emptied the queue and blocked once again before the queue can contain + * any more date. An error is indicated if an attempt to post data to the + * queue fails - indicating that the queue is already full. + * + */ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "croutine.h" +#include "queue.h" + +/* Demo application includes. */ +#include "partest.h" +#include "crflash.h" + +/* The queue should only need to be of length 1. See the description at the + * top of the file. */ +#define crfQUEUE_LENGTH 1 + +#define crfFIXED_DELAY_PRIORITY 0 +#define crfFLASH_PRIORITY 1 + +/* Only one flash co-routine is created so the index is not significant. */ +#define crfFLASH_INDEX 0 + +/* Don't allow more than crfMAX_FLASH_TASKS 'fixed delay' co-routines to be + * created. */ +#define crfMAX_FLASH_TASKS 8 + +/* We don't want to block when posting to the queue. */ +#define crfPOSTING_BLOCK_TIME 0 + +#if ( configUSE_CO_ROUTINES == 1 ) + +/* + * The 'fixed delay' co-routine as described at the top of the file. + */ + static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, + UBaseType_t uxIndex ); + +/* + * The 'flash' co-routine as described at the top of the file. + */ + static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, + UBaseType_t uxIndex ); + +/* The queue used to pass data between the 'fixed delay' co-routines and the + * 'flash' co-routine. */ + static QueueHandle_t xFlashQueue; + +/* This will be set to pdFALSE if we detect an error. */ + static BaseType_t xCoRoutineFlashStatus = pdPASS; + +/*-----------------------------------------------------------*/ + +/* + * See the header file for details. + */ + void vStartFlashCoRoutines( UBaseType_t uxNumberToCreate ) + { + UBaseType_t uxIndex; + + if( uxNumberToCreate > crfMAX_FLASH_TASKS ) + { + uxNumberToCreate = crfMAX_FLASH_TASKS; + } + + /* Create the queue used to pass data between the co-routines. */ + xFlashQueue = xQueueCreate( crfQUEUE_LENGTH, sizeof( UBaseType_t ) ); + + if( xFlashQueue ) + { + /* Create uxNumberToCreate 'fixed delay' co-routines. */ + for( uxIndex = 0; uxIndex < uxNumberToCreate; uxIndex++ ) + { + xCoRoutineCreate( prvFixedDelayCoRoutine, crfFIXED_DELAY_PRIORITY, uxIndex ); + } + + /* Create the 'flash' co-routine. */ + xCoRoutineCreate( prvFlashCoRoutine, crfFLASH_PRIORITY, crfFLASH_INDEX ); + } + } +/*-----------------------------------------------------------*/ + + static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, + UBaseType_t uxIndex ) + { +/* Even though this is a co-routine the xResult variable does not need to be + * static as we do not need it to maintain its state between blocks. */ + BaseType_t xResult; + +/* The uxIndex parameter of the co-routine function is used as an index into + * the xFlashRates array to obtain the delay period to use. */ + static const TickType_t xFlashRates[ crfMAX_FLASH_TASKS ] = + { + 150 / portTICK_PERIOD_MS, + 200 / portTICK_PERIOD_MS, + 250 / portTICK_PERIOD_MS, + 300 / portTICK_PERIOD_MS, + 350 / portTICK_PERIOD_MS, + 400 / portTICK_PERIOD_MS, + 450 / portTICK_PERIOD_MS, + 500 / portTICK_PERIOD_MS + }; + + /* Co-routines MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for( ; ; ) + { + /* Post our uxIndex value onto the queue. This is used as the LED to + * flash. */ + crQUEUE_SEND( xHandle, xFlashQueue, ( void * ) &uxIndex, crfPOSTING_BLOCK_TIME, &xResult ); + + if( xResult != pdPASS ) + { + /* For the reasons stated at the top of the file we should always + * find that we can post to the queue. If we could not then an error + * has occurred. */ + xCoRoutineFlashStatus = pdFAIL; + } + + crDELAY( xHandle, xFlashRates[ uxIndex ] ); + } + + /* Co-routines MUST end with a call to crEND. */ + crEND(); + } +/*-----------------------------------------------------------*/ + + static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, + UBaseType_t uxIndex ) + { +/* Even though this is a co-routine the variable do not need to be + * static as we do not need it to maintain their state between blocks. */ + BaseType_t xResult; + UBaseType_t uxLEDToFlash; + + /* Co-routines MUST start with a call to crSTART. */ + crSTART( xHandle ); + ( void ) uxIndex; + + for( ; ; ) + { + /* Block to wait for the number of the LED to flash. */ + crQUEUE_RECEIVE( xHandle, xFlashQueue, &uxLEDToFlash, portMAX_DELAY, &xResult ); + + if( xResult != pdPASS ) + { + /* We would not expect to wake unless we received something. */ + xCoRoutineFlashStatus = pdFAIL; + } + else + { + /* We received the number of an LED to flash - flash it! */ + vParTestToggleLED( uxLEDToFlash ); + } + } + + /* Co-routines MUST end with a call to crEND. */ + crEND(); + } +/*-----------------------------------------------------------*/ + + BaseType_t xAreFlashCoRoutinesStillRunning( void ) + { + /* Return pdPASS or pdFAIL depending on whether an error has been detected + * or not. */ + return xCoRoutineFlashStatus; + } + +#endif /* if ( configUSE_CO_ROUTINES == 1 ) */ diff --git a/FreeRTOS/Demo/Common/Minimal/crhook.c b/FreeRTOS/Demo/Common/Minimal/crhook.c new file mode 100644 index 000000000..764099d1b --- /dev/null +++ b/FreeRTOS/Demo/Common/Minimal/crhook.c @@ -0,0 +1,236 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/* + * This demo file demonstrates how to send data between an ISR and a + * co-routine. A tick hook function is used to periodically pass data between + * the RTOS tick and a set of 'hook' co-routines. + * + * hookNUM_HOOK_CO_ROUTINES co-routines are created. Each co-routine blocks + * to wait for a character to be received on a queue from the tick ISR, checks + * to ensure the character received was that expected, then sends the number + * back to the tick ISR on a different queue. + * + * The tick ISR checks the numbers received back from the 'hook' co-routines + * matches the number previously sent. + * + * If at any time a queue function returns unexpectedly, or an incorrect value + * is received either by the tick hook or a co-routine then an error is + * latched. + * + * This demo relies on each 'hook' co-routine to execute between each + * hookTICK_CALLS_BEFORE_POST tick interrupts. This and the heavy use of + * queues from within an interrupt may result in an error being detected on + * slower targets simply due to timing. + */ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "croutine.h" +#include "queue.h" + +/* Demo application includes. */ +#include "crhook.h" + +/* The number of 'hook' co-routines that are to be created. */ +#define hookNUM_HOOK_CO_ROUTINES ( 4 ) + +/* The number of times the tick hook should be called before a character is + * posted to the 'hook' co-routines. */ +#define hookTICK_CALLS_BEFORE_POST ( 500 ) + +/* There should never be more than one item in any queue at any time. */ +#define hookHOOK_QUEUE_LENGTH ( 1 ) + +/* Don't block when initially posting to the queue. */ +#define hookNO_BLOCK_TIME ( 0 ) + +/* The priority relative to other co-routines (rather than tasks) that the + * 'hook' co-routines should take. */ +#define mainHOOK_CR_PRIORITY ( 1 ) +/*-----------------------------------------------------------*/ +#if ( configUSE_CO_ROUTINES == 1 ) + +/* + * The co-routine function itself. + */ + static void prvHookCoRoutine( CoRoutineHandle_t xHandle, + UBaseType_t uxIndex ); + + +/* + * The tick hook function. This receives a number from each 'hook' co-routine + * then sends a number to each co-routine. An error is flagged if a send or + * receive fails, or an unexpected number is received. + */ + void vApplicationTickHook( void ); + +/*-----------------------------------------------------------*/ + +/* Queues used to send data FROM a co-routine TO the tick hook function. + * The hook functions received (Rx's) on these queues. One queue per + * 'hook' co-routine. */ + static QueueHandle_t xHookRxQueues[ hookNUM_HOOK_CO_ROUTINES ]; + +/* Queues used to send data FROM the tick hook TO a co-routine function. + * The hood function transmits (Tx's) on these queues. One queue per + * 'hook' co-routine. */ + static QueueHandle_t xHookTxQueues[ hookNUM_HOOK_CO_ROUTINES ]; + +/* Set to true if an error is detected at any time. */ + static BaseType_t xCoRoutineErrorDetected = pdFALSE; + +/*-----------------------------------------------------------*/ + + void vStartHookCoRoutines( void ) + { + UBaseType_t uxIndex, uxValueToPost = 0; + + for( uxIndex = 0; uxIndex < hookNUM_HOOK_CO_ROUTINES; uxIndex++ ) + { + /* Create a queue to transmit to and receive from each 'hook' + * co-routine. */ + xHookRxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( UBaseType_t ) ); + xHookTxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( UBaseType_t ) ); + + /* To start things off the tick hook function expects the queue it + * uses to receive data to contain a value. */ + xQueueSend( xHookRxQueues[ uxIndex ], &uxValueToPost, hookNO_BLOCK_TIME ); + + /* Create the 'hook' co-routine itself. */ + xCoRoutineCreate( prvHookCoRoutine, mainHOOK_CR_PRIORITY, uxIndex ); + } + } +/*-----------------------------------------------------------*/ + + static UBaseType_t uxCallCounter = 0, uxNumberToPost = 0; + void vApplicationTickHook( void ) + { + UBaseType_t uxReceivedNumber; + BaseType_t xIndex, xCoRoutineWoken; + + /* Is it time to talk to the 'hook' co-routines again? */ + uxCallCounter++; + + if( uxCallCounter >= hookTICK_CALLS_BEFORE_POST ) + { + uxCallCounter = 0; + + for( xIndex = 0; xIndex < hookNUM_HOOK_CO_ROUTINES; xIndex++ ) + { + xCoRoutineWoken = pdFALSE; + + if( crQUEUE_RECEIVE_FROM_ISR( xHookRxQueues[ xIndex ], &uxReceivedNumber, &xCoRoutineWoken ) != pdPASS ) + { + /* There is no reason why we would not expect the queue to + * contain a value. */ + xCoRoutineErrorDetected = pdTRUE; + } + else + { + /* Each queue used to receive data from the 'hook' co-routines + * should contain the number we last posted to the same co-routine. */ + if( uxReceivedNumber != uxNumberToPost ) + { + xCoRoutineErrorDetected = pdTRUE; + } + + /* Nothing should be blocked waiting to post to the queue. */ + if( xCoRoutineWoken != pdFALSE ) + { + xCoRoutineErrorDetected = pdTRUE; + } + } + } + + /* Start the next cycle by posting the next number onto each Tx queue. */ + uxNumberToPost++; + + for( xIndex = 0; xIndex < hookNUM_HOOK_CO_ROUTINES; xIndex++ ) + { + if( crQUEUE_SEND_FROM_ISR( xHookTxQueues[ xIndex ], &uxNumberToPost, pdFALSE ) != pdTRUE ) + { + /* Posting to the queue should have woken the co-routine that + * was blocked on the queue. */ + xCoRoutineErrorDetected = pdTRUE; + } + } + } + } +/*-----------------------------------------------------------*/ + + static void prvHookCoRoutine( CoRoutineHandle_t xHandle, + UBaseType_t uxIndex ) + { + static UBaseType_t uxReceivedValue[ hookNUM_HOOK_CO_ROUTINES ]; + BaseType_t xResult; + + /* Each co-routine MUST start with a call to crSTART(); */ + crSTART( xHandle ); + + for( ; ; ) + { + /* Wait to receive a value from the tick hook. */ + xResult = pdFAIL; + crQUEUE_RECEIVE( xHandle, xHookTxQueues[ uxIndex ], &( uxReceivedValue[ uxIndex ] ), portMAX_DELAY, &xResult ); + + /* There is no reason why we should not have received something on + * the queue. */ + if( xResult != pdPASS ) + { + xCoRoutineErrorDetected = pdTRUE; + } + + /* Send the same number back to the idle hook so it can verify it. */ + xResult = pdFAIL; + crQUEUE_SEND( xHandle, xHookRxQueues[ uxIndex ], &( uxReceivedValue[ uxIndex ] ), hookNO_BLOCK_TIME, &xResult ); + + if( xResult != pdPASS ) + { + /* There is no reason why we should not have been able to post to + * the queue. */ + xCoRoutineErrorDetected = pdTRUE; + } + } + + /* Each co-routine MUST end with a call to crEND(). */ + crEND(); + } +/*-----------------------------------------------------------*/ + + BaseType_t xAreHookCoRoutinesStillRunning( void ) + { + if( xCoRoutineErrorDetected ) + { + return pdFALSE; + } + else + { + return pdTRUE; + } + } + +#endif /* if ( configUSE_CO_ROUTINES == 1 ) */ diff --git a/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/arch.c b/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/arch.c index 5ab2d7e08..b28b01c9c 100644 --- a/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/arch.c +++ b/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/arch.c @@ -97,11 +97,11 @@ unsigned char *pucTemp; /* Point uip_buf at the next buffer that contains data. */ uip_buf = pucEthernetBufferPointers[ ucNextBufferToProcess ]; - /* The buffer pointed to by + /* The buffer pointed to by pucEthernetBufferPointeres[ ucNextBufferToProcess ] is now in use by uip_buf, but the buffer uip_buf was pointing to on entry to this - function is free. Set - pucEthernetBufferPointeres[ ucNextBufferToProcess ] to the free + function is free. Set + pucEthernetBufferPointeres[ ucNextBufferToProcess ] to the free buffer. */ pucEthernetBufferPointers[ ucNextBufferToProcess ] = pucTemp; lLengthOfDataInBuffer[ ucNextBufferToProcess ] = 0L; @@ -132,11 +132,11 @@ pcap_if_t *pxAllNetworkInterfaces; pucEthernetBufferPointers[] array. */ uip_buf = &( ucEthernetBuffer[ archNUM_BUFFERS - 1 ][ 0 ] ); - /* Query the computer the simulation is being executed on to find the + /* Query the computer the simulation is being executed on to find the network interfaces it has installed. */ pxAllNetworkInterfaces = prvPrintAvailableNetworkInterfaces(); - - /* Open the network interface. The number of the interface to be opened is + + /* Open the network interface. The number of the interface to be opened is set by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h. Calling this function will set the pxOpenedInterfaceHandle variable. If, after calling this function, pxOpenedInterfaceHandle is equal to NULL, then @@ -145,14 +145,14 @@ pcap_if_t *pxAllNetworkInterfaces; { prvOpenSelectedNetworkInterface( pxAllNetworkInterfaces ); } - + return x; } /*-----------------------------------------------------------*/ static pcap_if_t * prvPrintAvailableNetworkInterfaces( void ) -{ +{ pcap_if_t * pxAllNetworkInterfaces = NULL, *xInterface; long lInterfaceNumber = 1; @@ -169,7 +169,7 @@ long lInterfaceNumber = 1; for( xInterface = pxAllNetworkInterfaces; xInterface != NULL; xInterface = xInterface->next ) { printf( "%d. %s", lInterfaceNumber, xInterface->name ); - + if( xInterface->description != NULL ) { printf( " (%s)\r\n", xInterface->description ); @@ -178,7 +178,7 @@ long lInterfaceNumber = 1; { printf( " (No description available)\r\n") ; } - + lInterfaceNumber++; } } @@ -193,11 +193,11 @@ long lInterfaceNumber = 1; printf( "\r\nThe interface that will be opened is set by configNETWORK_INTERFACE_TO_USE which should be defined in FreeRTOSConfig.h\r\n" ); printf( "Attempting to open interface number %d.\r\n", configNETWORK_INTERFACE_TO_USE ); - + if( ( configNETWORK_INTERFACE_TO_USE < 1L ) || ( configNETWORK_INTERFACE_TO_USE > lInterfaceNumber ) ) { printf("\r\nconfigNETWORK_INTERFACE_TO_USE is not in the valid range.\r\n" ); - + if( pxAllNetworkInterfaces != NULL ) { /* Free the device list, as no devices are going to be opened. */ @@ -225,8 +225,8 @@ long x; /* Open the selected interface. */ pxOpenedInterfaceHandle = pcap_open( xInterface->name, /* The name of the selected interface. */ UIP_CONF_BUFFER_SIZE, /* The size of the packet to capture. */ - PCAP_OPENFLAG_PROMISCUOUS, /* Open in promiscious mode as the MAC and - IP address is going to be "simulated", and + PCAP_OPENFLAG_PROMISCUOUS, /* Open in promiscious mode as the MAC and + IP address is going to be "simulated", and not be the real MAC and IP address. This allows trafic to the simulated IP address to be routed to uIP, and trafic to the real IP address to be @@ -235,16 +235,16 @@ long x; until data is available. */ NULL, /* No authentication is required as this is not a remote capture session. */ - cErrorBuffer + cErrorBuffer ); - + if ( pxOpenedInterfaceHandle == NULL ) { printf( "\r\n%s is not supported by WinPcap and cannot be opened\r\n", xInterface->name ); } else { - /* Configure the capture filter to allow blocking reads, and to filter + /* Configure the capture filter to allow blocking reads, and to filter out packets that are not of interest to this demo. */ prvConfigureCaptureBehaviour(); } @@ -278,7 +278,7 @@ unsigned long ulNetMask; printf("\r\nThe packet filter string is invalid\r\n" ); } else - { + { if( pcap_setfilter( pxOpenedInterfaceHandle, &xFilterCode ) < 0 ) { printf( "\r\nAn error occurred setting the packet filter.\r\n" ); diff --git a/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/netif.h b/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/netif.h index fd802acbc..03982d4fa 100644 --- a/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/netif.h +++ b/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/netif.h @@ -28,13 +28,13 @@ #define NET_IF_H /* - * Send uip_len bytes from uip_buf to the network interface selected by the - * configNETWORK_INTERFACE_TO_USE constant (defined in FreeRTOSConfig.h). + * Send uip_len bytes from uip_buf to the network interface selected by the + * configNETWORK_INTERFACE_TO_USE constant (defined in FreeRTOSConfig.h). */ void vNetifTx( void ); /* - * Receive bytes from the network interface selected by the + * Receive bytes from the network interface selected by the * configNETWORK_INTERFACE_TO_USE constant (defined in FreeRTOSConfig.h). The * bytes are placed in uip_buf. The number of bytes copied into uip_buf is * returned. @@ -42,9 +42,9 @@ void vNetifTx( void ); unsigned portBASE_TYPE uxNetifRx( void ); /* - * Prepare a packet capture session. This will print out all the network - * interfaces available, and the one actually used is set by the - * configNETWORK_INTERFACE_TO_USE constant that is defined in + * Prepare a packet capture session. This will print out all the network + * interfaces available, and the one actually used is set by the + * configNETWORK_INTERFACE_TO_USE constant that is defined in * FreeRTOSConfig.h. */ portBASE_TYPE xNetifInit( void ); diff --git a/FreeRTOS/Demo/Common/include/crflash.h b/FreeRTOS/Demo/Common/include/crflash.h new file mode 100644 index 000000000..2b6844eb7 --- /dev/null +++ b/FreeRTOS/Demo/Common/include/crflash.h @@ -0,0 +1,45 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +#ifndef CRFLASH_LED_H +#define CRFLASH_LED_H + +/* + * Create the co-routines used to flash the LED's at different rates. + * + * @param uxPriority The number of 'fixed delay' co-routines to create. This + * also effects the number of LED's that will be utilised. For example, + * passing in 3 will cause LED's 0 to 2 to be utilised. + */ +void vStartFlashCoRoutines( UBaseType_t uxPriority ); + +/* + * Return pdPASS or pdFAIL depending on whether an error has been detected + * or not. + */ +BaseType_t xAreFlashCoRoutinesStillRunning( void ); + +#endif diff --git a/FreeRTOS/Demo/Common/include/crhook.h b/FreeRTOS/Demo/Common/include/crhook.h new file mode 100644 index 000000000..3459cdeb8 --- /dev/null +++ b/FreeRTOS/Demo/Common/include/crhook.h @@ -0,0 +1,41 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +#ifndef CRHOOK_H +#define CRHOOK_H + +/* + * Create the co-routines used to communicate wit the tick hook. + */ +void vStartHookCoRoutines( void ); + +/* + * Return pdPASS or pdFAIL depending on whether an error has been detected + * or not. + */ +BaseType_t xAreHookCoRoutinesStillRunning( void ); + +#endif diff --git a/FreeRTOS/Demo/Cygnal/FreeRTOSConfig.h b/FreeRTOS/Demo/Cygnal/FreeRTOSConfig.h index 40a50b47a..41676c967 100644 --- a/FreeRTOS/Demo/Cygnal/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/Cygnal/FreeRTOSConfig.h @@ -39,7 +39,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -57,6 +57,9 @@ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/Cygnal/Makefile b/FreeRTOS/Demo/Cygnal/Makefile index 0d6a06942..75e57f50c 100644 --- a/FreeRTOS/Demo/Cygnal/Makefile +++ b/FreeRTOS/Demo/Cygnal/Makefile @@ -93,6 +93,6 @@ main : main.c Makefile ../../Source/portable/SDCC/Cygnal/portmacro.h $(OBJ) - + diff --git a/FreeRTOS/Demo/Cygnal/main.c b/FreeRTOS/Demo/Cygnal/main.c index e0a8ceaa4..041dc8ee4 100644 --- a/FreeRTOS/Demo/Cygnal/main.c +++ b/FreeRTOS/Demo/Cygnal/main.c @@ -27,17 +27,17 @@ /* * Creates the demo application tasks, then starts the scheduler. The WEB * documentation provides more details of the demo application tasks. - * + * * Main. c also creates four other tasks: - * + * * 1) vErrorChecks() - * This only executes every few seconds but has the highest priority so is - * guaranteed to get processor time. Its main function is to check that all + * This only executes every few seconds but has the highest priority so is + * guaranteed to get processor time. Its main function is to check that all * the standard demo application tasks are still operational and have not * experienced any errors. vErrorChecks() will toggle the on board LED * every mainNO_ERROR_FLASH_PERIOD milliseconds if none of the demo application * tasks have reported an error. Should any task report an error at any time - * the rate at which the on board LED is toggled is increased to + * the rate at which the on board LED is toggled is increased to * mainERROR_FLASH_PERIOD - providing visual feedback that something has gone * wrong. * @@ -129,7 +129,7 @@ values to check for in the DPH, DPL and B registers. */ /* Macro that lets vErrorChecks() know that one of the tasks defined in main. c has detected an error. A critical region is used around xLatchError -as it is accessed from vErrorChecks(), which has a higher priority. */ +as it is accessed from vErrorChecks(), which has a higher priority. */ #define mainLATCH_ERROR() \ { \ portENTER_CRITICAL(); \ @@ -138,37 +138,37 @@ as it is accessed from vErrorChecks(), which has a higher priority. */ } /* - * Setup the Cygnal microcontroller for its fastest operation. + * Setup the Cygnal microcontroller for its fastest operation. */ static void prvSetupSystemClock( void ); /* - * Setup the peripherals, including the on board LED. + * Setup the peripherals, including the on board LED. */ static void prvSetupHardware( void ); /* - * Toggle the state of the on board LED. + * Toggle the state of the on board LED. */ static void prvToggleOnBoardLED( void ); /* - * See comments at the top of the file for details. + * See comments at the top of the file for details. */ static void vErrorChecks( void *pvParameters ); /* - * See comments at the top of the file for details. + * See comments at the top of the file for details. */ static void vRegisterCheck( void *pvParameters ); /* - * See comments at the top of the file for details. + * See comments at the top of the file for details. */ static void vFLOPCheck1( void *pvParameters ); /* - * See comments at the top of the file for details. + * See comments at the top of the file for details. */ static void vFLOPCheck2( void *pvParameters ); @@ -179,7 +179,7 @@ static portBASE_TYPE xLatchedError = pdFALSE; /*-----------------------------------------------------------*/ /* - * Starts all the other tasks, then starts the scheduler. + * Starts all the other tasks, then starts the scheduler. */ void main( void ) { @@ -206,7 +206,7 @@ void main( void ) xTaskCreate( vFLOPCheck1, "FLOP", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL ); xTaskCreate( vFLOPCheck2, "FLOP", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL ); } - #endif + #endif xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, ( TaskHandle_t * ) NULL ); @@ -245,7 +245,7 @@ unsigned char ucOriginalSFRPage; /* Set the on board LED to push pull. */ P1MDOUT |= mainPORT_1_BIT_6; - /* Setup the cross bar to enable serial comms here as it is not part of the + /* Setup the cross bar to enable serial comms here as it is not part of the standard 8051 setup and therefore is not in the driver code. */ XBR0 |= mainENABLE_COMS; P0MDOUT |= mainCOMS_LINES_TO_PUSH_PULL; @@ -331,22 +331,22 @@ static void prvToggleOnBoardLED( void ) /*-----------------------------------------------------------*/ /* - * See the documentation at the top of this file. + * See the documentation at the top of this file. */ static void vErrorChecks( void *pvParameters ) { portBASE_TYPE xErrorHasOccurred = pdFALSE; - + /* Just to prevent compiler warnings. */ ( void ) pvParameters; - + /* Cycle for ever, delaying then checking all the other tasks are still operating without error. The delay period depends on whether an error has ever been detected. */ for( ;; ) { if( xLatchedError == pdFALSE ) - { + { /* No errors have been detected so delay for a longer period. The on board LED will get toggled every mainNO_ERROR_FLASH_PERIOD ms. */ vTaskDelay( mainNO_ERROR_FLASH_PERIOD ); @@ -359,8 +359,8 @@ portBASE_TYPE xErrorHasOccurred = pdFALSE; vTaskDelay( mainERROR_FLASH_PERIOD ); } - - + + /* Check the demo application tasks for errors. */ if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) @@ -383,7 +383,7 @@ portBASE_TYPE xErrorHasOccurred = pdFALSE; xErrorHasOccurred = pdTRUE; } - /* If an error has occurred, latch it to cause the LED flash rate to + /* If an error has occurred, latch it to cause the LED flash rate to increase. */ if( xErrorHasOccurred == pdTRUE ) { @@ -391,7 +391,7 @@ portBASE_TYPE xErrorHasOccurred = pdFALSE; } /* Toggle the LED to indicate the completion of a check cycle. The - frequency of check cycles is dependent on whether or not we have + frequency of check cycles is dependent on whether or not we have latched an error. */ prvToggleOnBoardLED(); } @@ -458,7 +458,7 @@ volatile portFLOAT fVal1, fVal2, fResult; /*-----------------------------------------------------------*/ /* - * See the documentation at the top of this file. + * See the documentation at the top of this file. */ static void vRegisterCheck( void *pvParameters ) { @@ -550,7 +550,7 @@ static void vRegisterCheck( void *pvParameters ) if( B != 0x01 ) { mainLATCH_ERROR(); - } + } } } diff --git a/FreeRTOS/Demo/Cygnal/serial/serial.c b/FreeRTOS/Demo/Cygnal/serial/serial.c index c87ca217e..f9afb12c6 100644 --- a/FreeRTOS/Demo/Cygnal/serial/serial.c +++ b/FreeRTOS/Demo/Cygnal/serial/serial.c @@ -42,8 +42,8 @@ #define ser8BIT_WITH_RELOAD ( ( unsigned char ) 0x20 ) #define serSMOD ( ( unsigned char ) 0x10 ) -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; data static unsigned portBASE_TYPE uxTxEmpty; @@ -65,7 +65,7 @@ unsigned char ucOriginalSFRPage; /* Create the queues used by the com test task. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) ); xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) ); - + /* Calculate the baud rate to use timer 1. */ ulReloadValue = ( unsigned long ) ( ( ( portFLOAT ) 256 - ( fBaudConst / ( portFLOAT ) ( 32 * ulWantedBaud ) ) ) + ( portFLOAT ) 0.5 ); @@ -90,7 +90,7 @@ unsigned char ucOriginalSFRPage; SFRPAGE = ucOriginalSFRPage; } portEXIT_CRITICAL(); - + /* Unlike some 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. */ @@ -108,7 +108,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; portENTER_CRITICAL(); { - if( RI ) + if( RI ) { /* Get the character and post it on the queue of Rxed characters. If the post causes a task to wake force a context switch if the woken task @@ -119,7 +119,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); } - if( TI ) + if( TI ) { if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == ( portBASE_TYPE ) pdTRUE ) { @@ -134,7 +134,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; TI = 0; } - + if( xHigherPriorityTaskWoken ) { portYIELD(); diff --git a/FreeRTOS/Demo/Flshlite/FRConfig.h b/FreeRTOS/Demo/Flshlite/FRConfig.h index 40a616815..a62f1f5eb 100644 --- a/FreeRTOS/Demo/Flshlite/FRConfig.h +++ b/FreeRTOS/Demo/Flshlite/FRConfig.h @@ -40,13 +40,17 @@ #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 10 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) /* This can be made smaller if required. */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 -/* The maximum number of characters a task name can take, +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* The maximum number of characters a task name can take, including the null terminator. */ #define configMAX_TASK_NAME_LEN ( 16 ) @@ -66,7 +70,7 @@ to exclude the component. */ /* Use/don't use the trace visualisation. */ #define configUSE_TRACE_FACILITY 0 -/* +/* * The tick count (and times defined in tick count units) can be either a 16bit * or a 32 bit value. See documentation on http://www.FreeRTOS.org to decide * which to use. diff --git a/FreeRTOS/Demo/Flshlite/FileIO/fileIO.c b/FreeRTOS/Demo/Flshlite/FileIO/fileIO.c index 09a27c26c..75a70412b 100644 --- a/FreeRTOS/Demo/Flshlite/FileIO/fileIO.c +++ b/FreeRTOS/Demo/Flshlite/FileIO/fileIO.c @@ -57,7 +57,7 @@ const char * const pcSeparator = "\r\n-----------------------\r\n"; FILE *pf; taskENTER_CRITICAL(); - { + { pf = fopen( pcFileName, "a" ); if( pf != NULL ) { diff --git a/FreeRTOS/Demo/Flshlite/FreeRTOSConfig.h b/FreeRTOS/Demo/Flshlite/FreeRTOSConfig.h index 8e99483fc..002399c93 100644 --- a/FreeRTOS/Demo/Flshlite/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/Flshlite/FreeRTOSConfig.h @@ -37,7 +37,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -48,12 +48,15 @@ #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 10 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) /* This can be made smaller if required. */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -69,7 +72,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/Flshlite/ParTest/ParTest.c b/FreeRTOS/Demo/Flshlite/ParTest/ParTest.c index 1a207897f..cff52dd1e 100644 --- a/FreeRTOS/Demo/Flshlite/ParTest/ParTest.c +++ b/FreeRTOS/Demo/Flshlite/ParTest/ParTest.c @@ -77,7 +77,7 @@ unsigned char ucBit = ( unsigned char ) 1; if( uxLED <= partstMAX_OUTPUT_LED ) { ucBit <<= uxLED; - } + } vTaskSuspendAll(); { @@ -118,7 +118,7 @@ unsigned char ucBit; portOUTPUT_BYTE( partstPORT_F_ADDR, ( unsigned ) ucCurrentOutputValue ); } - xTaskResumeAll(); + xTaskResumeAll(); } } diff --git a/FreeRTOS/Demo/Flshlite/main.c b/FreeRTOS/Demo/Flshlite/main.c index 67e85c0c8..aa723c434 100644 --- a/FreeRTOS/Demo/Flshlite/main.c +++ b/FreeRTOS/Demo/Flshlite/main.c @@ -27,13 +27,13 @@ /* * Creates all the demo application tasks, then starts the scheduler. * - * Main. c also creates a task called "Print". This only executes every five - * seconds but has the highest priority so is guaranteed to get processor time. - * Its main function is to check that all the other tasks are still operational. - * Nearly all the tasks in the demo application maintain a unique count that is - * incremented each time the task successfully completes its function. Should any - * error occur within the task the count is permanently halted. The print task - * checks the count of each task to ensure it has changed since the last time the + * Main. c also creates a task called "Print". This only executes every five + * seconds but has the highest priority so is guaranteed to get processor time. + * Its main function is to check that all the other tasks are still operational. + * Nearly all the tasks in the demo application maintain a unique count that is + * incremented each time the task successfully completes its function. Should any + * error occur within the task the count is permanently halted. The print task + * checks the count of each task to ensure it has changed since the last time the * print task executed. If any count is found not to have changed the print task * displays an appropriate message, halts, and flashes the on board LED rapidly. * If all the tasks are still incrementing their unique counts the print task @@ -64,7 +64,7 @@ Changes from V1.01: Changes from V1.2.3 - + The integer and comtest tasks are now used when the cooperative scheduler + + The integer and comtest tasks are now used when the cooperative scheduler is being used. Previously they were only used with the preemptive scheduler. @@ -242,7 +242,7 @@ static void prvCheckForKeyPresses( void ) short sIn; - + taskENTER_CRITICAL(); sIn = kbhit(); taskEXIT_CRITICAL(); diff --git a/FreeRTOS/Demo/Flshlite/serial/serial.c b/FreeRTOS/Demo/Flshlite/serial/serial.c index febe83c3b..b64117d96 100644 --- a/FreeRTOS/Demo/Flshlite/serial/serial.c +++ b/FreeRTOS/Demo/Flshlite/serial/serial.c @@ -26,8 +26,8 @@ /* Changes from V1.00: - - + Call to the more efficient portSWITCH_CONTEXT() replaces the call to + + + Call to the more efficient portSWITCH_CONTEXT() replaces the call to taskYIELD() in the ISR. Changes from V1.01: @@ -42,7 +42,7 @@ Changes from V1.2.0: Changes from V1.2.3 - + The function xPortInitMinimal() has been renamed to + + The function xPortInitMinimal() has been renamed to xSerialPortInitMinimal() and the function xPortInit() has been renamed to xSerialPortInit(). @@ -104,70 +104,70 @@ Changes from V2.0.0 #define serDONT_BLOCK ( ( TickType_t ) 0 ) typedef enum -{ - serCOM1 = 0, - serCOM2, - serCOM3, - serCOM4, - serCOM5, - serCOM6, - serCOM7, - serCOM8 +{ + serCOM1 = 0, + serCOM2, + serCOM3, + serCOM4, + serCOM5, + serCOM6, + serCOM7, + serCOM8 } eCOMPort; -typedef enum -{ - serNO_PARITY, - serODD_PARITY, - serEVEN_PARITY, - serMARK_PARITY, - serSPACE_PARITY +typedef enum +{ + serNO_PARITY, + serODD_PARITY, + serEVEN_PARITY, + serMARK_PARITY, + serSPACE_PARITY } eParity; -typedef enum -{ - serSTOP_1, - serSTOP_2 +typedef enum +{ + serSTOP_1, + serSTOP_2 } eStopBits; -typedef enum -{ - serBITS_5, - serBITS_6, - serBITS_7, - serBITS_8 +typedef enum +{ + serBITS_5, + serBITS_6, + serBITS_7, + serBITS_8 } eDataBits; -typedef enum -{ +typedef enum +{ ser50 = 0, - ser75, - ser110, - ser134, - ser150, + ser75, + ser110, + ser134, + ser150, ser200, - ser300, - ser600, - ser1200, - ser1800, - ser2400, + ser300, + ser600, + ser1200, + ser1800, + ser2400, ser4800, - ser9600, - ser19200, - ser38400, - ser57600, + ser9600, + ser19200, + ser38400, + ser57600, ser115200 } eBaud; /* Must be same order as eBaud definitions. */ -static const unsigned short usBaudRateDivisor[] = +static const unsigned short usBaudRateDivisor[] = { 0, /* Not sure if the first 6 are correct. First cannot be used. */ 29127, 19859, 16302, 14564, - 10923, + 10923, 6879, 3437, 1718, @@ -196,7 +196,7 @@ typedef struct xCOM_PORT unsigned short usIRQVector; /* Queues used for communications with com test task. */ - QueueHandle_t xRxedChars; + QueueHandle_t xRxedChars; QueueHandle_t xCharsForTx; /* This semaphore does nothing useful except test a feature of the @@ -205,7 +205,7 @@ typedef struct xCOM_PORT } xComPort; -static xComPort xPorts[ serMAX_PORTS ] = +static xComPort xPorts[ serMAX_PORTS ] = { { pdFALSE, serPORT_0_INT_REG, serPORT_0_BAUD_REG, serPORT_0_RX_REG, serPORT_0_TX_REG, serPORT_0_STATUS_REG, serPORT_0_CTRL_REG, serPORT_0_IRQ, NULL, NULL, NULL }, { pdFALSE, serPORT_1_INT_REG, serPORT_1_BAUD_REG, serPORT_1_RX_REG, serPORT_1_TX_REG, serPORT_1_STATUS_REG, serPORT_1_CTRL_REG, serPORT_1_IRQ, NULL, NULL, NULL } @@ -239,7 +239,7 @@ unsigned short usIn; \ } \ } \ portEXIT_CRITICAL(); \ -} +} /*-----------------------------------------------------------*/ #define vInterruptOff( pxPort, usInterrupt ) \ @@ -264,14 +264,14 @@ unsigned short usIn; \ } \ } - + COM_IRQ_WRAPPER( 0 ) COM_IRQ_WRAPPER( 1 ) -static pxISR xISRs[ serMAX_PORTS ] = +static pxISR xISRs[ serMAX_PORTS ] = { - COM_IRQ0_WRAPPER, + COM_IRQ0_WRAPPER, COM_IRQ1_WRAPPER }; @@ -293,7 +293,7 @@ xComPortHandle pxPort = NULL; /* Currently only n,8,1 is supported. */ usPort = ( unsigned short ) ePort; - + if( usPort < serMAX_PORTS ) { pxPort = &( xPorts[ usPort ] ); @@ -348,7 +348,7 @@ char *pcNextChar; portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, char *pcRxedChar, TickType_t xBlockTime ) { - /* Get the next character from the buffer, note that this routine is only + /* Get the next character from the buffer, note that this routine is only called having checked that the is (at least) one to get */ if( xQueueReceive( pxPort->xRxedChars, pcRxedChar, xBlockTime ) ) { @@ -378,7 +378,7 @@ portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort ) { const TickType_t xBlockTime = ( TickType_t ) 0xffff; - /* This function does nothing interesting, but test the + /* This function does nothing interesting, but test the semaphore from ISR mechanism. */ return xSemaphoreTake( xPort->xTestSem, xBlockTime ); } diff --git a/FreeRTOS/Demo/H8S/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/H8S/RTOSDemo/FreeRTOSConfig.h index d7064e838..13313dbee 100644 --- a/FreeRTOS/Demo/H8S/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/H8S/RTOSDemo/FreeRTOSConfig.h @@ -37,7 +37,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -55,6 +55,9 @@ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/H8S/RTOSDemo/ParTest/ParTest.c b/FreeRTOS/Demo/H8S/RTOSDemo/ParTest/ParTest.c index 19725d8a9..bf9ab7ae0 100644 --- a/FreeRTOS/Demo/H8S/RTOSDemo/ParTest/ParTest.c +++ b/FreeRTOS/Demo/H8S/RTOSDemo/ParTest/ParTest.c @@ -105,7 +105,7 @@ unsigned char ucLED; portENTER_CRITICAL(); P2DR &= ~ucLED; portEXIT_CRITICAL(); - } + } } } /*-----------------------------------------------------------*/ @@ -133,7 +133,7 @@ unsigned char ucLED; } } portEXIT_CRITICAL(); - } + } } diff --git a/FreeRTOS/Demo/H8S/RTOSDemo/serial/serial.c b/FreeRTOS/Demo/H8S/RTOSDemo/serial/serial.c index 909a6785a..aa7bdbb34 100644 --- a/FreeRTOS/Demo/H8S/RTOSDemo/serial/serial.c +++ b/FreeRTOS/Demo/H8S/RTOSDemo/serial/serial.c @@ -44,8 +44,8 @@ peripheral. */ /* The queues used to communicate between the task code and the interrupt service routines. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /* Hardware specific constants. */ #define serTX_INTERRUPT ( ( unsigned char ) 0x80 ) @@ -54,18 +54,18 @@ static QueueHandle_t xCharsForTx; #define serRX_ENABLE ( ( unsigned char ) 0x10 ) /* Macros to turn on and off the serial port THRE interrupt while leaving the -other register bits in their correct state. The Rx interrupt is always +other register bits in their correct state. The Rx interrupt is always enabled. */ -#define serTX_INTERRUPT_ON() SCR1 = serTX_INTERRUPT | serRX_INTERRUPT | serTX_ENABLE | serRX_ENABLE; +#define serTX_INTERRUPT_ON() SCR1 = serTX_INTERRUPT | serRX_INTERRUPT | serTX_ENABLE | serRX_ENABLE; #define serTX_INTERRUPT_OFF() SCR1 = serRX_INTERRUPT | serTX_ENABLE | serRX_ENABLE; -/* Bit used to switch on the channel 1 serial port in the module stop +/* Bit used to switch on the channel 1 serial port in the module stop register. */ #define serMSTP6 ( ( unsigned short ) 0x0040 ) -/* Interrupt service routines. Note that the Rx and Tx service routines can +/* Interrupt service routines. Note that the Rx and Tx service routines can cause a context switch and are therefore defined with the saveall attribute in -addition to the interrupt_handler attribute. See the FreeRTOS.org WEB site +addition to the interrupt_handler attribute. See the FreeRTOS.org WEB site documentation for a full explanation.*/ void vCOM_1_Rx_ISR( void ) __attribute__ ( ( saveall, interrupt_handler ) ); void vCOM_1_Tx_ISR( void ) __attribute__ ( ( saveall, interrupt_handler ) ); @@ -83,14 +83,14 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); - /* No parity, 8 data bits and 1 stop bit is the default so does not require + /* No parity, 8 data bits and 1 stop bit is the default so does not require configuration - setup the remains of the hardware. */ portENTER_CRITICAL(); { /* Turn channel 1 on. */ MSTPCR &= ~serMSTP6; - /* Enable the channels and the Rx interrupt. The Tx interrupt is only + /* Enable the channels and the Rx interrupt. The Tx interrupt is only enabled when data is being transmitted. */ SCR1 = serRX_INTERRUPT | serTX_ENABLE | serRX_ENABLE; @@ -113,7 +113,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port break; } } - portEXIT_CRITICAL(); + portEXIT_CRITICAL(); /* Unlike some ports, this driver code does not allow for more than one com port. We therefore don't return a pointer to a port structure and can @@ -166,7 +166,7 @@ signed portBASE_TYPE xReturn = pdPASS; /*-----------------------------------------------------------*/ void vSerialClose( xComPortHandle xPort ) -{ +{ /* Not supported. */ ( void ) xPort; } @@ -178,7 +178,7 @@ void vCOM_1_Rx_ISR( void ) in the function. */ portENTER_SWITCHING_ISR(); - /* As this is a switching ISR the local variables must be declared as + /* As this is a switching ISR the local variables must be declared as static. */ static char cRxByte; static portBASE_TYPE xHigherPriorityTaskWoken; @@ -195,7 +195,7 @@ void vCOM_1_Rx_ISR( void ) /* Clear the interrupt. */ SSR1 &= ~serRX_INTERRUPT; - /* This must be the last line in the function. We pass cTaskWokenByPost so + /* This must be the last line in the function. We pass cTaskWokenByPost so a context switch will occur if the received character woke a task that has a priority higher than the task we interrupted. */ portEXIT_SWITCHING_ISR( xHigherPriorityTaskWoken ); @@ -208,7 +208,7 @@ void vCOM_1_Tx_ISR( void ) in the function. */ portENTER_SWITCHING_ISR(); - /* As this is a switching ISR the local variables must be declared as + /* As this is a switching ISR the local variables must be declared as static. */ static char cTxByte; static signed portBASE_TYPE xTaskWokenByTx; @@ -223,7 +223,7 @@ void vCOM_1_Tx_ISR( void ) if( xQueueReceiveFromISR( xCharsForTx, &cTxByte, &xTaskWokenByTx ) == pdTRUE ) { /* A character was retrieved from the queue so can be sent to the - THR now. */ + THR now. */ TDR1 = cTxByte; /* Clear the interrupt. */ @@ -233,9 +233,9 @@ void vCOM_1_Tx_ISR( void ) { /* Queue empty, nothing to send so turn off the Tx interrupt. */ serTX_INTERRUPT_OFF(); - } + } - /* This must be the last line in the function. We pass cTaskWokenByTx so + /* This must be the last line in the function. We pass cTaskWokenByTx so a context switch will occur if the Tx'ed character woke a task that has a priority higher than the task we interrupted. */ portEXIT_SWITCHING_ISR( xTaskWokenByTx ); @@ -243,8 +243,8 @@ void vCOM_1_Tx_ISR( void ) /*-----------------------------------------------------------*/ /* - * This ISR cannot cause a context switch so requires no special - * considerations. + * This ISR cannot cause a context switch so requires no special + * considerations. */ void vCOM_1_Error_ISR( void ) { diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/FreeRTOSConfig.h b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/FreeRTOSConfig.h index bbd191e30..ed874fa71 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/FreeRTOSConfig.h @@ -41,7 +41,7 @@ model. */ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -58,9 +58,12 @@ model. */ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* This parameter is normally required in order to set the RTOS tick timer. -This port is a bit different in that hardware setup uses the code generated by +This port is a bit different in that hardware setup uses the code generated by the Processor Expert, making this definition obsolete. #define configCPU_CLOCK_HZ ( ( unsigned long ) 25000000 ) diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/ParTest/ParTest.c b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/ParTest/ParTest.c index 45aec94aa..f0425f579 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/ParTest/ParTest.c +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/ParTest/ParTest.c @@ -40,7 +40,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { - /* This function is required as it is called from the standard demo + /* This function is required as it is called from the standard demo application files. All it does however is call the Processor Expert created function. */ portENTER_CRITICAL(); diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/main.c b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/main.c index 1bc9b903d..a6d663e80 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/main.c +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/main.c @@ -29,26 +29,26 @@ /* * * vMain() is effectively the demo application entry point. It is called by - * the main() function generated by the Processor Expert application. + * the main() function generated by the Processor Expert application. * * vMain() creates all the demo application tasks, then starts the scheduler. * The WEB documentation provides more details of the demo application tasks. * - * Main.c also creates a task called "Check". This only executes every three - * seconds but has the highest priority so is guaranteed to get processor time. + * Main.c also creates a task called "Check". This only executes every three + * seconds but has the highest priority so is guaranteed to get processor time. * Its main function is to check that all the other tasks are still operational. - * Each task (other than the "flash" tasks) maintains a unique count that is - * incremented each time the task successfully completes its function. Should - * any error occur within such a task the count is permanently halted. The + * Each task (other than the "flash" tasks) maintains a unique count that is + * incremented each time the task successfully completes its function. Should + * any error occur within such a task the count is permanently halted. The * check task inspects the count of each task to ensure it has changed since - * the last time the check task executed. If all the count variables have + * the last time the check task executed. If all the count variables have * changed all the tasks are still executing error free, and the check task - * toggles the onboard LED. Should any task contain an error at any time + * toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * - * This file also includes the functionality implemented within the + * This file also includes the functionality implemented within the * standard demo application file integer.c. This is done to demonstrate the - * use of an idle hook. See the documentation within integer.c for the + * use of an idle hook. See the documentation within integer.c for the * rationale of the integer task functionality. * */ @@ -82,7 +82,7 @@ /* LED that is toggled by the check task. The check task periodically checks that all the other tasks are operating without error. If no errors are found -the LED is toggled with mainCHECK_PERIOD frequency. If an error is found +the LED is toggled with mainCHECK_PERIOD frequency. If an error is found then the toggle rate increases to mainERROR_CHECK_PERIOD. */ #define mainCHECK_TASK_LED ( 7 ) #define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) @@ -145,7 +145,7 @@ portBASE_TYPE xLocalError = pdFALSE; /*-----------------------------------------------------------*/ -/* +/* * This is called from the main() function generated by the Processor Expert. */ void vMain( void ) @@ -157,17 +157,17 @@ void vMain( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartIntegerMathTasks( tskIDLE_PRIORITY ); - + /* Start the locally defined tasks. There is also a task implemented as the idle hook. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); - + /* Must be the last demo created. */ vCreateSuicidalTasks( mainDEATH_PRIORITY ); /* All the tasks have been created - start the scheduler. */ vTaskStartScheduler(); - + /* Should not reach here! */ for( ;; ); } @@ -184,11 +184,11 @@ TickType_t xLastWakeTime; for( ;; ) { - /* Delay until it is time to execute again. The delay period is + /* Delay until it is time to execute again. The delay period is shorter following an error. */ vTaskDelayUntil( &xLastWakeTime, xDelayPeriod ); - /* Check all the demo application tasks are executing without + /* Check all the demo application tasks are executing without error. If an error is found the delay period is shortened - this has the effect of increasing the flash rate of the 'check' task LED. */ @@ -227,11 +227,11 @@ portBASE_TYPE xAllTasksPassed = pdPASS; { xAllTasksPassed = pdFALSE; } - + if( xAreBlockingQueuesStillRunning() != pdTRUE ) { xAllTasksPassed = pdFALSE; - } + } if( xIsCreateTaskStillRunning() != pdTRUE ) { @@ -243,7 +243,7 @@ portBASE_TYPE xAllTasksPassed = pdPASS; { xAllTasksPassed = pdFAIL; } - + return xAllTasksPassed; } /*-----------------------------------------------------------*/ @@ -277,7 +277,7 @@ volatile long lValue; { taskYIELD(); } - #endif + #endif } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/serial/serial.c b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/serial/serial.c index 0133dcadd..2cea3b358 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_banked/serial/serial.c +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_banked/serial/serial.c @@ -43,8 +43,8 @@ to represent an optimised solution. */ /* The queues used to communicate between the task code and the interrupt service routines. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /* Interrupt identification bits. */ #define serOVERRUN_INTERRUPT ( 0x08 ) @@ -59,8 +59,8 @@ static QueueHandle_t xCharsForTx; */ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) { - /* Hardware setup is performed by the Processor Expert generated code. - This function just creates the queues used to communicate between the + /* Hardware setup is performed by the Processor Expert generated code. + This function just creates the queues used to communicate between the interrupt code and the task code - then sets the required baud rate. */ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); @@ -106,16 +106,16 @@ signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar /*-----------------------------------------------------------*/ void vSerialClose( xComPortHandle xPort ) -{ +{ /* Not supported. */ ( void ) xPort; } /*-----------------------------------------------------------*/ -/* +/* * Interrupt service routine for the serial port. Must be in non-banked - * memory. + * memory. */ #pragma CODE_SEG __NEAR_SEG NON_BANKED @@ -127,7 +127,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; /* What caused the interrupt? */ ucStatus = SCI0SR1; - + if( ucStatus & serOVERRUN_INTERRUPT ) { /* The interrupt was caused by an overrun. Clear the error by reading @@ -136,18 +136,18 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; } if( ucStatus & serRX_INTERRUPT ) - { + { /* The interrupt was caused by a character being received. Read the received byte. */ - ucByte = SCI0DRL; + ucByte = SCI0DRL; /* Post the character onto the queue of received characters - noting whether or not this wakes a task. */ xQueueSendFromISR( xRxedChars, ( void * ) &ucByte, &xHigherPriorityTaskWoken ); } - + if( ( ucStatus & serTX_INTERRUPT ) && ( SCI0CR2_SCTIE ) ) - { + { /* The interrupt was caused by a character being transmitted. */ if( xQueueReceiveFromISR( xCharsForTx, ( void * ) &ucByte, &xHigherPriorityTaskWoken ) == pdTRUE ) { @@ -157,7 +157,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; else { /* Disable transmit interrupt */ - SCI0CR2_SCTIE = 0; + SCI0CR2_SCTIE = 0; } } diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_small/FreeRTOSConfig.h b/FreeRTOS/Demo/HCS12_CodeWarrior_small/FreeRTOSConfig.h index 2783220ed..0f2b07120 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_small/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_small/FreeRTOSConfig.h @@ -37,7 +37,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -54,9 +54,12 @@ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* This parameter is normally required in order to set the RTOS tick timer. -This port is a bit different in that hardware setup uses the code generated by +This port is a bit different in that hardware setup uses the code generated by the Processor Expert, making this definition obsolete. #define configCPU_CLOCK_HZ ( ( unsigned long ) 24000000 ) diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_small/ParTest/ParTest.c b/FreeRTOS/Demo/HCS12_CodeWarrior_small/ParTest/ParTest.c index 45aec94aa..f0425f579 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_small/ParTest/ParTest.c +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_small/ParTest/ParTest.c @@ -40,7 +40,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { - /* This function is required as it is called from the standard demo + /* This function is required as it is called from the standard demo application files. All it does however is call the Processor Expert created function. */ portENTER_CRITICAL(); diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_small/main.c b/FreeRTOS/Demo/HCS12_CodeWarrior_small/main.c index 39aee6043..8ecf98ae8 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_small/main.c +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_small/main.c @@ -28,32 +28,32 @@ /* * * vMain() is effectively the demo application entry point. It is called by - * the main() function generated by the Processor Expert application. + * the main() function generated by the Processor Expert application. * * vMain() creates all the demo application tasks, then starts the scheduler. * The WEB documentation provides more details of the demo application tasks. * - * Main.c also creates a task called "Check". This only executes every three - * seconds but has the highest priority so is guaranteed to get processor time. + * Main.c also creates a task called "Check". This only executes every three + * seconds but has the highest priority so is guaranteed to get processor time. * Its main function is to check that all the other tasks are still operational. - * Each task (other than the "flash" tasks) maintains a unique count that is - * incremented each time the task successfully completes its function. Should - * any error occur within such a task the count is permanently halted. The + * Each task (other than the "flash" tasks) maintains a unique count that is + * incremented each time the task successfully completes its function. Should + * any error occur within such a task the count is permanently halted. The * check task inspects the count of each task to ensure it has changed since - * the last time the check task executed. If all the count variables have + * the last time the check task executed. If all the count variables have * changed all the tasks are still executing error free, and the check task - * toggles the onboard LED. Should any task contain an error at any time + * toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * - * This file also includes the functionality normally implemented within the - * standard demo application file integer.c. Due to the limited memory + * This file also includes the functionality normally implemented within the + * standard demo application file integer.c. Due to the limited memory * available on the microcontroller the functionality has been included within * the idle task hook [vApplicationIdleHook()] - instead of within the usual - * separate task. See the documentation within integer.c for the rationale + * separate task. See the documentation within integer.c for the rationale * of the integer task functionality. * * - * + * * The demo applications included with other FreeRTOS ports make use of the * standard ComTest tasks. These use a loopback connector to transmit and * receive RS232 characters between two tasks. The test is important for two @@ -66,21 +66,21 @@ * * The demo board used to develop this port does not include an RS232 interface * so the ComTest tasks could not easily be included. Instead these two tests - * are created using a 'Button Push' task. - * + * are created using a 'Button Push' task. + * * The 'Button Push' task blocks on a queue, waiting for data to arrive. A * simple interrupt routine connected to the PP0 input on the demo board places - * data in the queue each time the PP0 button is pushed (this button is built - * onto the demo board). As the 'Button Push' task is created with a + * data in the queue each time the PP0 button is pushed (this button is built + * onto the demo board). As the 'Button Push' task is created with a * relatively high priority it will unblock and want to execute as soon as data * arrives in the queue - resulting in a context switch within the PP0 input * ISR. If the data retrieved from the queue is that expected the 'Button Push' * task toggles LED 5. Therefore correct operation is indicated by the LED * toggling each time the PP0 button is pressed. * - * This test is not as satisfactory as the ComTest method - but the simple + * This test is not as satisfactory as the ComTest method - but the simple * nature of the port makes is just about adequate. - * + * */ /* Kernel includes. */ @@ -109,7 +109,7 @@ /* LED that is toggled by the check task. The check task periodically checks that all the other tasks are operating without error. If no errors are found -the LED is toggled with mainCHECK_PERIOD frequency. If an error is found +the LED is toggled with mainCHECK_PERIOD frequency. If an error is found then the toggle rate increases to mainERROR_CHECK_PERIOD. */ #define mainCHECK_TASK_LED ( 7 ) #define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) @@ -165,14 +165,14 @@ their status. If an error is detected in one of the locally defined tasks then this flag is set to pdTRUE. */ portBASE_TYPE xLocalError = pdFALSE; -/* The queue used to send data from the button push ISR to the Button Push +/* The queue used to send data from the button push ISR to the Button Push task. */ static QueueHandle_t xButtonQueue; /*-----------------------------------------------------------*/ -/* +/* * This is called from the main() function generated by the Processor Expert. */ void vMain( void ) @@ -181,15 +181,15 @@ void vMain( void ) vStartLEDFlashTasks( mainFLASH_PRIORITY ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartDynamicPriorityTasks(); - + /* Start the locally defined tasks. There is also a task implemented as the idle hook. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); xTaskCreate( vButtonTask, "Button", configMINIMAL_STACK_SIZE, NULL, mainBUTTON_TASK_PRIORITY, NULL ); - + /* All the tasks have been created - start the scheduler. */ vTaskStartScheduler(); - + /* Should not reach here! */ for( ;; ); } @@ -206,11 +206,11 @@ TickType_t xLastWakeTime; for( ;; ) { - /* Delay until it is time to execute again. The delay period is + /* Delay until it is time to execute again. The delay period is shorter following an error. */ vTaskDelayUntil( &xLastWakeTime, xDelayPeriod ); - /* Check all the demo application tasks are executing without + /* Check all the demo application tasks are executing without error. If an error is found the delay period is shortened - this has the effect of increasing the flash rate of the 'check' task LED. */ @@ -280,7 +280,7 @@ volatile long lValue; { taskYIELD(); } - #endif + #endif } } /*-----------------------------------------------------------*/ @@ -296,11 +296,11 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived; { /* Now the queue is created it is safe to enable the button interrupt. */ ButtonInterrupt_Enable(); - + for( ;; ) { /* Simply wait for data to arrive from the button push interrupt. */ - if( xQueueReceive( xButtonQueue, &uxReceived, portMAX_DELAY ) == pdPASS ) + if( xQueueReceive( xButtonQueue, &uxReceived, portMAX_DELAY ) == pdPASS ) { /* Was the data we received that expected? */ if( uxReceived != uxExpected ) @@ -308,21 +308,21 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived; /* Error! */ portENTER_CRITICAL(); xLocalError = pdTRUE; - portEXIT_CRITICAL(); + portEXIT_CRITICAL(); } else { /* Toggle the LED for every successful push. */ - vParTestToggleLED( mainBUTTON_PUSH_LED ); + vParTestToggleLED( mainBUTTON_PUSH_LED ); } - + uxExpected++; } } } - + /* Will only get here if the queue could not be created. */ - for( ;; ); + for( ;; ); } /*-----------------------------------------------------------*/ @@ -335,9 +335,9 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived; static unsigned long xHigherPriorityTaskWoken; xHigherPriorityTaskWoken = pdFALSE; - + /* Send an incrementing value to the button push task each run. */ - uxValToSend++; + uxValToSend++; /* Clear the interrupt flag. */ PIFP = 1; @@ -352,10 +352,10 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived; { /* NOTE: This macro can only be used if there are no local variables defined. This function uses a static variable so it's - use is permitted. If the variable were not static portYIELD() + use is permitted. If the variable were not static portYIELD() would have to be used in it's place. */ portTASK_SWITCH_FROM_ISR(); - } + } } #pragma CODE_SEG DEFAULT diff --git a/FreeRTOS/Demo/HCS12_CodeWarrior_small/serial/serial.c b/FreeRTOS/Demo/HCS12_CodeWarrior_small/serial/serial.c index 7f3ee65d4..1c7aed7a5 100644 --- a/FreeRTOS/Demo/HCS12_CodeWarrior_small/serial/serial.c +++ b/FreeRTOS/Demo/HCS12_CodeWarrior_small/serial/serial.c @@ -66,7 +66,7 @@ signed portBASE_TYPE xReturn = pdPASS; /*-----------------------------------------------------------*/ void vSerialClose( xComPortHandle xPort ) -{ +{ /* Not supported. */ ( void ) xPort; } diff --git a/FreeRTOS/Demo/HCS12_GCC_banked/FreeRTOSConfig.h b/FreeRTOS/Demo/HCS12_GCC_banked/FreeRTOSConfig.h index 6caac1915..f50452026 100644 --- a/FreeRTOS/Demo/HCS12_GCC_banked/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/HCS12_GCC_banked/FreeRTOSConfig.h @@ -24,7 +24,7 @@ * */ -/** +/** * FreeRTOSConfig.h configures FreeRTOS for GCC/HCS12 version of FreeRTOS Demo * * Modified by Jefferson L Smith, Robotronics Inc. @@ -44,7 +44,7 @@ model. */ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -61,6 +61,9 @@ model. */ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* This parameter is normally affects the clock frequency. In this port, at the moment it might just be used for reference. */ diff --git a/FreeRTOS/Demo/HCS12_GCC_banked/ParTest.c b/FreeRTOS/Demo/HCS12_GCC_banked/ParTest.c index 7a2aba6e2..72ef82ca4 100644 --- a/FreeRTOS/Demo/HCS12_GCC_banked/ParTest.c +++ b/FreeRTOS/Demo/HCS12_GCC_banked/ParTest.c @@ -24,7 +24,7 @@ * */ -/** +/** * ParTest.c controls bits (LEDs) for GCC/HCS12 version of FreeRTOS Demo * * Modified from CodeWarrior/HCS12 by Jefferson L Smith, Robotronics Inc. @@ -47,7 +47,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { - /* This function is required as it is called from the standard demo + /* This function is required as it is called from the standard demo application files. It manipulates a bit to control one LED. */ portENTER_CRITICAL(); diff --git a/FreeRTOS/Demo/HCS12_GCC_banked/main.c b/FreeRTOS/Demo/HCS12_GCC_banked/main.c index 470b480a0..382cbd5f4 100644 --- a/FreeRTOS/Demo/HCS12_GCC_banked/main.c +++ b/FreeRTOS/Demo/HCS12_GCC_banked/main.c @@ -31,21 +31,21 @@ * main() creates all the demo application tasks, then starts the scheduler. * The WEB documentation provides more details of the demo application tasks. * - * main.c also creates a task called "Check". This only executes every three - * seconds but has the highest priority so is guaranteed to get processor time. + * main.c also creates a task called "Check". This only executes every three + * seconds but has the highest priority so is guaranteed to get processor time. * Its main function is to check that all the other tasks are still operational. - * Each task (other than the "flash" tasks) maintains a unique count that is - * incremented each time the task successfully completes its function. Should - * any error occur within such a task the count is permanently halted. The + * Each task (other than the "flash" tasks) maintains a unique count that is + * incremented each time the task successfully completes its function. Should + * any error occur within such a task the count is permanently halted. The * check task inspects the count of each task to ensure it has changed since - * the last time the check task executed. If all the count variables have + * the last time the check task executed. If all the count variables have * changed all the tasks are still executing error free, and the check task - * toggles the onboard LED. Should any task contain an error at any time + * toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * - * This file also includes the functionality implemented within the + * This file also includes the functionality implemented within the * standard demo application file integer.c. This is done to demonstrate the - * use of an idle hook. See the documentation within integer.c for the + * use of an idle hook. See the documentation within integer.c for the * rationale of the integer task functionality. * */ @@ -85,7 +85,7 @@ portBASE_TYPE xArePollingQueuesStillRunning( void ); /* LED that is toggled by the check task. The check task periodically checks that all the other tasks are operating without error. If no errors are found -the LED is toggled with mainCHECK_PERIOD frequency. If an error is found +the LED is toggled with mainCHECK_PERIOD frequency. If an error is found then the toggle rate increases to mainERROR_CHECK_PERIOD. */ #define mainCHECK_TASK_LED ( 7 ) #define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) @@ -158,17 +158,17 @@ int ATTR_BANK0 main ( void ) vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartIntegerMathTasks( tskIDLE_PRIORITY ); - + /* Start the locally defined tasks. There is also a task implemented as the idle hook. */ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); - + /* Must be the last demo created. */ vCreateSuicidalTasks( mainDEATH_PRIORITY ); /* All the tasks have been created - start the scheduler. */ vTaskStartScheduler(); - + /* Should not reach here! */ for( ;; ); return 0; @@ -186,11 +186,11 @@ TickType_t xLastWakeTime; for( ;; ) { - /* Delay until it is time to execute again. The delay period is + /* Delay until it is time to execute again. The delay period is shorter following an error. */ vTaskDelayUntil( &xLastWakeTime, xDelayPeriod ); - /* Check all the demo application tasks are executing without + /* Check all the demo application tasks are executing without error. If an error is found the delay period is shortened - this has the effect of increasing the flash rate of the 'check' task LED. */ @@ -229,11 +229,11 @@ portBASE_TYPE xAllTasksPassed = pdPASS; { xAllTasksPassed = pdFALSE; } - + if( xAreBlockingQueuesStillRunning() != pdTRUE ) { xAllTasksPassed = pdFALSE; - } + } if( xIsCreateTaskStillRunning() != pdTRUE ) { @@ -245,7 +245,7 @@ portBASE_TYPE xAllTasksPassed = pdPASS; { xAllTasksPassed = pdFAIL; } - + return xAllTasksPassed; } /*-----------------------------------------------------------*/ @@ -279,7 +279,7 @@ volatile long lValue; { taskYIELD(); } - #endif + #endif } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/HCS12_GCC_banked/startup.c b/FreeRTOS/Demo/HCS12_GCC_banked/startup.c index 47acefe41..d96b58d44 100644 --- a/FreeRTOS/Demo/HCS12_GCC_banked/startup.c +++ b/FreeRTOS/Demo/HCS12_GCC_banked/startup.c @@ -48,7 +48,7 @@ __premain (void) COPCTL = RSBCK; // stops TCNT counter when debugging stops TSCR1 |= (1<<5); // TFRZ - + // PLL CLKSEL = 0; // disable PLL to configure // xtal 16MHz, bus 24MHz @@ -75,6 +75,6 @@ __premain (void) #elif PORT_LED==M6811_PTH //PTH DDRH = 0xff; #endif - + } diff --git a/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/FreeRTOSConfig.h b/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/FreeRTOSConfig.h index 4794598fd..56e60d4ab 100644 --- a/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/FreeRTOSConfig.h @@ -61,7 +61,7 @@ #define configMAX_API_CALL_INTERRUPT_PRIORITY 10 /* - * Interrupt entry code will switch the stack in use to a dedicated system + * Interrupt entry code will switch the stack in use to a dedicated system * stack. * * configISR_STACK_SIZE defines the number of 32-bit values that can be stored @@ -130,6 +130,9 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_TASK_NOTIFICATIONS 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/Full_Demo/RegTest.S b/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/Full_Demo/RegTest.S index 1d6a33115..ba2be7c19 100644 --- a/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/Full_Demo/RegTest.S +++ b/FreeRTOS/Demo/IA32_flat_GCC_Galileo_Gen_2/Full_Demo/RegTest.S @@ -46,7 +46,7 @@ .extern dRegTest2_st1 .extern vGenerateYieldInterrupt .extern vHPETIRQHandler1 - + .global vRegTest1 .global vRegTest2 .global vApplicationHPETTimer1Wrapper diff --git a/FreeRTOS/Demo/MB91460_Softune/91467d_FreeRTOS.prj b/FreeRTOS/Demo/MB91460_Softune/91467d_FreeRTOS.prj index 16f9be354..770517ff6 100644 --- a/FreeRTOS/Demo/MB91460_Softune/91467d_FreeRTOS.prj +++ b/FreeRTOS/Demo/MB91460_Softune/91467d_FreeRTOS.prj @@ -18,42 +18,44 @@ PrjInfo-1=MONDEB_INTERNAL Active=STANDALONE [MEMBER] -F0=35 +F0=37 F1=0 f Source Files -F2=0 c SRC\main.c -F3=0 a SRC\mb91467d.asm -F4=0 a SRC\Start91460.asm -F5=0 c SRC\vectors.c -F6=0 f Source Files\watchdog -F7=0 c SRC\watchdog\watchdog.c -F8=0 f Source Files\utility -F9=0 c SRC\utility\printf-stdarg.c -F10=0 c SRC\utility\taskutility.c -F11=0 f Source Files\FreeRTOS Source -F12=0 c ..\..\Source\list.c -F13=0 c ..\..\Source\queue.c -F14=0 c ..\..\Source\tasks.c -F15=0 f Source Files\FreeRTOS Source\portable -F16=0 c ..\..\Source\portable\Softune\MB91460\__STD_LIB_sbrk.c -F17=0 c ..\..\Source\portable\Softune\MB91460\port.c -F18=0 f Source Files\FreeRTOS Source\MemMang -F19=0 c ..\..\Source\portable\MemMang\heap_3.c -F20=0 f Source Files\Demo Source -F21=0 c ..\Common\Minimal\BlockQ.c -F22=0 c ..\Common\Minimal\blocktim.c -F23=0 c ..\Common\Minimal\comtest.c -F24=0 c ..\Common\Minimal\death.c -F25=0 c ..\Common\Minimal\dynamic.c -F26=0 c ..\Common\Minimal\flash.c -F27=0 c ..\Common\Minimal\flop.c -F28=0 c ..\Common\Minimal\GenQTest.c -F29=0 c ..\Common\Minimal\integer.c -F30=0 c SRC\partest\partest.c -F31=0 c ..\Common\Minimal\QPeek.c -F32=0 c ..\Common\Minimal\semtest.c -F33=0 f Source Files\Demo Source\serial -F34=0 c SRC\serial\serial.c -F35=0 f Include Files +F2=0 c SRC\crflash_modified.c +F3=0 c SRC\main.c +F4=0 a SRC\mb91467d.asm +F5=0 a SRC\Start91460.asm +F6=0 c SRC\vectors.c +F7=0 f Source Files\watchdog +F8=0 c SRC\watchdog\watchdog.c +F9=0 f Source Files\utility +F10=0 c SRC\utility\printf-stdarg.c +F11=0 c SRC\utility\taskutility.c +F12=0 f Source Files\FreeRTOS Source +F13=0 c ..\..\Source\croutine.c +F14=0 c ..\..\Source\list.c +F15=0 c ..\..\Source\queue.c +F16=0 c ..\..\Source\tasks.c +F17=0 f Source Files\FreeRTOS Source\portable +F18=0 c ..\..\Source\portable\Softune\MB91460\__STD_LIB_sbrk.c +F19=0 c ..\..\Source\portable\Softune\MB91460\port.c +F20=0 f Source Files\FreeRTOS Source\MemMang +F21=0 c ..\..\Source\portable\MemMang\heap_3.c +F22=0 f Source Files\Demo Source +F23=0 c ..\Common\Minimal\BlockQ.c +F24=0 c ..\Common\Minimal\blocktim.c +F25=0 c ..\Common\Minimal\comtest.c +F26=0 c ..\Common\Minimal\death.c +F27=0 c ..\Common\Minimal\dynamic.c +F28=0 c ..\Common\Minimal\flash.c +F29=0 c ..\Common\Minimal\flop.c +F30=0 c ..\Common\Minimal\GenQTest.c +F31=0 c ..\Common\Minimal\integer.c +F32=0 c SRC\partest\partest.c +F33=0 c ..\Common\Minimal\QPeek.c +F34=0 c ..\Common\Minimal\semtest.c +F35=0 f Source Files\Demo Source\serial +F36=0 c SRC\serial\serial.c +F37=0 f Include Files [OPTIONFILE] FILE=91460_template_91467d.dat @@ -73,7 +75,7 @@ LST=STANDALONE\LST\ OPT=STANDALONE\OPT\ [MEMBER-STANDALONE] -F0=27 +F0=29 F1=0 m 1 STANDALONE\ABS\91467d_FreeRTOS.abs F2=9 c 1 ..\..\Source\portable\Softune\MB91460\port.c F2-1=- ..\..\Source\include\FreeRTOS.h @@ -89,29 +91,28 @@ F3=3 c 1 ..\..\Source\portable\Softune\MB91460\__STD_LIB_sbrk.c F3-1=- SRC\FreeRTOSConfig.h F3-2=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h F3-3=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F4=9 c 1 ..\..\Source\list.c +F4=10 c 1 ..\..\Source\croutine.c F4-1=- ..\..\Source\include\FreeRTOS.h F4-2=- ..\..\Source\include\projdefs.h F4-3=- SRC\FreeRTOSConfig.h F4-4=- ..\..\Source\include\portable.h -F4-5=- ..\..\Source\include\list.h -F4-6=- ..\..\Source\portable\Softune\MB91460\portmacro.h -F4-7=- SRC\mb91467d.h -F4-8=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F4-9=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F5=11 c 1 ..\..\Source\queue.c +F4-5=- ..\..\Source\include\task.h +F4-6=- ..\..\Source\include\list.h +F4-7=- ..\..\Source\include\croutine.h +F4-8=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F4-9=- SRC\mb91467d.h +F4-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F5=9 c 1 ..\..\Source\list.c F5-1=- ..\..\Source\include\FreeRTOS.h F5-2=- ..\..\Source\include\projdefs.h F5-3=- SRC\FreeRTOSConfig.h F5-4=- ..\..\Source\include\portable.h -F5-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h -F5-6=- SRC\mb91467d.h -F5-7=- ..\..\Source\include\task.h -F5-8=- ..\..\Source\include\list.h -F5-9=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F5-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F5-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\string.h -F6=13 c 1 ..\..\Source\tasks.c +F5-5=- ..\..\Source\include\list.h +F5-6=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F5-7=- SRC\mb91467d.h +F5-8=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F5-9=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F6=12 c 1 ..\..\Source\queue.c F6-1=- ..\..\Source\include\FreeRTOS.h F6-2=- ..\..\Source\include\projdefs.h F6-3=- SRC\FreeRTOSConfig.h @@ -120,32 +121,32 @@ F6-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F6-6=- SRC\mb91467d.h F6-7=- ..\..\Source\include\task.h F6-8=- ..\..\Source\include\list.h -F6-9=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdio.h -F6-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F6-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdarg.h -F6-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F6-13=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\string.h -F7=3 c 1 SRC\vectors.c -F7-1=- SRC\mb91467d.h -F7-2=- SRC\watchdog\watchdog.h +F6-9=- ..\..\Source\include\croutine.h +F6-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F6-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F6-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\string.h +F7=13 c 1 ..\..\Source\tasks.c +F7-1=- ..\..\Source\include\FreeRTOS.h +F7-2=- ..\..\Source\include\projdefs.h F7-3=- SRC\FreeRTOSConfig.h -F8=1 a 1 SRC\mb91467d.asm +F7-4=- ..\..\Source\include\portable.h +F7-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F7-6=- SRC\mb91467d.h +F7-7=- ..\..\Source\include\task.h +F7-8=- ..\..\Source\include\list.h +F7-9=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdio.h +F7-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F7-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdarg.h +F7-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F7-13=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\string.h +F8=3 c 1 SRC\vectors.c F8-1=- SRC\mb91467d.h -F9=0 a 1 SRC\Start91460.asm -F10=12 c 1 ..\Common\Minimal\BlockQ.c -F10-1=- ..\..\Source\include\FreeRTOS.h -F10-2=- ..\..\Source\include\projdefs.h -F10-3=- SRC\FreeRTOSConfig.h -F10-4=- ..\..\Source\include\portable.h -F10-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h -F10-6=- SRC\mb91467d.h -F10-7=- ..\..\Source\include\task.h -F10-8=- ..\..\Source\include\list.h -F10-9=- ..\..\Source\include\queue.h -F10-10=- ..\Common\include\BlockQ.h -F10-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F10-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F11=11 c 1 ..\Common\Minimal\blocktim.c +F8-2=- SRC\watchdog\watchdog.h +F8-3=- SRC\FreeRTOSConfig.h +F9=1 a 1 SRC\mb91467d.asm +F9-1=- SRC\mb91467d.h +F10=0 a 1 SRC\Start91460.asm +F11=12 c 1 ..\Common\Minimal\BlockQ.c F11-1=- ..\..\Source\include\FreeRTOS.h F11-2=- ..\..\Source\include\projdefs.h F11-3=- SRC\FreeRTOSConfig.h @@ -155,9 +156,10 @@ F11-6=- SRC\mb91467d.h F11-7=- ..\..\Source\include\task.h F11-8=- ..\..\Source\include\list.h F11-9=- ..\..\Source\include\queue.h -F11-10=- ..\Common\include\blocktim.h -F11-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F12=13 c 1 ..\Common\Minimal\comtest.c +F11-10=- ..\Common\include\BlockQ.h +F11-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F11-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F12=11 c 1 ..\Common\Minimal\blocktim.c F12-1=- ..\..\Source\include\FreeRTOS.h F12-2=- ..\..\Source\include\projdefs.h F12-3=- SRC\FreeRTOSConfig.h @@ -166,12 +168,10 @@ F12-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F12-6=- SRC\mb91467d.h F12-7=- ..\..\Source\include\task.h F12-8=- ..\..\Source\include\list.h -F12-9=- ..\Common\include\serial.h -F12-10=- ..\Common\include\comtest.h -F12-11=- ..\Common\include\partest.h -F12-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F12-13=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F13=11 c 1 ..\Common\Minimal\death.c +F12-9=- ..\..\Source\include\queue.h +F12-10=- ..\Common\include\blocktim.h +F12-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F13=13 c 1 ..\Common\Minimal\comtest.c F13-1=- ..\..\Source\include\FreeRTOS.h F13-2=- ..\..\Source\include\projdefs.h F13-3=- SRC\FreeRTOSConfig.h @@ -180,10 +180,12 @@ F13-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F13-6=- SRC\mb91467d.h F13-7=- ..\..\Source\include\task.h F13-8=- ..\..\Source\include\list.h -F13-9=- ..\Common\include\death.h -F13-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F13-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F14=13 c 1 ..\Common\Minimal\dynamic.c +F13-9=- ..\Common\include\serial.h +F13-10=- ..\Common\include\comtest.h +F13-11=- ..\Common\include\partest.h +F13-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F13-13=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F14=11 c 1 ..\Common\Minimal\death.c F14-1=- ..\..\Source\include\FreeRTOS.h F14-2=- ..\..\Source\include\projdefs.h F14-3=- SRC\FreeRTOSConfig.h @@ -192,12 +194,10 @@ F14-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F14-6=- SRC\mb91467d.h F14-7=- ..\..\Source\include\task.h F14-8=- ..\..\Source\include\list.h -F14-9=- ..\..\Source\include\queue.h -F14-10=- ..\Common\include\dynamic.h -F14-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F14-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F14-13=- ..\..\Source\include\semphr.h -F15=12 c 1 ..\Common\Minimal\flash.c +F14-9=- ..\Common\include\death.h +F14-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F14-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F15=13 c 1 ..\Common\Minimal\dynamic.c F15-1=- ..\..\Source\include\FreeRTOS.h F15-2=- ..\..\Source\include\projdefs.h F15-3=- SRC\FreeRTOSConfig.h @@ -206,11 +206,12 @@ F15-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F15-6=- SRC\mb91467d.h F15-7=- ..\..\Source\include\task.h F15-8=- ..\..\Source\include\list.h -F15-9=- ..\Common\include\partest.h -F15-10=- ..\Common\include\flash.h +F15-9=- ..\..\Source\include\queue.h +F15-10=- ..\Common\include\dynamic.h F15-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h F15-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F16=13 c 1 ..\Common\Minimal\flop.c +F15-13=- ..\..\Source\include\semphr.h +F16=12 c 1 ..\Common\Minimal\flash.c F16-1=- ..\..\Source\include\FreeRTOS.h F16-2=- ..\..\Source\include\projdefs.h F16-3=- SRC\FreeRTOSConfig.h @@ -219,12 +220,11 @@ F16-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F16-6=- SRC\mb91467d.h F16-7=- ..\..\Source\include\task.h F16-8=- ..\..\Source\include\list.h -F16-9=- ..\Common\include\flop.h -F16-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F16-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F16-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\math.h -F16-13=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\errno.h -F17=13 c 1 ..\Common\Minimal\GenQTest.c +F16-9=- ..\Common\include\partest.h +F16-10=- ..\Common\include\flash.h +F16-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F16-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F17=13 c 1 ..\Common\Minimal\flop.c F17-1=- ..\..\Source\include\FreeRTOS.h F17-2=- ..\..\Source\include\projdefs.h F17-3=- SRC\FreeRTOSConfig.h @@ -233,12 +233,12 @@ F17-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F17-6=- SRC\mb91467d.h F17-7=- ..\..\Source\include\task.h F17-8=- ..\..\Source\include\list.h -F17-9=- ..\..\Source\include\queue.h -F17-10=- ..\Common\include\GenQTest.h -F17-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F17-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F17-13=- ..\..\Source\include\semphr.h -F18=11 c 1 ..\Common\Minimal\integer.c +F17-9=- ..\Common\include\flop.h +F17-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F17-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F17-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\math.h +F17-13=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\errno.h +F18=13 c 1 ..\Common\Minimal\GenQTest.c F18-1=- ..\..\Source\include\FreeRTOS.h F18-2=- ..\..\Source\include\projdefs.h F18-3=- SRC\FreeRTOSConfig.h @@ -247,10 +247,12 @@ F18-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F18-6=- SRC\mb91467d.h F18-7=- ..\..\Source\include\task.h F18-8=- ..\..\Source\include\list.h -F18-9=- ..\Common\include\integer.h -F18-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F18-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F19=13 c 1 ..\Common\Minimal\QPeek.c +F18-9=- ..\..\Source\include\queue.h +F18-10=- ..\Common\include\GenQTest.h +F18-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F18-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F18-13=- ..\..\Source\include\semphr.h +F19=11 c 1 ..\Common\Minimal\integer.c F19-1=- ..\..\Source\include\FreeRTOS.h F19-2=- ..\..\Source\include\projdefs.h F19-3=- SRC\FreeRTOSConfig.h @@ -259,12 +261,10 @@ F19-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F19-6=- SRC\mb91467d.h F19-7=- ..\..\Source\include\task.h F19-8=- ..\..\Source\include\list.h -F19-9=- ..\..\Source\include\queue.h -F19-10=- ..\Common\include\QPeek.h -F19-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F19-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F19-13=- ..\..\Source\include\semphr.h -F20=13 c 1 ..\Common\Minimal\semtest.c +F19-9=- ..\Common\include\integer.h +F19-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F19-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F20=13 c 1 ..\Common\Minimal\QPeek.c F20-1=- ..\..\Source\include\FreeRTOS.h F20-2=- ..\..\Source\include\projdefs.h F20-3=- SRC\FreeRTOSConfig.h @@ -274,11 +274,11 @@ F20-6=- SRC\mb91467d.h F20-7=- ..\..\Source\include\task.h F20-8=- ..\..\Source\include\list.h F20-9=- ..\..\Source\include\queue.h -F20-10=- ..\Common\include\semtest.h +F20-10=- ..\Common\include\QPeek.h F20-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h F20-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h F20-13=- ..\..\Source\include\semphr.h -F21=10 c 1 ..\..\Source\portable\MemMang\heap_3.c +F21=13 c 1 ..\Common\Minimal\semtest.c F21-1=- ..\..\Source\include\FreeRTOS.h F21-2=- ..\..\Source\include\projdefs.h F21-3=- SRC\FreeRTOSConfig.h @@ -287,81 +287,109 @@ F21-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F21-6=- SRC\mb91467d.h F21-7=- ..\..\Source\include\task.h F21-8=- ..\..\Source\include\list.h -F21-9=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F21-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F22=12 c 1 SRC\serial\serial.c +F21-9=- ..\..\Source\include\queue.h +F21-10=- ..\Common\include\semtest.h +F21-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F21-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F21-13=- ..\..\Source\include\semphr.h +F22=10 c 1 ..\..\Source\portable\MemMang\heap_3.c F22-1=- ..\..\Source\include\FreeRTOS.h F22-2=- ..\..\Source\include\projdefs.h F22-3=- SRC\FreeRTOSConfig.h F22-4=- ..\..\Source\include\portable.h F22-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h F22-6=- SRC\mb91467d.h -F22-7=- ..\..\Source\include\queue.h -F22-8=- ..\..\Source\include\task.h -F22-9=- ..\..\Source\include\list.h -F22-10=- ..\Common\include\serial.h -F22-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h -F22-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F23=10 c 1 SRC\watchdog\watchdog.c -F23-1=- SRC\mb91467d.h -F23-2=- ..\..\Source\include\FreeRTOS.h -F23-3=- ..\..\Source\include\projdefs.h -F23-4=- SRC\FreeRTOSConfig.h -F23-5=- ..\..\Source\include\portable.h -F23-6=- ..\..\Source\portable\Softune\MB91460\portmacro.h -F23-7=- ..\..\Source\include\task.h -F23-8=- ..\..\Source\include\list.h -F23-9=- SRC\watchdog\watchdog.h -F23-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F24=11 c 1 SRC\utility\taskutility.c +F22-7=- ..\..\Source\include\task.h +F22-8=- ..\..\Source\include\list.h +F22-9=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F22-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F23=12 c 1 SRC\serial\serial.c +F23-1=- ..\..\Source\include\FreeRTOS.h +F23-2=- ..\..\Source\include\projdefs.h +F23-3=- SRC\FreeRTOSConfig.h +F23-4=- ..\..\Source\include\portable.h +F23-5=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F23-6=- SRC\mb91467d.h +F23-7=- ..\..\Source\include\queue.h +F23-8=- ..\..\Source\include\task.h +F23-9=- ..\..\Source\include\list.h +F23-10=- ..\Common\include\serial.h +F23-11=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdlib.h +F23-12=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F24=10 c 1 SRC\watchdog\watchdog.c F24-1=- SRC\mb91467d.h -F24-2=- SRC\vectors.h -F24-3=- ..\..\Source\include\FreeRTOS.h -F24-4=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F24-5=- ..\..\Source\include\projdefs.h -F24-6=- SRC\FreeRTOSConfig.h -F24-7=- ..\..\Source\include\portable.h -F24-8=- ..\..\Source\portable\Softune\MB91460\portmacro.h -F24-9=- ..\..\Source\include\task.h -F24-10=- ..\..\Source\include\list.h -F24-11=- ..\..\Source\include\queue.h -F25=24 c 1 SRC\main.c +F24-2=- ..\..\Source\include\FreeRTOS.h +F24-3=- ..\..\Source\include\projdefs.h +F24-4=- SRC\FreeRTOSConfig.h +F24-5=- ..\..\Source\include\portable.h +F24-6=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F24-7=- ..\..\Source\include\task.h +F24-8=- ..\..\Source\include\list.h +F24-9=- SRC\watchdog\watchdog.h +F24-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F25=11 c 1 SRC\utility\taskutility.c F25-1=- SRC\mb91467d.h F25-2=- SRC\vectors.h -F25-3=- SRC\watchdog\watchdog.h -F25-4=- ..\..\Source\include\FreeRTOS.h -F25-5=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F25-6=- ..\..\Source\include\projdefs.h -F25-7=- SRC\FreeRTOSConfig.h -F25-8=- ..\..\Source\include\portable.h -F25-9=- ..\..\Source\portable\Softune\MB91460\portmacro.h -F25-10=- ..\..\Source\include\task.h -F25-11=- ..\..\Source\include\list.h -F25-12=- ..\Common\include\flash.h -F25-13=- ..\Common\include\integer.h -F25-14=- ..\Common\include\comtest2.h -F25-15=- ..\Common\include\semtest.h -F25-16=- ..\Common\include\BlockQ.h -F25-17=- ..\Common\include\dynamic.h -F25-18=- ..\Common\include\flop.h -F25-19=- ..\Common\include\GenQTest.h -F25-20=- ..\Common\include\QPeek.h -F25-21=- ..\Common\include\blocktim.h -F25-22=- ..\Common\include\death.h -F25-23=- SRC\utility\taskutility.h -F25-24=- ..\Common\include\partest.h -F26=9 c 1 SRC\partest\partest.c +F25-3=- ..\..\Source\include\FreeRTOS.h +F25-4=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F25-5=- ..\..\Source\include\projdefs.h +F25-6=- SRC\FreeRTOSConfig.h +F25-7=- ..\..\Source\include\portable.h +F25-8=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F25-9=- ..\..\Source\include\task.h +F25-10=- ..\..\Source\include\list.h +F25-11=- ..\..\Source\include\queue.h +F26=25 c 1 SRC\main.c F26-1=- SRC\mb91467d.h -F26-2=- ..\..\Source\include\FreeRTOS.h -F26-3=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h -F26-4=- ..\..\Source\include\projdefs.h -F26-5=- SRC\FreeRTOSConfig.h -F26-6=- ..\..\Source\include\portable.h -F26-7=- ..\..\Source\portable\Softune\MB91460\portmacro.h -F26-8=- ..\..\Source\include\task.h -F26-9=- ..\..\Source\include\list.h -F27=1 c 1 SRC\utility\printf-stdarg.c -F27-1=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdarg.h +F26-2=- SRC\vectors.h +F26-3=- SRC\watchdog\watchdog.h +F26-4=- ..\..\Source\include\FreeRTOS.h +F26-5=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F26-6=- ..\..\Source\include\projdefs.h +F26-7=- SRC\FreeRTOSConfig.h +F26-8=- ..\..\Source\include\portable.h +F26-9=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F26-10=- ..\..\Source\include\task.h +F26-11=- ..\..\Source\include\list.h +F26-12=- ..\Common\include\flash.h +F26-13=- ..\Common\include\integer.h +F26-14=- ..\Common\include\comtest2.h +F26-15=- ..\Common\include\semtest.h +F26-16=- ..\Common\include\BlockQ.h +F26-17=- ..\Common\include\dynamic.h +F26-18=- ..\Common\include\flop.h +F26-19=- ..\Common\include\GenQTest.h +F26-20=- ..\Common\include\QPeek.h +F26-21=- ..\Common\include\blocktim.h +F26-22=- ..\Common\include\death.h +F26-23=- SRC\utility\taskutility.h +F26-24=- ..\Common\include\partest.h +F26-25=- ..\Common\include\crflash.h +F27=9 c 1 SRC\partest\partest.c +F27-1=- SRC\mb91467d.h +F27-2=- ..\..\Source\include\FreeRTOS.h +F27-3=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F27-4=- ..\..\Source\include\projdefs.h +F27-5=- SRC\FreeRTOSConfig.h +F27-6=- ..\..\Source\include\portable.h +F27-7=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F27-8=- ..\..\Source\include\task.h +F27-9=- ..\..\Source\include\list.h +F28=12 c 1 SRC\crflash_modified.c +F28-1=- ..\..\Source\include\FreeRTOS.h +F28-2=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h +F28-3=- ..\..\Source\include\projdefs.h +F28-4=- SRC\FreeRTOSConfig.h +F28-5=- ..\..\Source\include\portable.h +F28-6=- ..\..\Source\portable\Softune\MB91460\portmacro.h +F28-7=- SRC\mb91467d.h +F28-8=- ..\..\Source\include\croutine.h +F28-9=- ..\..\Source\include\list.h +F28-10=- ..\..\Source\include\queue.h +F28-11=- ..\Common\include\partest.h +F28-12=- ..\Common\include\crflash.h +F29=1 c 1 SRC\utility\printf-stdarg.c +F29-1=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stdarg.h [BUILDMODE-STANDALONE] kernel=1 @@ -396,34 +424,36 @@ LST=MONDEB_INTERNAL\LST\ OPT=MONDEB_INTERNAL\OPT\ [MEMBER-MONDEB_INTERNAL] -F0=27 +F0=29 F1=0 m 1 MONDEB_INTERNAL\ABS\91467d_FreeRTOS.abs F2=0 c 1 ..\..\Source\portable\Softune\MB91460\port.c F3=0 c 1 ..\..\Source\portable\Softune\MB91460\__STD_LIB_sbrk.c -F4=0 c 1 ..\..\Source\list.c -F5=0 c 1 ..\..\Source\queue.c -F6=0 c 1 ..\..\Source\tasks.c -F7=0 c 1 SRC\vectors.c -F8=0 a 1 SRC\mb91467d.asm -F9=0 a 1 SRC\Start91460.asm -F10=0 c 1 ..\Common\Minimal\BlockQ.c -F11=0 c 1 ..\Common\Minimal\blocktim.c -F12=0 c 1 ..\Common\Minimal\comtest.c -F13=0 c 1 ..\Common\Minimal\death.c -F14=0 c 1 ..\Common\Minimal\dynamic.c -F15=0 c 1 ..\Common\Minimal\flash.c -F16=0 c 1 ..\Common\Minimal\flop.c -F17=0 c 1 ..\Common\Minimal\GenQTest.c -F18=0 c 1 ..\Common\Minimal\integer.c -F19=0 c 1 ..\Common\Minimal\QPeek.c -F20=0 c 1 ..\Common\Minimal\semtest.c -F21=0 c 1 ..\..\Source\portable\MemMang\heap_3.c -F22=0 c 1 SRC\serial\serial.c -F23=0 c 1 SRC\watchdog\watchdog.c -F24=0 c 1 SRC\utility\taskutility.c -F25=0 c 1 SRC\main.c -F26=0 c 1 SRC\partest\partest.c -F27=0 c 1 SRC\utility\printf-stdarg.c +F4=0 c 1 ..\..\Source\croutine.c +F5=0 c 1 ..\..\Source\list.c +F6=0 c 1 ..\..\Source\queue.c +F7=0 c 1 ..\..\Source\tasks.c +F8=0 c 1 SRC\vectors.c +F9=0 a 1 SRC\mb91467d.asm +F10=0 a 1 SRC\Start91460.asm +F11=0 c 1 ..\Common\Minimal\BlockQ.c +F12=0 c 1 ..\Common\Minimal\blocktim.c +F13=0 c 1 ..\Common\Minimal\comtest.c +F14=0 c 1 ..\Common\Minimal\death.c +F15=0 c 1 ..\Common\Minimal\dynamic.c +F16=0 c 1 ..\Common\Minimal\flash.c +F17=0 c 1 ..\Common\Minimal\flop.c +F18=0 c 1 ..\Common\Minimal\GenQTest.c +F19=0 c 1 ..\Common\Minimal\integer.c +F20=0 c 1 ..\Common\Minimal\QPeek.c +F21=0 c 1 ..\Common\Minimal\semtest.c +F22=0 c 1 ..\..\Source\portable\MemMang\heap_3.c +F23=0 c 1 SRC\serial\serial.c +F24=0 c 1 SRC\watchdog\watchdog.c +F25=0 c 1 SRC\utility\taskutility.c +F26=0 c 1 SRC\main.c +F27=0 c 1 SRC\partest\partest.c +F28=0 c 1 SRC\crflash_modified.c +F29=0 c 1 SRC\utility\printf-stdarg.c [BUILDMODE-MONDEB_INTERNAL] kernel=1 diff --git a/FreeRTOS/Demo/MB91460_Softune/SRC/FreeRTOSConfig.h b/FreeRTOS/Demo/MB91460_Softune/SRC/FreeRTOSConfig.h index d2aafc387..9d23ec48a 100644 --- a/FreeRTOS/Demo/MB91460_Softune/SRC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/MB91460_Softune/SRC/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -54,6 +54,11 @@ #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 4 ) + + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -70,7 +75,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/MB91460_Softune/SRC/crflash_modified.c b/FreeRTOS/Demo/MB91460_Softune/SRC/crflash_modified.c new file mode 100644 index 000000000..c600ac40b --- /dev/null +++ b/FreeRTOS/Demo/MB91460_Softune/SRC/crflash_modified.c @@ -0,0 +1,214 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/* + * This demo application file demonstrates the use of queues to pass data + * between co-routines. + * + * N represents the number of 'fixed delay' co-routines that are created and + * is set during initialisation. + * + * N 'fixed delay' co-routines are created that just block for a fixed + * period then post the number of an LED onto a queue. Each such co-routine + * uses a different block period. A single 'flash' co-routine is also created + * that blocks on the same queue, waiting for the number of the next LED it + * should flash. Upon receiving a number it simply toggle the instructed LED + * then blocks on the queue once more. In this manner each LED from LED 0 to + * LED N-1 is caused to flash at a different rate. + * + * The 'fixed delay' co-routines are created with co-routine priority 0. The + * flash co-routine is created with co-routine priority 1. This means that + * the queue should never contain more than a single item. This is because + * posting to the queue will unblock the 'flash' co-routine, and as this has + * a priority greater than the tasks posting to the queue it is guaranteed to + * have emptied the queue and blocked once again before the queue can contain + * any more date. An error is indicated if an attempt to post data to the + * queue fails - indicating that the queue is already full. + * + */ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "croutine.h" +#include "queue.h" + +/* Demo application includes. */ +#include "partest.h" +#include "crflash.h" + +/* The queue should only need to be of length 1. See the description at the +top of the file. */ +#define crfQUEUE_LENGTH 1 + +#define crfFIXED_DELAY_PRIORITY 0 +#define crfFLASH_PRIORITY 1 + +/* Only one flash co-routine is created so the index is not significant. */ +#define crfFLASH_INDEX 0 + +/* Don't allow more than crfMAX_FLASH_TASKS 'fixed delay' co-routines to be +created. */ +#define crfMAX_FLASH_TASKS 8 + +/* We don't want to block when posting to the queue. */ +#define crfPOSTING_BLOCK_TIME 0 + +/* Added by MPi, this define is added in order to make the vParTestToggleLED() +work. This basically differentiates the PDR09 from PDR00. 7-seg display LEDs connected +to PDR09 (SEG1) are used by the prvFlashCoRoutine() and PDR00 (SEG2) are used by tasks. */ +#define PDR00_Offset 8 + +/* + * The 'fixed delay' co-routine as described at the top of the file. + */ +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* + * The 'flash' co-routine as described at the top of the file. + */ +static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* The queue used to pass data between the 'fixed delay' co-routines and the +'flash' co-routine. */ +static QueueHandle_t xFlashQueue; + +/* This will be set to pdFALSE if we detect an error. */ +static unsigned portBASE_TYPE uxCoRoutineFlashStatus = pdPASS; + +/*-----------------------------------------------------------*/ + +/* + * See the header file for details. + */ +void vStartFlashCoRoutines( unsigned portBASE_TYPE uxNumberToCreate ) +{ +unsigned portBASE_TYPE uxIndex; + + if( uxNumberToCreate > crfMAX_FLASH_TASKS ) + { + uxNumberToCreate = crfMAX_FLASH_TASKS; + } + + /* Create the queue used to pass data between the co-routines. */ + xFlashQueue = xQueueCreate( crfQUEUE_LENGTH, sizeof( unsigned portBASE_TYPE ) ); + + if( xFlashQueue ) + { + /* Create uxNumberToCreate 'fixed delay' co-routines. */ + for( uxIndex = 0; uxIndex < uxNumberToCreate; uxIndex++ ) + { + xCoRoutineCreate( prvFixedDelayCoRoutine, crfFIXED_DELAY_PRIORITY, uxIndex ); + } + + /* Create the 'flash' co-routine. */ + xCoRoutineCreate( prvFlashCoRoutine, crfFLASH_PRIORITY, crfFLASH_INDEX ); + } +} +/*-----------------------------------------------------------*/ + +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +/* Even though this is a co-routine the xResult variable does not need to be +static as we do not need it to maintain its state between blocks. */ +signed portBASE_TYPE xResult; +/* The uxIndex parameter of the co-routine function is used as an index into +the xFlashRates array to obtain the delay period to use. */ +static const TickType_t xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_PERIOD_MS, + 200 / portTICK_PERIOD_MS, + 250 / portTICK_PERIOD_MS, + 300 / portTICK_PERIOD_MS, + 350 / portTICK_PERIOD_MS, + 400 / portTICK_PERIOD_MS, + 450 / portTICK_PERIOD_MS, + 500 / portTICK_PERIOD_MS }; + + /* Co-routines MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for( ;; ) + { + /* Post our uxIndex value onto the queue. This is used as the LED to + flash. */ + crQUEUE_SEND( xHandle, xFlashQueue, ( void * ) &uxIndex, crfPOSTING_BLOCK_TIME, &xResult ); + + if( xResult != pdPASS ) + { + /* For the reasons stated at the top of the file we should always + find that we can post to the queue. If we could not then an error + has occurred. */ + uxCoRoutineFlashStatus = pdFAIL; + } + + crDELAY( xHandle, xFlashRates[ uxIndex ] ); + } + + /* Co-routines MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + +static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +/* Even though this is a co-routine the variable do not need to be +static as we do not need it to maintain their state between blocks. */ +signed portBASE_TYPE xResult; +unsigned portBASE_TYPE uxLEDToFlash; + + /* Co-routines MUST start with a call to crSTART. */ + crSTART( xHandle ); + ( void ) uxIndex; + + for( ;; ) + { + /* Block to wait for the number of the LED to flash. */ + crQUEUE_RECEIVE( xHandle, xFlashQueue, &uxLEDToFlash, portMAX_DELAY, &xResult ); + + if( xResult != pdPASS ) + { + /* We would not expect to wake unless we received something. */ + uxCoRoutineFlashStatus = pdFAIL; + } + else + { + /* We received the number of an LED to flash - flash it! */ + /* Added by MPi, PDR00_Offset is added in order to make the + vParTestToggleLED() work. */ + vParTestToggleLED( uxLEDToFlash + PDR00_Offset ); + } + } + + /* Co-routines MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + +portBASE_TYPE xAreFlashCoRoutinesStillRunning( void ) +{ + /* Return pdPASS or pdFAIL depending on whether an error has been detected + or not. */ + return uxCoRoutineFlashStatus; +} + diff --git a/FreeRTOS/Demo/MB91460_Softune/SRC/main.c b/FreeRTOS/Demo/MB91460_Softune/SRC/main.c index 09eb54e9a..9bf61f213 100644 --- a/FreeRTOS/Demo/MB91460_Softune/SRC/main.c +++ b/FreeRTOS/Demo/MB91460_Softune/SRC/main.c @@ -77,6 +77,7 @@ #include "death.h" #include "taskutility.h" #include "partest.h" +#include "crflash.h" /* Demo task priorities. */ #define mainWATCHDOG_TASK_PRIORITY ( tskIDLE_PRIORITY + 5 ) @@ -100,6 +101,9 @@ LCD represent LEDs]*/ #define mainNO_ERROR_CHECK_DELAY ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) #define mainERROR_CHECK_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS ) +/* The total number of LEDs available. */ +#define mainNO_CO_ROUTINE_LEDs ( 8 ) + /* The first LED used by the comtest tasks. */ #define mainCOM_TEST_LED ( 0x05 ) @@ -109,6 +113,9 @@ LCD represent LEDs]*/ /* The number of interrupt levels to use. */ #define mainINTERRUPT_LEVELS ( 31 ) +/* The number of 'flash' co-routines to create - each toggles a different LED. */ +#define mainNUM_FLASH_CO_ROUTINES ( 8 ) + /*---------------------------------------------------------------------------*/ /* @@ -162,6 +169,7 @@ void main(void) vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); vStartQueuePeekTasks(); vCreateBlockTimeTasks(); + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); /* Start the 'Check' task which is defined in this file. */ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); @@ -326,6 +334,8 @@ static void prvSetupHardware( void ) #if WATCHDOG == WTC_IN_IDLE Kick_Watchdog(); #endif + + vCoRoutineSchedule(); } #else #if WATCHDOG == WTC_IN_IDLE diff --git a/FreeRTOS/Demo/MB91460_Softune/SRC/partest/partest.c b/FreeRTOS/Demo/MB91460_Softune/SRC/partest/partest.c index ee2e06626..739eabfc4 100644 --- a/FreeRTOS/Demo/MB91460_Softune/SRC/partest/partest.c +++ b/FreeRTOS/Demo/MB91460_Softune/SRC/partest/partest.c @@ -53,7 +53,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) if( uxLED < partstNUM_LEDs ) { taskENTER_CRITICAL(); - { + { /* Toggle the state of the single genuine on board LED. */ if( sState[ uxLED ] ) { @@ -63,9 +63,9 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { PDR25 &= ~( 1 << uxLED ); } - + sState[uxLED] = !( sState[ uxLED ] ); - } + } taskEXIT_CRITICAL(); } else @@ -73,11 +73,11 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) uxLED -= partstNUM_LEDs; if( uxLED < partstNUM_LEDs ) - { + { taskENTER_CRITICAL(); - { + { /* Toggle the state of the single genuine on board LED. */ - if( sState1[uxLED]) + if( sState1[uxLED]) { PDR16 |= ( 1 << uxLED ); } @@ -85,7 +85,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { PDR16 &= ~( 1 << uxLED ); } - + sState1[ uxLED ] = !( sState1[ uxLED ] ); } taskEXIT_CRITICAL(); @@ -114,7 +114,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) } taskEXIT_CRITICAL(); } - else + else { uxLED -= partstNUM_LEDs; diff --git a/FreeRTOS/Demo/MB91460_Softune/SRC/serial/serial.c b/FreeRTOS/Demo/MB91460_Softune/SRC/serial/serial.c index 3b5b9b215..a5b106853 100644 --- a/FreeRTOS/Demo/MB91460_Softune/SRC/serial/serial.c +++ b/FreeRTOS/Demo/MB91460_Softune/SRC/serial/serial.c @@ -25,9 +25,9 @@ */ -/* - * BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. - * +/* + * BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. + * * This file only supports UART 2 */ @@ -43,10 +43,10 @@ #include "serial.h" /* The queue used to hold received characters. */ -static QueueHandle_t xRxedChars; +static QueueHandle_t xRxedChars; /* The queue used to hold characters waiting transmission. */ -static QueueHandle_t xCharsForTx; +static QueueHandle_t xCharsForTx; static volatile short sTHREEmpty; @@ -62,7 +62,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port /* Initialize UART asynchronous mode */ BGR02 = configPER_CLOCK_HZ / ulWantedBaud; - + SCR02 = 0x17; /* 8N1 */ SMR02 = 0x0d; /* enable SOT3, Reset, normal mode */ SSR02 = 0x02; /* LSB first, enable receive interrupts */ @@ -73,7 +73,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port EPFR20_D1 = 0; /* enable UART */ } 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. */ @@ -105,7 +105,7 @@ signed portBASE_TYPE xReturn; { if( sTHREEmpty == pdTRUE ) { - /* If sTHREEmpty is true then the UART Tx ISR has indicated that + /* If sTHREEmpty is true then the UART Tx ISR has indicated that there are no characters queued to be transmitted - so we can write the character directly to the shift Tx register. */ sTHREEmpty = pdFALSE; @@ -115,10 +115,10 @@ signed portBASE_TYPE xReturn; else { /* sTHREEmpty is false, so there are still characters waiting to be - transmitted. We have to queue this character so it gets + transmitted. We have to queue this character so it gets transmitted in turn. */ - /* Return false if after the block time there is no room on the Tx + /* Return false if after the block time there is no room on the Tx queue. It is ok to block inside a critical section as each task maintains it's own critical section status. */ if (xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) == pdTRUE) @@ -130,7 +130,7 @@ signed portBASE_TYPE xReturn; xReturn = pdFAIL; } } - + if (pdPASS == xReturn) { /* Turn on the Tx interrupt so the ISR will remove the character from the @@ -139,7 +139,7 @@ signed portBASE_TYPE xReturn; will simply turn off the Tx interrupt again. */ SSR02_TIE = 1; } - + } portEXIT_CRITICAL(); @@ -155,7 +155,7 @@ signed portBASE_TYPE xReturn; signed char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - /* Get the character from the UART and post it on the queue of Rxed + /* Get the character from the UART and post it on the queue of Rxed characters. */ cChar = RDR02; @@ -163,8 +163,8 @@ signed portBASE_TYPE xReturn; if( xHigherPriorityTaskWoken ) { - /*If the post causes a task to wake force a context switch - as the woken task may have a higher priority than the task we have + /*If the post causes a task to wake force a context switch + as the woken task may have a higher priority than the task we have interrupted. */ portYIELD_FROM_ISR(); } @@ -191,7 +191,7 @@ __interrupt void UART2_TxISR (void) { /* There were no other characters to transmit. */ sTHREEmpty = pdTRUE; - + /* Disable transmit interrupts */ SSR02_TIE = 0; } diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/FreeRTOS_96348hs_SK16FX100PMC.prj b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/FreeRTOS_96348hs_SK16FX100PMC.prj index d4a8f4ea3..b940b7c8c 100644 --- a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/FreeRTOS_96348hs_SK16FX100PMC.prj +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/FreeRTOS_96348hs_SK16FX100PMC.prj @@ -17,7 +17,7 @@ PrjInfo-0=STANDALONE Active=STANDALONE [MEMBER] -F0=36 +F0=38 F1=0 f Source Files F2=0 c Src\Main.c F3=0 a Src\mb96348hs.asm @@ -27,33 +27,35 @@ F6=0 c Src\vectors.c F7=0 f Source Files\watchdog F8=0 c Src\watchdog\watchdog.c F9=0 f Source Files\FreeRTOS Source -F10=0 c ..\..\..\Source\list.c -F11=0 c ..\..\..\Source\queue.c -F12=0 c ..\..\..\Source\tasks.c -F13=0 f Source Files\FreeRTOS Source\portable -F14=0 c ..\..\..\Source\portable\Softune\MB96340\__STD_LIB_sbrk.c -F15=0 c ..\..\..\Source\portable\Softune\MB96340\port.c -F16=0 f Source Files\FreeRTOS Source\MemMang -F17=0 c ..\..\..\Source\portable\MemMang\heap_3.c -F18=0 f Source Files\Demo Source -F19=0 c ..\..\Common\Minimal\BlockQ.c -F20=0 c ..\..\Common\Minimal\blocktim.c -F21=0 c ..\..\Common\Minimal\comtest.c -F22=0 c ..\..\Common\Minimal\death.c -F23=0 c ..\..\Common\Minimal\dynamic.c -F24=0 c ..\..\Common\Minimal\flash.c -F25=0 c ..\..\Common\Minimal\GenQTest.c -F26=0 c ..\..\Common\Minimal\integer.c -F27=0 c ..\..\Common\Minimal\PollQ.c -F28=0 c ..\..\Common\Minimal\semtest.c -F29=0 f Source Files\Demo Source\partest -F30=0 c Src\partest\partest.c -F31=0 f Source Files\Demo Source\utility -F32=0 c Src\utility\printf_stdarg.c -F33=0 c Src\utility\taskutility.c -F34=0 f Source Files\Demo Source\serial -F35=0 c Src\serial\serial.c -F36=0 f Include Files +F10=0 c ..\..\..\Source\croutine.c +F11=0 c ..\..\..\Source\list.c +F12=0 c ..\..\..\Source\queue.c +F13=0 c ..\..\..\Source\tasks.c +F14=0 f Source Files\FreeRTOS Source\portable +F15=0 c ..\..\..\Source\portable\Softune\MB96340\__STD_LIB_sbrk.c +F16=0 c ..\..\..\Source\portable\Softune\MB96340\port.c +F17=0 f Source Files\FreeRTOS Source\MemMang +F18=0 c ..\..\..\Source\portable\MemMang\heap_3.c +F19=0 f Source Files\Demo Source +F20=0 c ..\..\Common\Minimal\BlockQ.c +F21=0 c ..\..\Common\Minimal\blocktim.c +F22=0 c ..\..\Common\Minimal\comtest.c +F23=0 c Src\crflash_sk16fx100mpc.c +F24=0 c ..\..\Common\Minimal\death.c +F25=0 c ..\..\Common\Minimal\dynamic.c +F26=0 c ..\..\Common\Minimal\flash.c +F27=0 c ..\..\Common\Minimal\GenQTest.c +F28=0 c ..\..\Common\Minimal\integer.c +F29=0 c ..\..\Common\Minimal\PollQ.c +F30=0 c ..\..\Common\Minimal\semtest.c +F31=0 f Source Files\Demo Source\partest +F32=0 c Src\partest\partest.c +F33=0 f Source Files\Demo Source\utility +F34=0 c Src\utility\printf_stdarg.c +F35=0 c Src\utility\taskutility.c +F36=0 f Source Files\Demo Source\serial +F37=0 c Src\serial\serial.c +F38=0 f Include Files [OPTIONFILE] FILE=options.dat @@ -70,9 +72,9 @@ LST=STANDALONE\LST\ OPT=STANDALONE\OPT\ [MEMBER-STANDALONE] -F0=26 +F0=28 F1=0 m 1 STANDALONE\ABS\FreeRTOS_96348hs_SK16FX100PMC.abs -F2=26 c 1 Src\Main.c +F2=27 c 1 Src\Main.c F2-1=- src\mb96348hs.h F2-2=- ..\..\..\Source\include\FreeRTOS.h F2-3=- ..\..\..\Source\include\projdefs.h @@ -98,7 +100,8 @@ F2-22=- ..\..\Common\include\blocktim.h F2-23=- ..\..\Common\include\death.h F2-24=- ..\..\Common\include\partest.h F2-25=- Src\utility\taskutility.h -F2-26=- Src\FreeRTOSConfig.h +F2-26=- ..\..\Common\include\crflash.h +F2-27=- Src\FreeRTOSConfig.h F3=0 a 1 Src\mb96348hs.asm F4=0 a 1 Src\Start.asm F5=2 c 1 Src\vectors.c @@ -114,57 +117,56 @@ F6-6=- ..\..\..\Source\include\task.h F6-7=- ..\..\..\Source\include\list.h F6-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h F6-9=- Src\FreeRTOSConfig.h -F7=9 c 1 ..\..\..\Source\list.c +F7=10 c 1 ..\..\..\Source\croutine.c F7-1=- ..\..\..\Source\include\FreeRTOS.h F7-2=- ..\..\..\Source\include\projdefs.h F7-3=- ..\..\..\Source\include\portable.h F7-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h -F7-5=- ..\..\..\Source\include\list.h -F7-6=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F7-7=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F7-8=- src\mb96348hs.h -F7-9=- Src\FreeRTOSConfig.h -F8=11 c 1 ..\..\..\Source\queue.c +F7-5=- ..\..\..\Source\include\task.h +F7-6=- ..\..\..\Source\include\list.h +F7-7=- ..\..\..\Source\include\croutine.h +F7-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F7-9=- src\mb96348hs.h +F7-10=- Src\FreeRTOSConfig.h +F8=9 c 1 ..\..\..\Source\list.c F8-1=- ..\..\..\Source\include\FreeRTOS.h F8-2=- ..\..\..\Source\include\projdefs.h F8-3=- ..\..\..\Source\include\portable.h F8-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h -F8-5=- ..\..\..\Source\include\task.h -F8-6=- ..\..\..\Source\include\list.h -F8-7=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F8-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F8-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\string.h -F8-10=- src\mb96348hs.h -F8-11=- Src\FreeRTOSConfig.h -F9=14 c 1 ..\..\..\Source\tasks.c +F8-5=- ..\..\..\Source\include\list.h +F8-6=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F8-7=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F8-8=- src\mb96348hs.h +F8-9=- Src\FreeRTOSConfig.h +F9=12 c 1 ..\..\..\Source\queue.c F9-1=- ..\..\..\Source\include\FreeRTOS.h F9-2=- ..\..\..\Source\include\projdefs.h F9-3=- ..\..\..\Source\include\portable.h F9-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F9-5=- ..\..\..\Source\include\task.h F9-6=- ..\..\..\Source\include\list.h -F9-7=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdio.h -F9-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F9-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdarg.h -F9-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F9-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\string.h -F9-12=- src\mb96348hs.h -F9-13=- Src\FreeRTOSConfig.h -F9-14=- ..\..\..\Source\include\StackMacros.h -F10=12 c 1 ..\..\Common\Minimal\BlockQ.c +F9-7=- ..\..\..\Source\include\croutine.h +F9-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F9-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F9-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\string.h +F9-11=- src\mb96348hs.h +F9-12=- Src\FreeRTOSConfig.h +F10=14 c 1 ..\..\..\Source\tasks.c F10-1=- ..\..\..\Source\include\FreeRTOS.h F10-2=- ..\..\..\Source\include\projdefs.h F10-3=- ..\..\..\Source\include\portable.h F10-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F10-5=- ..\..\..\Source\include\task.h F10-6=- ..\..\..\Source\include\list.h -F10-7=- ..\..\..\Source\include\queue.h -F10-8=- ..\..\Common\include\BlockQ.h -F10-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F10-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F10-11=- src\mb96348hs.h -F10-12=- Src\FreeRTOSConfig.h -F11=11 c 1 ..\..\Common\Minimal\blocktim.c +F10-7=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdio.h +F10-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F10-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdarg.h +F10-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F10-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\string.h +F10-12=- src\mb96348hs.h +F10-13=- Src\FreeRTOSConfig.h +F10-14=- ..\..\..\Source\include\StackMacros.h +F11=12 c 1 ..\..\Common\Minimal\BlockQ.c F11-1=- ..\..\..\Source\include\FreeRTOS.h F11-2=- ..\..\..\Source\include\projdefs.h F11-3=- ..\..\..\Source\include\portable.h @@ -172,141 +174,143 @@ F11-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F11-5=- ..\..\..\Source\include\task.h F11-6=- ..\..\..\Source\include\list.h F11-7=- ..\..\..\Source\include\queue.h -F11-8=- ..\..\Common\include\blocktim.h -F11-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F11-10=- src\mb96348hs.h -F11-11=- Src\FreeRTOSConfig.h -F12=13 c 1 ..\..\Common\Minimal\comtest.c +F11-8=- ..\..\Common\include\BlockQ.h +F11-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F11-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F11-11=- src\mb96348hs.h +F11-12=- Src\FreeRTOSConfig.h +F12=11 c 1 ..\..\Common\Minimal\blocktim.c F12-1=- ..\..\..\Source\include\FreeRTOS.h F12-2=- ..\..\..\Source\include\projdefs.h F12-3=- ..\..\..\Source\include\portable.h F12-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F12-5=- ..\..\..\Source\include\task.h F12-6=- ..\..\..\Source\include\list.h -F12-7=- ..\..\Common\include\serial.h -F12-8=- ..\..\Common\include\comtest.h -F12-9=- ..\..\Common\include\partest.h -F12-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F12-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F12-12=- src\mb96348hs.h -F12-13=- Src\FreeRTOSConfig.h -F13=11 c 1 ..\..\Common\Minimal\death.c +F12-7=- ..\..\..\Source\include\queue.h +F12-8=- ..\..\Common\include\blocktim.h +F12-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F12-10=- src\mb96348hs.h +F12-11=- Src\FreeRTOSConfig.h +F13=13 c 1 ..\..\Common\Minimal\comtest.c F13-1=- ..\..\..\Source\include\FreeRTOS.h F13-2=- ..\..\..\Source\include\projdefs.h F13-3=- ..\..\..\Source\include\portable.h F13-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F13-5=- ..\..\..\Source\include\task.h F13-6=- ..\..\..\Source\include\list.h -F13-7=- ..\..\Common\include\death.h -F13-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F13-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F13-10=- src\mb96348hs.h -F13-11=- Src\FreeRTOSConfig.h -F14=13 c 1 ..\..\Common\Minimal\dynamic.c +F13-7=- ..\..\Common\include\serial.h +F13-8=- ..\..\Common\include\comtest.h +F13-9=- ..\..\Common\include\partest.h +F13-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F13-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F13-12=- src\mb96348hs.h +F13-13=- Src\FreeRTOSConfig.h +F14=11 c 1 ..\..\Common\Minimal\death.c F14-1=- ..\..\..\Source\include\FreeRTOS.h F14-2=- ..\..\..\Source\include\projdefs.h F14-3=- ..\..\..\Source\include\portable.h F14-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F14-5=- ..\..\..\Source\include\task.h F14-6=- ..\..\..\Source\include\list.h -F14-7=- ..\..\..\Source\include\semphr.h -F14-8=- ..\..\..\Source\include\queue.h -F14-9=- ..\..\Common\include\dynamic.h -F14-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F14-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F14-12=- src\mb96348hs.h -F14-13=- Src\FreeRTOSConfig.h -F15=12 c 1 ..\..\Common\Minimal\flash.c +F14-7=- ..\..\Common\include\death.h +F14-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F14-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F14-10=- src\mb96348hs.h +F14-11=- Src\FreeRTOSConfig.h +F15=13 c 1 ..\..\Common\Minimal\dynamic.c F15-1=- ..\..\..\Source\include\FreeRTOS.h F15-2=- ..\..\..\Source\include\projdefs.h F15-3=- ..\..\..\Source\include\portable.h F15-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F15-5=- ..\..\..\Source\include\task.h F15-6=- ..\..\..\Source\include\list.h -F15-7=- ..\..\Common\include\partest.h -F15-8=- ..\..\Common\include\flash.h -F15-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F15-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F15-11=- src\mb96348hs.h -F15-12=- Src\FreeRTOSConfig.h -F16=13 c 1 ..\..\Common\Minimal\GenQTest.c +F15-7=- ..\..\..\Source\include\semphr.h +F15-8=- ..\..\..\Source\include\queue.h +F15-9=- ..\..\Common\include\dynamic.h +F15-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F15-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F15-12=- src\mb96348hs.h +F15-13=- Src\FreeRTOSConfig.h +F16=12 c 1 ..\..\Common\Minimal\flash.c F16-1=- ..\..\..\Source\include\FreeRTOS.h F16-2=- ..\..\..\Source\include\projdefs.h F16-3=- ..\..\..\Source\include\portable.h F16-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F16-5=- ..\..\..\Source\include\task.h F16-6=- ..\..\..\Source\include\list.h -F16-7=- ..\..\..\Source\include\queue.h -F16-8=- ..\..\..\Source\include\semphr.h -F16-9=- ..\..\Common\include\GenQTest.h -F16-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F16-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F16-12=- src\mb96348hs.h -F16-13=- Src\FreeRTOSConfig.h -F17=11 c 1 ..\..\Common\Minimal\integer.c +F16-7=- ..\..\Common\include\partest.h +F16-8=- ..\..\Common\include\flash.h +F16-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F16-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F16-11=- src\mb96348hs.h +F16-12=- Src\FreeRTOSConfig.h +F17=13 c 1 ..\..\Common\Minimal\GenQTest.c F17-1=- ..\..\..\Source\include\FreeRTOS.h F17-2=- ..\..\..\Source\include\projdefs.h F17-3=- ..\..\..\Source\include\portable.h F17-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F17-5=- ..\..\..\Source\include\task.h F17-6=- ..\..\..\Source\include\list.h -F17-7=- ..\..\Common\include\integer.h -F17-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F17-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F17-10=- src\mb96348hs.h -F17-11=- Src\FreeRTOSConfig.h -F18=12 c 1 ..\..\Common\Minimal\PollQ.c +F17-7=- ..\..\..\Source\include\queue.h +F17-8=- ..\..\..\Source\include\semphr.h +F17-9=- ..\..\Common\include\GenQTest.h +F17-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F17-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F17-12=- src\mb96348hs.h +F17-13=- Src\FreeRTOSConfig.h +F18=11 c 1 ..\..\Common\Minimal\integer.c F18-1=- ..\..\..\Source\include\FreeRTOS.h F18-2=- ..\..\..\Source\include\projdefs.h F18-3=- ..\..\..\Source\include\portable.h F18-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F18-5=- ..\..\..\Source\include\task.h F18-6=- ..\..\..\Source\include\list.h -F18-7=- ..\..\..\Source\include\queue.h -F18-8=- ..\..\Common\include\PollQ.h -F18-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F18-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F18-11=- src\mb96348hs.h -F18-12=- Src\FreeRTOSConfig.h -F19=13 c 1 ..\..\Common\Minimal\semtest.c +F18-7=- ..\..\Common\include\integer.h +F18-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F18-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F18-10=- src\mb96348hs.h +F18-11=- Src\FreeRTOSConfig.h +F19=12 c 1 ..\..\Common\Minimal\PollQ.c F19-1=- ..\..\..\Source\include\FreeRTOS.h F19-2=- ..\..\..\Source\include\projdefs.h F19-3=- ..\..\..\Source\include\portable.h F19-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F19-5=- ..\..\..\Source\include\task.h F19-6=- ..\..\..\Source\include\list.h -F19-7=- ..\..\..\Source\include\semphr.h -F19-8=- ..\..\..\Source\include\queue.h -F19-9=- ..\..\Common\include\semtest.h -F19-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F19-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F19-12=- src\mb96348hs.h -F19-13=- Src\FreeRTOSConfig.h -F20=12 c 1 Src\serial\serial.c +F19-7=- ..\..\..\Source\include\queue.h +F19-8=- ..\..\Common\include\PollQ.h +F19-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F19-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F19-11=- src\mb96348hs.h +F19-12=- Src\FreeRTOSConfig.h +F20=13 c 1 ..\..\Common\Minimal\semtest.c F20-1=- ..\..\..\Source\include\FreeRTOS.h F20-2=- ..\..\..\Source\include\projdefs.h F20-3=- ..\..\..\Source\include\portable.h F20-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h -F20-5=- ..\..\..\Source\include\queue.h -F20-6=- ..\..\..\Source\include\task.h -F20-7=- ..\..\..\Source\include\list.h -F20-8=- ..\..\Common\include\serial.h -F20-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F20-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F20-11=- src\mb96348hs.h -F20-12=- Src\FreeRTOSConfig.h -F21=10 c 1 Src\watchdog\watchdog.c -F21-1=- src\mb96348hs.h -F21-2=- ..\..\..\Source\include\FreeRTOS.h -F21-3=- ..\..\..\Source\include\projdefs.h -F21-4=- ..\..\..\Source\include\portable.h -F21-5=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h +F20-5=- ..\..\..\Source\include\task.h +F20-6=- ..\..\..\Source\include\list.h +F20-7=- ..\..\..\Source\include\semphr.h +F20-8=- ..\..\..\Source\include\queue.h +F20-9=- ..\..\Common\include\semtest.h +F20-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F20-11=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F20-12=- src\mb96348hs.h +F20-13=- Src\FreeRTOSConfig.h +F21=12 c 1 Src\serial\serial.c +F21-1=- ..\..\..\Source\include\FreeRTOS.h +F21-2=- ..\..\..\Source\include\projdefs.h +F21-3=- ..\..\..\Source\include\portable.h +F21-4=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h +F21-5=- ..\..\..\Source\include\queue.h F21-6=- ..\..\..\Source\include\task.h F21-7=- ..\..\..\Source\include\list.h -F21-8=- Src\watchdog\watchdog.h -F21-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F21-10=- Src\FreeRTOSConfig.h -F22=10 c 1 Src\utility\taskutility.c +F21-8=- ..\..\Common\include\serial.h +F21-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F21-10=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F21-11=- src\mb96348hs.h +F21-12=- Src\FreeRTOSConfig.h +F22=10 c 1 Src\watchdog\watchdog.c F22-1=- src\mb96348hs.h F22-2=- ..\..\..\Source\include\FreeRTOS.h F22-3=- ..\..\..\Source\include\projdefs.h @@ -314,37 +318,61 @@ F22-4=- ..\..\..\Source\include\portable.h F22-5=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h F22-6=- ..\..\..\Source\include\task.h F22-7=- ..\..\..\Source\include\list.h -F22-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F22-9=- Src\FreeRTOSConfig.h -F22-10=- ..\..\..\Source\include\queue.h -F23=9 c 1 Src\partest\partest.c -F23-1=- ..\..\..\Source\include\FreeRTOS.h -F23-2=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F22-8=- Src\watchdog\watchdog.h +F22-9=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F22-10=- Src\FreeRTOSConfig.h +F23=10 c 1 Src\utility\taskutility.c +F23-1=- src\mb96348hs.h +F23-2=- ..\..\..\Source\include\FreeRTOS.h F23-3=- ..\..\..\Source\include\projdefs.h F23-4=- ..\..\..\Source\include\portable.h F23-5=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h -F23-6=- src\mb96348hs.h -F23-7=- ..\..\..\Source\include\task.h -F23-8=- ..\..\..\Source\include\list.h +F23-6=- ..\..\..\Source\include\task.h +F23-7=- ..\..\..\Source\include\list.h +F23-8=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h F23-9=- Src\FreeRTOSConfig.h -F24=1 c 1 Src\utility\printf_stdarg.c -F24-1=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdarg.h -F25=4 c 1 ..\..\..\Source\portable\Softune\MB96340\__STD_LIB_sbrk.c -F25-1=- Src\FreeRTOSConfig.h -F25-2=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F25-3=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F25-4=- src\mb96348hs.h -F26=10 c 1 ..\..\..\Source\portable\MemMang\heap_3.c -F26-1=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h -F26-2=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F26-3=- ..\..\..\Source\include\FreeRTOS.h -F26-4=- ..\..\..\Source\include\projdefs.h -F26-5=- Src\FreeRTOSConfig.h -F26-6=- ..\..\..\Source\include\portable.h -F26-7=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h -F26-8=- src\mb96348hs.h -F26-9=- ..\..\..\Source\include\task.h -F26-10=- ..\..\..\Source\include\list.h +F23-10=- ..\..\..\Source\include\queue.h +F24=12 c 1 Src\crflash_sk16fx100mpc.c +F24-1=- ..\..\..\Source\include\FreeRTOS.h +F24-2=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F24-3=- ..\..\..\Source\include\projdefs.h +F24-4=- ..\..\..\Source\include\portable.h +F24-5=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h +F24-6=- ..\..\..\Source\include\croutine.h +F24-7=- ..\..\..\Source\include\list.h +F24-8=- ..\..\..\Source\include\queue.h +F24-9=- ..\..\Common\include\partest.h +F24-10=- ..\..\Common\include\crflash.h +F24-11=- src\mb96348hs.h +F24-12=- Src\FreeRTOSConfig.h +F25=9 c 1 Src\partest\partest.c +F25-1=- ..\..\..\Source\include\FreeRTOS.h +F25-2=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F25-3=- ..\..\..\Source\include\projdefs.h +F25-4=- ..\..\..\Source\include\portable.h +F25-5=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h +F25-6=- src\mb96348hs.h +F25-7=- ..\..\..\Source\include\task.h +F25-8=- ..\..\..\Source\include\list.h +F25-9=- Src\FreeRTOSConfig.h +F26=1 c 1 Src\utility\printf_stdarg.c +F26-1=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdarg.h +F27=4 c 1 ..\..\..\Source\portable\Softune\MB96340\__STD_LIB_sbrk.c +F27-1=- Src\FreeRTOSConfig.h +F27-2=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F27-3=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F27-4=- src\mb96348hs.h +F28=10 c 1 ..\..\..\Source\portable\MemMang\heap_3.c +F28-1=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F28-2=- ..\..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F28-3=- ..\..\..\Source\include\FreeRTOS.h +F28-4=- ..\..\..\Source\include\projdefs.h +F28-5=- Src\FreeRTOSConfig.h +F28-6=- ..\..\..\Source\include\portable.h +F28-7=- ..\..\..\Source\portable\Softune\MB96340\portmacro.h +F28-8=- src\mb96348hs.h +F28-9=- ..\..\..\Source\include\task.h +F28-10=- ..\..\..\Source\include\list.h [BUILDMODE-STANDALONE] kernel=1 diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opb b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opb index af748bd1b..e74430948 100644 --- a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opb +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opb @@ -10,6 +10,7 @@ -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\Start.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\vectors.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\port.obj" +-a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\croutine.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\list.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\queue.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\tasks.obj" @@ -26,6 +27,7 @@ -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\serial.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\watchdog.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\taskutility.obj" +-a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\crflash_sk16fx100mpc.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\partest.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\printf_stdarg.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\__STD_LIB_sbrk.obj" diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opl b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opl index c225b6482..915142000 100644 --- a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opl +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/STANDALONE/OPT/FreeRTOS_96348hs_SK16FX100PMC.opl @@ -29,6 +29,7 @@ "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\Start.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\vectors.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\port.obj" +"C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\croutine.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\list.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\queue.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\tasks.obj" @@ -45,6 +46,7 @@ "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\serial.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\watchdog.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\taskutility.obj" +"C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\crflash_sk16fx100mpc.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\partest.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\printf_stdarg.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96340_Softune\FreeRTOS_96348hs_SK16FX100PMC\STANDALONE\OBJ\__STD_LIB_sbrk.obj" diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/FreeRTOSConfig.h b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/FreeRTOSConfig.h index 4e631034a..30c06adbc 100644 --- a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/FreeRTOSConfig.h @@ -30,9 +30,9 @@ /* Device specific includes. */ #include "mb96348hs.h" -/* - * The below define should be same as the option selected by the Memory - * Model (Project->Setup Project->C Compiler->Category->Target Depend ) +/* + * The below define should be same as the option selected by the Memory + * Model (Project->Setup Project->C Compiler->Category->Target Depend ) * * Valid settings here include: * ------- Memory models --------- Data Code @@ -55,7 +55,7 @@ the ComTest tasks will be included in place of the trace task. */ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. *----------------------------------------------------------*/ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 1 @@ -72,6 +72,10 @@ the ComTest tasks will be included in place of the trace task. */ #define configUSE_MUTEXES 1 #define configUSE_TRACE_FACILITY 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 4 ) + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ #define INCLUDE_vTaskPrioritySet 1 @@ -87,7 +91,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/crflash_sk16fx100mpc.c b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/crflash_sk16fx100mpc.c new file mode 100644 index 000000000..c600ac40b --- /dev/null +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/crflash_sk16fx100mpc.c @@ -0,0 +1,214 @@ +/* + * FreeRTOS V202212.00 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +/* + * This demo application file demonstrates the use of queues to pass data + * between co-routines. + * + * N represents the number of 'fixed delay' co-routines that are created and + * is set during initialisation. + * + * N 'fixed delay' co-routines are created that just block for a fixed + * period then post the number of an LED onto a queue. Each such co-routine + * uses a different block period. A single 'flash' co-routine is also created + * that blocks on the same queue, waiting for the number of the next LED it + * should flash. Upon receiving a number it simply toggle the instructed LED + * then blocks on the queue once more. In this manner each LED from LED 0 to + * LED N-1 is caused to flash at a different rate. + * + * The 'fixed delay' co-routines are created with co-routine priority 0. The + * flash co-routine is created with co-routine priority 1. This means that + * the queue should never contain more than a single item. This is because + * posting to the queue will unblock the 'flash' co-routine, and as this has + * a priority greater than the tasks posting to the queue it is guaranteed to + * have emptied the queue and blocked once again before the queue can contain + * any more date. An error is indicated if an attempt to post data to the + * queue fails - indicating that the queue is already full. + * + */ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "croutine.h" +#include "queue.h" + +/* Demo application includes. */ +#include "partest.h" +#include "crflash.h" + +/* The queue should only need to be of length 1. See the description at the +top of the file. */ +#define crfQUEUE_LENGTH 1 + +#define crfFIXED_DELAY_PRIORITY 0 +#define crfFLASH_PRIORITY 1 + +/* Only one flash co-routine is created so the index is not significant. */ +#define crfFLASH_INDEX 0 + +/* Don't allow more than crfMAX_FLASH_TASKS 'fixed delay' co-routines to be +created. */ +#define crfMAX_FLASH_TASKS 8 + +/* We don't want to block when posting to the queue. */ +#define crfPOSTING_BLOCK_TIME 0 + +/* Added by MPi, this define is added in order to make the vParTestToggleLED() +work. This basically differentiates the PDR09 from PDR00. 7-seg display LEDs connected +to PDR09 (SEG1) are used by the prvFlashCoRoutine() and PDR00 (SEG2) are used by tasks. */ +#define PDR00_Offset 8 + +/* + * The 'fixed delay' co-routine as described at the top of the file. + */ +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* + * The 'flash' co-routine as described at the top of the file. + */ +static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ); + +/* The queue used to pass data between the 'fixed delay' co-routines and the +'flash' co-routine. */ +static QueueHandle_t xFlashQueue; + +/* This will be set to pdFALSE if we detect an error. */ +static unsigned portBASE_TYPE uxCoRoutineFlashStatus = pdPASS; + +/*-----------------------------------------------------------*/ + +/* + * See the header file for details. + */ +void vStartFlashCoRoutines( unsigned portBASE_TYPE uxNumberToCreate ) +{ +unsigned portBASE_TYPE uxIndex; + + if( uxNumberToCreate > crfMAX_FLASH_TASKS ) + { + uxNumberToCreate = crfMAX_FLASH_TASKS; + } + + /* Create the queue used to pass data between the co-routines. */ + xFlashQueue = xQueueCreate( crfQUEUE_LENGTH, sizeof( unsigned portBASE_TYPE ) ); + + if( xFlashQueue ) + { + /* Create uxNumberToCreate 'fixed delay' co-routines. */ + for( uxIndex = 0; uxIndex < uxNumberToCreate; uxIndex++ ) + { + xCoRoutineCreate( prvFixedDelayCoRoutine, crfFIXED_DELAY_PRIORITY, uxIndex ); + } + + /* Create the 'flash' co-routine. */ + xCoRoutineCreate( prvFlashCoRoutine, crfFLASH_PRIORITY, crfFLASH_INDEX ); + } +} +/*-----------------------------------------------------------*/ + +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +/* Even though this is a co-routine the xResult variable does not need to be +static as we do not need it to maintain its state between blocks. */ +signed portBASE_TYPE xResult; +/* The uxIndex parameter of the co-routine function is used as an index into +the xFlashRates array to obtain the delay period to use. */ +static const TickType_t xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_PERIOD_MS, + 200 / portTICK_PERIOD_MS, + 250 / portTICK_PERIOD_MS, + 300 / portTICK_PERIOD_MS, + 350 / portTICK_PERIOD_MS, + 400 / portTICK_PERIOD_MS, + 450 / portTICK_PERIOD_MS, + 500 / portTICK_PERIOD_MS }; + + /* Co-routines MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for( ;; ) + { + /* Post our uxIndex value onto the queue. This is used as the LED to + flash. */ + crQUEUE_SEND( xHandle, xFlashQueue, ( void * ) &uxIndex, crfPOSTING_BLOCK_TIME, &xResult ); + + if( xResult != pdPASS ) + { + /* For the reasons stated at the top of the file we should always + find that we can post to the queue. If we could not then an error + has occurred. */ + uxCoRoutineFlashStatus = pdFAIL; + } + + crDELAY( xHandle, xFlashRates[ uxIndex ] ); + } + + /* Co-routines MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + +static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex ) +{ +/* Even though this is a co-routine the variable do not need to be +static as we do not need it to maintain their state between blocks. */ +signed portBASE_TYPE xResult; +unsigned portBASE_TYPE uxLEDToFlash; + + /* Co-routines MUST start with a call to crSTART. */ + crSTART( xHandle ); + ( void ) uxIndex; + + for( ;; ) + { + /* Block to wait for the number of the LED to flash. */ + crQUEUE_RECEIVE( xHandle, xFlashQueue, &uxLEDToFlash, portMAX_DELAY, &xResult ); + + if( xResult != pdPASS ) + { + /* We would not expect to wake unless we received something. */ + uxCoRoutineFlashStatus = pdFAIL; + } + else + { + /* We received the number of an LED to flash - flash it! */ + /* Added by MPi, PDR00_Offset is added in order to make the + vParTestToggleLED() work. */ + vParTestToggleLED( uxLEDToFlash + PDR00_Offset ); + } + } + + /* Co-routines MUST end with a call to crEND. */ + crEND(); +} +/*-----------------------------------------------------------*/ + +portBASE_TYPE xAreFlashCoRoutinesStillRunning( void ) +{ + /* Return pdPASS or pdFAIL depending on whether an error has been detected + or not. */ + return uxCoRoutineFlashStatus; +} + diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/main.c b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/main.c index fb07fd852..e4a2a3976 100644 --- a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/main.c +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/main.c @@ -67,6 +67,7 @@ #include "death.h" #include "taskutility.h" #include "partest.h" +#include "crflash.h" #include "watchdog.h" /* Library includes. */ @@ -98,6 +99,7 @@ LCD represent LED's] */ #define mainERROR_CHECK_DELAY ( (TickType_t) 500 / portTICK_PERIOD_MS ) /* LED assignments for the demo tasks. */ +#define mainNUM_FLASH_CO_ROUTINES 8 #define mainCOM_TEST_LED 0x05 #define mainCHECK_TEST_LED 0x07 @@ -140,6 +142,7 @@ void main( void ) vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY ); vStartDynamicPriorityTasks(); + vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES ); vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); vCreateBlockTimeTasks(); @@ -246,6 +249,11 @@ static short prvCheckOtherTasksAreStillRunning( void ) sNoErrorFound = pdFALSE; } + if( xAreFlashCoRoutinesStillRunning() != pdTRUE ) + { + sNoErrorFound = pdFALSE; + } + if( xAreGenericQueueTasksStillRunning() != pdTRUE ) { sNoErrorFound = pdFALSE; @@ -285,6 +293,8 @@ static short prvCheckOtherTasksAreStillRunning( void ) #if WATCHDOG == WTC_IN_IDLE Kick_Watchdog(); #endif + + vCoRoutineSchedule(); } #else #if WATCHDOG == WTC_IN_IDLE diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/partest/partest.c b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/partest/partest.c index 31de8af32..ed361c931 100644 --- a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/partest/partest.c +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/partest/partest.c @@ -61,7 +61,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) if( uxLED < partstNUM_LEDs ) { taskENTER_CRITICAL(); - { + { /* Toggle the state of the single genuine on board LED. */ if( sState[ uxLED ] ) { @@ -71,9 +71,9 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { PDR09 &= ~( 1 << uxLED ); } - + sState[uxLED] = !( sState[ uxLED ] ); - } + } taskEXIT_CRITICAL(); } else @@ -81,11 +81,11 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) uxLED -= partstNUM_LEDs; if( uxLED < partstNUM_LEDs ) - { + { taskENTER_CRITICAL(); - { + { /* Toggle the state of the single genuine on board LED. */ - if( sState1[uxLED]) + if( sState1[uxLED]) { PDR00 |= ( 1 << uxLED ); } @@ -93,7 +93,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { PDR00 &= ~( 1 << uxLED ); } - + sState1[ uxLED ] = !( sState1[ uxLED ] ); } taskEXIT_CRITICAL(); @@ -122,7 +122,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) } taskEXIT_CRITICAL(); } - else + else { uxLED -= partstNUM_LEDs; diff --git a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/serial/serial.c b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/serial/serial.c index 527e86f95..15d42a91e 100644 --- a/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/serial/serial.c +++ b/FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/serial/serial.c @@ -24,8 +24,8 @@ * */ -/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. - * +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. + * * This file only supports UART 0 */ @@ -114,7 +114,7 @@ signed portBASE_TYPE xReturn; { if( sTHREEmpty == pdTRUE ) { - /* If sTHREEmpty is true then the UART Tx ISR has indicated that + /* If sTHREEmpty is true then the UART Tx ISR has indicated that there are no characters queued to be transmitted - so we can write the character directly to the shift Tx register. */ sTHREEmpty = pdFALSE; @@ -124,10 +124,10 @@ signed portBASE_TYPE xReturn; else { /* sTHREEmpty is false, so there are still characters waiting to be - transmitted. We have to queue this character so it gets + transmitted. We have to queue this character so it gets transmitted in turn. */ - /* Return false if after the block time there is no room on the Tx + /* Return false if after the block time there is no room on the Tx queue. It is ok to block inside a critical section as each task maintains it's own critical section status. */ if( xQueueSend(xCharsForTx, &cOutChar, xBlockTime) == pdTRUE ) @@ -163,7 +163,7 @@ __interrupt void UART0_RxISR( void ) volatile signed char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - /* Get the character from the UART and post it on the queue of Rxed + /* Get the character from the UART and post it on the queue of Rxed characters. */ cChar = RDR0; @@ -171,8 +171,8 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( xHigherPriorityTaskWoken ) { - /*If the post causes a task to wake force a context switch - as the woken task may have a higher priority than the task we have + /*If the post causes a task to wake force a context switch + as the woken task may have a higher priority than the task we have interrupted. */ portYIELD_FROM_ISR(); } diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/DiceTask.c b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/DiceTask.c index 191f086f5..20b5097c2 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/DiceTask.c +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/DiceTask.c @@ -25,7 +25,7 @@ */ -/* +/* * Defines the 'dice' tasks as described at the top of main.c */ @@ -67,7 +67,7 @@ extern volatile unsigned char *pucDisplayOutput[ 2 ]; /*-----------------------------------------------------------*/ -/* +/* * Defines the 'dice' tasks as described at the top of main.c */ void vDiceTask( void *pvParameters ) @@ -83,12 +83,12 @@ extern void vSuspendFlashTasks( unsigned char ucIndex, short sSuspendTasks ); the left side or right side display. The constant is used as an index into the arrays defined at file scope within this file. */ ucIndex = ( unsigned char ) pvParameters; - + /* A binary semaphore is used to signal button push events. Create the semaphore before it is used. */ vSemaphoreCreateBinary( xSemaphores[ ucIndex ] ); - /* Make sure the semaphore starts in the wanted state - no button pushes + /* Make sure the semaphore starts in the wanted state - no button pushes pending. This call will just clear any button pushes that are latched. Passing in 0 as the block time means the call will not wait for any further button pushes but instead return immediately. */ @@ -101,18 +101,18 @@ extern void vSuspendFlashTasks( unsigned char ucIndex, short sSuspendTasks ); /* Start the task proper. A loop will be performed each time a button is - pushed. The task will remain in the blocked state (sleeping) until a + pushed. The task will remain in the blocked state (sleeping) until a button is pushed. */ for( ;; ) { /* Wait for a button push. This task will enter the Blocked state (will not run again) until after a button has been pushed. */ prvButtonHit( ucIndex, portMAX_DELAY ); - + /* The next line will only execute after a button has been pushed - initialise the variable used to control the time the dice is shaken for. */ - ulDiceRunTime = diceSHAKE_TIME; + ulDiceRunTime = diceSHAKE_TIME; /* Suspend the flash tasks so this task has exclusive access to the display. */ @@ -141,7 +141,7 @@ extern void vSuspendFlashTasks( unsigned char ucIndex, short sSuspendTasks ); /* Clear any button pushes that are pending because a button bounced, or - was pressed while the dice were shaking. Again a block time of zero is + was pressed while the dice were shaking. Again a block time of zero is used so the function does not wait for any pushes but instead returns immediately. */ prvButtonHit( ucIndex, 0 ); @@ -151,11 +151,11 @@ extern void vSuspendFlashTasks( unsigned char ucIndex, short sSuspendTasks ); a button push. If a button is pressed xQueuePeek() will return but the button push will remain pending to be read again at the top of this for loop. It is safe to uses a queue function on a semaphore handle as - semaphores are implemented as macros that uses queues, so the two are + semaphores are implemented as macros that uses queues, so the two are basically the same thing. */ xQueuePeek( xSemaphores[ ucIndex ], NULL, diceDELAY_WHILE_DISPLAYING_RESULT ); - /* Clear the display then resume the tasks that were using + /* Clear the display then resume the tasks or co-routines that were using the segments of the display. */ *pucDisplayOutput[ ucIndex ] = 0xff; vSuspendFlashTasks( ucIndex, pdFALSE ); diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/FreeRTOSConfig.h b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/FreeRTOSConfig.h index 2d233a299..931d6b2ca 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/FreeRTOSConfig.h @@ -29,9 +29,9 @@ #include "mb96356rs.h" -/* - * The below define should be same as the option selected by the Memory - * Model (Project->Setup Project->C Compiler->Category->Target Depend ) +/* + * The below define should be same as the option selected by the Memory + * Model (Project->Setup Project->C Compiler->Category->Target Depend ) * * Valid settings here include: * ------- Memory models --------- Data Code @@ -54,7 +54,7 @@ the ComTest tasks will be included in place of the trace task. */ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. *----------------------------------------------------------*/ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 @@ -72,6 +72,10 @@ the ComTest tasks will be included in place of the trace task. */ #define configUSE_TRACE_FACILITY 0 #define configCHECK_FOR_STACK_OVERFLOW 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ #define INCLUDE_vTaskPrioritySet 0 @@ -88,7 +92,7 @@ to exclude the API function. */ #define configKERNEL_INTERRUPT_PRIORITY 6 -/* Passed into the Dice tasks to let then know if they are controlling the +/* Passed into the Dice tasks to let then know if they are controlling the display on the left side or the right side. */ #define configLEFT_DISPLAY 0 #define configRIGHT_DISPLAY 1 diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opb b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opb index ae30de0a0..184cdbf62 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opb +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opb @@ -15,6 +15,7 @@ -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\port.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\__STD_LIB_sbrk.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\heap_1.obj" +-a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\croutine.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\DiceTask.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\ParTest.obj" -a "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\SegmentToggleTasks.obj" diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opl b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opl index daa7d0c86..783e3407d 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opl +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/OPT/dicekit16fx_dice2-v10.opl @@ -33,6 +33,7 @@ "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\port.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\__STD_LIB_sbrk.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\heap_1.obj" +"C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\croutine.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\DiceTask.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\ParTest.obj" "C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\MB96350_Softune_Dice_Kit\OBJ\SegmentToggleTasks.obj" diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/ParTest/ParTest.c b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/ParTest/ParTest.c index c13466d91..0362300d1 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/ParTest/ParTest.c +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/ParTest/ParTest.c @@ -43,7 +43,7 @@ volatile unsigned char *pucDisplayOutput[ 2 ] = { ( unsigned char * ) 3, ( unsig void vParTestInitialise( void ) { /* In this case all the initialisation is performed in prvSetupHardware() - in main.c. */ + in main.c. */ } /*-----------------------------------------------------------*/ @@ -54,7 +54,7 @@ unsigned portBASE_TYPE uxLEDMask = 0x01; if( uxLED < partstNUM_LEDs_PER_DISPLAY ) { uxLEDMask <<= uxLED; - + taskENTER_CRITICAL(); { if( xValue ) @@ -63,7 +63,7 @@ unsigned portBASE_TYPE uxLEDMask = 0x01; } else { - *pucDisplayOutput[ 0 ] |= uxLEDMask; + *pucDisplayOutput[ 0 ] |= uxLEDMask; } } taskEXIT_CRITICAL(); @@ -73,7 +73,7 @@ unsigned portBASE_TYPE uxLEDMask = 0x01; uxLED -= partstNUM_LEDs_PER_DISPLAY; uxLEDMask <<= uxLED; - + taskENTER_CRITICAL(); { if( xValue ) @@ -82,7 +82,7 @@ unsigned portBASE_TYPE uxLEDMask = 0x01; } else { - *pucDisplayOutput[ 1 ] |= uxLEDMask; + *pucDisplayOutput[ 1 ] |= uxLEDMask; } } taskEXIT_CRITICAL(); @@ -97,7 +97,7 @@ unsigned portBASE_TYPE uxLEDMask = 0x01; if( uxLED < partstNUM_LEDs_PER_DISPLAY ) { uxLEDMask <<= uxLED; - + taskENTER_CRITICAL(); { if( *pucDisplayOutput[ 0 ] & uxLEDMask ) @@ -116,7 +116,7 @@ unsigned portBASE_TYPE uxLEDMask = 0x01; uxLED -= partstNUM_LEDs_PER_DISPLAY; uxLEDMask <<= uxLED; - + taskENTER_CRITICAL(); { if( *pucDisplayOutput[ 1 ] & uxLEDMask ) diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c index 6a07c5d98..4eae39958 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c @@ -25,8 +25,8 @@ */ /** - * Defines the tasks used to toggle the segments of the left - * seven segment display, as described at the top of main.c + * Defines the tasks and co-routines used to toggle the segments of the two + * seven segment displays, as described at the top of main.c */ @@ -35,6 +35,7 @@ /* Scheduler include files. */ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" /* Demo program include files. */ #include "partest.h" @@ -47,22 +48,38 @@ /* Each task toggles at a frequency that is a multiple of 333ms. */ #define ledFLASH_RATE_BASE ( ( TickType_t ) 333 ) +/* One co-routine per segment of the right hand display. */ +#define ledNUM_OF_LED_CO_ROUTINES 7 + +/* All co-routines run at the same priority. */ +#define ledCO_ROUTINE_PRIORITY 0 + /*-----------------------------------------------------------*/ /* The task that is created 7 times. */ static void vLEDFlashTask( void *pvParameters ); +/* The co-routine that is created 7 times. */ +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned short usIndex ); + +/* This task is created once, but itself creates 7 co-routines. */ +static void vLEDCoRoutineControlTask( void *pvParameters ); + /* Handles to each of the 7 tasks. Used so the tasks can be suspended and resumed. */ static TaskHandle_t xFlashTaskHandles[ ledNUM_OF_LED_TASKS ] = { 0 }; +/* Handle to the task in which the co-routines run. Used so the +co-routines can be suspended and resumed. */ +static TaskHandle_t xCoroutineTask; + /*-----------------------------------------------------------*/ /** - * Creates the tasks used to toggle the segments of the left - * seven segment display, as described at the top of main.c + * Creates the tasks and co-routines used to toggle the segments of the two + * seven segment displays, as described at the top of main.c */ -void vCreateFlashTasks( void ) +void vCreateFlashTasksAndCoRoutines( void ) { signed short sLEDTask; @@ -72,6 +89,10 @@ signed short sLEDTask; /* Spawn the task. */ xTaskCreate( vLEDFlashTask, "LEDt", configMINIMAL_STACK_SIZE, ( void * ) sLEDTask, ( tskIDLE_PRIORITY + 1 ), &( xFlashTaskHandles[ sLEDTask ] ) ); } + + /* Create the task in which the co-routines run. The co-routines themselves + are created within the task. */ + xTaskCreate( vLEDCoRoutineControlTask, "LEDc", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCoroutineTask ); } /*-----------------------------------------------------------*/ @@ -98,6 +119,19 @@ short sLEDTask; } } } + else + { + /* Suspend or resume the task in which the co-routines are running. The + co-routines toggle the segments of the right side display. */ + if( sSuspendTasks == pdTRUE ) + { + vTaskSuspend( xCoroutineTask ); + } + else + { + vTaskResume( xCoroutineTask ); + } + } } /*-----------------------------------------------------------*/ @@ -132,7 +166,58 @@ unsigned short usLED; vParTestToggleLED( usLED ); } } +/*-----------------------------------------------------------*/ +static void vLEDCoRoutineControlTask( void *pvParameters ) +{ +unsigned short usCoroutine; + + ( void ) pvParameters; + + /* Create the co-routines - one of each segment of the right side display. */ + for( usCoroutine = 0; usCoroutine < ledNUM_OF_LED_CO_ROUTINES; usCoroutine++ ) + { + xCoRoutineCreate( prvFixedDelayCoRoutine, ledCO_ROUTINE_PRIORITY, usCoroutine ); + } + + /* This task has nothing else to do except scheduler the co-routines it just + created. */ + for( ;; ) + { + vCoRoutineSchedule(); + } +} +/*-----------------------------------------------------------*/ + +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned short usIndex ) +{ +/* The usIndex parameter of the co-routine function is used as an index into +the xFlashRates array to obtain the delay period to use. */ +static const TickType_t xFlashRates[ ledNUM_OF_LED_CO_ROUTINES ] = { 150 / portTICK_PERIOD_MS, + 300 / portTICK_PERIOD_MS, + 450 / portTICK_PERIOD_MS, + 600 / portTICK_PERIOD_MS, + 750 / portTICK_PERIOD_MS, + 900 / portTICK_PERIOD_MS, + 1050 / portTICK_PERIOD_MS }; + + /* Co-routines MUST start with a call to crSTART. */ + crSTART( xHandle ); + + for( ;; ) + { + /* Toggle the LED. An offset of 8 is used to skip over the segments of + the left side display which use the low numbers. */ + vParTestToggleLED( usIndex + 8 ); + + /* Delay until it is time to toggle the segment that this co-routine is + controlling again. */ + crDELAY( xHandle, xFlashRates[ usIndex ] ); + } + + /* Co-routines MUST end with a call to crEND. */ + crEND(); +} /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/dicekit16fx_dice2-v10.prj b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/dicekit16fx_dice2-v10.prj index 376881bf1..d119ee38c 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/dicekit16fx_dice2-v10.prj +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/dicekit16fx_dice2-v10.prj @@ -17,23 +17,24 @@ PrjInfo-0=Debug Active=Debug [MEMBER] -F0=16 +F0=17 F1=0 f Include Files F2=0 f FreeRTOS Source F3=0 c ..\..\Source\portable\Softune\MB96340\__STD_LIB_sbrk.c -F4=0 c ..\..\Source\portable\MemMang\heap_1.c -F5=0 c ..\..\Source\list.c -F6=0 c ..\..\Source\portable\Softune\MB96340\port.c -F7=0 c ..\..\Source\queue.c -F8=0 c ..\..\Source\tasks.c -F9=0 f Demo Source -F10=0 c DiceTask.c -F11=0 c main.c -F12=0 a mb96356rs.asm -F13=0 c ParTest\ParTest.c -F14=0 c SegmentToggleTasks.c -F15=0 a START.ASM -F16=0 c vectors.c +F4=0 c ..\..\Source\croutine.c +F5=0 c ..\..\Source\portable\MemMang\heap_1.c +F6=0 c ..\..\Source\list.c +F7=0 c ..\..\Source\portable\Softune\MB96340\port.c +F8=0 c ..\..\Source\queue.c +F9=0 c ..\..\Source\tasks.c +F10=0 f Demo Source +F11=0 c DiceTask.c +F12=0 c main.c +F13=0 a mb96356rs.asm +F14=0 c ParTest\ParTest.c +F15=0 c SegmentToggleTasks.c +F16=0 a START.ASM +F17=0 c vectors.c [OPTIONFILE] FILE=options.dat @@ -50,7 +51,7 @@ LST=LST\ OPT=OPT\ [MEMBER-Debug] -F0=14 +F0=15 F1=0 m 1 ABS\RTOSDemo.abs F2=2 c 1 vectors.c F2-1=- mb96356rs.h @@ -95,7 +96,7 @@ F7-6=- ..\..\Source\portable\Softune\MB96340\portmacro.h F7-7=- ..\..\Source\Include\list.h F7-8=- FreeRTOSConfig.h F7-9=- mb96356rs.h -F8=11 c 1 ..\..\Source\queue.c +F8=12 c 1 ..\..\Source\queue.c F8-1=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h F8-2=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h F8-3=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\string.h @@ -105,8 +106,9 @@ F8-6=- ..\..\Source\Include\portable.h F8-7=- ..\..\Source\portable\Softune\MB96340\portmacro.h F8-8=- ..\..\Source\Include\task.h F8-9=- ..\..\Source\Include\list.h -F8-10=- FreeRTOSConfig.h -F8-11=- mb96356rs.h +F8-10=- ..\..\Source\Include\croutine.h +F8-11=- FreeRTOSConfig.h +F8-12=- mb96356rs.h F9=9 c 1 ..\..\Source\portable\Softune\MB96340\port.c F9-1=- ..\..\Source\Include\FreeRTOS.h F9-2=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h @@ -133,7 +135,7 @@ F11-7=- ..\..\Source\Include\portable.h F11-8=- ..\..\Source\portable\Softune\MB96340\portmacro.h F11-9=- ..\..\Source\Include\task.h F11-10=- ..\..\Source\Include\list.h -F12=11 c 1 DiceTask.c +F12=10 c 1 ..\..\Source\croutine.c F12-1=- ..\..\Source\Include\FreeRTOS.h F12-2=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h F12-3=- ..\..\Source\Include\projdefs.h @@ -143,9 +145,8 @@ F12-6=- ..\..\Source\Include\portable.h F12-7=- ..\..\Source\portable\Softune\MB96340\portmacro.h F12-8=- ..\..\Source\Include\task.h F12-9=- ..\..\Source\Include\list.h -F12-10=- ..\..\Source\Include\semphr.h -F12-11=- ..\..\Source\Include\queue.h -F13=10 c 1 ParTest\ParTest.c +F12-10=- ..\..\Source\Include\croutine.h +F13=11 c 1 DiceTask.c F13-1=- ..\..\Source\Include\FreeRTOS.h F13-2=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h F13-3=- ..\..\Source\Include\projdefs.h @@ -155,19 +156,32 @@ F13-6=- ..\..\Source\Include\portable.h F13-7=- ..\..\Source\portable\Softune\MB96340\portmacro.h F13-8=- ..\..\Source\Include\task.h F13-9=- ..\..\Source\Include\list.h -F13-10=- ..\Common\Include\ParTest.h -F14=11 c 1 SegmentToggleTasks.c -F14-1=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F13-10=- ..\..\Source\Include\semphr.h +F13-11=- ..\..\Source\Include\queue.h +F14=10 c 1 ParTest\ParTest.c +F14-1=- ..\..\Source\Include\FreeRTOS.h F14-2=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h -F14-3=- ..\..\Source\Include\FreeRTOS.h -F14-4=- ..\..\Source\Include\projdefs.h -F14-5=- FreeRTOSConfig.h -F14-6=- mb96356rs.h -F14-7=- ..\..\Source\Include\portable.h -F14-8=- ..\..\Source\portable\Softune\MB96340\portmacro.h -F14-9=- ..\..\Source\Include\task.h -F14-10=- ..\..\Source\Include\list.h -F14-11=- ..\Common\Include\ParTest.h +F14-3=- ..\..\Source\Include\projdefs.h +F14-4=- FreeRTOSConfig.h +F14-5=- mb96356rs.h +F14-6=- ..\..\Source\Include\portable.h +F14-7=- ..\..\Source\portable\Softune\MB96340\portmacro.h +F14-8=- ..\..\Source\Include\task.h +F14-9=- ..\..\Source\Include\list.h +F14-10=- ..\Common\Include\ParTest.h +F15=12 c 1 SegmentToggleTasks.c +F15-1=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stdlib.h +F15-2=- ..\..\..\..\..\..\devtools\Softune\LIB\907\INCLUDE\stddef.h +F15-3=- ..\..\Source\Include\FreeRTOS.h +F15-4=- ..\..\Source\Include\projdefs.h +F15-5=- FreeRTOSConfig.h +F15-6=- mb96356rs.h +F15-7=- ..\..\Source\Include\portable.h +F15-8=- ..\..\Source\portable\Softune\MB96340\portmacro.h +F15-9=- ..\..\Source\Include\task.h +F15-10=- ..\..\Source\Include\list.h +F15-11=- ..\..\Source\Include\croutine.h +F15-12=- ..\Common\Include\ParTest.h [BUILDMODE-Debug] kernel=0 diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/main.c b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/main.c index e2ae3ddcc..ec6bc2002 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/main.c +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/main.c @@ -51,6 +51,14 @@ * generated, if SW2 is not pressed within the 5 seconds then the 7 tasks are * un-suspended and will once again toggle the segments of the left hand display. * + * + * - Right 7 segment display - + * + * Control of the right side 7 segment display is very similar to that of the + * left, except co-routines are used to toggle the segments instead of tasks, + * and button SW3 is used instead of SW2. + * + * * - Notes - * * Only one dice task is actually defined. Two instances of this single @@ -60,13 +68,17 @@ * control. * * Both dice tasks and the flash tasks operate completely independently under - * the control of FreeRTOS. 11 tasks are created in total, including the idle - * task. + * the control of FreeRTOS. 11 tasks and 7 co-routines are created in total, + * including the idle task. + * + * The co-routines all execute within a single low priority task. + * + * * * When this demo is executing as expected: * - * + Every segment of the left display will toggle at a fixed frequency - with - * each segment using a different frequency. + * + Every segment of both displays will toggle at a fixed frequency - with each + * segment using a different frequency. * + When a button is pushed the segment toggling will temporarily stop and the * dice 'throw' will start whereby the display will show a fast changing random * number for a few seconds before the dice value is chosen and displayed. @@ -93,9 +105,10 @@ static void prvSetupHardware( void ); /* - * The function that creates the flash tasks. + * The function that creates the flash tasks and co-routines (the tasks and + * co-routines that toggle the 7 segment display segments. */ -extern vCreateFlashTasks( void ); +extern vCreateFlashTasksAndCoRoutines( void ); /*-----------------------------------------------------------*/ @@ -104,8 +117,8 @@ void main( void ) /* Setup the MCU IO. */ prvSetupHardware(); - /* Create the tasks that toggle the display segments. */ - vCreateFlashTasks(); + /* Create the tasks and co-routines that toggle the display segments. */ + vCreateFlashTasksAndCoRoutines(); /* Create a 'dice' task to control the left hand display. */ xTaskCreate( vDiceTask, "Dice1", configMINIMAL_STACK_SIZE, ( void * ) configLEFT_DISPLAY, mainDICE_PRIORITY, NULL ); diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/FreeRTOSConfig.h b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/FreeRTOSConfig.h index 173feaa3b..c4563df39 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/FreeRTOSConfig.h @@ -75,6 +75,9 @@ #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) #endif +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/ParTest.c b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/ParTest.c index c12e649a7..e6f5f6b0a 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/ParTest.c +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/ParTest.c @@ -56,10 +56,10 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { case 0: LED_PORT_OUT |= LED_1; break; - + case 1: LED_PORT_OUT |= LED_2; break; - + default: /* Nothing to do here, there are only two LEDs. */ break; } @@ -70,7 +70,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { case 0: LED_PORT_OUT &= ~LED_1; break; - + case 1: LED_PORT_OUT &= ~LED_2; break; default: /* Nothing to do here, there are only two LEDs. */ diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/RegTest.asm b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/RegTest.asm index 89fcad3c9..fb020d72e 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/RegTest.asm +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/RegTest.asm @@ -43,12 +43,12 @@ .global usRegTest1Counter .global usRegTest2Counter .global vPortYield - + .def vRegTest1Task .def vRegTest2Task .text - + .align 2 vRegTest1Task: .asmfunc @@ -65,7 +65,7 @@ vRegTest1Task: .asmfunc mov_x #0xdddd, r13 mov_x #0xeeee, r14 mov_x #0xffff, r15 - + prvRegTest1Loop: ; Test each general purpose register to check that it still contains the @@ -95,19 +95,19 @@ prvRegTest1Loop: jne vRegTest1Error cmp_x #0xffff, r15 jne vRegTest1Error - + ; This task is still running without jumping to vRegTest1Error, so increment ; the loop counter so the check task knows the task is running error free. inc_x &usRegTest1Counter - + ; Loop again, performing the same tests. jmp prvRegTest1Loop nop - + vRegTest1Error: jmp vRegTest1Error nop - .endasmfunc + .endasmfunc ; ----------------------------------------------------------- ; See the comments in vRegTest1Task. This task is the same, it just uses @@ -127,7 +127,7 @@ vRegTest2Task: .asmfunc mov_x #0xddd1, r13 mov_x #0xeee1, r14 mov_x #0xfff1, r15 - + prvRegTest2Loop: cmp_x #0x4441, r4 @@ -154,21 +154,21 @@ prvRegTest2Loop: jne vRegTest2Error cmp_x #0xfff1, r15 jne vRegTest2Error - + ; Also perform a manual yield, just to increase the scope of the test. call_x #vPortYield - + inc_x &usRegTest2Counter jmp prvRegTest2Loop nop - + vRegTest2Error: jmp vRegTest2Error nop .endasmfunc ; /*----------------------------------------------------------- - + .end - + diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/main.c b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/main.c index 215c26dbf..f4a120585 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/main.c +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/main.c @@ -58,9 +58,9 @@ * the poll rate to ensure debouncing is not necessary and that the task does * not use all the available CPU processing time. * - * Button Interrupt - The select button on the joystick input device is - * configured to generate an external interrupt. The handler for this interrupt - * sends a message to LCD task, which then prints out a string to say the + * Button Interrupt - The select button on the joystick input device is + * configured to generate an external interrupt. The handler for this interrupt + * sends a message to LCD task, which then prints out a string to say the * joystick select button was pressed. * * Idle Hook - The idle hook is a function that is called on each iteration of @@ -71,10 +71,10 @@ * driven tasks, and slowing the tick interrupt frequency, etc. * * "Check" callback function - Called each time the 'check' timer expires. The - * check timer executes every five seconds. Its main function is to check that - * all the standard demo tasks are still operational. Each time it executes it - * sends a status code to the LCD task. The LCD task interprets the code and - * displays an appropriate message - which will be PASS if no tasks have + * check timer executes every five seconds. Its main function is to check that + * all the standard demo tasks are still operational. Each time it executes it + * sends a status code to the LCD task. The LCD task interprets the code and + * displays an appropriate message - which will be PASS if no tasks have * reported any errors, or a message stating which task has reported an error. * * "Reg test" tasks - These fill the registers with known values, then check @@ -84,11 +84,11 @@ * test loop. A register containing an unexpected value is indicative of an * error in the context switching mechanism and will result in a branch to a * null loop - which in turn will prevent the check variable from incrementing - * any further and allow the check timer callback (described a above) to - * determine that an error has occurred. The nature of the reg test tasks + * any further and allow the check timer callback (described a above) to + * determine that an error has occurred. The nature of the reg test tasks * necessitates that they are written in assembly code. * - * Tick hook function - called inside the RTOS tick function, this simple + * Tick hook function - called inside the RTOS tick function, this simple * example does nothing but toggle an LED. * * *NOTE 1* vApplicationSetupTimerInterrupt() is called by the kernel to let @@ -246,7 +246,7 @@ void main( void ) vStartDynamicPriorityTasks(); vStartGenericQueueTasks( mainGENERIC_QUEUE_TEST_PRIORITY ); vStartCountingSemaphoreTasks(); - + /* Note that creating the timer test/demo tasks will fill the timer command queue. This is intentional, and forms part of the test the tasks perform. It does mean however that, after this function is called, no @@ -254,7 +254,7 @@ void main( void ) started (at which point the timer daemon will drained the timer command queue, freeing up space for more commands to be received). */ vStartTimerDemoTask( mainTIMER_TEST_PERIOD ); - + /* Create the LCD, button poll and register test tasks, as described at the top of this file. */ xTaskCreate( prvLCDTask, "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL ); @@ -264,10 +264,10 @@ void main( void ) /* Create the 'check' timer - the timer that periodically calls the check function as described at the top of this file. Note that, for - the reasons stated in the comments above the call to - vStartTimerDemoTask(), that the check timer is not actually started + the reasons stated in the comments above the call to + vStartTimerDemoTask(), that the check timer is not actually started until after the scheduler has been started. */ - xCheckTimer = xTimerCreate( "Check timer", mainCHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback ); + xCheckTimer = xTimerCreate( "Check timer", mainCHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback ); /* Start the scheduler. */ vTaskStartScheduler(); @@ -276,7 +276,7 @@ void main( void ) /* If all is well then this line will never be reached. If it is reached then it is likely that there was insufficient (FreeRTOS) heap memory space to create the idle task. This may have been trapped by the malloc() failed - hook function, if one is configured. */ + hook function, if one is configured. */ for( ;; ); } /*-----------------------------------------------------------*/ @@ -301,7 +301,7 @@ unsigned char ucLine = 1; } /* This is the only function that is permitted to access the LCD. - + First print out the number of bytes that remain in the FreeRTOS heap. This is done after a short delay to ensure all the demo tasks have created all the objects they are going to use. */ @@ -309,13 +309,13 @@ unsigned char ucLine = 1; sprintf( cBuffer, "%d heap free", ( int ) xPortGetFreeHeapSize() ); halLcdPrintLine( cBuffer, ucLine, OVERWRITE_TEXT ); ucLine++; - + /* Just as a test of the port, and for no functional reason, check the task parameter contains its expected value. */ if( pvParameters != mainTASK_PARAMETER_CHECK_VALUE ) { halLcdPrintLine( "Invalid parameter", ucLine, OVERWRITE_TEXT ); - ucLine++; + ucLine++; } for( ;; ) @@ -333,7 +333,7 @@ unsigned char ucLine = 1; halLcdClearScreen(); ucLine = 0; } - + /* What is this message? What does it contain? */ switch( xReceivedMessage.cMessageID ) { @@ -347,15 +347,15 @@ unsigned char ucLine = 1; case mainMESSAGE_BUTTON_SEL : /* The select button interrupt just informed this task that the select button has been pressed. - In this case the pointer to the - string to print is sent directly - in the ulMessageValue member of - the message. This just - demonstrates a different + In this case the pointer to the + string to print is sent directly + in the ulMessageValue member of + the message. This just + demonstrates a different communication technique. */ sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.ulMessageValue ); break; - + case mainMESSAGE_STATUS : /* The tick interrupt hook function has just informed this task of the system status. @@ -363,11 +363,11 @@ unsigned char ucLine = 1; with the status value. */ prvGenerateStatusMessage( cBuffer, xReceivedMessage.ulMessageValue ); break; - + default : sprintf( cBuffer, "Unknown message" ); break; } - + /* Output the message that was placed into the cBuffer array within the switch statement above, then move onto the next line ready for the next message to arrive on the queue. */ @@ -414,13 +414,13 @@ xQueueMessage xMessage; { /* Check the button state. */ ucState = ( halButtonsPressed() & BUTTON_UP ); - + if( ucState != 0 ) { /* The button was pressed. */ ucState = pdTRUE; } - + if( ucState != ucLastState ) { /* The state has changed, send a message to the LCD task. */ @@ -429,7 +429,7 @@ xQueueMessage xMessage; ucLastState = ucState; xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY ); } - + /* Block for 10 milliseconds so this task does not utilise all the CPU time and debouncing of the button is not necessary. */ vTaskDelay( 10 / portTICK_PERIOD_MS ); @@ -450,7 +450,7 @@ static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS }; /* The parameter is not used. */ ( void ) xTimer; - + /* See if the standard demo tasks are executing as expected, changing the message that is sent to the LCD task from PASS to an error code if any tasks set reports an error. */ @@ -463,17 +463,17 @@ static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS }; { xStatusMessage.ulMessageValue = mainERROR_DYNAMIC_TASKS; } - + if( xAreGenericQueueTasksStillRunning() != pdPASS ) { xStatusMessage.ulMessageValue = mainERROR_GEN_QUEUE_TEST; - } - + } + if( xAreCountingSemaphoreTasksStillRunning() != pdPASS ) { xStatusMessage.ulMessageValue = mainERROR_COUNT_SEM_TEST; } - + if( xAreTimerDemoTasksStillRunning( ( TickType_t ) mainCHECK_TIMER_PERIOD ) != pdPASS ) { xStatusMessage.ulMessageValue = mainERROR_TIMER_TEST; @@ -493,7 +493,7 @@ static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS }; usLastRegTest1Counter = usRegTest1Counter; usLastRegTest2Counter = usRegTest2Counter; - + /* This is called from a timer callback so must not block! */ xQueueSendToBack( xLCDQueue, &xStatusMessage, mainDONT_BLOCK ); } @@ -502,10 +502,10 @@ static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS }; static void prvSetupHardware( void ) { taskDISABLE_INTERRUPTS(); - + /* Disable the watchdog. */ WDTCTL = WDTPW + WDTHOLD; - + halBoardInit(); LFXT_Start( XT1DRIVE_0 ); @@ -523,7 +523,7 @@ static void prvSetupHardware( void ) halLcdInit(); halLcdSetContrast( 100 ); halLcdClearScreen(); - + halLcdPrintLine( " www.FreeRTOS.org", 0, OVERWRITE_TEXT ); } /*-----------------------------------------------------------*/ @@ -565,7 +565,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; xQueueSendFromISR( xLCDQueue, &xMessage, &xHigherPriorityTaskWoken ); P2IFG = 0; - + /* If writing to xLCDQueue 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 @@ -631,7 +631,7 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) { ( void ) pxTask; ( void ) pcTaskName; - + /* Run time stack overflow checking is performed if configconfigCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is called if a stack overflow is detected. */ diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/serial.c b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/serial.c index 3a9d58450..6571c087c 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/serial.c +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_CCS/Demo_Source/serial.c @@ -28,7 +28,7 @@ /* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. * * 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 + * 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! @@ -76,7 +76,7 @@ unsigned long ulBaudRateCount; /* Use SMCLK. */ UCA1CTL1 = UCSSEL0 | UCSSEL1; - + /* Setup baud rate low byte. */ UCA1BR0 = ( unsigned char ) ( ulBaudRateCount & ( unsigned long ) 0xff ); @@ -89,12 +89,12 @@ unsigned long ulBaudRateCount; /* Enable interrupts. */ UCA1IE |= UCRXIE; - + /* Take out of reset. */ UCA1CTL1 &= ~UCSWRST; } portEXIT_CRITICAL(); - + /* Note the comments at the top of this file about this not being a generic UART driver. */ return NULL; @@ -125,7 +125,7 @@ signed portBASE_TYPE xReturn; completed and switched itself off. */ xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime ); UCA1IE |= UCTXIE; - + return xReturn; } /*-----------------------------------------------------------*/ @@ -148,7 +148,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; characters. */ cChar = UCA1RXBUF; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - } + } else if( ( UCA1IFG & UCTXIFG ) != 0 ) { /* The previous character has been transmitted. See if there are any @@ -165,16 +165,16 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; UCA1IE &= ~UCTXIE; } } - + __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. */ + interrupt returns directly to the higher priority unblocked task. + + THIS MUST BE THE LAST THING DONE IN THE ISR. */ portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); } diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h index 60423d2b7..1e578ff0c 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h @@ -19,8 +19,8 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * https://www.FreeRTOS.org - * https://github.com/FreeRTOS + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS * */ @@ -65,6 +65,9 @@ #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 80 ) #endif +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -78,7 +81,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/ParTest.c b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/ParTest.c index c12e649a7..e6f5f6b0a 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/ParTest.c +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/ParTest.c @@ -56,10 +56,10 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { case 0: LED_PORT_OUT |= LED_1; break; - + case 1: LED_PORT_OUT |= LED_2; break; - + default: /* Nothing to do here, there are only two LEDs. */ break; } @@ -70,7 +70,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { case 0: LED_PORT_OUT &= ~LED_1; break; - + case 1: LED_PORT_OUT &= ~LED_2; break; default: /* Nothing to do here, there are only two LEDs. */ diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 index 107df6f10..88133112a 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 @@ -37,12 +37,12 @@ IMPORT usRegTest1Counter IMPORT usRegTest2Counter IMPORT vPortYield - + EXPORT vRegTest1Task EXPORT vRegTest2Task RSEG CODE - + EVEN vRegTest1Task: @@ -60,7 +60,7 @@ vRegTest1Task: mov_x #0xdddd, r13 mov_x #0xeeee, r14 mov_x #0xffff, r15 - + prvRegTest1Loop: /* Test each general purpose register to check that it still contains the @@ -90,22 +90,22 @@ prvRegTest1Loop: jne vRegTest1Error cmp_x #0xffff, r15 jne vRegTest1Error - + /* This task is still running without jumping to vRegTest1Error, so increment the loop counter so the check task knows the task is running error free. */ incx.w &usRegTest1Counter - + /* Loop again, performing the same tests. */ jmp prvRegTest1Loop nop - + EVEN - + vRegTest1Error: jmp vRegTest1Error nop - + /*-----------------------------------------------------------*/ /* See the comments in vRegTest1Task. This task is the same, it just uses @@ -124,7 +124,7 @@ vRegTest2Task: mov_x #0xddd1, r13 mov_x #0xeee1, r14 mov_x #0xfff1, r15 - + prvRegTest2Loop: cmp_x #0x4441, r4 @@ -151,20 +151,20 @@ prvRegTest2Loop: jne vRegTest2Error cmp_x #0xfff1, r15 jne vRegTest2Error - + /* Also perform a manual yield, just to increase the scope of the test. */ calla #vPortYield - + incx.w &usRegTest2Counter jmp prvRegTest2Loop nop - + vRegTest2Error: jmp vRegTest2Error nop /*-----------------------------------------------------------*/ - + END - + diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/serial.c b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/serial.c index 60a9e6e7d..b17fc219c 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/serial.c +++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/serial.c @@ -76,7 +76,7 @@ unsigned long ulBaudRateCount; /* Use SMCLK. */ UCA1CTL1 = UCSSEL0 | UCSSEL1; - + /* Setup baud rate low byte. */ UCA1BR0 = ( unsigned char ) ( ulBaudRateCount & ( unsigned long ) 0xff ); @@ -89,12 +89,12 @@ unsigned long ulBaudRateCount; /* Enable interrupts. */ UCA1IE |= UCRXIE; - + /* Take out of reset. */ UCA1CTL1 &= ~UCSWRST; } portEXIT_CRITICAL(); - + /* Note the comments at the top of this file about this not being a generic UART driver. */ return NULL; @@ -149,7 +149,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; cChar = UCA1RXBUF; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); } - + /* If there is a Tx interrupt pending and the tx interrupts are enabled. */ if( ( UCA1IFG & UCTXIFG ) != 0 ) { @@ -169,14 +169,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. */ + + THIS MUST BE THE LAST THING DONE IN THE ISR. */ portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); } diff --git a/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/CCS_Only/RegTest.asm b/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/CCS_Only/RegTest.asm index 1afc3ddb7..6253e1d8d 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/CCS_Only/RegTest.asm +++ b/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/CCS_Only/RegTest.asm @@ -43,12 +43,12 @@ .global usRegTest1LoopCounter .global usRegTest2LoopCounter .global vPortYield - + .def vRegTest1Implementation .def vRegTest2Implementation .text - + .align 2 vRegTest1Implementation: .asmfunc @@ -65,7 +65,7 @@ vRegTest1Implementation: .asmfunc mov_x #0xdddd, r13 mov_x #0xeeee, r14 mov_x #0xffff, r15 - + prvRegTest1Loop: ; Test each general purpose register to check that it still contains the @@ -95,19 +95,19 @@ prvRegTest1Loop: jne vRegTest1Error cmp_x #0xffff, r15 jne vRegTest1Error - + ; This task is still running without jumping to vRegTest1Error, so increment ; the loop counter so the check task knows the task is running error free. inc_x &usRegTest1LoopCounter - + ; Loop again, performing the same tests. jmp prvRegTest1Loop nop - + vRegTest1Error: jmp vRegTest1Error nop - .endasmfunc + .endasmfunc ; ----------------------------------------------------------- ; See the comments in vRegTest1Implementation. This task is the same, it just uses @@ -127,7 +127,7 @@ vRegTest2Implementation: .asmfunc mov_x #0xddd1, r13 mov_x #0xeee1, r14 mov_x #0xfff1, r15 - + prvRegTest2Loop: cmp_x #0x4441, r4 @@ -154,21 +154,21 @@ prvRegTest2Loop: jne vRegTest2Error cmp_x #0xfff1, r15 jne vRegTest2Error - + ; Also perform a manual yield, just to increase the scope of the test. call_x #vPortYield - + inc_x &usRegTest2LoopCounter jmp prvRegTest2Loop nop - + vRegTest2Error: jmp vRegTest2Error nop .endasmfunc ; /*----------------------------------------------------------- - + .end - + diff --git a/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/FreeRTOSConfig.h b/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/FreeRTOSConfig.h index 865b1dc1b..d45e2070d 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/FreeRTOSConfig.h @@ -50,6 +50,7 @@ __persistent keyword to be used. See http://www.freertos.org/a00111.html#heap_4 #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configQUEUE_REGISTRY_SIZE 0 @@ -80,6 +81,9 @@ __persistent keyword to be used. See http://www.freertos.org/a00111.html#heap_4 /* Return the current timer counter value + the overflow counter. */ #define portGET_RUN_TIME_COUNTER_VALUE() ( ( ( uint32_t ) TA1R ) + ulRunTimeCounterOverflows ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. The IAR linker will remove unused functions diff --git a/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/Full_Demo/main_full.c b/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/Full_Demo/main_full.c index f603788be..148f04a68 100644 --- a/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/Full_Demo/main_full.c +++ b/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/Full_Demo/main_full.c @@ -358,7 +358,7 @@ void vConfigureTimerForRunTimeStats( void ) __interrupt void v4RunTimeStatsTimerOverflow( void ) { TA1CTL &= ~TAIFG; - + /* 16-bit overflow, so add 17th bit. */ ulRunTimeCounterOverflows += 0x10000; __bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF ); diff --git a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/.project b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/.project index c67aaf89d..04040ffb0 100644 --- a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/.project +++ b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/.project @@ -56,6 +56,15 @@ + + 1420634088772 + src/FreeRTOS_Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 1420634120346 src/FreeRTOS_Source/portable diff --git a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/FreeRTOSConfig.h b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/FreeRTOSConfig.h index e84b04572..9e358d88a 100644 --- a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/FreeRTOSConfig.h @@ -73,6 +73,7 @@ this demo on the FreeRTOS.org web site for more information. */ #define configUSE_TICKLESS_IDLE 0 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_QUEUE_SETS 0 diff --git a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c index 70c5c4fed..456563d9e 100644 --- a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c +++ b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/lwIP_Demo/lwIP_Apps/lwIP_Apps.c @@ -44,8 +44,8 @@ /* include the port-dependent configuration */ #include "lwipcfg_msvc.h" -/* Dimensions the cTxBuffer array - which is itself used to hold replies from -command line commands. cTxBuffer is a shared buffer, so protected by the +/* Dimensions the cTxBuffer array - which is itself used to hold replies from +command line commands. cTxBuffer is a shared buffer, so protected by the xTxBufferMutex mutex. */ #define lwipappsTX_BUFFER_SIZE 1024 @@ -53,7 +53,7 @@ xTxBufferMutex mutex. */ available. */ #define lwipappsMAX_TIME_TO_WAIT_FOR_TX_BUFFER_MS ( 100 / portTICK_RATE_MS ) -/* Definitions of the various SSI callback functions within the pccSSITags +/* Definitions of the various SSI callback functions within the pccSSITags array. If pccSSITags is updated, then these definitions must also be updated. */ #define ssiTASK_STATS_INDEX 0 #define ssiRUN_TIME_STATS_INDEX 1 @@ -74,9 +74,9 @@ static unsigned short uslwIPAppsSSIHandler( int iIndex, char *pcBuffer, int iBuf /*-----------------------------------------------------------*/ /* The SSI strings that are embedded in the served html files. If this array -is changed, then the index position defined by the #defines such as +is changed, then the index position defined by the #defines such as ssiTASK_STATS_INDEX above must also be updated. */ -static const char *pccSSITags[] = +static const char *pccSSITags[] = { "rtos_stats", "run_stats" @@ -85,11 +85,11 @@ static const char *pccSSITags[] = /* Semaphore used to guard the Tx buffer. */ static xSemaphoreHandle xTxBufferMutex = NULL; -/* The Tx buffer itself. This is used to hold the text generated by the -execution of command line commands, and (hopefully) the execution of +/* The Tx buffer itself. This is used to hold the text generated by the +execution of command line commands, and (hopefully) the execution of server side include callbacks. It is a shared buffer so protected by the -xTxBufferMutex mutex. pcLwipAppsBlockingGetTxBuffer() and -vLwipAppsReleaseTxBuffer() are provided to obtain and release the +xTxBufferMutex mutex. pcLwipAppsBlockingGetTxBuffer() and +vLwipAppsReleaseTxBuffer() are provided to obtain and release the xTxBufferMutex respectively. pcLwipAppsBlockingGetTxBuffer() must be used with caution as it has the potential to block. */ static signed char cTxBuffer[ lwipappsTX_BUFFER_SIZE ]; @@ -157,7 +157,7 @@ static struct netif xNetIf; /* Install the server side include handler. */ http_set_ssi_handler( uslwIPAppsSSIHandler, pccSSITags, sizeof( pccSSITags ) / sizeof( char * ) ); - /* Create the mutex used to ensure mutual exclusive access to the Tx + /* Create the mutex used to ensure mutual exclusive access to the Tx buffer. */ xTxBufferMutex = xSemaphoreCreateMutex(); configASSERT( xTxBufferMutex ); @@ -185,7 +185,7 @@ extern char *pcMainGetTaskStatusMessage( void ); /* The SSI handler function that generates text depending on the index of the SSI tag encountered. */ - + switch( iIndex ) { case ssiTASK_STATS_INDEX : diff --git a/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonISR.s26 b/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonISR.s26 index af11bc335..12b199fc0 100644 --- a/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonISR.s26 +++ b/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonISR.s26 @@ -39,9 +39,9 @@ EXTERN vButtonISRHandler RSEG CODE:CODE - + vButtonISRWrapper: - ; Save the current task context. + ; Save the current task context. portSAVE_CONTEXT ; Call the C portion of the ISR. diff --git a/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonTask.c b/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonTask.c index e4e85c117..8f134bdcb 100644 --- a/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonTask.c +++ b/FreeRTOS/Demo/NEC_78K0R_IAR/ButtonTask.c @@ -63,7 +63,7 @@ void vButtonTask( void *pvParameters ) /* The button must have been pushed for this line to be executed. Simply toggle the LED. */ butLED1 = !butLED1; - + /* Wait a short time then clear any pending button pushes as a crude method of debouncing the switch. xSemaphoreTake() uses a block time of zero this time so it returns immediately rather than waiting for the @@ -85,7 +85,7 @@ short sHigherPriorityTaskWoken = pdFALSE; /* 'Give' the semaphore to unblock the button task. */ xSemaphoreGiveFromISR( xButtonSemaphore, &sHigherPriorityTaskWoken ); - + /* If giving the semaphore unblocked a task, and the unblocked task has a priority that is higher than the currently running task, then sHigherPriorityTaskWoken will have been set to pdTRUE. Passing a pdTRUE diff --git a/FreeRTOS/Demo/NEC_78K0R_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/NEC_78K0R_IAR/FreeRTOSConfig.h index a375920fe..408f01d31 100644 --- a/FreeRTOS/Demo/NEC_78K0R_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/NEC_78K0R_IAR/FreeRTOSConfig.h @@ -57,12 +57,12 @@ /* Only use following section for C files */ #ifdef __IAR_SYSTEMS_ICC__ - + #pragma language=extended #pragma system_include - + #include - + #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) @@ -74,8 +74,11 @@ #define configIDLE_SHOULD_YIELD 1 #define configCHECK_FOR_STACK_OVERFLOW 2 #define configUSE_MUTEXES 1 - - + + /* Co-routine definitions. */ + #define configUSE_CO_ROUTINES 0 + #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ #define INCLUDE_vTaskPrioritySet 1 @@ -85,34 +88,34 @@ #define INCLUDE_vTaskSuspend 1 #define INCLUDE_vTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 - + #if configCLOCK_SOURCE == 0 #define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) /* using the external clock source */ #else #define configCPU_CLOCK_HZ ( ( unsigned long ) 8000000 ) /* using the internal high speed clock */ #endif /* configCLOCK_SOURCE */ - + /* Definitions that are specific to the project being used. */ #ifdef __IAR_78K0R_Kx3__ - + /* Device specific includes. */ #include #include - + #define configTOTAL_HEAP_SIZE ( (size_t ) ( 7000 ) ) - + #endif /* __IAR_78K0R_Kx3__ */ - + #ifdef __IAR_78K0R_Kx3L__ - + /* Device specific includes. */ #include #include - + #define configTOTAL_HEAP_SIZE ( (size_t ) ( 2500 ) ) - + #endif /* _IAR_78K0R_Kx3L__ */ - + #endif /* __IAR_SYSTEMS_ICC__ */ #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/NEC_78K0R_IAR/RegTest.s26 b/FreeRTOS/Demo/NEC_78K0R_IAR/RegTest.s26 index 8fe1b58a0..5deff7c44 100644 --- a/FreeRTOS/Demo/NEC_78K0R_IAR/RegTest.s26 +++ b/FreeRTOS/Demo/NEC_78K0R_IAR/RegTest.s26 @@ -67,7 +67,7 @@ vRegTest1: MOVW DE, #0x5566 MOVW HL, #0x7788 MOV CS, #0x01 -#if configMEMORY_MODE == 1 +#if configMEMORY_MODE == 1 ; ES is not saved or restored when using the near memory model so only ; test it when using the far model. MOV ES, #0x02 @@ -84,18 +84,18 @@ loop1: BZ +5 ; Jump over the branch to vRegTestError() if the register contained the ; expected value - otherwise flag an error by executing vRegTestError(). - BR vRegTestError + BR vRegTestError ; Repeat for all the registers. MOVW AX, BC CMPW AX, #0x3344 BZ +5 - BR vRegTestError + BR vRegTestError MOVW AX, DE CMPW AX, #0x5566 BZ +5 - BR vRegTestError - MOVW AX, HL + BR vRegTestError + MOVW AX, HL CMPW AX, #0x7788 BZ +5 BR vRegTestError @@ -103,7 +103,7 @@ loop1: CMP A, #0x01 BZ +5 BR vRegTestError -#if configMEMORY_MODE == 1 +#if configMEMORY_MODE == 1 ; ES is not saved or restored when using the near memory model so only ; test it when using the far model. MOV A, ES @@ -135,23 +135,23 @@ vRegTest2: MOVW DE, #0xddee MOVW HL, #0xff12 MOV CS, #0x03 -#if configMEMORY_MODE == 1 - MOV ES, #0x04 +#if configMEMORY_MODE == 1 + MOV ES, #0x04 #endif loop2: CMPW AX, #0x99aa BZ +5 - BR vRegTestError + BR vRegTestError MOVW AX, BC CMPW AX, #0xbbcc BZ +5 - BR vRegTestError + BR vRegTestError MOVW AX, DE CMPW AX, #0xddee BZ +5 - BR vRegTestError - MOVW AX, HL + BR vRegTestError + MOVW AX, HL CMPW AX, #0xff12 BZ +5 BR vRegTestError @@ -159,7 +159,7 @@ loop2: CMP A, #0x03 BZ +5 BR vRegTestError -#if configMEMORY_MODE == 1 +#if configMEMORY_MODE == 1 MOV A, ES CMP A, #0x04 BZ +5 diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/NEC_V850ES_IAR/FreeRTOSConfig.h index d505081d5..01c8dd0ef 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/FreeRTOSConfig.h @@ -65,12 +65,16 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 - #define configUSE_MUTEXES 1 + #define configUSE_CO_ROUTINES 0 + #define configUSE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 #define configUSE_RECURSIVE_MUTEXES 1 #define configQUEUE_REGISTRY_SIZE 0 #define configUSE_COUNTING_SEMAPHORES 0 + /* Co-routine definitions. */ + #define configUSE_CO_ROUTINES 0 + #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit.c b/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit.c index 446192a8b..d4b0040f1 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit.c +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit.c @@ -37,11 +37,11 @@ unsigned char __low_level_init(void) { unsigned char resetflag = RESF; unsigned char psval = 0; -unsigned portBASE_TYPE i = 0; +unsigned portBASE_TYPE i = 0; /* Setup provided by NEC. */ - portDISABLE_INTERRUPTS(); /* disable global interrupts */ + portDISABLE_INTERRUPTS(); /* disable global interrupts */ PRCMD = 0x00; /* On-chip debug mode */ OCDM = 0x00; diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Fx3.c b/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Fx3.c index f672aaddc..4aacf6e22 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Fx3.c +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Fx3.c @@ -95,10 +95,10 @@ unsigned char psval = 0; PCLM = 0x00; /* disable dma0 - dma3 */ - E00 = 0; + E00 = 0; E11 = 0; E22 = 0; - E33 = 0; + E33 = 0; return pdTRUE; } diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Hx2.c b/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Hx2.c index 462205e6f..b6059874e 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Hx2.c +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/LowLevelInit/LowLevelInit_Hx2.c @@ -36,9 +36,9 @@ unsigned char __low_level_init( void ); unsigned char __low_level_init( void ) { unsigned char resetflag = RESF; -unsigned portBASE_TYPE i = 0; +unsigned portBASE_TYPE i = 0; - portDISABLE_INTERRUPTS(); /* disable global interrupts */ + portDISABLE_INTERRUPTS(); /* disable global interrupts */ PRCMD = 0x00; /* On-chip debug mode */ PCC = 0x00; /* high speed mode fCPU */ diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Fx3_App_Board.c b/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Fx3_App_Board.c index 3243e8917..9aa0013de 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Fx3_App_Board.c +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Fx3_App_Board.c @@ -60,7 +60,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = xLEDs[ uxLED ]; - + taskENTER_CRITICAL(); { if( xValue ) @@ -84,7 +84,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = xLEDs[ uxLED ]; - + taskENTER_CRITICAL(); { if( P3 & uxLEDMask ) diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Generic_Target_Board.c b/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Generic_Target_Board.c index e1beda5ae..e8208a0f3 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Generic_Target_Board.c +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/ParTest/ParTest_Generic_Target_Board.c @@ -58,7 +58,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = xLEDs[ uxLED ]; - + taskENTER_CRITICAL(); { if( xValue ) @@ -67,7 +67,7 @@ unsigned portBASE_TYPE uxLEDMask; } else { - PCM |= uxLEDMask; + PCM |= uxLEDMask; } } taskEXIT_CRITICAL(); @@ -82,7 +82,7 @@ unsigned portBASE_TYPE uxLEDMask; if( uxLED < partstNUM_LEDs ) { uxLEDMask = xLEDs[ uxLED ]; - + taskENTER_CRITICAL(); { if( PCM & uxLEDMask ) diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/RegTest.s85 b/FreeRTOS/Demo/NEC_V850ES_IAR/RegTest.s85 index be49f2d99..66b3559cb 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/RegTest.s85 +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/RegTest.s85 @@ -44,7 +44,7 @@ ;------------------------------------------------------------------------------ -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ RSEG CODE:CODE vRegTest1: MOV 0x01010101, R1 @@ -79,7 +79,7 @@ vRegTest1: MOV 0x21212121, R28 MOV 0x22222222, R29 MOV 0x23232323, R30 - + vReg1TestLoopStart: TRAP 0 MOV 0x01010101, R31 @@ -196,11 +196,11 @@ vReg1TestLoopStart: CMP R31, R30 BZ $+6 JARL vRegTestFailed, lp - MOV vReg1TestLoopStart, R31 + MOV vReg1TestLoopStart, R31 JMP [R31] ;------------------------------------------------------------------------------ -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ RSEG CODE:CODE vRegTest2: MOV 0xa101010b, R1 @@ -235,7 +235,7 @@ vRegTest2: MOV 0xa121212b, R28 MOV 0xa222222b, R29 MOV 0xa323232b, R30 - + vReg2TestLoopStart: MOV 0xa101010b, R31 CMP R31, R1 @@ -351,7 +351,8 @@ vReg2TestLoopStart: CMP R31, R30 BZ $+6 JARL vRegTestFailed, lp - MOV vReg2TestLoopStart, R31 + MOV vReg2TestLoopStart, R31 JMP [R31] END + \ No newline at end of file diff --git a/FreeRTOS/Demo/NEC_V850ES_IAR/serial/serial.c b/FreeRTOS/Demo/NEC_V850ES_IAR/serial/serial.c index 25388a82b..741ccf063 100644 --- a/FreeRTOS/Demo/NEC_V850ES_IAR/serial/serial.c +++ b/FreeRTOS/Demo/NEC_V850ES_IAR/serial/serial.c @@ -96,17 +96,17 @@ const unsigned long ulFuclk = ( configCPU_CLOCK_HZ / 2 ) / 8UL; PMC3 |= ( serRX_DATA_PIN | serTX_DATA_PIN ); PM3 &= ~( serTX_DATA_PIN ); - /* Setup clock for required baud. */ + /* Setup clock for required baud. */ UD0CTL1 = serCLOCK_Fxx_DIV_8; UD0CTL2 = ulFuclk / ( 2 * ulWantedBaud ); - /* Enable, n81. */ + /* Enable, n81. */ UD0CTL0 = ( serUPWR | serUTXE | serURXE | serUCL | serLSB ); - + /* Enable interrupts for both Rx and Tx. */ UD0TIC = 0x07; UD0RIC = 0x07; - + ulTxInProgress = pdFALSE; } portEXIT_CRITICAL(); @@ -188,7 +188,7 @@ portBASE_TYPE xReturn = pdPASS; } } portEXIT_CRITICAL(); - + return xReturn; } /*-----------------------------------------------------------*/ @@ -216,7 +216,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; /* The UART is no longer active. */ ulTxInProgress = pdFALSE; } - + /* If reading a character from the Rx queue caused a task to unblock, and the unblocked task has a priority higher than the currently running task, then xHigherPriorityTaskWoken will have been set to true and a context @@ -234,15 +234,15 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; /* Send the received character to the Rx queue. */ cChar = UD0RX; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - + /* If sending a character to the Tx queue caused a task to unblock, and the unblocked task has a priority higher than the currently running task, then xHigherPriorityTaskWoken will have been set to true and a context switch should occur now. */ - portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); } - + diff --git a/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/FreeRTOSConfig.h index 86d914341..1236de7bb 100644 --- a/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/FreeRTOSConfig.h @@ -27,10 +27,10 @@ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H -/* +/* * The following #error directive is to remind users that a batch file must be - * executed prior to this project being built. The batch file *cannot* be - * executed from within the IDE! Once it has been executed, re-open or refresh + * executed prior to this project being built. The batch file *cannot* be + * executed from within the IDE! Once it has been executed, re-open or refresh * the Eclipse project and remove the #error line below. */ #error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above. @@ -44,14 +44,14 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. *----------------------------------------------------------*/ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) -#define configCPU_CLOCK_HZ ( ( unsigned long ) SYS_CLK_FREQ ) +#define configCPU_CLOCK_HZ ( ( unsigned long ) SYS_CLK_FREQ ) #define configMAX_PRIORITIES ( 5 ) #define configMINIMAL_STACK_SIZE ( 1024 ) #define configISR_STACK_SIZE configMINIMAL_STACK_SIZE @@ -66,6 +66,9 @@ #define configCHECK_FOR_STACK_OVERFLOW 2 #define configQUEUE_REGISTRY_SIZE 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/ParTest/ParTest.c b/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/ParTest/ParTest.c index 6c6194038..26d754630 100644 --- a/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/ParTest/ParTest.c +++ b/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/ParTest/ParTest.c @@ -51,7 +51,7 @@ static unsigned long ulLedStates; void vParTestInitialise( void ) { IOWR_ALTERA_AVALON_PIO_DIRECTION( LED_PIO_BASE, ALTERA_AVALON_PIO_DIRECTION_OUTPUT ); - ulLedStates = 0; + ulLedStates = 0; } /*-----------------------------------------------------------*/ @@ -83,7 +83,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) taskENTER_CRITICAL(); { vParTestSetLED( uxLED, !( ulLedStates & ( 1 << uxLED ) ) ); - } + } taskEXIT_CRITICAL(); } } diff --git a/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/serial.c b/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/serial.c index 09a72aff2..5b5730c91 100644 --- a/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/serial.c +++ b/FreeRTOS/Demo/NiosII_CycloneIII_DBC3C40_GCC/RTOSDemo/serial.c @@ -24,7 +24,7 @@ * */ -/* NOTE: This is just a test file and not intended to be a generic +/* NOTE: This is just a test file and not intended to be a generic COM driver. */ #include "altera_avalon_uart.h" @@ -41,8 +41,8 @@ COM driver. */ #define serNO_BLOCK ( ( TickType_t ) 0 ) /*---------------------------------------------------------------------------*/ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; alt_u32 uartControl; /*---------------------------------------------------------------------------*/ @@ -64,8 +64,8 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port portENTER_CRITICAL(); { uartControl = ALTERA_AVALON_UART_CONTROL_RTS_MSK | ALTERA_AVALON_UART_CONTROL_RRDY_MSK | ALTERA_AVALON_UART_CONTROL_DCTS_MSK; - IOWR_ALTERA_AVALON_UART_CONTROL( UART_BASE, uartControl ); - + IOWR_ALTERA_AVALON_UART_CONTROL( UART_BASE, uartControl ); + /* register the interrupt handler */ alt_irq_register ( UART_IRQ, NULL, vUARTInterruptHandler ); } @@ -114,12 +114,12 @@ signed portBASE_TYPE lReturn = pdPASS; if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) == pdPASS ) { /*Triggers an interrupt on every character or (down) when queue is full. */ - uartControl |= ALTERA_AVALON_UART_CONTROL_TRDY_MSK; + uartControl |= ALTERA_AVALON_UART_CONTROL_TRDY_MSK; IOWR_ALTERA_AVALON_UART_CONTROL( UART_BASE, uartControl ); lReturn = pdPASS; } else - { + { lReturn = pdFAIL; } return lReturn; @@ -153,19 +153,19 @@ static void vUARTInterruptHandler( void* context, alt_u32 id ) { alt_u32 status; - /* Read the status register in order to determine the cause of the + /* Read the status register in order to determine the cause of the interrupt. */ status = IORD_ALTERA_AVALON_UART_STATUS( UART_BASE ); - + /* Clear any error flags set at the device */ IOWR_ALTERA_AVALON_UART_STATUS( UART_BASE, 0 ); - + /* process a read irq */ if ( status & ALTERA_AVALON_UART_STATUS_RRDY_MSK ) { vUARTReceiveHandler( status ); } - + /* process a write irq */ if ( status & ( ALTERA_AVALON_UART_STATUS_TRDY_MSK ) ) { @@ -190,12 +190,12 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; cChar = IORD_ALTERA_AVALON_UART_RXDATA( UART_BASE ); if ( pdTRUE != xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ) ) { - /* If the circular buffer was full, disable interrupts. Interrupts will + /* If the circular buffer was full, disable interrupts. Interrupts will be re-enabled when data is removed from the buffer. */ uartControl &= ~ALTERA_AVALON_UART_CONTROL_RRDY_MSK; IOWR_ALTERA_AVALON_UART_CONTROL( UART_BASE, uartControl ); } - + portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } /*---------------------------------------------------------------------------*/ @@ -213,8 +213,8 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { uartControl &= ~ALTERA_AVALON_UART_CONTROL_TRDY_MSK; } - + IOWR_ALTERA_AVALON_UART_CONTROL( UART_BASE, uartControl ); - portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); -} + portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); +} /*---------------------------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/PIC18_MPLAB/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_MPLAB/FreeRTOSConfig.h index c19ad66d8..42d7ccc59 100644 --- a/FreeRTOS/Demo/PIC18_MPLAB/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_MPLAB/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -54,6 +54,9 @@ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/PIC18_MPLAB/ParTest/ParTest.c b/FreeRTOS/Demo/PIC18_MPLAB/ParTest/ParTest.c index 002f2301a..199047898 100644 --- a/FreeRTOS/Demo/PIC18_MPLAB/ParTest/ParTest.c +++ b/FreeRTOS/Demo/PIC18_MPLAB/ParTest/ParTest.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V2.0.0 + Use scheduler suspends in place of critical sections. @@ -64,13 +64,13 @@ void vParTestInitialise( void ) /* Enable the driver. */ ADCON1 = partstENABLE_GENERAL_IO; TRISEbits.TRISE2 = partstBIT_AS_OUTPUT; - PORTEbits.RE2 = partstSET_OUTPUT; + PORTEbits.RE2 = partstSET_OUTPUT; } /*-----------------------------------------------------------*/ void vParTestSetLED( unsigned portBASE_TYPE uxLED, portBASE_TYPE xValue ) { - /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ + /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ vTaskSuspendAll(); { switch( uxLED ) @@ -93,7 +93,7 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, portBASE_TYPE xValue ) void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { - /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ + /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ vTaskSuspendAll(); { switch( uxLED ) diff --git a/FreeRTOS/Demo/PIC18_MPLAB/serial/serial.c b/FreeRTOS/Demo/PIC18_MPLAB/serial/serial.c index 429c26763..87f5273fe 100644 --- a/FreeRTOS/Demo/PIC18_MPLAB/serial/serial.c +++ b/FreeRTOS/Demo/PIC18_MPLAB/serial/serial.c @@ -73,7 +73,7 @@ void vSerialRxISR( void ); /*-----------------------------------------------------------*/ /* Queues to interface between comms API and interrupt routines. */ -static QueueHandle_t xRxedChars; +static QueueHandle_t xRxedChars; static QueueHandle_t xCharsForTx; /*-----------------------------------------------------------*/ @@ -125,7 +125,7 @@ unsigned long ulBaud; 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 + com port. We therefore don't return a pointer to a port structure and can instead just return NULL. */ return NULL; } @@ -161,7 +161,7 @@ portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickT return pdFAIL; } - /* Turn interrupt on - ensure the compiler only generates a single + /* Turn interrupt on - ensure the compiler only generates a single instruction for this. */ PIE1bits.TXIE = serINTERRUPT_ENABLED; @@ -192,7 +192,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( RCSTAbits.OERR ) { RCSTAbits.CREN = serCLEAR_OVERRUN; - RCSTAbits.CREN = serCONTINUOUS_RX; + RCSTAbits.CREN = serCONTINUOUS_RX; } xQueueSendFromISR( xRxedChars, ( const void * ) &cChar, &xHigherPriorityTaskWoken ); diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo1/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_WizC/Demo1/FreeRTOSConfig.h index d8d4ff7ba..716960a78 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo1/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_WizC/Demo1/FreeRTOSConfig.h @@ -43,7 +43,7 @@ Changes from V3.0.1 * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -59,6 +59,9 @@ Changes from V3.0.1 #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo1/interrupt.c b/FreeRTOS/Demo/PIC18_WizC/Demo1/interrupt.c index f8d3444ca..9549dfeba 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo1/interrupt.c +++ b/FreeRTOS/Demo/PIC18_WizC/Demo1/interrupt.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. @@ -58,7 +58,7 @@ void pointed Interrupt() * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; - + /* * Was the interrupt the FreeRTOS SystemTick? */ @@ -93,7 +93,7 @@ void pointed Interrupt() { vTaskSwitchContext(); } - + /* * Restore the context of the (possibly other) task. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo2/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_WizC/Demo2/FreeRTOSConfig.h index 48c4331e0..157c5c0e1 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo2/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_WizC/Demo2/FreeRTOSConfig.h @@ -43,7 +43,7 @@ Changes from V3.0.1 * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -59,6 +59,9 @@ Changes from V3.0.1 #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo2/interrupt.c b/FreeRTOS/Demo/PIC18_WizC/Demo2/interrupt.c index 06c83a799..88794e6ee 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo2/interrupt.c +++ b/FreeRTOS/Demo/PIC18_WizC/Demo2/interrupt.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. @@ -58,7 +58,7 @@ void pointed Interrupt() * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; - + /* * Was the interrupt the FreeRTOS SystemTick? */ @@ -102,7 +102,7 @@ void pointed Interrupt() { vTaskSwitchContext(); } - + /* * Restore the context of the (possibly other) task. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo3/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_WizC/Demo3/FreeRTOSConfig.h index 7373b10ca..867c39546 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo3/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_WizC/Demo3/FreeRTOSConfig.h @@ -43,7 +43,7 @@ Changes from V3.0.1 * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -59,6 +59,9 @@ Changes from V3.0.1 #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo3/interrupt.c b/FreeRTOS/Demo/PIC18_WizC/Demo3/interrupt.c index 06c83a799..88794e6ee 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo3/interrupt.c +++ b/FreeRTOS/Demo/PIC18_WizC/Demo3/interrupt.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. @@ -58,7 +58,7 @@ void pointed Interrupt() * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; - + /* * Was the interrupt the FreeRTOS SystemTick? */ @@ -102,7 +102,7 @@ void pointed Interrupt() { vTaskSwitchContext(); } - + /* * Restore the context of the (possibly other) task. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo4/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_WizC/Demo4/FreeRTOSConfig.h index 330fc530f..42273feac 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo4/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_WizC/Demo4/FreeRTOSConfig.h @@ -43,7 +43,7 @@ Changes from V3.0.1 * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -59,6 +59,9 @@ Changes from V3.0.1 #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo4/interrupt.c b/FreeRTOS/Demo/PIC18_WizC/Demo4/interrupt.c index 06c83a799..88794e6ee 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo4/interrupt.c +++ b/FreeRTOS/Demo/PIC18_WizC/Demo4/interrupt.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. @@ -58,7 +58,7 @@ void pointed Interrupt() * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; - + /* * Was the interrupt the FreeRTOS SystemTick? */ @@ -102,7 +102,7 @@ void pointed Interrupt() { vTaskSwitchContext(); } - + /* * Restore the context of the (possibly other) task. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo5/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_WizC/Demo5/FreeRTOSConfig.h index 68b9dec45..fb8d40dbb 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo5/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_WizC/Demo5/FreeRTOSConfig.h @@ -43,7 +43,7 @@ Changes from V3.0.1 * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -59,6 +59,9 @@ Changes from V3.0.1 #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo5/interrupt.c b/FreeRTOS/Demo/PIC18_WizC/Demo5/interrupt.c index 06c83a799..88794e6ee 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo5/interrupt.c +++ b/FreeRTOS/Demo/PIC18_WizC/Demo5/interrupt.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. @@ -58,7 +58,7 @@ void pointed Interrupt() * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; - + /* * Was the interrupt the FreeRTOS SystemTick? */ @@ -102,7 +102,7 @@ void pointed Interrupt() { vTaskSwitchContext(); } - + /* * Restore the context of the (possibly other) task. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo6/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_WizC/Demo6/FreeRTOSConfig.h index 1331f3b6a..5b2e1ee06 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo6/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_WizC/Demo6/FreeRTOSConfig.h @@ -43,7 +43,7 @@ Changes from V3.0.1 * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -59,6 +59,9 @@ Changes from V3.0.1 #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo6/interrupt.c b/FreeRTOS/Demo/PIC18_WizC/Demo6/interrupt.c index 06c83a799..88794e6ee 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo6/interrupt.c +++ b/FreeRTOS/Demo/PIC18_WizC/Demo6/interrupt.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. @@ -58,7 +58,7 @@ void pointed Interrupt() * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; - + /* * Was the interrupt the FreeRTOS SystemTick? */ @@ -102,7 +102,7 @@ void pointed Interrupt() { vTaskSwitchContext(); } - + /* * Restore the context of the (possibly other) task. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo7/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC18_WizC/Demo7/FreeRTOSConfig.h index 4a96022aa..dd9511801 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo7/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC18_WizC/Demo7/FreeRTOSConfig.h @@ -43,7 +43,7 @@ Changes from V3.0.1 * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -59,6 +59,9 @@ Changes from V3.0.1 #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/Demo7/interrupt.c b/FreeRTOS/Demo/PIC18_WizC/Demo7/interrupt.c index 06c83a799..88794e6ee 100644 --- a/FreeRTOS/Demo/PIC18_WizC/Demo7/interrupt.c +++ b/FreeRTOS/Demo/PIC18_WizC/Demo7/interrupt.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. @@ -58,7 +58,7 @@ void pointed Interrupt() * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; - + /* * Was the interrupt the FreeRTOS SystemTick? */ @@ -102,7 +102,7 @@ void pointed Interrupt() { vTaskSwitchContext(); } - + /* * Restore the context of the (possibly other) task. */ diff --git a/FreeRTOS/Demo/PIC18_WizC/ParTest/ParTest.c b/FreeRTOS/Demo/PIC18_WizC/ParTest/ParTest.c index ce9cf1841..60dbb97a3 100644 --- a/FreeRTOS/Demo/PIC18_WizC/ParTest/ParTest.c +++ b/FreeRTOS/Demo/PIC18_WizC/ParTest/ParTest.c @@ -24,7 +24,7 @@ * */ -/* +/* Changes from V3.0.0 Changes from V3.0.1 @@ -66,13 +66,13 @@ void vParTestInitialise( void ) /* Enable the driver. */ ADCON1 = partstENABLE_GENERAL_IO; bTRE2 = partstBIT_AS_OUTPUT; - bRE2 = partstSET_OUTPUT; + bRE2 = partstSET_OUTPUT; } /*-----------------------------------------------------------*/ void vParTestSetLED( unsigned char ucLED, char cValue ) { - /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ + /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ vTaskSuspendAll(); { switch( ucLED ) @@ -95,7 +95,7 @@ void vParTestSetLED( unsigned char ucLED, char cValue ) void vParTestToggleLED( unsigned char ucLED ) { - /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ + /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ vTaskSuspendAll(); { switch( ucLED ) diff --git a/FreeRTOS/Demo/PIC18_WizC/serial/isrSerialRx.c b/FreeRTOS/Demo/PIC18_WizC/serial/isrSerialRx.c index 77dbdfc4f..429abcd24 100644 --- a/FreeRTOS/Demo/PIC18_WizC/serial/isrSerialRx.c +++ b/FreeRTOS/Demo/PIC18_WizC/serial/isrSerialRx.c @@ -53,7 +53,7 @@ Changes from V3.0.1 * Queue to interface between comms API and interrupt routine. */ extern QueueHandle_t xRxedChars; - + /* * Because we are not allowed to use local variables here, * PRODL is (ab)used as temporary storage. This is allowed @@ -87,7 +87,7 @@ Changes from V3.0.1 if( bOERR ) { bCREN = serCLEAR_OVERRUN; - bCREN = serCONTINUOUS_RX; + bCREN = serCONTINUOUS_RX; } xHigherPriorityTaskWoken = pdFALSE; diff --git a/FreeRTOS/Demo/PIC18_WizC/serial/serial.c b/FreeRTOS/Demo/PIC18_WizC/serial/serial.c index 36a72a581..61bd64d5b 100644 --- a/FreeRTOS/Demo/PIC18_WizC/serial/serial.c +++ b/FreeRTOS/Demo/PIC18_WizC/serial/serial.c @@ -55,7 +55,7 @@ Changes from V3.0.1 /*-----------------------------------------------------------*/ /* Queues to interface between comms API and interrupt routines. */ -QueueHandle_t xRxedChars; +QueueHandle_t xRxedChars; QueueHandle_t xCharsForTx; portBASE_TYPE xHigherPriorityTaskWoken; @@ -64,7 +64,7 @@ portBASE_TYPE xHigherPriorityTaskWoken; xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned char ucQueueLength ) { unsigned short usSPBRG; - + /* Create the queues used by the ISR's to interface to tasks. */ xRxedChars = xQueueCreate( ucQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) ); xCharsForTx = xQueueCreate( ucQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) ); @@ -117,11 +117,11 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned char /* Enable the Rx interrupt now, the Tx interrupt will get enabled when we have data to send. */ bRCIE = serINTERRUPT_ENABLED; - + 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 + com port. We therefore don't return a pointer to a port structure and can instead just return NULL. */ return NULL; } @@ -156,7 +156,7 @@ portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, char cOutChar, TickType_t x return pdFAIL; } - /* Turn interrupt on - ensure the compiler only generates a single + /* Turn interrupt on - ensure the compiler only generates a single instruction for this. */ bTXIE = serINTERRUPT_ENABLED; diff --git a/FreeRTOS/Demo/PIC24_MPLAB/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC24_MPLAB/FreeRTOSConfig.h index 9da1b7943..e7e957cb9 100644 --- a/FreeRTOS/Demo/PIC24_MPLAB/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC24_MPLAB/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -55,6 +55,10 @@ #define configIDLE_SHOULD_YIELD 1 #define configCHECK_FOR_STACK_OVERFLOW 2 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -66,6 +70,7 @@ to exclude the API function. */ #define INCLUDE_vTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 + #define configKERNEL_INTERRUPT_PRIORITY 0x01 #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/PIC24_MPLAB/RTOSDemo_PIC24.mcp b/FreeRTOS/Demo/PIC24_MPLAB/RTOSDemo_PIC24.mcp index e0b25e4b3..c71c940cd 100644 --- a/FreeRTOS/Demo/PIC24_MPLAB/RTOSDemo_PIC24.mcp +++ b/FreeRTOS/Demo/PIC24_MPLAB/RTOSDemo_PIC24.mcp @@ -44,6 +44,9 @@ file_016=Standard Demo Source file_017=. file_018=. file_019=. +file_020=. +file_021=. +file_022=. [GENERATED_FILES] file_000=no file_001=no @@ -65,6 +68,9 @@ file_016=no file_017=no file_018=no file_019=no +file_020=no +file_021=no +file_022=no [OTHER_FILES] file_000=no file_001=no @@ -86,6 +92,9 @@ file_016=no file_017=no file_018=no file_019=no +file_020=no +file_021=no +file_022=no [FILE_INFO] file_000=main.c file_001=..\..\source\list.c @@ -96,17 +105,20 @@ file_005=lcd.c file_006=..\Common\Minimal\BlockQ.c file_007=..\Common\Minimal\blocktim.c file_008=..\Common\Minimal\comtest.c -file_009=..\..\source\portable\MemMang\heap_1.c -file_010=..\Common\Minimal\integer.c -file_011=..\..\source\portable\MPLAB\PIC24_dsPIC\port.c -file_012=..\..\Source\portable\MPLAB\PIC24_dsPIC\portasm_PIC24.S -file_013=..\..\source\tasks.c -file_014=timertest.c -file_015=..\..\source\include\semphr.h -file_016=..\..\source\include\task.h -file_017=..\..\source\include\queue.h -file_018=FreeRTOSConfig.h -file_019=p24FJ128GA010.gld +file_009=..\Common\Minimal\crflash.c +file_010=..\..\source\croutine.c +file_011=..\..\source\portable\MemMang\heap_1.c +file_012=..\Common\Minimal\integer.c +file_013=..\..\source\portable\MPLAB\PIC24_dsPIC\port.c +file_014=..\..\Source\portable\MPLAB\PIC24_dsPIC\portasm_PIC24.S +file_015=..\..\source\tasks.c +file_016=timertest.c +file_017=..\..\source\include\semphr.h +file_018=..\..\source\include\task.h +file_019=..\..\source\include\croutine.h +file_020=..\..\source\include\queue.h +file_021=FreeRTOSConfig.h +file_022=p24FJ128GA010.gld [SUITE_INFO] suite_guid={479DDE59-4D56-455E-855E-FFF59A3DB57E} suite_state= diff --git a/FreeRTOS/Demo/PIC24_MPLAB/main.c b/FreeRTOS/Demo/PIC24_MPLAB/main.c index 0ce37686c..3139864b1 100644 --- a/FreeRTOS/Demo/PIC24_MPLAB/main.c +++ b/FreeRTOS/Demo/PIC24_MPLAB/main.c @@ -31,27 +31,27 @@ * defined and/or created within this file: * * "Fast Interrupt Test" - A high frequency periodic interrupt is generated - * using a free running timer to demonstrate the use of the - * configKERNEL_INTERRUPT_PRIORITY configuration constant. The interrupt + * using a free running timer to demonstrate the use of the + * configKERNEL_INTERRUPT_PRIORITY configuration constant. The interrupt * service routine measures the number of processor clocks that occur between - * each interrupt - and in so doing measures the jitter in the interrupt - * timing. The maximum measured jitter time is latched in the usMaxJitter - * variable, and displayed on the LCD by the 'Check' as described below. - * The fast interrupt is configured and handled in the timer_test.c source + * each interrupt - and in so doing measures the jitter in the interrupt + * timing. The maximum measured jitter time is latched in the usMaxJitter + * variable, and displayed on the LCD by the 'Check' as described below. + * The fast interrupt is configured and handled in the timer_test.c source * file. * * "LCD" task - the LCD task is a 'gatekeeper' task. It is the only task that * is permitted to access the LCD directly. Other tasks wishing to write a - * message to the LCD send the message on a queue to the LCD task instead of - * accessing the LCD themselves. The LCD task just blocks on the queue waiting + * message to the LCD send the message on a queue to the LCD task instead of + * accessing the LCD themselves. The LCD task just blocks on the queue waiting * for messages - waking and displaying the messages as they arrive. The LCD - * task is defined in lcd.c. - * - * "Check" task - This only executes every three seconds but has the highest - * priority so is guaranteed to get processor time. Its main function is to + * task is defined in lcd.c. + * + * "Check" task - This only executes every three seconds but has the highest + * priority so is guaranteed to get processor time. Its main function is to * check that all the standard demo tasks are still operational. Should any * unexpected behaviour within a demo task be discovered the 'check' task will - * write "FAIL #n" to the LCD (via the LCD task). If all the demo tasks are + * write "FAIL #n" to the LCD (via the LCD task). If all the demo tasks are * executing with their expected behaviour then the check task writes the max * jitter time to the LCD (again via the LCD task), as described above. */ @@ -63,9 +63,11 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "croutine.h" /* Demo application includes. */ #include "BlockQ.h" +#include "crflash.h" #include "blocktim.h" #include "integer.h" #include "comtest2.h" @@ -84,6 +86,9 @@ /* The execution period of the check task. */ #define mainCHECK_TASK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_COROUTINES ( 5 ) + /* Baud rate used by the comtest tasks. */ #define mainCOM_TEST_BAUD_RATE ( 19200 ) @@ -137,8 +142,9 @@ int main( void ) prvSetupHardware(); /* Create the standard demo tasks. */ - vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); + vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartIntegerMathTasks( tskIDLE_PRIORITY ); + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vCreateBlockTimeTasks(); @@ -170,7 +176,7 @@ static void prvSetupHardware( void ) static void vCheckTask( void *pvParameters ) { /* Used to wake the task at the correct frequency. */ -TickType_t xLastExecutionTime; +TickType_t xLastExecutionTime; /* The maximum jitter time measured by the fast interrupt test. */ extern unsigned short usMaxJitter ; @@ -206,7 +212,7 @@ unsigned short usErrorDetected = pdFALSE; usErrorDetected = pdTRUE; sprintf( cStringBuffer, "FAIL #1" ); } - + if( xAreComTestTasksStillRunning() != pdTRUE ) { usErrorDetected = pdTRUE; @@ -240,6 +246,8 @@ unsigned short usErrorDetected = pdFALSE; void vApplicationIdleHook( void ) { + /* Schedule the co-routines from within the idle task hook. */ + vCoRoutineSchedule(); } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/.gitignore b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/.gitignore deleted file mode 100644 index 45efcf210..000000000 --- a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile-local-default.mk -Makefile-impl.mk -Makefile-variables.mk -Makefile-default.mk -Package-default.bash diff --git a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-default.mk b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-default.mk new file mode 100644 index 000000000..60fba524c --- /dev/null +++ b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-default.mk @@ -0,0 +1,386 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Include project Makefile +ifeq "${IGNORE_LOCAL}" "TRUE" +# do not include local makefile. User is passing all local related variables already +else +include Makefile +# Include makefile containing local settings +ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk" +include nbproject/Makefile-local-default.mk +endif +endif + +# Environment +MKDIR=gnumkdir -p +RM=rm -f +MV=mv +CP=cp + +# Macros +CND_CONF=default +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +IMAGE_TYPE=debug +OUTPUT_SUFFIX=elf +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +else +IMAGE_TYPE=production +OUTPUT_SUFFIX=hex +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +endif + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} + +# Distribution Directory +DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} + +# Source Files Quoted if spaced +SOURCEFILES_QUOTED_IF_SPACED=../../Source/portable/MemMang/heap_1.c ../../Source/portable/MPLAB/PIC24_dsPIC/port.c ../../Source/portable/MPLAB/PIC24_dsPIC/portasm_PIC24.S ../../Source/list.c ../../Source/queue.c ../../Source/tasks.c ../../Source/timers.c ../../Source/croutine.c ../Common/Minimal/BlockQ.c ../Common/Minimal/blocktim.c ../Common/Minimal/comtest.c ../Common/Minimal/crflash.c ../Common/Minimal/integer.c timertest.c lcd.c main.c serial/serial.c ParTest/ParTest.c + +# Object Files Quoted if spaced +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/897580706/heap_1.o ${OBJECTDIR}/_ext/410575107/port.o ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o ${OBJECTDIR}/_ext/1787047461/list.o ${OBJECTDIR}/_ext/1787047461/queue.o ${OBJECTDIR}/_ext/1787047461/tasks.o ${OBJECTDIR}/_ext/1787047461/timers.o ${OBJECTDIR}/_ext/1787047461/croutine.o ${OBJECTDIR}/_ext/270959020/BlockQ.o ${OBJECTDIR}/_ext/270959020/blocktim.o ${OBJECTDIR}/_ext/270959020/comtest.o ${OBJECTDIR}/_ext/270959020/crflash.o ${OBJECTDIR}/_ext/270959020/integer.o ${OBJECTDIR}/timertest.o ${OBJECTDIR}/lcd.o ${OBJECTDIR}/main.o ${OBJECTDIR}/serial/serial.o ${OBJECTDIR}/ParTest/ParTest.o +POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/897580706/heap_1.o.d ${OBJECTDIR}/_ext/410575107/port.o.d ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.d ${OBJECTDIR}/_ext/1787047461/list.o.d ${OBJECTDIR}/_ext/1787047461/queue.o.d ${OBJECTDIR}/_ext/1787047461/tasks.o.d ${OBJECTDIR}/_ext/1787047461/timers.o.d ${OBJECTDIR}/_ext/1787047461/croutine.o.d ${OBJECTDIR}/_ext/270959020/BlockQ.o.d ${OBJECTDIR}/_ext/270959020/blocktim.o.d ${OBJECTDIR}/_ext/270959020/comtest.o.d ${OBJECTDIR}/_ext/270959020/crflash.o.d ${OBJECTDIR}/_ext/270959020/integer.o.d ${OBJECTDIR}/timertest.o.d ${OBJECTDIR}/lcd.o.d ${OBJECTDIR}/main.o.d ${OBJECTDIR}/serial/serial.o.d ${OBJECTDIR}/ParTest/ParTest.o.d + +# Object Files +OBJECTFILES=${OBJECTDIR}/_ext/897580706/heap_1.o ${OBJECTDIR}/_ext/410575107/port.o ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o ${OBJECTDIR}/_ext/1787047461/list.o ${OBJECTDIR}/_ext/1787047461/queue.o ${OBJECTDIR}/_ext/1787047461/tasks.o ${OBJECTDIR}/_ext/1787047461/timers.o ${OBJECTDIR}/_ext/1787047461/croutine.o ${OBJECTDIR}/_ext/270959020/BlockQ.o ${OBJECTDIR}/_ext/270959020/blocktim.o ${OBJECTDIR}/_ext/270959020/comtest.o ${OBJECTDIR}/_ext/270959020/crflash.o ${OBJECTDIR}/_ext/270959020/integer.o ${OBJECTDIR}/timertest.o ${OBJECTDIR}/lcd.o ${OBJECTDIR}/main.o ${OBJECTDIR}/serial/serial.o ${OBJECTDIR}/ParTest/ParTest.o + +# Source Files +SOURCEFILES=../../Source/portable/MemMang/heap_1.c ../../Source/portable/MPLAB/PIC24_dsPIC/port.c ../../Source/portable/MPLAB/PIC24_dsPIC/portasm_PIC24.S ../../Source/list.c ../../Source/queue.c ../../Source/tasks.c ../../Source/timers.c ../../Source/croutine.c ../Common/Minimal/BlockQ.c ../Common/Minimal/blocktim.c ../Common/Minimal/comtest.c ../Common/Minimal/crflash.c ../Common/Minimal/integer.c timertest.c lcd.c main.c serial/serial.c ParTest/ParTest.c + + +CFLAGS= +ASFLAGS= +LDLIBSOPTIONS= + +############# Tool locations ########################################## +# If you copy a project from one host to another, the path where the # +# compiler is installed may be different. # +# If you open this project with MPLAB X in the new host, this # +# makefile will be regenerated and the paths will be corrected. # +####################################################################### +# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build +FIXDEPS=fixDeps + +.build-conf: ${BUILD_SUBPROJECTS} +ifneq ($(INFORMATION_MESSAGE), ) + @echo $(INFORMATION_MESSAGE) +endif + ${MAKE} -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX} + +MP_PROCESSOR_OPTION=24FJ128GA010 +MP_LINKER_FILE_OPTION=,--script=p24FJ128GA010.gld +# ------------------------------------------------------------------------------------ +# Rules for buildStep: compile +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${OBJECTDIR}/_ext/897580706/heap_1.o: ../../Source/portable/MemMang/heap_1.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/897580706" + @${RM} ${OBJECTDIR}/_ext/897580706/heap_1.o.d + @${RM} ${OBJECTDIR}/_ext/897580706/heap_1.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/portable/MemMang/heap_1.c -o ${OBJECTDIR}/_ext/897580706/heap_1.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/897580706/heap_1.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/897580706/heap_1.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/410575107/port.o: ../../Source/portable/MPLAB/PIC24_dsPIC/port.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/410575107" + @${RM} ${OBJECTDIR}/_ext/410575107/port.o.d + @${RM} ${OBJECTDIR}/_ext/410575107/port.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/portable/MPLAB/PIC24_dsPIC/port.c -o ${OBJECTDIR}/_ext/410575107/port.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/410575107/port.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/410575107/port.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/list.o: ../../Source/list.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/list.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/list.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/list.c -o ${OBJECTDIR}/_ext/1787047461/list.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/list.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/list.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/queue.o: ../../Source/queue.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/queue.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/queue.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/queue.c -o ${OBJECTDIR}/_ext/1787047461/queue.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/queue.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/queue.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/tasks.o: ../../Source/tasks.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/tasks.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/tasks.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/tasks.c -o ${OBJECTDIR}/_ext/1787047461/tasks.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/tasks.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/tasks.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/timers.o: ../../Source/timers.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/timers.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/timers.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/timers.c -o ${OBJECTDIR}/_ext/1787047461/timers.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/timers.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/timers.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/croutine.o: ../../Source/croutine.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/croutine.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/croutine.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/croutine.c -o ${OBJECTDIR}/_ext/1787047461/croutine.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/croutine.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/croutine.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/BlockQ.o: ../Common/Minimal/BlockQ.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/BlockQ.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/BlockQ.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/BlockQ.c -o ${OBJECTDIR}/_ext/270959020/BlockQ.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/BlockQ.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/BlockQ.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/blocktim.o: ../Common/Minimal/blocktim.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/blocktim.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/blocktim.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/blocktim.c -o ${OBJECTDIR}/_ext/270959020/blocktim.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/blocktim.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/blocktim.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/comtest.o: ../Common/Minimal/comtest.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/comtest.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/comtest.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/comtest.c -o ${OBJECTDIR}/_ext/270959020/comtest.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/comtest.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/comtest.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/crflash.o: ../Common/Minimal/crflash.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/crflash.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/crflash.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/crflash.c -o ${OBJECTDIR}/_ext/270959020/crflash.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/crflash.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/crflash.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/integer.o: ../Common/Minimal/integer.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/integer.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/integer.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/integer.c -o ${OBJECTDIR}/_ext/270959020/integer.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/integer.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/integer.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/timertest.o: timertest.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/timertest.o.d + @${RM} ${OBJECTDIR}/timertest.o + ${MP_CC} $(MP_EXTRA_CC_PRE) timertest.c -o ${OBJECTDIR}/timertest.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/timertest.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/timertest.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/lcd.o: lcd.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lcd.o.d + @${RM} ${OBJECTDIR}/lcd.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lcd.c -o ${OBJECTDIR}/lcd.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lcd.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/lcd.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.o.d + @${RM} ${OBJECTDIR}/main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) main.c -o ${OBJECTDIR}/main.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/main.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/serial/serial.o: serial/serial.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/serial" + @${RM} ${OBJECTDIR}/serial/serial.o.d + @${RM} ${OBJECTDIR}/serial/serial.o + ${MP_CC} $(MP_EXTRA_CC_PRE) serial/serial.c -o ${OBJECTDIR}/serial/serial.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/serial/serial.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/serial/serial.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/ParTest/ParTest.o: ParTest/ParTest.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/ParTest" + @${RM} ${OBJECTDIR}/ParTest/ParTest.o.d + @${RM} ${OBJECTDIR}/ParTest/ParTest.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ParTest/ParTest.c -o ${OBJECTDIR}/ParTest/ParTest.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/ParTest/ParTest.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/ParTest/ParTest.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +else +${OBJECTDIR}/_ext/897580706/heap_1.o: ../../Source/portable/MemMang/heap_1.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/897580706" + @${RM} ${OBJECTDIR}/_ext/897580706/heap_1.o.d + @${RM} ${OBJECTDIR}/_ext/897580706/heap_1.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/portable/MemMang/heap_1.c -o ${OBJECTDIR}/_ext/897580706/heap_1.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/897580706/heap_1.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/897580706/heap_1.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/410575107/port.o: ../../Source/portable/MPLAB/PIC24_dsPIC/port.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/410575107" + @${RM} ${OBJECTDIR}/_ext/410575107/port.o.d + @${RM} ${OBJECTDIR}/_ext/410575107/port.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/portable/MPLAB/PIC24_dsPIC/port.c -o ${OBJECTDIR}/_ext/410575107/port.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/410575107/port.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/410575107/port.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/list.o: ../../Source/list.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/list.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/list.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/list.c -o ${OBJECTDIR}/_ext/1787047461/list.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/list.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/list.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/queue.o: ../../Source/queue.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/queue.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/queue.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/queue.c -o ${OBJECTDIR}/_ext/1787047461/queue.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/queue.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/queue.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/tasks.o: ../../Source/tasks.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/tasks.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/tasks.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/tasks.c -o ${OBJECTDIR}/_ext/1787047461/tasks.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/tasks.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/tasks.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/timers.o: ../../Source/timers.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/timers.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/timers.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/timers.c -o ${OBJECTDIR}/_ext/1787047461/timers.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/timers.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/timers.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/1787047461/croutine.o: ../../Source/croutine.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1787047461" + @${RM} ${OBJECTDIR}/_ext/1787047461/croutine.o.d + @${RM} ${OBJECTDIR}/_ext/1787047461/croutine.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../../Source/croutine.c -o ${OBJECTDIR}/_ext/1787047461/croutine.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/1787047461/croutine.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/1787047461/croutine.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/BlockQ.o: ../Common/Minimal/BlockQ.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/BlockQ.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/BlockQ.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/BlockQ.c -o ${OBJECTDIR}/_ext/270959020/BlockQ.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/BlockQ.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/BlockQ.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/blocktim.o: ../Common/Minimal/blocktim.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/blocktim.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/blocktim.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/blocktim.c -o ${OBJECTDIR}/_ext/270959020/blocktim.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/blocktim.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/blocktim.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/comtest.o: ../Common/Minimal/comtest.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/comtest.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/comtest.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/comtest.c -o ${OBJECTDIR}/_ext/270959020/comtest.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/comtest.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/comtest.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/crflash.o: ../Common/Minimal/crflash.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/crflash.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/crflash.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/crflash.c -o ${OBJECTDIR}/_ext/270959020/crflash.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/crflash.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/crflash.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/_ext/270959020/integer.o: ../Common/Minimal/integer.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/270959020" + @${RM} ${OBJECTDIR}/_ext/270959020/integer.o.d + @${RM} ${OBJECTDIR}/_ext/270959020/integer.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ../Common/Minimal/integer.c -o ${OBJECTDIR}/_ext/270959020/integer.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/270959020/integer.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/_ext/270959020/integer.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/timertest.o: timertest.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/timertest.o.d + @${RM} ${OBJECTDIR}/timertest.o + ${MP_CC} $(MP_EXTRA_CC_PRE) timertest.c -o ${OBJECTDIR}/timertest.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/timertest.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/timertest.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/lcd.o: lcd.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lcd.o.d + @${RM} ${OBJECTDIR}/lcd.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lcd.c -o ${OBJECTDIR}/lcd.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lcd.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/lcd.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.o.d + @${RM} ${OBJECTDIR}/main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) main.c -o ${OBJECTDIR}/main.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/main.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/serial/serial.o: serial/serial.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/serial" + @${RM} ${OBJECTDIR}/serial/serial.o.d + @${RM} ${OBJECTDIR}/serial/serial.o + ${MP_CC} $(MP_EXTRA_CC_PRE) serial/serial.c -o ${OBJECTDIR}/serial/serial.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/serial/serial.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/serial/serial.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/ParTest/ParTest.o: ParTest/ParTest.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/ParTest" + @${RM} ${OBJECTDIR}/ParTest/ParTest.o.d + @${RM} ${OBJECTDIR}/ParTest/ParTest.o + ${MP_CC} $(MP_EXTRA_CC_PRE) ParTest/ParTest.c -o ${OBJECTDIR}/ParTest/ParTest.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/ParTest/ParTest.o.d" -g -omf=elf -ffunction-sections -fdata-sections -O0 -msmart-io=1 -Wall -msfr-warn=off -I ../../Source/include -I ../../Source/portable/MPLAB/PIC24_dsPIC -I ../Common/include -I . -Wextra + @${FIXDEPS} "${OBJECTDIR}/ParTest/ParTest.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assemble +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assemblePreproc +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${OBJECTDIR}/_ext/410575107/portasm_PIC24.o: ../../Source/portable/MPLAB/PIC24_dsPIC/portasm_PIC24.S nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/410575107" + @${RM} ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.d + @${RM} ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o + ${MP_CC} $(MP_EXTRA_AS_PRE) ../../Source/portable/MPLAB/PIC24_dsPIC/portasm_PIC24.S -o ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.d" -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -Wa,-MD,"${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.asm.d",--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,--defsym=__MPLAB_DEBUGGER_SIMULATOR=1,-g,--no-relax$(MP_EXTRA_AS_POST) + @${FIXDEPS} "${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.d" "${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.asm.d" -t $(SILENT) -rsi ${MP_CC_DIR}../ + +else +${OBJECTDIR}/_ext/410575107/portasm_PIC24.o: ../../Source/portable/MPLAB/PIC24_dsPIC/portasm_PIC24.S nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/410575107" + @${RM} ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.d + @${RM} ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o + ${MP_CC} $(MP_EXTRA_AS_PRE) ../../Source/portable/MPLAB/PIC24_dsPIC/portasm_PIC24.S -o ${OBJECTDIR}/_ext/410575107/portasm_PIC24.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.d" -omf=elf -Wa,-MD,"${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.asm.d",--defsym=__MPLAB_BUILD=1,-g,--no-relax$(MP_EXTRA_AS_POST) + @${FIXDEPS} "${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.d" "${OBJECTDIR}/_ext/410575107/portasm_PIC24.o.asm.d" -t $(SILENT) -rsi ${MP_CC_DIR}../ + +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: link +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} + ${MP_CC} $(MP_EXTRA_LD_PRE) -o dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -mcpu=$(MP_PROCESSOR_OPTION) -D__DEBUG -D__MPLAB_DEBUGGER_SIMULATOR=1 -omf=elf -Wl,,--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,--defsym=__MPLAB_DEBUGGER_SIMULATOR=1,$(MP_LINKER_FILE_OPTION),--stack=16,--check-sections,--data-init,--pack-data,--handles,--isr,--no-gc-sections,--fill-upper=0,--stackguard=16,--no-force-link,--smart-io,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--report-mem,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml$(MP_EXTRA_LD_POST) + +else +dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} + ${MP_CC} $(MP_EXTRA_LD_PRE) -o dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -mcpu=$(MP_PROCESSOR_OPTION) -omf=elf -Wl,,--defsym=__MPLAB_BUILD=1,$(MP_LINKER_FILE_OPTION),--stack=16,--check-sections,--data-init,--pack-data,--handles,--isr,--no-gc-sections,--fill-upper=0,--stackguard=16,--no-force-link,--smart-io,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--report-mem,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml$(MP_EXTRA_LD_POST) + ${MP_CC_DIR}\\xc16-bin2hex dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -a -omf=elf + +endif + + +# Subprojects +.build-subprojects: + + +# Subprojects +.clean-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r build/default + ${RM} -r dist/default + +# Enable dependency checking +.dep.inc: .depcheck-impl + +DEPFILES=$(shell mplabwildcard ${POSSIBLE_DEPFILES}) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-impl.mk b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-impl.mk new file mode 100644 index 000000000..9910c9347 --- /dev/null +++ b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-impl.mk @@ -0,0 +1,69 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=PIC24_MPLAB + +# Active Configuration +DEFAULTCONF=default +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=default + + +# build +.build-impl: .build-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default clean + + + +# all +.all-impl: .all-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default build + + + +# dependency checking support +.depcheck-impl: +# @echo "# This code depends on make tool being used" >.dep.inc +# @if [ -n "${MAKE_VERSION}" ]; then \ +# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ +# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ +# echo "include \$${DEPFILES}" >>.dep.inc; \ +# echo "endif" >>.dep.inc; \ +# else \ +# echo ".KEEP_STATE:" >>.dep.inc; \ +# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ +# fi diff --git a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-local-default.mk b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-local-default.mk new file mode 100644 index 000000000..bde41e52d --- /dev/null +++ b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-local-default.mk @@ -0,0 +1,37 @@ +# +# Generated Makefile - do not edit! +# +# +# This file contains information about the location of compilers and other tools. +# If you commmit this file into your revision control server, you will be able to +# to checkout the project and build it from the command line with make. However, +# if more than one person works on the same project, then this file might show +# conflicts since different users are bound to have compilers in different places. +# In that case you might choose to not commit this file and let MPLAB X recreate this file +# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at +# least once so the file gets created and the project can be built. Finally, you can also +# avoid using this file at all if you are only building from the command line with make. +# You can invoke make with the values of the macros: +# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ... +# +SHELL=cmd.exe +PATH_TO_IDE_BIN=C:/DevTools/Microchip/MPLABX/v3.10/mplab_ide/mplab_ide/modules/../../bin/ +# Adding MPLAB X bin directory to path. +PATH:=C:/DevTools/Microchip/MPLABX/v3.10/mplab_ide/mplab_ide/modules/../../bin/:$(PATH) +# Path to java used to run MPLAB X when this makefile was created +MP_JAVA_PATH="C:\DevTools\Microchip\MPLABX\v3.10\sys\java\jre1.7.0_79/bin/" +OS_CURRENT="$(shell uname -s)" +MP_CC="C:\DevTools\Microchip\xc16\v1.25\bin\xc16-gcc.exe" +# MP_CPPC is not defined +# MP_BC is not defined +MP_AS="C:\DevTools\Microchip\xc16\v1.25\bin\xc16-as.exe" +# MP_LD is not defined +MP_AR="C:\DevTools\Microchip\xc16\v1.25\bin\xc16-ar.exe" +DEP_GEN=${MP_JAVA_PATH}java -jar "C:/DevTools/Microchip/MPLABX/v3.10/mplab_ide/mplab_ide/modules/../../bin/extractobjectdependencies.jar" +MP_CC_DIR="C:\DevTools\Microchip\xc16\v1.25\bin" +# MP_CPPC_DIR is not defined +# MP_BC_DIR is not defined +MP_AS_DIR="C:\DevTools\Microchip\xc16\v1.25\bin" +# MP_LD_DIR is not defined +MP_AR_DIR="C:\DevTools\Microchip\xc16\v1.25\bin" +# MP_BC_DIR is not defined diff --git a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-variables.mk b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-variables.mk new file mode 100644 index 000000000..10249ca27 --- /dev/null +++ b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Makefile-variables.mk @@ -0,0 +1,13 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +# default configuration +CND_ARTIFACT_DIR_default=dist/default/production +CND_ARTIFACT_NAME_default=PIC24_MPLAB.production.hex +CND_ARTIFACT_PATH_default=dist/default/production/PIC24_MPLAB.production.hex +CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package +CND_PACKAGE_NAME_default=pic24mplab.tar +CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/pic24mplab.tar diff --git a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Package-default.bash b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Package-default.bash new file mode 100644 index 000000000..1266fa343 --- /dev/null +++ b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/Package-default.bash @@ -0,0 +1,73 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_CONF=default +CND_DISTDIR=dist +TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +OUTPUT_BASENAME=PIC24_MPLAB.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +PACKAGE_TOP_DIR=pic24mplab/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/package +rm -rf ${TMPDIR} +mkdir -p ${TMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory ${TMPDIR}/pic24mplab/bin +copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/package/pic24mplab.tar +cd ${TMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/pic24mplab.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${TMPDIR} diff --git a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/configurations.xml b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/configurations.xml index 1d2a351e5..88bc67cb3 100644 --- a/FreeRTOS/Demo/PIC24_MPLAB/nbproject/configurations.xml +++ b/FreeRTOS/Demo/PIC24_MPLAB/nbproject/configurations.xml @@ -25,11 +25,13 @@ ../../Source/queue.c ../../Source/tasks.c ../../Source/timers.c + ../../Source/croutine.c ../Common/Minimal/BlockQ.c ../Common/Minimal/blocktim.c ../Common/Minimal/comtest.c + ../Common/Minimal/crflash.c ../Common/Minimal/integer.c timertest.c diff --git a/FreeRTOS/Demo/PIC24_MPLAB/serial/serial.c b/FreeRTOS/Demo/PIC24_MPLAB/serial/serial.c index b75a2e83c..8be3a0701 100644 --- a/FreeRTOS/Demo/PIC24_MPLAB/serial/serial.c +++ b/FreeRTOS/Demo/PIC24_MPLAB/serial/serial.c @@ -25,7 +25,7 @@ */ -/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. NOTE: This driver is primarily to test the scheduler functionality. It does not effectively use the buffers or DMA and is therefore not intended to be @@ -66,8 +66,8 @@ an example of an efficient driver. */ /* The queues used to communicate between tasks and ISR's. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; static portBASE_TYPE xTxHasEnded; /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/PIC24_MPLAB/timertest.c b/FreeRTOS/Demo/PIC24_MPLAB/timertest.c index a67aa00fc..06ca0a572 100644 --- a/FreeRTOS/Demo/PIC24_MPLAB/timertest.c +++ b/FreeRTOS/Demo/PIC24_MPLAB/timertest.c @@ -42,7 +42,7 @@ /*-----------------------------------------------------------*/ /* - * Measure the time between this interrupt and the previous interrupt to + * Measure the time between this interrupt and the previous interrupt to * calculate the timing jitter. Remember the maximum value the jitter has * ever been calculated to be. */ @@ -71,7 +71,7 @@ void vSetupTimerTest( unsigned short usFrequencyHz ) /* Timer 4 is going to free run from minimum to maximum value. */ PR4 = ( unsigned short ) timerMAX_COUNT; - /* 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. */ IPC1bits.T2IP = configKERNEL_INTERRUPT_PRIORITY + 1; @@ -102,7 +102,7 @@ unsigned short usThisCount, usDifference; usDifference = usThisCount - usLastCount; /* Store the difference in the timer values if it is larger than the - currently stored largest value. The difference over and above the + currently stored largest value. The difference over and above the expected difference will give the 'jitter' in the processing of these interrupts. */ if( usDifference > usMaxJitter ) @@ -112,7 +112,7 @@ unsigned short usThisCount, usDifference; } else { - /* Don't bother storing any values for the first couple of + /* Don't bother storing any values for the first couple of interrupts. */ usSettleCount++; } diff --git a/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/PIC32MEC14xx_RTOSDemo.X/nbproject/configurations.xml b/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/PIC32MEC14xx_RTOSDemo.X/nbproject/configurations.xml index 3d1624dcf..83135a2b9 100644 --- a/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/PIC32MEC14xx_RTOSDemo.X/nbproject/configurations.xml +++ b/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/PIC32MEC14xx_RTOSDemo.X/nbproject/configurations.xml @@ -8,6 +8,7 @@ ../../../Source/include/FreeRTOS.h ../../../Source/include/StackMacros.h + ../../../Source/include/croutine.h ../../../Source/include/event_groups.h ../../../Source/include/list.h ../../../Source/include/mpu_wrappers.h diff --git a/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/FreeRTOSConfig.h index 4b663b093..3c52ecc42 100644 --- a/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/FreeRTOSConfig.h @@ -47,26 +47,26 @@ * signal which triggers a single interrupt with a fixed priority for all * interrupt levels. Alternatively the signals can be disaggregated into unique * interrupt events which can be vectored via a dispatch table to unique - * handlers for each interrupt source. This mechanism allows, for instance, a - * single interrupt handler for a large number of IO pins yet unique handlers + * handlers for each interrupt source. This mechanism allows, for instance, a + * single interrupt handler for a large number of IO pins yet unique handlers * for timers and other signals. - * + * * When operating in disaggregated mode certain restrictions apply. The * interrupt event and status registers are shared between timers due to their * proximity in the memory map. Similarly the software interrupt control * registers are shared with other interrupt sources. The JTVIC maps interrupt - * levels into MIPs core interrupt levels consequently JTVIC priorities of 0, 1, - * 3, and 4 map to the MIPs core values of 1, 3, 5, and 7. The parameter - * configTIMERS_DISAGGREGATED_ISRS is used to control if the timers in register - * GIRQ23 are operating in disaggregated mode. Similarly + * levels into MIPs core interrupt levels consequently JTVIC priorities of 0, 1, + * 3, and 4 map to the MIPs core values of 1, 3, 5, and 7. The parameter + * configTIMERS_DISAGGREGATED_ISRS is used to control if the timers in register + * GIRQ23 are operating in disaggregated mode. Similarly * configCPU_DISAGGREGATED_ISRS controls the mode for GIRQ24. - * + * * Note: * Disaggregated mode is the more natural manner in which to operate the ISRs * and currently only this mode has been tested with the demo application. If * you wish to use aggregated mode then an alternative interrupt handler scheme - * will need to be used that marshals all interrupts from a single GIRQ through - * a common handler function that tests which interrupt occurred and dispatches + * will need to be used that marshals all interrupts from a single GIRQ through + * a common handler function that tests which interrupt occurred and dispatches * to the relevant handlers. */ #define configTIMERS_DISAGGREGATED_ISRS 1 @@ -99,6 +99,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/Full_Demo/timertest.c b/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/Full_Demo/timertest.c index f75802811..51b86a1ea 100644 --- a/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/Full_Demo/timertest.c +++ b/FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/Full_Demo/timertest.c @@ -66,8 +66,8 @@ void vSetupTimerTest( unsigned short usFrequencyHz ) /* Timer 3 is going to interrupt at usFrequencyHz Hz. */ const uint32_t ulPreload = ( unsigned short ) ( ( configPERIPHERAL_CLOCK_HZ / ( unsigned long ) usFrequencyHz ) - 1 ); - /* Timer 3 is used to generate interrupts above the kernel and max syscall - interrupt priorities. No system library calls are used here as they are not + /* Timer 3 is used to generate interrupts above the kernel and max syscall + interrupt priorities. No system library calls are used here as they are not guaranteed to be re-entrant. */ portMMCR_TMR3_CONTROL = 1ul; portMMCR_TMR3_PRELOAD = ulPreload; diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.c b/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.c index f4789850f..09aea6f73 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.c +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.c @@ -123,7 +123,7 @@ extern unsigned long _ebase_address[]; /* Setup EBase. */ _CP0_SET_EBASE( ( unsigned long ) _ebase_address ); - + /* Space vectors by 0x20 bytes. */ _CP0_XCH_INTCTL( 0x20 ); @@ -138,7 +138,7 @@ extern unsigned long _ebase_address[]; /* Set MVEC bit. */ INTCONbits.MVEC = 1; - + /* Finally enable interrupts again. */ ulStatus |= hwGLOBAL_INTERRUPT_BIT; _CP0_SET_STATUS( ulStatus ); diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.h b/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.h index add080121..d4dce6ce8 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.h +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/ConfigPerformance.h @@ -33,7 +33,7 @@ */ void vHardwareConfigurePerformance( void ); -/* +/* * Configure the interrupt controller to use a separate vector for each * interrupt. */ diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h index 0331977c2..ec8b272cf 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -65,6 +65,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S b/FreeRTOS/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S index 646bd5b9f..343a72e94 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S @@ -23,20 +23,20 @@ * https://github.com/FreeRTOS * */ - + #include #include #include "ISR_Support.h" - + #define portEXC_CODE_MASK ( 0x1f << 2 ) .set nomips16 .set noreorder - + .extern vT3InterruptHandler .extern vT4InterruptHandler - + .global vT3InterruptWrapper .global vT4InterruptWrapper @@ -46,7 +46,7 @@ .set noreorder .set noat .ent vT3InterruptWrapper - + vT3InterruptWrapper: portSAVE_CONTEXT @@ -63,7 +63,7 @@ vT3InterruptWrapper: .set noreorder .set noat .ent vT4InterruptWrapper - + vT4InterruptWrapper: portSAVE_CONTEXT diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/ParTest/ParTest_Explorer16.c b/FreeRTOS/Demo/PIC32MX_MPLAB/ParTest/ParTest_Explorer16.c index 9d417a0cf..7aa1e2a43 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/ParTest/ParTest_Explorer16.c +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/ParTest/ParTest_Explorer16.c @@ -39,8 +39,8 @@ void vParTestInitialise( void ) { - /* All LEDs output. */ - TRISA = ptOUTPUT; + /* All LEDs output. */ + TRISA = ptOUTPUT; PORTA = ptALL_OFF; /* Disable the JTAG. */ @@ -73,7 +73,7 @@ unsigned portBASE_TYPE uxLEDBit; void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { unsigned portBASE_TYPE uxLEDBit; - + uxLEDBit = 1 << uxLED; /* Use of the PORTAINV register removes the need to use a critical section. */ diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.X/nbproject/configurations.xml b/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.X/nbproject/configurations.xml index 41d4cc89a..13385eead 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.X/nbproject/configurations.xml +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.X/nbproject/configurations.xml @@ -8,6 +8,7 @@ ../../../Source/portable/MPLAB/PIC32MX/portmacro.h ../../../Source/include/portable.h ../../../Source/include/task.h + ../../../Source/include/croutine.h ../../../Source/include/FreeRTOS.h ../../../Source/include/list.h ../../../Source/include/projdefs.h diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.mcp b/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.mcp index 29ae3c3ed..a00a23a43 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.mcp +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/RTOSDemo.mcp @@ -62,6 +62,7 @@ file_034=. file_035=. file_036=. file_037=. +file_038=. [GENERATED_FILES] file_000=no file_001=no @@ -101,6 +102,7 @@ file_034=no file_035=no file_036=no file_037=no +file_038=no [OTHER_FILES] file_000=no file_001=no @@ -140,6 +142,7 @@ file_034=no file_035=no file_036=no file_037=no +file_038=yes [FILE_INFO] file_000=main.c file_001=ParTest\ParTest_Explorer16.c @@ -173,12 +176,13 @@ file_028=FreeRTOSConfig.h file_029=..\..\Source\portable\MPLAB\PIC32MX\portmacro.h file_030=..\..\Source\include\portable.h file_031=..\..\Source\include\task.h -file_032=..\..\Source\include\FreeRTOS.h -file_033=..\..\Source\include\list.h -file_034=..\..\Source\include\projdefs.h -file_035=..\..\Source\include\queue.h -file_036=..\..\Source\include\semphr.h -file_037=PIC32MX_MPLAB.map +file_032=..\..\Source\include\croutine.h +file_033=..\..\Source\include\FreeRTOS.h +file_034=..\..\Source\include\list.h +file_035=..\..\Source\include\projdefs.h +file_036=..\..\Source\include\queue.h +file_037=..\..\Source\include\semphr.h +file_038=PIC32MX_MPLAB.map [SUITE_INFO] suite_guid={62D235D8-2DB2-49CD-AF24-5489A6015337} suite_state= diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/lcd.c b/FreeRTOS/Demo/PIC32MX_MPLAB/lcd.c index d8d75c144..621b9ba30 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/lcd.c +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/lcd.c @@ -48,18 +48,18 @@ static void vLCDTask( void *pvParameters ); */ 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 short usRow ); -/* - * Write a string of text to the LCD. +/* + * Write a string of text to the LCD. */ static void prvLCDPutString( char *pcString ); -/* - * Clear the LCD. +/* + * Clear the LCD. */ static void prvLCDClear( void ); @@ -115,18 +115,18 @@ QueueHandle_t xStartLCDTask( void ) static void prvLCDGotoRow( unsigned short usRow ) { - if(usRow == 0) + if(usRow == 0) { prvLCDCommand( LCD_CURSOR_HOME_CMD ); - } - else + } + else { prvLCDCommand( LCD_NEW_LINE ); } } /*-----------------------------------------------------------*/ -static void prvLCDCommand( char cCommand ) +static void prvLCDCommand( char cCommand ) { PMPSetAddress( LCD_COMMAND_ADDRESS ); PMPMasterWrite( cCommand ); @@ -164,7 +164,7 @@ static void prvSetupLCD(void) { /* Wait for proper power up. */ vTaskDelay( lcdLONG_DELAY ); - + /* Open the PMP port */ mPMPOpen((PMP_ON | PMP_READ_WRITE_EN | PMP_CS2_CS1_EN | PMP_LATCH_POL_HI | PMP_CS2_POL_HI | PMP_CS1_POL_HI | @@ -172,7 +172,7 @@ static void prvSetupLCD(void) (PMP_MODE_MASTER1 | PMP_WAIT_BEG_4 | PMP_WAIT_MID_15 | PMP_WAIT_END_4), PMP_PEN_0, 0); - + /* Wait for the LCD to power up correctly. */ vTaskDelay( lcdLONG_DELAY ); vTaskDelay( lcdLONG_DELAY ); @@ -180,18 +180,18 @@ static void prvSetupLCD(void) /* Set up the LCD function. */ prvLCDCommand( LCD_FUNCTION_SET_CMD | LCD_FUNCTION_SET_8_BITS | LCD_FUNCTION_SET_2_LINES | LCD_FUNCTION_SET_LRG_FONT ); - + /* Turn the display on. */ prvLCDCommand( LCD_DISPLAY_CTRL_CMD | LCD_DISPLAY_CTRL_DISPLAY_ON ); - + /* Clear the display. */ prvLCDCommand( LCD_CLEAR_DISPLAY_CMD ); - vTaskDelay( lcdLONG_DELAY ); - + vTaskDelay( lcdLONG_DELAY ); + /* Increase the cursor. */ prvLCDCommand( LCD_ENTRY_MODE_CMD | LCD_ENTRY_MODE_INCREASE ); - vTaskDelay( lcdLONG_DELAY ); - vTaskDelay( lcdLONG_DELAY ); + vTaskDelay( lcdLONG_DELAY ); + vTaskDelay( lcdLONG_DELAY ); vTaskDelay( lcdLONG_DELAY ); } /*-----------------------------------------------------------*/ @@ -222,9 +222,9 @@ unsigned short usRow = 0; usRow++; prvLCDPutString( xMessage.pcMessage ); - /* Delay the requested amount of time to ensure the text just written + /* Delay the requested amount of time to ensure the text just written to the LCD is not overwritten. */ - vTaskDelay( xMessage.xMinDisplayTime ); + vTaskDelay( xMessage.xMinDisplayTime ); } } diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/main.c b/FreeRTOS/Demo/PIC32MX_MPLAB/main.c index fe0e7bb11..5abc43d54 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/main.c +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/main.c @@ -157,7 +157,7 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) ( void ) pxTask; /* Run time task stack overflow checking is performed if - configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is + configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is called if a task stack overflow is detected. Note the system/interrupt stack is not checked. */ taskDISABLE_INTERRUPTS(); @@ -177,7 +177,7 @@ void vApplicationTickHook( void ) 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. */ for( ;; ); } diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/serial/serial.c b/FreeRTOS/Demo/PIC32MX_MPLAB/serial/serial.c index 77d867346..120dd633e 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/serial/serial.c +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/serial/serial.c @@ -25,7 +25,7 @@ */ -/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. NOTE: This driver is primarily to test the scheduler functionality. It does not effectively use the buffers or DMA and is therefore not intended to be @@ -47,8 +47,8 @@ an example of an efficient driver. */ #define serSET_FLAG ( 1 ) /* The queues used to communicate between tasks and ISR's. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /* Flag used to indicate the tx status. */ static volatile portBASE_TYPE xTxHasEnded; @@ -57,7 +57,7 @@ static volatile portBASE_TYPE xTxHasEnded; /* The UART interrupt handler. As this uses the FreeRTOS assembly interrupt entry point the IPL setting in the following prototype has no effect. The -interrupt priority is set by the call to ConfigIntUART2() in +interrupt priority is set by the call to ConfigIntUART2() in xSerialPortInitMinimal(). */ void __attribute__( (interrupt(IPL0AUTO), vector(_UART2_VECTOR))) vU2InterruptWrapper( void ); diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/timertest.c b/FreeRTOS/Demo/PIC32MX_MPLAB/timertest.c index 469d47d4d..6e6767fac 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/timertest.c +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/timertest.c @@ -83,7 +83,7 @@ static unsigned long ulCalls = 0; ++ulCalls; if( ulCalls >= ulFrequencyHz ) { - /* Increment the count that will be shown on the LCD. + /* Increment the count that will be shown on the LCD. The increment occurs once every 20,000 interrupts so ulHighFrequencyTimerInterrupts should count in seconds. */ ulHighFrequencyTimerInterrupts++; diff --git a/FreeRTOS/Demo/PIC32MX_MPLAB/timertest_isr.S b/FreeRTOS/Demo/PIC32MX_MPLAB/timertest_isr.S index 100226a91..f79f2b4d5 100644 --- a/FreeRTOS/Demo/PIC32MX_MPLAB/timertest_isr.S +++ b/FreeRTOS/Demo/PIC32MX_MPLAB/timertest_isr.S @@ -30,7 +30,7 @@ .set nomips16 .set noreorder - + .extern vT2InterruptHandler .extern xISRStackTop .global vT2InterruptWrapper diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/ConfigPerformance.h b/FreeRTOS/Demo/PIC32MZ_MPLAB/ConfigPerformance.h index add080121..d4dce6ce8 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/ConfigPerformance.h +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/ConfigPerformance.h @@ -33,7 +33,7 @@ */ void vHardwareConfigurePerformance( void ); -/* +/* * Configure the interrupt controller to use a separate vector for each * interrupt. */ diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/FreeRTOSConfig.h b/FreeRTOS/Demo/PIC32MZ_MPLAB/FreeRTOSConfig.h index c2d49c1d5..b449cf7ef 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/FreeRTOSConfig.h @@ -69,10 +69,13 @@ /* Enable support for Task based FPU operations. This will enable support for FPU context saving during switches only on architectures with hardware FPU. -NOTE: This constant is defined in the project options as configurations are -provided that both enable and disable floating point support. +NOTE: This constant is defined in the project options as configurations are +provided that both enable and disable floating point support. #define configUSE_TASK_FPU_SUPPORT 0 */ +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 @@ -108,5 +111,5 @@ interrupts. */ extern void vAssertCalled( const char * pcFile, unsigned long ulLine ); #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ ) #endif - + #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/ParTest/ParTest.c b/FreeRTOS/Demo/PIC32MZ_MPLAB/ParTest/ParTest.c index ecd75cc71..1a5b60595 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/ParTest/ParTest.c +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/ParTest/ParTest.c @@ -79,7 +79,7 @@ unsigned portBASE_TYPE uxLEDBit; { uxLEDBit = 1 << uxLED; - /* Use of the LATHINV register removes the need to use a critical + /* Use of the LATHINV register removes the need to use a critical section. */ LATHINV = uxLEDBit; } diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/RTOSDemo.X/nbproject/configurations.xml b/FreeRTOS/Demo/PIC32MZ_MPLAB/RTOSDemo.X/nbproject/configurations.xml index beae60d9c..1969d0d06 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/RTOSDemo.X/nbproject/configurations.xml +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/RTOSDemo.X/nbproject/configurations.xml @@ -7,6 +7,7 @@ ../../../Source/include/portable.h ../../../Source/include/task.h + ../../../Source/include/croutine.h ../../../Source/include/FreeRTOS.h ../../../Source/include/list.h ../../../Source/include/projdefs.h diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/flop_mz.c b/FreeRTOS/Demo/PIC32MZ_MPLAB/flop_mz.c index 13657972b..eff44d2e3 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/flop_mz.c +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/flop_mz.c @@ -99,7 +99,7 @@ short sError = pdFALSE; /* The variable this task increments to show it is still running is passed in as the parameter. */ pulTaskCheckVariable = ( unsigned long * ) pvParameters; - + /* Keep performing a calculation and checking the result against a constant. */ for(;;) { diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest.c b/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest.c index 26650c0ed..3f9f05ea3 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest.c +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest.c @@ -53,7 +53,7 @@ void vSetupTimerTest( unsigned short usFrequencyHz ) /* Remember the frequency so it can be used from the ISR. */ ulFrequencyHz = ( unsigned long ) usFrequencyHz; - /* T2 is used to generate interrupts above the kernel and max syscall + /* T2 is used to generate interrupts above the kernel and max syscall interrupt priority. */ T2CON = 0; TMR2 = 0; diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest_isr.S b/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest_isr.S index 512d87017..dd1c6bccb 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest_isr.S +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/timertest_isr.S @@ -30,7 +30,7 @@ .set nomips16 .set noreorder - + .extern vT2InterruptHandler .extern xISRStackTop .global vT2InterruptWrapper diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h index bbeed3571..d6b9efe07 100644 --- a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -60,6 +60,9 @@ #define configUSE_FPU 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 4 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c index de85fe2e6..c8b3f9808 100644 --- a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c @@ -27,36 +27,36 @@ /* * Tests the floating point context save and restore mechanism. * - * Two tasks are created - each of which is allocated a buffer of + * Two tasks are created - each of which is allocated a buffer of * portNO_FLOP_REGISTERS_TO_SAVE 32bit variables into which the flop context * of the task is saved when the task is switched out, and from which the - * flop context of the task is restored when the task is switch in. Prior to - * the tasks being created each position in the two buffers is filled with a + * flop context of the task is restored when the task is switch in. Prior to + * the tasks being created each position in the two buffers is filled with a * unique value - this way the flop context of each task is different. * * The two test tasks never block so are always in either the Running or * Ready state. They execute at the lowest priority so will get pre-empted * regularly, although the yield frequently so will not get much execution - * time. The lack of execution time is not a problem as its only the + * time. The lack of execution time is not a problem as its only the * switching in and out that is being tested. * - * Whenever a task is moved from the Ready to the Running state its flop + * Whenever a task is moved from the Ready to the Running state its flop * context will be loaded from the buffer, but while the task is in the * Running state the buffer is not used and can contain any value - in this - * case and for test purposes the task itself clears the buffer to zero. + * case and for test purposes the task itself clears the buffer to zero. * The next time the task is moved out of the Running state into the - * Ready state the flop context will once more get saved to the buffer - + * Ready state the flop context will once more get saved to the buffer - * overwriting the zeros. * * Therefore whenever the task is not in the Running state its buffer contains * the most recent values of its floating point registers - the zeroing out - * of the buffer while the task was executing being used to ensure the values + * of the buffer while the task was executing being used to ensure the values * the buffer contains are not stale. * * When neither test task is in the Running state the buffers should contain * the unique values allocated before the tasks were created. If so then * the floating point context has been maintained. This check is performed - * by the 'check' task (defined in main.c) by calling + * by the 'check' task (defined in main.c) by calling * xAreFlopRegisterTestsStillRunning(). * * The test tasks also increment a value each time they execute. @@ -84,7 +84,7 @@ static void vFlopTest2( void *pvParameters ); /*-----------------------------------------------------------*/ -/* Buffers into which the flop registers will be saved. There is a buffer for +/* Buffers into which the flop registers will be saved. There is a buffer for both tasks. */ static volatile portDOUBLE dFlopRegisters[ flopNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ]; @@ -100,7 +100,7 @@ TaskHandle_t xTaskJustCreated; unsigned portBASE_TYPE x, y; portDOUBLE z = flopSTART_VALUE; - /* Fill the arrays into which the flop registers are to be saved with + /* Fill the arrays into which the flop registers are to be saved with known values. These are the values that will be written to the flop registers when the tasks start, and as the tasks do not perform any flop operations the values should never change. Each position in the @@ -119,7 +119,7 @@ portDOUBLE z = flopSTART_VALUE; /* Create the first task. */ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated ); - /* The task tag value is a value that can be associated with a task, but + /* The task tag value is a value that can be associated with a task, but is not used by the scheduler itself. Its use is down to the application so it makes a convenient place in this case to store the pointer to the buffer into which the flop context of the task will be stored. The first created @@ -147,7 +147,7 @@ static void vFlopTest1( void *pvParameters ) memset( ( void * ) dFlopRegisters[ 0 ], 0x00, ( portNO_FLOP_REGISTERS_TO_SAVE * sizeof( portDOUBLE ) ) ); portEXIT_CRITICAL(); - /* We don't have to do anything other than indicate that we are + /* We don't have to do anything other than indicate that we are still running. */ ulFlop1CycleCount++; taskYIELD(); @@ -169,7 +169,7 @@ static void vFlopTest2( void *pvParameters ) memset( ( void * ) dFlopRegisters[ 1 ], 0x00, ( portNO_FLOP_REGISTERS_TO_SAVE * sizeof( portDOUBLE ) ) ); portEXIT_CRITICAL(); - /* We don't have to do anything other than indicate that we are + /* We don't have to do anything other than indicate that we are still running. */ ulFlop2CycleCount++; taskYIELD(); @@ -185,7 +185,7 @@ portDOUBLE z = flopSTART_VALUE; static unsigned long ulLastFlop1CycleCount = 0, ulLastFlop2CycleCount = 0; /* Called from the 'check' task. - + The flop tasks cannot be currently running, check their saved registers are as expected. The tests tasks do not perform any flop operations so their registers should be as per their initial setting. */ diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c index d1be122e3..76de6d284 100644 --- a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c @@ -28,12 +28,12 @@ * Creates eight tasks, each of which loops continuously performing a * floating point calculation. * - * All the tasks run at the idle priority and never block or yield. This causes - * all eight tasks to time slice with the idle task. Running at the idle priority + * All the tasks run at the idle priority and never block or yield. This causes + * all eight tasks to time slice with the idle task. Running at the idle priority * means that these tasks will get pre-empted any time another task is ready to run - * or a time slice occurs. More often than not the pre-emption will occur mid - * calculation, creating a good test of the schedulers context switch mechanism - a - * calculation producing an unexpected result could be a symptom of a corruption in + * or a time slice occurs. More often than not the pre-emption will occur mid + * calculation, creating a good test of the schedulers context switch mechanism - a + * calculation producing an unexpected result could be a symptom of a corruption in * the context of a task. * * This file demonstrates the use of the task tag and traceTASK_SWITCHED_IN and @@ -54,18 +54,18 @@ #define mathSTACK_SIZE configMINIMAL_STACK_SIZE #define mathNUMBER_OF_TASKS ( 8 ) -/* Four tasks, each of which performs a different floating point calculation. +/* Four tasks, each of which performs a different floating point calculation. Each of the four is created twice. */ static portTASK_FUNCTION_PROTO( vCompetingMathTask1, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask2, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask3, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask4, pvParameters ); -/* These variables are used to check that all the tasks are still running. If a +/* These variables are used to check that all the tasks are still running. If a task gets a calculation wrong it will stop incrementing its check variable. */ static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 }; -/* Buffers into which the flop registers will be saved. There is a buffer for +/* Buffers into which the flop registers will be saved. There is a buffer for each task created within this file. Zeroing out this array is the normal and safe option as this will cause the task to start with all zeros in its flop context. */ @@ -78,11 +78,11 @@ void vStartMathTasks( unsigned portBASE_TYPE uxPriority ) TaskHandle_t xTaskJustCreated; portBASE_TYPE x, y; - /* Place known values into the buffers into which the flop registers are + /* Place known values into the buffers into which the flop registers are to be saved. This is for debug purposes only, it is not normally required. The last position in each array is left at zero as the status - register will be loaded from there. - + register will be loaded from there. + It is intended that these values can be viewed being loaded into the flop registers when a task is started - however the Insight debugger does not seem to want to show the flop register values. */ @@ -95,11 +95,11 @@ portBASE_TYPE x, y; } /* Create the first task - passing it the address of the check variable - that it is going to increment. This check variable is used as an + that it is going to increment. This check variable is used as an indication that the task is still running. */ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated ); - /* The task tag value is a value that can be associated with a task, but + /* The task tag value is a value that can be associated with a task, but is not used by the scheduler itself. Its use is down to the application so it makes a convenient place in this case to store the pointer to the buffer into which the flop context of the task will be stored. The first created @@ -143,7 +143,7 @@ short sError = pdFALSE; dAnswer = ( df1 + df2 ) * df3; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; @@ -160,7 +160,7 @@ short sError = pdFALSE; taskYIELD(); #endif - /* If the calculation does not match the expected constant, stop the + /* If the calculation does not match the expected constant, stop the increment of the check variable. */ if( fabs( df4 - dAnswer ) > 0.001 ) { @@ -169,7 +169,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } @@ -196,7 +196,7 @@ short sError = pdFALSE; dAnswer = ( df1 / df2 ) * df3; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; @@ -212,8 +212,8 @@ short sError = pdFALSE; #if configUSE_PREEMPTION == 0 taskYIELD(); #endif - - /* If the calculation does not match the expected constant, stop the + + /* If the calculation does not match the expected constant, stop the increment of the check variable. */ if( fabs( df4 - dAnswer ) > 0.001 ) { @@ -222,7 +222,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; @@ -243,14 +243,14 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) ); - /* Keep filling an array, keeping a running total of the values placed in the - array. Then run through the array adding up all the values. If the two totals + /* Keep filling an array, keeping a running total of the values placed in the + array. Then run through the array adding up all the values. If the two totals do not match, stop the check variable from incrementing. */ for( ;; ) { @@ -260,7 +260,7 @@ short sError = pdFALSE; for( xPosition = 0; xPosition < xArraySize; xPosition++ ) { pdArray[ xPosition ] = ( portDOUBLE ) xPosition + 5.5; - dTotal1 += ( portDOUBLE ) xPosition + 5.5; + dTotal1 += ( portDOUBLE ) xPosition + 5.5; } #if configUSE_PREEMPTION == 0 @@ -284,7 +284,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } @@ -300,14 +300,14 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) ); - /* Keep filling an array, keeping a running total of the values placed in the - array. Then run through the array adding up all the values. If the two totals + /* Keep filling an array, keeping a running total of the values placed in the + array. Then run through the array adding up all the values. If the two totals do not match, stop the check variable from incrementing. */ for( ;; ) { @@ -317,7 +317,7 @@ short sError = pdFALSE; for( xPosition = 0; xPosition < xArraySize; xPosition++ ) { pdArray[ xPosition ] = ( portDOUBLE ) xPosition * 12.123; - dTotal1 += ( portDOUBLE ) xPosition * 12.123; + dTotal1 += ( portDOUBLE ) xPosition * 12.123; } #if configUSE_PREEMPTION == 0 @@ -341,23 +341,23 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } } -} +} /*-----------------------------------------------------------*/ /* This is called to check that all the created tasks are still running. */ portBASE_TYPE xAreMathsTaskStillRunning( void ) { -/* Keep a history of the check variables so we know if they have been incremented +/* Keep a history of the check variables so we know if they have been incremented since the last call. */ static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 }; portBASE_TYPE xReturn = pdTRUE, xTask; - /* Check the maths tasks are still running by ensuring their check variables + /* Check the maths tasks are still running by ensuring their check variables are still incrementing. */ for( xTask = 0; xTask < mathNUMBER_OF_TASKS; xTask++ ) { diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c index 445711638..fac75fee0 100644 --- a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c @@ -27,19 +27,19 @@ /* * Creates all the demo application tasks, then starts the scheduler. The WEB * documentation provides more details of the demo application tasks. - * + * * In addition to the standard demo tasks, the follow demo specific tasks are * create: * - * The "Check" task. This only executes every three seconds but has the highest - * priority so is guaranteed to get processor time. Its main function is to - * check that all the other tasks are still operational. Most tasks maintain - * a unique count that is incremented each time the task successfully completes - * its function. Should any error occur within such a task the count is - * permanently halted. The check task inspects the count of each task to ensure - * it has changed since the last time the check task executed. If all the count - * variables have changed all the tasks are still executing error free, and the - * check task toggles the onboard LED. Should any task contain an error at any time + * The "Check" task. This only executes every three seconds but has the highest + * priority so is guaranteed to get processor time. Its main function is to + * check that all the other tasks are still operational. Most tasks maintain + * a unique count that is incremented each time the task successfully completes + * its function. Should any error occur within such a task the count is + * permanently halted. The check task inspects the count of each task to ensure + * it has changed since the last time the check task executed. If all the count + * variables have changed all the tasks are still executing error free, and the + * check task toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * * The "Register Check" tasks. These tasks fill the CPU registers with known @@ -96,15 +96,15 @@ baud rate parameters passed into the comtest initialisation has no effect. */ /* Delay periods used by the check task. If no errors have been found then the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an -error has been found at any time then the toggle rate will increase to +error has been found at any time then the toggle rate will increase to mainERROR_CHECK_DELAY milliseconds. */ #define mainNO_ERROR_CHECK_DELAY ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) #define mainERROR_CHECK_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS ) -/* +/* * The tasks defined within this file - described within the comments at the - * head of this page. + * head of this page. */ static void prvRegTestTask1( void *pvParameters ); static void prvRegTestTask2( void *pvParameters ); @@ -145,12 +145,12 @@ int main( void ) /* Start the standard demo application tasks. Note that the baud rate used by the comtest tasks is set by the hardware, so the baud rate parameter passed has no effect. */ - vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); + vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); vStartIntegerMathTasks( tskIDLE_PRIORITY ); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED ); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); - vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); - vStartDynamicPriorityTasks(); + vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); + vStartDynamicPriorityTasks(); vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); vStartQueuePeekTasks(); vCreateBlockTimeTasks(); @@ -173,10 +173,10 @@ int main( void ) vCreateSuicidalTasks( mainDEATH_PRIORITY ); /* Now start the scheduler. Following this call the created tasks should - be executing. */ + be executing. */ vTaskStartScheduler(); - /* vTaskStartScheduler() will only return if an error occurs while the + /* vTaskStartScheduler() will only return if an error occurs while the idle task is being created. */ for( ;; ); @@ -190,7 +190,7 @@ portBASE_TYPE lReturn = pdPASS; static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; /* The demo tasks maintain a count that increments every cycle of the task - provided that the task has never encountered an error. This function + provided that the task has never encountered an error. This function checks the counts maintained by the tasks to ensure they are still being incremented. A count remaining at the same value between calls therefore indicates that an error has been detected. */ @@ -204,37 +204,37 @@ static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; { lReturn = pdFAIL; } - + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreBlockingQueuesStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xIsCreateTaskStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreGenericQueueTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreQueuePeekTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; @@ -319,14 +319,14 @@ volatile unsigned portBASE_TYPE uxFreeStack; uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); /* Wait until it is time to check again. The time we wait here depends - on whether an error has been detected or not. When an error is + on whether an error has been detected or not. When an error is detected the time is shortened resulting in a faster LED flash rate. */ vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); /* See if the other tasks are all ok. */ if( prvCheckOtherTasksAreStillRunning() != pdPASS ) { - /* An error occurred in one of the tasks so shorten the delay + /* An error occurred in one of the tasks so shorten the delay period - which has the effect of increasing the frequency of the LED toggle. */ xDelayPeriod = mainERROR_CHECK_DELAY; @@ -378,7 +378,7 @@ static void prvRegTestTask1( void *pvParameters ) ( void ) pvParameters; /* The first register test task as described at the top of this file. The - values used in the registers are different to those use in the second + values used in the registers are different to those use in the second register test task. Also, unlike the second register test task, this task yields between setting the register values and subsequently checking the register values. */ @@ -518,7 +518,7 @@ static void prvRegTestTask2( void *pvParameters ) /* Just to remove compiler warning. */ ( void ) pvParameters; - /* The second register test task as described at the top of this file. + /* The second register test task as described at the top of this file. Note that this task fills the registers with different values to the first register test task. */ asm volatile diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c index e57eac09d..33c512cf2 100644 --- a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c @@ -40,7 +40,7 @@ #define partstCHANNEL_1 0x01 #define partstMAX_8BIT_LED 0x07 -/* The outputs are split into two IO sections, these variables maintain the +/* The outputs are split into two IO sections, these variables maintain the current value of either section. */ static unsigned portBASE_TYPE uxCurrentOutput8Bit, uxCurrentOutput5Bit; @@ -74,7 +74,7 @@ unsigned portBASE_TYPE uxBaseAddress, *puxCurrentValue; { uxBaseAddress = XPAR_LEDS_8BIT_BASEADDR; puxCurrentValue = &uxCurrentOutput5Bit; - } + } else { uxBaseAddress = XPAR_LEDS_POSITIONS_BASEADDR; @@ -115,7 +115,7 @@ unsigned portBASE_TYPE uxBaseAddress, *puxCurrentValue; uxBaseAddress = XPAR_LEDS_8BIT_BASEADDR; puxCurrentValue = &uxCurrentOutput5Bit; - } + } else { uxBaseAddress = XPAR_LEDS_POSITIONS_BASEADDR; diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c index 6a495f10f..704a4060c 100644 --- a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c @@ -25,7 +25,7 @@ */ -/* +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART */ @@ -46,8 +46,8 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /* Structure that maintains information on the UART being used. */ static XUartLite xUART; @@ -82,13 +82,13 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port if( xPortInstallInterruptHandler( XPAR_XPS_INTC_0_RS232_UART_1_INTERRUPT_INTR, ( XInterruptHandler )vSerialISR, (void *)&xUART ) == pdPASS ) { - /* xPortInstallInterruptHandler() could fail if - vPortSetupInterruptController() has not been called prior to this + /* xPortInstallInterruptHandler() could fail if + vPortSetupInterruptController() has not been called prior to this function. */ XUartLite_EnableInterrupt( &xUART ); } } - + /* There is only one port so the handle is not used. */ return ( xComPortHandle ) 0; } @@ -131,17 +131,17 @@ portBASE_TYPE xReturn = pdTRUE; } } /* Otherwise, if there is data already in the queue we should add the - new data to the back of the queue to ensure the sequencing is + new data to the back of the queue to ensure the sequencing is maintained. */ else if( uxQueueMessagesWaiting( xCharsForTx ) ) { if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) { xReturn = pdFAIL; - } + } } /* If the UART FIFO is not full and there is no data already in the - queue we can write directly to the FIFO without disrupting the + queue we can write directly to the FIFO without disrupting the sequence. */ else { @@ -179,13 +179,13 @@ char cChar; if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) { /* A character is available - place it in the queue of received - characters. This might wake a task that was blocked waiting for + characters. This might wake a task that was blocked waiting for data. */ cChar = ( char ) XIo_In32( XPAR_RS232_UART_1_BASEADDR + XUL_RX_FIFO_OFFSET ); xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); lDidSomething = pdTRUE; } - + if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) { /* There is space in the FIFO - if there are any characters queue for @@ -195,7 +195,7 @@ char cChar; { XIo_Out32( XPAR_RS232_UART_1_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); lDidSomething = pdTRUE; - } + } } } while( lDidSomething == pdTRUE ); diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 new file mode 100644 index 000000000..47829db12 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 @@ -0,0 +1,473 @@ + +# ############################################################################## +# Created by Base System Builder Wizard for Xilinx EDK 11.1 Build EDK_L.29.1 +# Sat Jun 13 13:14:11 2009 +# Target Board: Xilinx Virtex 5 ML507 Evaluation Platform Rev A +# Family: virtex5 +# Device: xc5vfx70t +# Package: ff1136 +# Speed Grade: -1 +# Processor number: 1 +# Processor 1: ppc440_0 +# Processor clock frequency: 125.0 +# Bus clock frequency: 125.0 +# Debug Interface: FPGA JTAG +# ############################################################################## + PARAMETER VERSION = 2.1.0 + + + PORT fpga_0_RS232_Uart_1_RX_pin = fpga_0_RS232_Uart_1_RX_pin, DIR = I + PORT fpga_0_RS232_Uart_1_TX_pin = fpga_0_RS232_Uart_1_TX_pin, DIR = O + PORT fpga_0_LEDs_8Bit_GPIO_IO_pin = fpga_0_LEDs_8Bit_GPIO_IO_pin, DIR = IO, VEC = [0:7] + PORT fpga_0_LEDs_Positions_GPIO_IO_pin = fpga_0_LEDs_Positions_GPIO_IO_pin, DIR = IO, VEC = [0:4] + PORT fpga_0_Push_Buttons_5Bit_GPIO_IO_pin = fpga_0_Push_Buttons_5Bit_GPIO_IO_pin, DIR = IO, VEC = [0:4] + PORT fpga_0_DIP_Switches_8Bit_GPIO_IO_pin = fpga_0_DIP_Switches_8Bit_GPIO_IO_pin, DIR = IO, VEC = [0:7] + PORT fpga_0_IIC_EEPROM_Sda_pin = fpga_0_IIC_EEPROM_Sda_pin, DIR = IO + PORT fpga_0_IIC_EEPROM_Scl_pin = fpga_0_IIC_EEPROM_Scl_pin, DIR = IO + PORT fpga_0_SRAM_Mem_A_pin = fpga_0_SRAM_Mem_A_pin_vslice_7_30_concat, DIR = O, VEC = [7:30] + PORT fpga_0_SRAM_Mem_CEN_pin = fpga_0_SRAM_Mem_CEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_OEN_pin = fpga_0_SRAM_Mem_OEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_WEN_pin = fpga_0_SRAM_Mem_WEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_BEN_pin = fpga_0_SRAM_Mem_BEN_pin, DIR = O, VEC = [0:3] + PORT fpga_0_SRAM_Mem_ADV_LDN_pin = fpga_0_SRAM_Mem_ADV_LDN_pin, DIR = O + PORT fpga_0_SRAM_Mem_DQ_pin = fpga_0_SRAM_Mem_DQ_pin, DIR = IO, VEC = [0:31] + PORT fpga_0_SRAM_ZBT_CLK_OUT_pin = SRAM_CLK_OUT_s, DIR = O + PORT fpga_0_SRAM_ZBT_CLK_FB_pin = SRAM_CLK_FB_s, DIR = I, SIGIS = CLK, CLK_FREQ = 125000000 + PORT fpga_0_PCIe_Bridge_RXN_pin = fpga_0_PCIe_Bridge_RXN_pin, DIR = I + PORT fpga_0_PCIe_Bridge_RXP_pin = fpga_0_PCIe_Bridge_RXP_pin, DIR = I + PORT fpga_0_PCIe_Bridge_TXN_pin = fpga_0_PCIe_Bridge_TXN_pin, DIR = O + PORT fpga_0_PCIe_Bridge_TXP_pin = fpga_0_PCIe_Bridge_TXP_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_clk_pin = fpga_0_Ethernet_MAC_PHY_tx_clk_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_clk_pin = fpga_0_Ethernet_MAC_PHY_rx_clk_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_crs_pin = fpga_0_Ethernet_MAC_PHY_crs_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_dv_pin = fpga_0_Ethernet_MAC_PHY_dv_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_data_pin = fpga_0_Ethernet_MAC_PHY_rx_data_pin, DIR = I, VEC = [3:0] + PORT fpga_0_Ethernet_MAC_PHY_col_pin = fpga_0_Ethernet_MAC_PHY_col_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_er_pin = fpga_0_Ethernet_MAC_PHY_rx_er_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rst_n_pin = fpga_0_Ethernet_MAC_PHY_rst_n_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_en_pin = fpga_0_Ethernet_MAC_PHY_tx_en_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_data_pin = fpga_0_Ethernet_MAC_PHY_tx_data_pin, DIR = O, VEC = [3:0] + PORT fpga_0_Ethernet_MAC_MDINT_pin = fpga_0_Ethernet_MAC_MDINT_pin, DIR = I, SIGIS = INTERRUPT, SENSITIVITY = LEVEL_LOW, INTERRUPT_PRIORITY = MEDIUM + PORT fpga_0_DDR2_SDRAM_DDR2_DQ_pin = fpga_0_DDR2_SDRAM_DDR2_DQ_pin, DIR = IO, VEC = [63:0] + PORT fpga_0_DDR2_SDRAM_DDR2_DQS_pin = fpga_0_DDR2_SDRAM_DDR2_DQS_pin, DIR = IO, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin = fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin, DIR = IO, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_A_pin = fpga_0_DDR2_SDRAM_DDR2_A_pin, DIR = O, VEC = [12:0] + PORT fpga_0_DDR2_SDRAM_DDR2_BA_pin = fpga_0_DDR2_SDRAM_DDR2_BA_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin = fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin = fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_WE_N_pin = fpga_0_DDR2_SDRAM_DDR2_WE_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_CS_N_pin = fpga_0_DDR2_SDRAM_DDR2_CS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_ODT_pin = fpga_0_DDR2_SDRAM_DDR2_ODT_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CKE_pin = fpga_0_DDR2_SDRAM_DDR2_CKE_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_DM_pin = fpga_0_DDR2_SDRAM_DDR2_DM_pin, DIR = O, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CK_pin = fpga_0_DDR2_SDRAM_DDR2_CK_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CK_N_pin = fpga_0_DDR2_SDRAM_DDR2_CK_N_pin, DIR = O, VEC = [1:0] + PORT fpga_0_SysACE_CompactFlash_SysACE_MPA_pin = fpga_0_SysACE_CompactFlash_SysACE_MPA_pin, DIR = O, VEC = [6:0] + PORT fpga_0_SysACE_CompactFlash_SysACE_CLK_pin = fpga_0_SysACE_CompactFlash_SysACE_CLK_pin, DIR = I + PORT fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin, DIR = I + PORT fpga_0_SysACE_CompactFlash_SysACE_CEN_pin = fpga_0_SysACE_CompactFlash_SysACE_CEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_OEN_pin = fpga_0_SysACE_CompactFlash_SysACE_OEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_WEN_pin = fpga_0_SysACE_CompactFlash_SysACE_WEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_MPD_pin = fpga_0_SysACE_CompactFlash_SysACE_MPD_pin, DIR = IO, VEC = [15:0] + PORT fpga_0_clk_1_sys_clk_pin = dcm_clk_s, DIR = I, SIGIS = CLK, CLK_FREQ = 100000000 + PORT fpga_0_rst_1_sys_rst_pin = sys_rst_s, DIR = I, SIGIS = RST, RST_POLARITY = 0 + PORT fpga_0_PCIe_Diff_Clk_IBUF_DS_P_pin = PCIe_Diff_Clk, DIR = I, DIFFERENTIAL_POLARITY = P, SIGIS = CLK + PORT fpga_0_PCIe_Diff_Clk_IBUF_DS_N_pin = PCIe_Diff_Clk, DIR = I, DIFFERENTIAL_POLARITY = N, SIGIS = CLK + + +BEGIN ppc440_virtex5 + PARAMETER INSTANCE = ppc440_0 + PARAMETER C_IDCR_BASEADDR = 0b0000000000 + PARAMETER C_IDCR_HIGHADDR = 0b0011111111 + PARAMETER C_APU_CONTROL = 0b00000010000000001 + PARAMETER C_PPC440MC_ROW_CONFLICT_MASK = 0x003FFE00 + PARAMETER C_PPC440MC_BANK_CONFLICT_MASK = 0x00C00000 + PARAMETER C_PPC440MC_CONTROL = 0xF810008F + PARAMETER C_SPLB0_USE_MPLB_ADDR = 1 + PARAMETER C_SPLB0_NUM_MPLB_ADDR_RNG = 1 + PARAMETER C_SPLB1_NUM_MPLB_ADDR_RNG = 0 + PARAMETER HW_VER = 1.01.a + PARAMETER C_SPLB0_RNG0_MPLB_BASEADDR = 0x80000000 + PARAMETER C_SPLB0_RNG0_MPLB_HIGHADDR = 0xffffffff + PARAMETER C_SPLB0_RNG_MC_BASEADDR = 0x00000000 + PARAMETER C_SPLB0_RNG_MC_HIGHADDR = 0x0fffffff + BUS_INTERFACE MPLB = plb_v46_0 + BUS_INTERFACE SPLB0 = ppc440_0_SPLB0 + BUS_INTERFACE PPC440MC = ppc440_0_PPC440MC + BUS_INTERFACE MFCB = ppc440_0_fcb_v20 + BUS_INTERFACE JTAGPPC = ppc440_0_jtagppc_bus + BUS_INTERFACE RESETPPC = ppc_reset_bus + PORT CPMC440CLK = clk_125_0000MHzPLL0 + PORT CPMINTERCONNECTCLK = clk_125_0000MHzPLL0 + PORT CPMINTERCONNECTCLKNTO1 = net_vcc + PORT EICC440EXTIRQ = ppc440_0_EICC440EXTIRQ + PORT CPMMCCLK = clk_125_0000MHzPLL0_ADJUST + PORT CPMPPCMPLBCLK = clk_125_0000MHzPLL0_ADJUST + PORT CPMPPCS0PLBCLK = clk_125_0000MHzPLL0_ADJUST +END + +BEGIN plb_v46 + PARAMETER INSTANCE = plb_v46_0 + PARAMETER C_DCR_INTFCE = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.04.a + PORT PLB_Clk = clk_125_0000MHzPLL0_ADJUST + PORT SYS_Rst = sys_bus_reset +END + +BEGIN xps_bram_if_cntlr + PARAMETER INSTANCE = xps_bram_if_cntlr_1 + PARAMETER C_SPLB_NATIVE_DWIDTH = 64 + PARAMETER C_SPLB_SUPPORT_BURSTS = 1 + PARAMETER C_SPLB_P2P = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.00.b + PARAMETER C_BASEADDR = 0xffffe000 + PARAMETER C_HIGHADDR = 0xffffffff + BUS_INTERFACE SPLB = plb_v46_0 + BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port +END + +BEGIN bram_block + PARAMETER INSTANCE = xps_bram_if_cntlr_1_bram + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.00.a + BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port +END + +BEGIN xps_uartlite + PARAMETER INSTANCE = RS232_Uart_1 + PARAMETER C_FAMILY = virtex5 + PARAMETER C_BAUDRATE = 9600 + PARAMETER C_DATA_BITS = 8 + PARAMETER C_USE_PARITY = 0 + PARAMETER C_ODD_PARITY = 0 + PARAMETER HW_VER = 1.01.a + PARAMETER C_BASEADDR = 0x84000000 + PARAMETER C_HIGHADDR = 0x8400ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT RX = fpga_0_RS232_Uart_1_RX_pin + PORT TX = fpga_0_RS232_Uart_1_TX_pin + PORT Interrupt = RS232_Uart_1_Interrupt +END + +BEGIN xps_gpio + PARAMETER INSTANCE = LEDs_8Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 0 + PARAMETER C_GPIO_WIDTH = 8 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81440000 + PARAMETER C_HIGHADDR = 0x8144ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_LEDs_8Bit_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = LEDs_Positions + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 0 + PARAMETER C_GPIO_WIDTH = 5 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81420000 + PARAMETER C_HIGHADDR = 0x8142ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_LEDs_Positions_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = Push_Buttons_5Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 1 + PARAMETER C_GPIO_WIDTH = 5 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81400000 + PARAMETER C_HIGHADDR = 0x8140ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_Push_Buttons_5Bit_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = DIP_Switches_8Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 1 + PARAMETER C_GPIO_WIDTH = 8 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81460000 + PARAMETER C_HIGHADDR = 0x8146ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_DIP_Switches_8Bit_GPIO_IO_pin +END + +BEGIN xps_iic + PARAMETER INSTANCE = IIC_EEPROM + PARAMETER C_IIC_FREQ = 100000 + PARAMETER C_TEN_BIT_ADR = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 2.01.a + PARAMETER C_BASEADDR = 0x81600000 + PARAMETER C_HIGHADDR = 0x8160ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT Sda = fpga_0_IIC_EEPROM_Sda_pin + PORT Scl = fpga_0_IIC_EEPROM_Scl_pin +END + +BEGIN xps_mch_emc + PARAMETER INSTANCE = SRAM + PARAMETER C_FAMILY = virtex5 + PARAMETER C_NUM_BANKS_MEM = 1 + PARAMETER C_NUM_CHANNELS = 0 + PARAMETER C_MEM0_WIDTH = 32 + PARAMETER C_MAX_MEM_WIDTH = 32 + PARAMETER C_INCLUDE_DATAWIDTH_MATCHING_0 = 0 + PARAMETER C_SYNCH_MEM_0 = 1 + PARAMETER C_TCEDV_PS_MEM_0 = 0 + PARAMETER C_TAVDV_PS_MEM_0 = 0 + PARAMETER C_THZCE_PS_MEM_0 = 0 + PARAMETER C_THZOE_PS_MEM_0 = 0 + PARAMETER C_TWC_PS_MEM_0 = 0 + PARAMETER C_TWP_PS_MEM_0 = 0 + PARAMETER C_TLZWE_PS_MEM_0 = 0 + PARAMETER HW_VER = 3.00.a + PARAMETER C_MEM0_BASEADDR = 0xf8000000 + PARAMETER C_MEM0_HIGHADDR = 0xf80fffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT RdClk = clk_125_0000MHzPLL0_ADJUST + PORT Mem_A = 0b0000000 & fpga_0_SRAM_Mem_A_pin_vslice_7_30_concat & 0b0 + PORT Mem_CEN = fpga_0_SRAM_Mem_CEN_pin + PORT Mem_OEN = fpga_0_SRAM_Mem_OEN_pin + PORT Mem_WEN = fpga_0_SRAM_Mem_WEN_pin + PORT Mem_BEN = fpga_0_SRAM_Mem_BEN_pin + PORT Mem_ADV_LDN = fpga_0_SRAM_Mem_ADV_LDN_pin + PORT Mem_DQ = fpga_0_SRAM_Mem_DQ_pin +END + +BEGIN plbv46_pcie + PARAMETER INSTANCE = PCIe_Bridge + PARAMETER C_FAMILY = virtex5 + PARAMETER C_IPIFBAR_NUM = 2 + PARAMETER C_PCIBAR_NUM = 1 + PARAMETER C_DEVICE_ID = 0x0505 + PARAMETER C_VENDOR_ID = 0x10EE + PARAMETER C_CLASS_CODE = 0x058000 + PARAMETER C_REV_ID = 0x00 + PARAMETER C_SUBSYSTEM_ID = 0x0000 + PARAMETER C_SUBSYSTEM_VENDOR_ID = 0x0000 + PARAMETER C_COMP_TIMEOUT = 1 + PARAMETER C_IPIFBAR2PCIBAR_0 = 0x00000000 + PARAMETER C_IPIFBAR2PCIBAR_1 = 0x00000000 + PARAMETER C_PCIBAR2IPIFBAR_0 = 0xf8000000 + PARAMETER C_PCIBAR2IPIFBAR_1 = 0x00000000 + PARAMETER C_PCIBAR_LEN_0 = 20 + PARAMETER C_PCIBAR_LEN_1 = 28 + PARAMETER C_BOARD = ml507 + PARAMETER HW_VER = 3.00.b + PARAMETER C_BASEADDR = 0x85c00000 + PARAMETER C_HIGHADDR = 0x85c0ffff + PARAMETER C_IPIFBAR_0 = 0xc0000000 + PARAMETER C_IPIFBAR_HIGHADDR_0 = 0xdfffffff + PARAMETER C_IPIFBAR_1 = 0xe0000000 + PARAMETER C_IPIFBAR_HIGHADDR_1 = 0xefffffff + BUS_INTERFACE SPLB = plb_v46_0 + BUS_INTERFACE MPLB = ppc440_0_SPLB0 + PORT PERSTN = net_vcc + PORT REFCLK = PCIe_Diff_Clk + PORT RXN = fpga_0_PCIe_Bridge_RXN_pin + PORT RXP = fpga_0_PCIe_Bridge_RXP_pin + PORT TXN = fpga_0_PCIe_Bridge_TXN_pin + PORT TXP = fpga_0_PCIe_Bridge_TXP_pin + PORT MSI_request = net_gnd +END + +BEGIN plb_v46 + PARAMETER INSTANCE = ppc440_0_SPLB0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.04.a + PORT PLB_Clk = clk_125_0000MHzPLL0_ADJUST + PORT SYS_Rst = sys_bus_reset +END + +BEGIN xps_ethernetlite + PARAMETER INSTANCE = Ethernet_MAC + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 2.01.a + PARAMETER C_BASEADDR = 0x81000000 + PARAMETER C_HIGHADDR = 0x8100ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT PHY_tx_clk = fpga_0_Ethernet_MAC_PHY_tx_clk_pin + PORT PHY_rx_clk = fpga_0_Ethernet_MAC_PHY_rx_clk_pin + PORT PHY_crs = fpga_0_Ethernet_MAC_PHY_crs_pin + PORT PHY_dv = fpga_0_Ethernet_MAC_PHY_dv_pin + PORT PHY_rx_data = fpga_0_Ethernet_MAC_PHY_rx_data_pin + PORT PHY_col = fpga_0_Ethernet_MAC_PHY_col_pin + PORT PHY_rx_er = fpga_0_Ethernet_MAC_PHY_rx_er_pin + PORT PHY_rst_n = fpga_0_Ethernet_MAC_PHY_rst_n_pin + PORT PHY_tx_en = fpga_0_Ethernet_MAC_PHY_tx_en_pin + PORT PHY_tx_data = fpga_0_Ethernet_MAC_PHY_tx_data_pin +END + +BEGIN ppc440mc_ddr2 + PARAMETER INSTANCE = DDR2_SDRAM + PARAMETER C_DDR_BAWIDTH = 2 + PARAMETER C_NUM_CLK_PAIRS = 2 + PARAMETER C_DDR_DWIDTH = 64 + PARAMETER C_DDR_CAWIDTH = 10 + PARAMETER C_NUM_RANKS_MEM = 1 + PARAMETER C_CS_BITS = 0 + PARAMETER C_DDR_DM_WIDTH = 8 + PARAMETER C_DQ_BITS = 8 + PARAMETER C_DDR2_ODT_WIDTH = 2 + PARAMETER C_DDR2_ADDT_LAT = 0 + PARAMETER C_INCLUDE_ECC_SUPPORT = 0 + PARAMETER C_DDR2_ODT_SETTING = 1 + PARAMETER C_DQS_BITS = 3 + PARAMETER C_DDR_DQS_WIDTH = 8 + PARAMETER C_DDR_RAWIDTH = 13 + PARAMETER C_DDR_BURST_LENGTH = 4 + PARAMETER C_DDR_CAS_LAT = 4 + PARAMETER C_REG_DIMM = 0 + PARAMETER C_MIB_MC_CLOCK_RATIO = 1 + PARAMETER C_DDR_TREFI = 3900 + PARAMETER C_DDR_TRAS = 40000 + PARAMETER C_DDR_TRCD = 15000 + PARAMETER C_DDR_TRFC = 75000 + PARAMETER C_DDR_TRP = 15000 + PARAMETER C_DDR_TRTP = 7500 + PARAMETER C_DDR_TWR = 15000 + PARAMETER C_DDR_TWTR = 7500 + PARAMETER C_MC_MIBCLK_PERIOD_PS = 8000 + PARAMETER C_IDEL_HIGH_PERF = TRUE + PARAMETER C_NUM_IDELAYCTRL = 3 + PARAMETER C_IDELAYCTRL_LOC = IDELAYCTRL_X0Y6-IDELAYCTRL_X0Y2-IDELAYCTRL_X0Y1 + PARAMETER C_DQS_IO_COL = 0b000000000000000000 + PARAMETER C_DQ_IO_MS = 0b000000000111010100111101000011110001111000101110110000111100000110111100 + PARAMETER HW_VER = 2.00.a + PARAMETER C_MEM_BASEADDR = 0x00000000 + PARAMETER C_MEM_HIGHADDR = 0x0fffffff + BUS_INTERFACE PPC440MC = ppc440_0_PPC440MC + PORT mc_mibclk = clk_125_0000MHzPLL0_ADJUST + PORT mi_mcclk90 = clk_125_0000MHz90PLL0_ADJUST + PORT mi_mcreset = sys_bus_reset + PORT mi_mcclkdiv2 = clk_62_5000MHzPLL0_ADJUST + PORT mi_mcclk_200 = clk_200_0000MHz + PORT DDR2_DQ = fpga_0_DDR2_SDRAM_DDR2_DQ_pin + PORT DDR2_DQS = fpga_0_DDR2_SDRAM_DDR2_DQS_pin + PORT DDR2_DQS_N = fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin + PORT DDR2_A = fpga_0_DDR2_SDRAM_DDR2_A_pin + PORT DDR2_BA = fpga_0_DDR2_SDRAM_DDR2_BA_pin + PORT DDR2_RAS_N = fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin + PORT DDR2_CAS_N = fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin + PORT DDR2_WE_N = fpga_0_DDR2_SDRAM_DDR2_WE_N_pin + PORT DDR2_CS_N = fpga_0_DDR2_SDRAM_DDR2_CS_N_pin + PORT DDR2_ODT = fpga_0_DDR2_SDRAM_DDR2_ODT_pin + PORT DDR2_CKE = fpga_0_DDR2_SDRAM_DDR2_CKE_pin + PORT DDR2_DM = fpga_0_DDR2_SDRAM_DDR2_DM_pin + PORT DDR2_CK = fpga_0_DDR2_SDRAM_DDR2_CK_pin + PORT DDR2_CK_N = fpga_0_DDR2_SDRAM_DDR2_CK_N_pin +END + +BEGIN xps_sysace + PARAMETER INSTANCE = SysACE_CompactFlash + PARAMETER C_MEM_WIDTH = 16 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.01.a + PARAMETER C_BASEADDR = 0x83600000 + PARAMETER C_HIGHADDR = 0x8360ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT SysACE_MPA = fpga_0_SysACE_CompactFlash_SysACE_MPA_pin + PORT SysACE_CLK = fpga_0_SysACE_CompactFlash_SysACE_CLK_pin + PORT SysACE_MPIRQ = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin + PORT SysACE_CEN = fpga_0_SysACE_CompactFlash_SysACE_CEN_pin + PORT SysACE_OEN = fpga_0_SysACE_CompactFlash_SysACE_OEN_pin + PORT SysACE_WEN = fpga_0_SysACE_CompactFlash_SysACE_WEN_pin + PORT SysACE_MPD = fpga_0_SysACE_CompactFlash_SysACE_MPD_pin +END + +BEGIN fcb_v20 + PARAMETER INSTANCE = ppc440_0_fcb_v20 + PARAMETER HW_VER = 1.00.a + PORT FCB_CLK = clk_125_0000MHzPLL0_ADJUST + PORT SYS_RST = sys_bus_reset +END + +BEGIN apu_fpu_virtex5 + PARAMETER INSTANCE = ppc440_0_apu_fpu_virtex5 + PARAMETER HW_VER = 1.01.a + BUS_INTERFACE SFCB2 = ppc440_0_fcb_v20 +END + +BEGIN clock_generator + PARAMETER INSTANCE = clock_generator_0 + PARAMETER C_CLKIN_FREQ = 100000000 + PARAMETER C_CLKFBIN_FREQ = 125000000 + PARAMETER C_CLKOUT0_FREQ = 125000000 + PARAMETER C_CLKOUT0_PHASE = 90 + PARAMETER C_CLKOUT0_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT0_BUF = TRUE + PARAMETER C_CLKOUT1_FREQ = 125000000 + PARAMETER C_CLKOUT1_PHASE = 0 + PARAMETER C_CLKOUT1_GROUP = PLL0 + PARAMETER C_CLKOUT1_BUF = TRUE + PARAMETER C_CLKOUT2_FREQ = 125000000 + PARAMETER C_CLKOUT2_PHASE = 0 + PARAMETER C_CLKOUT2_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT2_BUF = TRUE + PARAMETER C_CLKOUT3_FREQ = 200000000 + PARAMETER C_CLKOUT3_PHASE = 0 + PARAMETER C_CLKOUT3_GROUP = NONE + PARAMETER C_CLKOUT3_BUF = TRUE + PARAMETER C_CLKOUT4_FREQ = 62500000 + PARAMETER C_CLKOUT4_PHASE = 0 + PARAMETER C_CLKOUT4_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT4_BUF = TRUE + PARAMETER C_CLKFBOUT_FREQ = 125000000 + PARAMETER C_CLKFBOUT_BUF = TRUE + PARAMETER HW_VER = 3.00.a + PORT CLKIN = dcm_clk_s + PORT CLKFBIN = SRAM_CLK_FB_s + PORT CLKOUT0 = clk_125_0000MHz90PLL0_ADJUST + PORT CLKOUT1 = clk_125_0000MHzPLL0 + PORT CLKOUT2 = clk_125_0000MHzPLL0_ADJUST + PORT CLKOUT3 = clk_200_0000MHz + PORT CLKOUT4 = clk_62_5000MHzPLL0_ADJUST + PORT CLKFBOUT = SRAM_CLK_OUT_s + PORT RST = net_gnd + PORT LOCKED = Dcm_all_locked +END + +BEGIN jtagppc_cntlr + PARAMETER INSTANCE = jtagppc_cntlr_inst + PARAMETER HW_VER = 2.01.c + BUS_INTERFACE JTAGPPC0 = ppc440_0_jtagppc_bus +END + +BEGIN proc_sys_reset + PARAMETER INSTANCE = proc_sys_reset_0 + PARAMETER C_EXT_RESET_HIGH = 0 + PARAMETER HW_VER = 2.00.a + BUS_INTERFACE RESETPPC0 = ppc_reset_bus + PORT Slowest_sync_clk = clk_125_0000MHzPLL0_ADJUST + PORT Ext_Reset_In = sys_rst_s + PORT Dcm_locked = Dcm_all_locked + PORT Bus_Struct_Reset = sys_bus_reset + PORT Peripheral_Reset = sys_periph_reset +END + +BEGIN xps_intc + PARAMETER INSTANCE = xps_intc_0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81800000 + PARAMETER C_HIGHADDR = 0x8180ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT Intr = fpga_0_Ethernet_MAC_MDINT_pin&RS232_Uart_1_Interrupt + PORT Irq = ppc440_0_EICC440EXTIRQ +END + diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_mss.11.1 b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_mss.11.1 new file mode 100644 index 000000000..aa363ea29 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_mss.11.1 @@ -0,0 +1,131 @@ + + PARAMETER VERSION = 2.2.0 + + +BEGIN OS + PARAMETER OS_NAME = standalone + PARAMETER OS_VER = 2.00.a + PARAMETER PROC_INSTANCE = ppc440_0 + PARAMETER STDIN = RS232_Uart_1 + PARAMETER STDOUT = RS232_Uart_1 +END + + +BEGIN PROCESSOR + PARAMETER DRIVER_NAME = cpu_ppc440 + PARAMETER DRIVER_VER = 1.00.b + PARAMETER HW_INSTANCE = ppc440_0 + PARAMETER COMPILER = powerpc-eabi-gcc + PARAMETER ARCHIVER = powerpc-eabi-ar +END + + +BEGIN DRIVER + PARAMETER DRIVER_NAME = bram + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1_bram +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = uartlite + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = RS232_Uart_1 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = LEDs_8Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = LEDs_Positions +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = Push_Buttons_5Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = DIP_Switches_8Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = iic + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = IIC_EEPROM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = emc + PARAMETER DRIVER_VER = 2.00.a + PARAMETER HW_INSTANCE = SRAM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = pcie + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = PCIe_Bridge +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = emaclite + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = Ethernet_MAC +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = memcon + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = DDR2_SDRAM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = sysace + PARAMETER DRIVER_VER = 1.12.a + PARAMETER HW_INSTANCE = SysACE_CompactFlash +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = apu_fpu_virtex5 + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = ppc440_0_apu_fpu_virtex5 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = clock_generator_0 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = jtagppc_cntlr_inst +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = proc_sys_reset_0 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = intc + PARAMETER DRIVER_VER = 1.11.a + PARAMETER HW_INSTANCE = xps_intc_0 +END + + diff --git a/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 new file mode 100644 index 000000000..fccfc5ab2 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 @@ -0,0 +1,69 @@ +#Please do not modify this file by hand +XmpVersion: 11.1 +VerMgmt: 11.1 +IntStyle: default +MHS File: system.mhs +MSS File: system.mss +Architecture: virtex5 +Device: xc5vfx70t +Package: ff1136 +SpeedGrade: -1 +UserCmd1: +UserCmd1Type: 0 +UserCmd2: +UserCmd2Type: 0 +GenSimTB: 0 +SdkExportBmmBit: 1 +SdkExportDir: SDK/SDK_Export +InsertNoPads: 0 +WarnForEAArch: 1 +HdlLang: VHDL +SimModel: BEHAVIORAL +UcfFile: data/system.ucf +EnableParTimingError: 1 +ShowLicenseDialog: 1 +Processor: ppc440_0 +BootLoop: 1 +XmdStub: 0 +SwProj: RTOSDemo +Processor: ppc440_0 +Executable: RTOSDemo/executable.elf +Source: RTOSDemo/../../Common/Minimal/BlockQ.c +Source: RTOSDemo/../../Common/Minimal/blocktim.c +Source: RTOSDemo/../../Common/Minimal/comtest.c +Source: RTOSDemo/../../Common/Minimal/countsem.c +Source: RTOSDemo/../../Common/Minimal/death.c +Source: RTOSDemo/../../Common/Minimal/dynamic.c +Source: RTOSDemo/../../Common/Minimal/flash.c +Source: RTOSDemo/../../Common/Minimal/GenQTest.c +Source: RTOSDemo/../../Common/Minimal/integer.c +Source: RTOSDemo/../../Common/Minimal/QPeek.c +Source: RTOSDemo/../../Common/Minimal/recmutex.c +Source: RTOSDemo/../../Common/Minimal/semtest.c +Source: RTOSDemo/../../../Source/tasks.c +Source: RTOSDemo/../../../Source/list.c +Source: RTOSDemo/../../../Source/queue.c +Source: RTOSDemo/../../../Source/croutine.c +Source: RTOSDemo/../../../Source/portable/GCC/PPC440_Xilinx/portasm.S +Source: RTOSDemo/../../../Source/portable/GCC/PPC440_Xilinx/port.c +Source: RTOSDemo/../../../Source/portable/MemMang/heap_2.c +Source: RTOSDemo/flop/flop-reg-test.c +Source: RTOSDemo/flop/flop.c +Source: RTOSDemo/partest/partest.c +Source: RTOSDemo/serial/serial.c +Source: RTOSDemo/main.c +DefaultInit: EXECUTABLE +InitBram: 0 +Active: 1 +CompilerOptLevel: 0 +GlobPtrOpt: 0 +DebugSym: 1 +ProfileFlag: 0 +SearchIncl: ../../Source/include ../../Source/portable/GCC/PPC440_Xilinx ../Common/include ./RTOSDemo ./RTOSDemo/flop +ProgStart: +StackSize: +HeapSize: +LinkerScript: RTOSDemo/RTOSDemo_linker_script.ld +ProgCCFlags: -D USE_DP_FPU -D GCC_PPC440 -mregnames +CompileInXps: 1 +NonXpsApp: 0 diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h index bbeed3571..d6b9efe07 100644 --- a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -60,6 +60,9 @@ #define configUSE_FPU 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 4 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c index 071e3922b..68551a1eb 100644 --- a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c @@ -27,36 +27,36 @@ /* * Tests the floating point context save and restore mechanism. * - * Two tasks are created - each of which is allocated a buffer of + * Two tasks are created - each of which is allocated a buffer of * portNO_FLOP_REGISTERS_TO_SAVE 32bit variables into which the flop context * of the task is saved when the task is switched out, and from which the - * flop context of the task is restored when the task is switch in. Prior to - * the tasks being created each position in the two buffers is filled with a + * flop context of the task is restored when the task is switch in. Prior to + * the tasks being created each position in the two buffers is filled with a * unique value - this way the flop context of each task is different. * * The two test tasks never block so are always in either the Running or * Ready state. They execute at the lowest priority so will get pre-empted * regularly, although the yield frequently so will not get much execution - * time. The lack of execution time is not a problem as its only the + * time. The lack of execution time is not a problem as its only the * switching in and out that is being tested. * - * Whenever a task is moved from the Ready to the Running state its flop + * Whenever a task is moved from the Ready to the Running state its flop * context will be loaded from the buffer, but while the task is in the * Running state the buffer is not used and can contain any value - in this - * case and for test purposes the task itself clears the buffer to zero. + * case and for test purposes the task itself clears the buffer to zero. * The next time the task is moved out of the Running state into the - * Ready state the flop context will once more get saved to the buffer - + * Ready state the flop context will once more get saved to the buffer - * overwriting the zeros. * * Therefore whenever the task is not in the Running state its buffer contains * the most recent values of its floating point registers - the zeroing out - * of the buffer while the task was executing being used to ensure the values + * of the buffer while the task was executing being used to ensure the values * the buffer contains are not stale. * * When neither test task is in the Running state the buffers should contain * the unique values allocated before the tasks were created. If so then * the floating point context has been maintained. This check is performed - * by the 'check' task (defined in main.c) by calling + * by the 'check' task (defined in main.c) by calling * xAreFlopRegisterTestsStillRunning(). * * The test tasks also increment a value each time they execute. @@ -84,7 +84,7 @@ static void vFlopTest2( void *pvParameters ); /*-----------------------------------------------------------*/ -/* Buffers into which the flop registers will be saved. There is a buffer for +/* Buffers into which the flop registers will be saved. There is a buffer for both tasks. */ static volatile unsigned long ulFlopRegisters[ flopNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ]; @@ -99,7 +99,7 @@ void vStartFlopRegTests( void ) TaskHandle_t xTaskJustCreated; unsigned portBASE_TYPE x, y, z = flopSTART_VALUE; - /* Fill the arrays into which the flop registers are to be saved with + /* Fill the arrays into which the flop registers are to be saved with known values. These are the values that will be written to the flop registers when the tasks start, and as the tasks do not perform any flop operations the values should never change. Each position in the @@ -118,7 +118,7 @@ unsigned portBASE_TYPE x, y, z = flopSTART_VALUE; /* Create the first task. */ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated ); - /* The task tag value is a value that can be associated with a task, but + /* The task tag value is a value that can be associated with a task, but is not used by the scheduler itself. Its use is down to the application so it makes a convenient place in this case to store the pointer to the buffer into which the flop context of the task will be stored. The first created @@ -146,7 +146,7 @@ static void vFlopTest1( void *pvParameters ) memset( ( void * ) ulFlopRegisters[ 0 ], 0x00, ( portNO_FLOP_REGISTERS_TO_SAVE * sizeof( unsigned portBASE_TYPE ) ) ); portEXIT_CRITICAL(); - /* We don't have to do anything other than indicate that we are + /* We don't have to do anything other than indicate that we are still running. */ ulFlop1CycleCount++; taskYIELD(); @@ -168,7 +168,7 @@ static void vFlopTest2( void *pvParameters ) memset( ( void * ) ulFlopRegisters[ 1 ], 0x00, ( portNO_FLOP_REGISTERS_TO_SAVE * sizeof( unsigned portBASE_TYPE ) ) ); portEXIT_CRITICAL(); - /* We don't have to do anything other than indicate that we are + /* We don't have to do anything other than indicate that we are still running. */ ulFlop2CycleCount++; taskYIELD(); @@ -183,7 +183,7 @@ unsigned portBASE_TYPE x, y, z = flopSTART_VALUE; static unsigned long ulLastFlop1CycleCount = 0, ulLastFlop2CycleCount = 0; /* Called from the 'check' task. - + The flop tasks cannot be currently running, check their saved registers are as expected. The tests tasks do not perform any flop operations so their registers should be as per their initial setting. */ diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c index b7b610c67..4fd4215f4 100644 --- a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c @@ -28,12 +28,12 @@ * Creates eight tasks, each of which loops continuously performing a * floating point calculation. * - * All the tasks run at the idle priority and never block or yield. This causes - * all eight tasks to time slice with the idle task. Running at the idle priority + * All the tasks run at the idle priority and never block or yield. This causes + * all eight tasks to time slice with the idle task. Running at the idle priority * means that these tasks will get pre-empted any time another task is ready to run - * or a time slice occurs. More often than not the pre-emption will occur mid - * calculation, creating a good test of the schedulers context switch mechanism - a - * calculation producing an unexpected result could be a symptom of a corruption in + * or a time slice occurs. More often than not the pre-emption will occur mid + * calculation, creating a good test of the schedulers context switch mechanism - a + * calculation producing an unexpected result could be a symptom of a corruption in * the context of a task. * * This file demonstrates the use of the task tag and traceTASK_SWITCHED_IN and @@ -54,18 +54,18 @@ #define mathSTACK_SIZE configMINIMAL_STACK_SIZE #define mathNUMBER_OF_TASKS ( 8 ) -/* Four tasks, each of which performs a different floating point calculation. +/* Four tasks, each of which performs a different floating point calculation. Each of the four is created twice. */ static portTASK_FUNCTION_PROTO( vCompetingMathTask1, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask2, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask3, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask4, pvParameters ); -/* These variables are used to check that all the tasks are still running. If a +/* These variables are used to check that all the tasks are still running. If a task gets a calculation wrong it will stop incrementing its check variable. */ static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 }; -/* Buffers into which the flop registers will be saved. There is a buffer for +/* Buffers into which the flop registers will be saved. There is a buffer for each task created within this file. Zeroing out this array is the normal and safe option as this will cause the task to start with all zeros in its flop context. */ @@ -78,11 +78,11 @@ void vStartMathTasks( unsigned portBASE_TYPE uxPriority ) TaskHandle_t xTaskJustCreated; portBASE_TYPE x, y; - /* Place known values into the buffers into which the flop registers are + /* Place known values into the buffers into which the flop registers are to be saved. This is for debug purposes only, it is not normally required. The last position in each array is left at zero as the status - register will be loaded from there. - + register will be loaded from there. + It is intended that these values can be viewed being loaded into the flop registers when a task is started - however the Insight debugger does not seem to want to show the flop register values. */ @@ -95,11 +95,11 @@ portBASE_TYPE x, y; } /* Create the first task - passing it the address of the check variable - that it is going to increment. This check variable is used as an + that it is going to increment. This check variable is used as an indication that the task is still running. */ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated ); - /* The task tag value is a value that can be associated with a task, but + /* The task tag value is a value that can be associated with a task, but is not used by the scheduler itself. Its use is down to the application so it makes a convenient place in this case to store the pointer to the buffer into which the flop context of the task will be stored. The first created @@ -143,7 +143,7 @@ short sError = pdFALSE; fAnswer = ( ff1 + ff2 ) * ff3; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; @@ -160,7 +160,7 @@ short sError = pdFALSE; taskYIELD(); #endif - /* If the calculation does not match the expected constant, stop the + /* If the calculation does not match the expected constant, stop the increment of the check variable. */ if( fabs( ff4 - fAnswer ) > 0.001F ) { @@ -169,7 +169,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } @@ -196,7 +196,7 @@ short sError = pdFALSE; fAnswer = ( ff1 / ff2 ) * ff3; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; @@ -212,8 +212,8 @@ short sError = pdFALSE; #if configUSE_PREEMPTION == 0 taskYIELD(); #endif - - /* If the calculation does not match the expected constant, stop the + + /* If the calculation does not match the expected constant, stop the increment of the check variable. */ if( fabs( ff4 - fAnswer ) > 0.001F ) { @@ -222,7 +222,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; @@ -243,14 +243,14 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) ); - /* Keep filling an array, keeping a running total of the values placed in the - array. Then run through the array adding up all the values. If the two totals + /* Keep filling an array, keeping a running total of the values placed in the + array. Then run through the array adding up all the values. If the two totals do not match, stop the check variable from incrementing. */ for( ;; ) { @@ -260,7 +260,7 @@ short sError = pdFALSE; for( xPosition = 0; xPosition < xArraySize; xPosition++ ) { pfArray[ xPosition ] = ( portFLOAT ) xPosition + 5.5F; - fTotal1 += ( portFLOAT ) xPosition + 5.5F; + fTotal1 += ( portFLOAT ) xPosition + 5.5F; } #if configUSE_PREEMPTION == 0 @@ -284,7 +284,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } @@ -300,14 +300,14 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) ); - /* Keep filling an array, keeping a running total of the values placed in the - array. Then run through the array adding up all the values. If the two totals + /* Keep filling an array, keeping a running total of the values placed in the + array. Then run through the array adding up all the values. If the two totals do not match, stop the check variable from incrementing. */ for( ;; ) { @@ -317,7 +317,7 @@ short sError = pdFALSE; for( xPosition = 0; xPosition < xArraySize; xPosition++ ) { pfArray[ xPosition ] = ( portFLOAT ) xPosition * 12.123F; - fTotal1 += ( portFLOAT ) xPosition * 12.123F; + fTotal1 += ( portFLOAT ) xPosition * 12.123F; } #if configUSE_PREEMPTION == 0 @@ -341,23 +341,23 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } } -} +} /*-----------------------------------------------------------*/ /* This is called to check that all the created tasks are still running. */ portBASE_TYPE xAreMathsTaskStillRunning( void ) { -/* Keep a history of the check variables so we know if they have been incremented +/* Keep a history of the check variables so we know if they have been incremented since the last call. */ static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 }; portBASE_TYPE xReturn = pdTRUE, xTask; - /* Check the maths tasks are still running by ensuring their check variables + /* Check the maths tasks are still running by ensuring their check variables are still incrementing. */ for( xTask = 0; xTask < mathNUMBER_OF_TASKS; xTask++ ) { diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c index 437b147f9..a655c2c52 100644 --- a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/main.c @@ -27,19 +27,19 @@ /* * Creates all the demo application tasks, then starts the scheduler. The WEB * documentation provides more details of the demo application tasks. - * + * * In addition to the standard demo tasks, the follow demo specific tasks are * create: * - * The "Check" task. This only executes every three seconds but has the highest - * priority so is guaranteed to get processor time. Its main function is to - * check that all the other tasks are still operational. Most tasks maintain - * a unique count that is incremented each time the task successfully completes - * its function. Should any error occur within such a task the count is - * permanently halted. The check task inspects the count of each task to ensure - * it has changed since the last time the check task executed. If all the count - * variables have changed all the tasks are still executing error free, and the - * check task toggles the onboard LED. Should any task contain an error at any time + * The "Check" task. This only executes every three seconds but has the highest + * priority so is guaranteed to get processor time. Its main function is to + * check that all the other tasks are still operational. Most tasks maintain + * a unique count that is incremented each time the task successfully completes + * its function. Should any error occur within such a task the count is + * permanently halted. The check task inspects the count of each task to ensure + * it has changed since the last time the check task executed. If all the count + * variables have changed all the tasks are still executing error free, and the + * check task toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * * The "Register Check" tasks. These tasks fill the CPU registers with known @@ -96,15 +96,15 @@ baud rate parameters passed into the comtest initialisation has no effect. */ /* Delay periods used by the check task. If no errors have been found then the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an -error has been found at any time then the toggle rate will increase to +error has been found at any time then the toggle rate will increase to mainERROR_CHECK_DELAY milliseconds. */ #define mainNO_ERROR_CHECK_DELAY ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) #define mainERROR_CHECK_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS ) -/* +/* * The tasks defined within this file - described within the comments at the - * head of this page. + * head of this page. */ static void prvRegTestTask1( void *pvParameters ); static void prvRegTestTask2( void *pvParameters ); @@ -145,12 +145,12 @@ int main( void ) /* Start the standard demo application tasks. Note that the baud rate used by the comtest tasks is set by the hardware, so the baud rate parameter passed has no effect. */ - vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); + vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); vStartIntegerMathTasks( tskIDLE_PRIORITY ); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED ); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); - vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); - vStartDynamicPriorityTasks(); + vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); + vStartDynamicPriorityTasks(); vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); vStartQueuePeekTasks(); vCreateBlockTimeTasks(); @@ -173,10 +173,10 @@ int main( void ) vCreateSuicidalTasks( mainDEATH_PRIORITY ); /* Now start the scheduler. Following this call the created tasks should - be executing. */ + be executing. */ vTaskStartScheduler(); - /* vTaskStartScheduler() will only return if an error occurs while the + /* vTaskStartScheduler() will only return if an error occurs while the idle task is being created. */ for( ;; ); @@ -190,7 +190,7 @@ portBASE_TYPE lReturn = pdPASS; static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; /* The demo tasks maintain a count that increments every cycle of the task - provided that the task has never encountered an error. This function + provided that the task has never encountered an error. This function checks the counts maintained by the tasks to ensure they are still being incremented. A count remaining at the same value between calls therefore indicates that an error has been detected. */ @@ -204,37 +204,37 @@ static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; { lReturn = pdFAIL; } - + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreBlockingQueuesStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xIsCreateTaskStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreGenericQueueTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreQueuePeekTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; @@ -319,14 +319,14 @@ volatile unsigned portBASE_TYPE uxFreeStack; uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); /* Wait until it is time to check again. The time we wait here depends - on whether an error has been detected or not. When an error is + on whether an error has been detected or not. When an error is detected the time is shortened resulting in a faster LED flash rate. */ vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); /* See if the other tasks are all ok. */ if( prvCheckOtherTasksAreStillRunning() != pdPASS ) { - /* An error occurred in one of the tasks so shorten the delay + /* An error occurred in one of the tasks so shorten the delay period - which has the effect of increasing the frequency of the LED toggle. */ xDelayPeriod = mainERROR_CHECK_DELAY; @@ -378,7 +378,7 @@ static void prvRegTestTask1( void *pvParameters ) ( void ) pvParameters; /* The first register test task as described at the top of this file. The - values used in the registers are different to those use in the second + values used in the registers are different to those use in the second register test task. Also, unlike the second register test task, this task yields between setting the register values and subsequently checking the register values. */ @@ -518,7 +518,7 @@ static void prvRegTestTask2( void *pvParameters ) /* Just to remove compiler warning. */ ( void ) pvParameters; - /* The second register test task as described at the top of this file. + /* The second register test task as described at the top of this file. Note that this task fills the registers with different values to the first register test task. */ asm volatile diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c index e57eac09d..33c512cf2 100644 --- a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c @@ -40,7 +40,7 @@ #define partstCHANNEL_1 0x01 #define partstMAX_8BIT_LED 0x07 -/* The outputs are split into two IO sections, these variables maintain the +/* The outputs are split into two IO sections, these variables maintain the current value of either section. */ static unsigned portBASE_TYPE uxCurrentOutput8Bit, uxCurrentOutput5Bit; @@ -74,7 +74,7 @@ unsigned portBASE_TYPE uxBaseAddress, *puxCurrentValue; { uxBaseAddress = XPAR_LEDS_8BIT_BASEADDR; puxCurrentValue = &uxCurrentOutput5Bit; - } + } else { uxBaseAddress = XPAR_LEDS_POSITIONS_BASEADDR; @@ -115,7 +115,7 @@ unsigned portBASE_TYPE uxBaseAddress, *puxCurrentValue; uxBaseAddress = XPAR_LEDS_8BIT_BASEADDR; puxCurrentValue = &uxCurrentOutput5Bit; - } + } else { uxBaseAddress = XPAR_LEDS_POSITIONS_BASEADDR; diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c index 6a495f10f..704a4060c 100644 --- a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c @@ -25,7 +25,7 @@ */ -/* +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART */ @@ -46,8 +46,8 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /* Structure that maintains information on the UART being used. */ static XUartLite xUART; @@ -82,13 +82,13 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port if( xPortInstallInterruptHandler( XPAR_XPS_INTC_0_RS232_UART_1_INTERRUPT_INTR, ( XInterruptHandler )vSerialISR, (void *)&xUART ) == pdPASS ) { - /* xPortInstallInterruptHandler() could fail if - vPortSetupInterruptController() has not been called prior to this + /* xPortInstallInterruptHandler() could fail if + vPortSetupInterruptController() has not been called prior to this function. */ XUartLite_EnableInterrupt( &xUART ); } } - + /* There is only one port so the handle is not used. */ return ( xComPortHandle ) 0; } @@ -131,17 +131,17 @@ portBASE_TYPE xReturn = pdTRUE; } } /* Otherwise, if there is data already in the queue we should add the - new data to the back of the queue to ensure the sequencing is + new data to the back of the queue to ensure the sequencing is maintained. */ else if( uxQueueMessagesWaiting( xCharsForTx ) ) { if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) { xReturn = pdFAIL; - } + } } /* If the UART FIFO is not full and there is no data already in the - queue we can write directly to the FIFO without disrupting the + queue we can write directly to the FIFO without disrupting the sequence. */ else { @@ -179,13 +179,13 @@ char cChar; if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) { /* A character is available - place it in the queue of received - characters. This might wake a task that was blocked waiting for + characters. This might wake a task that was blocked waiting for data. */ cChar = ( char ) XIo_In32( XPAR_RS232_UART_1_BASEADDR + XUL_RX_FIFO_OFFSET ); xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); lDidSomething = pdTRUE; } - + if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) { /* There is space in the FIFO - if there are any characters queue for @@ -195,7 +195,7 @@ char cChar; { XIo_Out32( XPAR_RS232_UART_1_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); lDidSomething = pdTRUE; - } + } } } while( lDidSomething == pdTRUE ); diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 new file mode 100644 index 000000000..597527ed7 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 @@ -0,0 +1,474 @@ + +# ############################################################################## +# Created by Base System Builder Wizard for Xilinx EDK 11.1 Build EDK_L.29.1 +# Sat Jun 13 13:14:11 2009 +# Target Board: Xilinx Virtex 5 ML507 Evaluation Platform Rev A +# Family: virtex5 +# Device: xc5vfx70t +# Package: ff1136 +# Speed Grade: -1 +# Processor number: 1 +# Processor 1: ppc440_0 +# Processor clock frequency: 125.0 +# Bus clock frequency: 125.0 +# Debug Interface: FPGA JTAG +# ############################################################################## + PARAMETER VERSION = 2.1.0 + + + PORT fpga_0_RS232_Uart_1_RX_pin = fpga_0_RS232_Uart_1_RX_pin, DIR = I + PORT fpga_0_RS232_Uart_1_TX_pin = fpga_0_RS232_Uart_1_TX_pin, DIR = O + PORT fpga_0_LEDs_8Bit_GPIO_IO_pin = fpga_0_LEDs_8Bit_GPIO_IO_pin, DIR = IO, VEC = [0:7] + PORT fpga_0_LEDs_Positions_GPIO_IO_pin = fpga_0_LEDs_Positions_GPIO_IO_pin, DIR = IO, VEC = [0:4] + PORT fpga_0_Push_Buttons_5Bit_GPIO_IO_pin = fpga_0_Push_Buttons_5Bit_GPIO_IO_pin, DIR = IO, VEC = [0:4] + PORT fpga_0_DIP_Switches_8Bit_GPIO_IO_pin = fpga_0_DIP_Switches_8Bit_GPIO_IO_pin, DIR = IO, VEC = [0:7] + PORT fpga_0_IIC_EEPROM_Sda_pin = fpga_0_IIC_EEPROM_Sda_pin, DIR = IO + PORT fpga_0_IIC_EEPROM_Scl_pin = fpga_0_IIC_EEPROM_Scl_pin, DIR = IO + PORT fpga_0_SRAM_Mem_A_pin = fpga_0_SRAM_Mem_A_pin_vslice_7_30_concat, DIR = O, VEC = [7:30] + PORT fpga_0_SRAM_Mem_CEN_pin = fpga_0_SRAM_Mem_CEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_OEN_pin = fpga_0_SRAM_Mem_OEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_WEN_pin = fpga_0_SRAM_Mem_WEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_BEN_pin = fpga_0_SRAM_Mem_BEN_pin, DIR = O, VEC = [0:3] + PORT fpga_0_SRAM_Mem_ADV_LDN_pin = fpga_0_SRAM_Mem_ADV_LDN_pin, DIR = O + PORT fpga_0_SRAM_Mem_DQ_pin = fpga_0_SRAM_Mem_DQ_pin, DIR = IO, VEC = [0:31] + PORT fpga_0_SRAM_ZBT_CLK_OUT_pin = SRAM_CLK_OUT_s, DIR = O + PORT fpga_0_SRAM_ZBT_CLK_FB_pin = SRAM_CLK_FB_s, DIR = I, SIGIS = CLK, CLK_FREQ = 125000000 + PORT fpga_0_PCIe_Bridge_RXN_pin = fpga_0_PCIe_Bridge_RXN_pin, DIR = I + PORT fpga_0_PCIe_Bridge_RXP_pin = fpga_0_PCIe_Bridge_RXP_pin, DIR = I + PORT fpga_0_PCIe_Bridge_TXN_pin = fpga_0_PCIe_Bridge_TXN_pin, DIR = O + PORT fpga_0_PCIe_Bridge_TXP_pin = fpga_0_PCIe_Bridge_TXP_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_clk_pin = fpga_0_Ethernet_MAC_PHY_tx_clk_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_clk_pin = fpga_0_Ethernet_MAC_PHY_rx_clk_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_crs_pin = fpga_0_Ethernet_MAC_PHY_crs_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_dv_pin = fpga_0_Ethernet_MAC_PHY_dv_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_data_pin = fpga_0_Ethernet_MAC_PHY_rx_data_pin, DIR = I, VEC = [3:0] + PORT fpga_0_Ethernet_MAC_PHY_col_pin = fpga_0_Ethernet_MAC_PHY_col_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_er_pin = fpga_0_Ethernet_MAC_PHY_rx_er_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rst_n_pin = fpga_0_Ethernet_MAC_PHY_rst_n_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_en_pin = fpga_0_Ethernet_MAC_PHY_tx_en_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_data_pin = fpga_0_Ethernet_MAC_PHY_tx_data_pin, DIR = O, VEC = [3:0] + PORT fpga_0_Ethernet_MAC_MDINT_pin = fpga_0_Ethernet_MAC_MDINT_pin, DIR = I, SIGIS = INTERRUPT, SENSITIVITY = LEVEL_LOW, INTERRUPT_PRIORITY = MEDIUM + PORT fpga_0_DDR2_SDRAM_DDR2_DQ_pin = fpga_0_DDR2_SDRAM_DDR2_DQ_pin, DIR = IO, VEC = [63:0] + PORT fpga_0_DDR2_SDRAM_DDR2_DQS_pin = fpga_0_DDR2_SDRAM_DDR2_DQS_pin, DIR = IO, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin = fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin, DIR = IO, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_A_pin = fpga_0_DDR2_SDRAM_DDR2_A_pin, DIR = O, VEC = [12:0] + PORT fpga_0_DDR2_SDRAM_DDR2_BA_pin = fpga_0_DDR2_SDRAM_DDR2_BA_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin = fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin = fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_WE_N_pin = fpga_0_DDR2_SDRAM_DDR2_WE_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_CS_N_pin = fpga_0_DDR2_SDRAM_DDR2_CS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_ODT_pin = fpga_0_DDR2_SDRAM_DDR2_ODT_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CKE_pin = fpga_0_DDR2_SDRAM_DDR2_CKE_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_DM_pin = fpga_0_DDR2_SDRAM_DDR2_DM_pin, DIR = O, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CK_pin = fpga_0_DDR2_SDRAM_DDR2_CK_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CK_N_pin = fpga_0_DDR2_SDRAM_DDR2_CK_N_pin, DIR = O, VEC = [1:0] + PORT fpga_0_SysACE_CompactFlash_SysACE_MPA_pin = fpga_0_SysACE_CompactFlash_SysACE_MPA_pin, DIR = O, VEC = [6:0] + PORT fpga_0_SysACE_CompactFlash_SysACE_CLK_pin = fpga_0_SysACE_CompactFlash_SysACE_CLK_pin, DIR = I + PORT fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin, DIR = I + PORT fpga_0_SysACE_CompactFlash_SysACE_CEN_pin = fpga_0_SysACE_CompactFlash_SysACE_CEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_OEN_pin = fpga_0_SysACE_CompactFlash_SysACE_OEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_WEN_pin = fpga_0_SysACE_CompactFlash_SysACE_WEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_MPD_pin = fpga_0_SysACE_CompactFlash_SysACE_MPD_pin, DIR = IO, VEC = [15:0] + PORT fpga_0_clk_1_sys_clk_pin = dcm_clk_s, DIR = I, SIGIS = CLK, CLK_FREQ = 100000000 + PORT fpga_0_rst_1_sys_rst_pin = sys_rst_s, DIR = I, SIGIS = RST, RST_POLARITY = 0 + PORT fpga_0_PCIe_Diff_Clk_IBUF_DS_P_pin = PCIe_Diff_Clk, DIR = I, DIFFERENTIAL_POLARITY = P, SIGIS = CLK + PORT fpga_0_PCIe_Diff_Clk_IBUF_DS_N_pin = PCIe_Diff_Clk, DIR = I, DIFFERENTIAL_POLARITY = N, SIGIS = CLK + + +BEGIN ppc440_virtex5 + PARAMETER INSTANCE = ppc440_0 + PARAMETER C_IDCR_BASEADDR = 0b0000000000 + PARAMETER C_IDCR_HIGHADDR = 0b0011111111 + PARAMETER C_APU_CONTROL = 0b00000010000000001 + PARAMETER C_PPC440MC_ROW_CONFLICT_MASK = 0x003FFE00 + PARAMETER C_PPC440MC_BANK_CONFLICT_MASK = 0x00C00000 + PARAMETER C_PPC440MC_CONTROL = 0xF810008F + PARAMETER C_SPLB0_USE_MPLB_ADDR = 1 + PARAMETER C_SPLB0_NUM_MPLB_ADDR_RNG = 1 + PARAMETER C_SPLB1_NUM_MPLB_ADDR_RNG = 0 + PARAMETER HW_VER = 1.01.a + PARAMETER C_SPLB0_RNG0_MPLB_BASEADDR = 0x80000000 + PARAMETER C_SPLB0_RNG0_MPLB_HIGHADDR = 0xffffffff + PARAMETER C_SPLB0_RNG_MC_BASEADDR = 0x00000000 + PARAMETER C_SPLB0_RNG_MC_HIGHADDR = 0x0fffffff + BUS_INTERFACE MPLB = plb_v46_0 + BUS_INTERFACE SPLB0 = ppc440_0_SPLB0 + BUS_INTERFACE PPC440MC = ppc440_0_PPC440MC + BUS_INTERFACE MFCB = ppc440_0_fcb_v20 + BUS_INTERFACE JTAGPPC = ppc440_0_jtagppc_bus + BUS_INTERFACE RESETPPC = ppc_reset_bus + PORT CPMC440CLK = clk_125_0000MHzPLL0 + PORT CPMINTERCONNECTCLK = clk_125_0000MHzPLL0 + PORT CPMINTERCONNECTCLKNTO1 = net_vcc + PORT EICC440EXTIRQ = ppc440_0_EICC440EXTIRQ + PORT CPMMCCLK = clk_125_0000MHzPLL0_ADJUST + PORT CPMPPCMPLBCLK = clk_125_0000MHzPLL0_ADJUST + PORT CPMPPCS0PLBCLK = clk_125_0000MHzPLL0_ADJUST +END + +BEGIN plb_v46 + PARAMETER INSTANCE = plb_v46_0 + PARAMETER C_DCR_INTFCE = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.04.a + PORT PLB_Clk = clk_125_0000MHzPLL0_ADJUST + PORT SYS_Rst = sys_bus_reset +END + +BEGIN xps_bram_if_cntlr + PARAMETER INSTANCE = xps_bram_if_cntlr_1 + PARAMETER C_SPLB_NATIVE_DWIDTH = 64 + PARAMETER C_SPLB_SUPPORT_BURSTS = 1 + PARAMETER C_SPLB_P2P = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.00.b + PARAMETER C_BASEADDR = 0xffffe000 + PARAMETER C_HIGHADDR = 0xffffffff + BUS_INTERFACE SPLB = plb_v46_0 + BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port +END + +BEGIN bram_block + PARAMETER INSTANCE = xps_bram_if_cntlr_1_bram + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.00.a + BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port +END + +BEGIN xps_uartlite + PARAMETER INSTANCE = RS232_Uart_1 + PARAMETER C_FAMILY = virtex5 + PARAMETER C_BAUDRATE = 9600 + PARAMETER C_DATA_BITS = 8 + PARAMETER C_USE_PARITY = 0 + PARAMETER C_ODD_PARITY = 0 + PARAMETER HW_VER = 1.01.a + PARAMETER C_BASEADDR = 0x84000000 + PARAMETER C_HIGHADDR = 0x8400ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT RX = fpga_0_RS232_Uart_1_RX_pin + PORT TX = fpga_0_RS232_Uart_1_TX_pin + PORT Interrupt = RS232_Uart_1_Interrupt +END + +BEGIN xps_gpio + PARAMETER INSTANCE = LEDs_8Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 0 + PARAMETER C_GPIO_WIDTH = 8 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81440000 + PARAMETER C_HIGHADDR = 0x8144ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_LEDs_8Bit_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = LEDs_Positions + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 0 + PARAMETER C_GPIO_WIDTH = 5 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81420000 + PARAMETER C_HIGHADDR = 0x8142ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_LEDs_Positions_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = Push_Buttons_5Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 1 + PARAMETER C_GPIO_WIDTH = 5 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81400000 + PARAMETER C_HIGHADDR = 0x8140ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_Push_Buttons_5Bit_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = DIP_Switches_8Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 1 + PARAMETER C_GPIO_WIDTH = 8 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81460000 + PARAMETER C_HIGHADDR = 0x8146ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_DIP_Switches_8Bit_GPIO_IO_pin +END + +BEGIN xps_iic + PARAMETER INSTANCE = IIC_EEPROM + PARAMETER C_IIC_FREQ = 100000 + PARAMETER C_TEN_BIT_ADR = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 2.01.a + PARAMETER C_BASEADDR = 0x81600000 + PARAMETER C_HIGHADDR = 0x8160ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT Sda = fpga_0_IIC_EEPROM_Sda_pin + PORT Scl = fpga_0_IIC_EEPROM_Scl_pin +END + +BEGIN xps_mch_emc + PARAMETER INSTANCE = SRAM + PARAMETER C_FAMILY = virtex5 + PARAMETER C_NUM_BANKS_MEM = 1 + PARAMETER C_NUM_CHANNELS = 0 + PARAMETER C_MEM0_WIDTH = 32 + PARAMETER C_MAX_MEM_WIDTH = 32 + PARAMETER C_INCLUDE_DATAWIDTH_MATCHING_0 = 0 + PARAMETER C_SYNCH_MEM_0 = 1 + PARAMETER C_TCEDV_PS_MEM_0 = 0 + PARAMETER C_TAVDV_PS_MEM_0 = 0 + PARAMETER C_THZCE_PS_MEM_0 = 0 + PARAMETER C_THZOE_PS_MEM_0 = 0 + PARAMETER C_TWC_PS_MEM_0 = 0 + PARAMETER C_TWP_PS_MEM_0 = 0 + PARAMETER C_TLZWE_PS_MEM_0 = 0 + PARAMETER HW_VER = 3.00.a + PARAMETER C_MEM0_BASEADDR = 0xf8000000 + PARAMETER C_MEM0_HIGHADDR = 0xf80fffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT RdClk = clk_125_0000MHzPLL0_ADJUST + PORT Mem_A = 0b0000000 & fpga_0_SRAM_Mem_A_pin_vslice_7_30_concat & 0b0 + PORT Mem_CEN = fpga_0_SRAM_Mem_CEN_pin + PORT Mem_OEN = fpga_0_SRAM_Mem_OEN_pin + PORT Mem_WEN = fpga_0_SRAM_Mem_WEN_pin + PORT Mem_BEN = fpga_0_SRAM_Mem_BEN_pin + PORT Mem_ADV_LDN = fpga_0_SRAM_Mem_ADV_LDN_pin + PORT Mem_DQ = fpga_0_SRAM_Mem_DQ_pin +END + +BEGIN plbv46_pcie + PARAMETER INSTANCE = PCIe_Bridge + PARAMETER C_FAMILY = virtex5 + PARAMETER C_IPIFBAR_NUM = 2 + PARAMETER C_PCIBAR_NUM = 1 + PARAMETER C_DEVICE_ID = 0x0505 + PARAMETER C_VENDOR_ID = 0x10EE + PARAMETER C_CLASS_CODE = 0x058000 + PARAMETER C_REV_ID = 0x00 + PARAMETER C_SUBSYSTEM_ID = 0x0000 + PARAMETER C_SUBSYSTEM_VENDOR_ID = 0x0000 + PARAMETER C_COMP_TIMEOUT = 1 + PARAMETER C_IPIFBAR2PCIBAR_0 = 0x00000000 + PARAMETER C_IPIFBAR2PCIBAR_1 = 0x00000000 + PARAMETER C_PCIBAR2IPIFBAR_0 = 0xf8000000 + PARAMETER C_PCIBAR2IPIFBAR_1 = 0x00000000 + PARAMETER C_PCIBAR_LEN_0 = 20 + PARAMETER C_PCIBAR_LEN_1 = 28 + PARAMETER C_BOARD = ml507 + PARAMETER HW_VER = 3.00.b + PARAMETER C_BASEADDR = 0x85c00000 + PARAMETER C_HIGHADDR = 0x85c0ffff + PARAMETER C_IPIFBAR_0 = 0xc0000000 + PARAMETER C_IPIFBAR_HIGHADDR_0 = 0xdfffffff + PARAMETER C_IPIFBAR_1 = 0xe0000000 + PARAMETER C_IPIFBAR_HIGHADDR_1 = 0xefffffff + BUS_INTERFACE SPLB = plb_v46_0 + BUS_INTERFACE MPLB = ppc440_0_SPLB0 + PORT PERSTN = net_vcc + PORT REFCLK = PCIe_Diff_Clk + PORT RXN = fpga_0_PCIe_Bridge_RXN_pin + PORT RXP = fpga_0_PCIe_Bridge_RXP_pin + PORT TXN = fpga_0_PCIe_Bridge_TXN_pin + PORT TXP = fpga_0_PCIe_Bridge_TXP_pin + PORT MSI_request = net_gnd +END + +BEGIN plb_v46 + PARAMETER INSTANCE = ppc440_0_SPLB0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.04.a + PORT PLB_Clk = clk_125_0000MHzPLL0_ADJUST + PORT SYS_Rst = sys_bus_reset +END + +BEGIN xps_ethernetlite + PARAMETER INSTANCE = Ethernet_MAC + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 2.01.a + PARAMETER C_BASEADDR = 0x81000000 + PARAMETER C_HIGHADDR = 0x8100ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT PHY_tx_clk = fpga_0_Ethernet_MAC_PHY_tx_clk_pin + PORT PHY_rx_clk = fpga_0_Ethernet_MAC_PHY_rx_clk_pin + PORT PHY_crs = fpga_0_Ethernet_MAC_PHY_crs_pin + PORT PHY_dv = fpga_0_Ethernet_MAC_PHY_dv_pin + PORT PHY_rx_data = fpga_0_Ethernet_MAC_PHY_rx_data_pin + PORT PHY_col = fpga_0_Ethernet_MAC_PHY_col_pin + PORT PHY_rx_er = fpga_0_Ethernet_MAC_PHY_rx_er_pin + PORT PHY_rst_n = fpga_0_Ethernet_MAC_PHY_rst_n_pin + PORT PHY_tx_en = fpga_0_Ethernet_MAC_PHY_tx_en_pin + PORT PHY_tx_data = fpga_0_Ethernet_MAC_PHY_tx_data_pin +END + +BEGIN ppc440mc_ddr2 + PARAMETER INSTANCE = DDR2_SDRAM + PARAMETER C_DDR_BAWIDTH = 2 + PARAMETER C_NUM_CLK_PAIRS = 2 + PARAMETER C_DDR_DWIDTH = 64 + PARAMETER C_DDR_CAWIDTH = 10 + PARAMETER C_NUM_RANKS_MEM = 1 + PARAMETER C_CS_BITS = 0 + PARAMETER C_DDR_DM_WIDTH = 8 + PARAMETER C_DQ_BITS = 8 + PARAMETER C_DDR2_ODT_WIDTH = 2 + PARAMETER C_DDR2_ADDT_LAT = 0 + PARAMETER C_INCLUDE_ECC_SUPPORT = 0 + PARAMETER C_DDR2_ODT_SETTING = 1 + PARAMETER C_DQS_BITS = 3 + PARAMETER C_DDR_DQS_WIDTH = 8 + PARAMETER C_DDR_RAWIDTH = 13 + PARAMETER C_DDR_BURST_LENGTH = 4 + PARAMETER C_DDR_CAS_LAT = 4 + PARAMETER C_REG_DIMM = 0 + PARAMETER C_MIB_MC_CLOCK_RATIO = 1 + PARAMETER C_DDR_TREFI = 3900 + PARAMETER C_DDR_TRAS = 40000 + PARAMETER C_DDR_TRCD = 15000 + PARAMETER C_DDR_TRFC = 75000 + PARAMETER C_DDR_TRP = 15000 + PARAMETER C_DDR_TRTP = 7500 + PARAMETER C_DDR_TWR = 15000 + PARAMETER C_DDR_TWTR = 7500 + PARAMETER C_MC_MIBCLK_PERIOD_PS = 8000 + PARAMETER C_IDEL_HIGH_PERF = TRUE + PARAMETER C_NUM_IDELAYCTRL = 3 + PARAMETER C_IDELAYCTRL_LOC = IDELAYCTRL_X0Y6-IDELAYCTRL_X0Y2-IDELAYCTRL_X0Y1 + PARAMETER C_DQS_IO_COL = 0b000000000000000000 + PARAMETER C_DQ_IO_MS = 0b000000000111010100111101000011110001111000101110110000111100000110111100 + PARAMETER HW_VER = 2.00.a + PARAMETER C_MEM_BASEADDR = 0x00000000 + PARAMETER C_MEM_HIGHADDR = 0x0fffffff + BUS_INTERFACE PPC440MC = ppc440_0_PPC440MC + PORT mc_mibclk = clk_125_0000MHzPLL0_ADJUST + PORT mi_mcclk90 = clk_125_0000MHz90PLL0_ADJUST + PORT mi_mcreset = sys_bus_reset + PORT mi_mcclkdiv2 = clk_62_5000MHzPLL0_ADJUST + PORT mi_mcclk_200 = clk_200_0000MHz + PORT DDR2_DQ = fpga_0_DDR2_SDRAM_DDR2_DQ_pin + PORT DDR2_DQS = fpga_0_DDR2_SDRAM_DDR2_DQS_pin + PORT DDR2_DQS_N = fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin + PORT DDR2_A = fpga_0_DDR2_SDRAM_DDR2_A_pin + PORT DDR2_BA = fpga_0_DDR2_SDRAM_DDR2_BA_pin + PORT DDR2_RAS_N = fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin + PORT DDR2_CAS_N = fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin + PORT DDR2_WE_N = fpga_0_DDR2_SDRAM_DDR2_WE_N_pin + PORT DDR2_CS_N = fpga_0_DDR2_SDRAM_DDR2_CS_N_pin + PORT DDR2_ODT = fpga_0_DDR2_SDRAM_DDR2_ODT_pin + PORT DDR2_CKE = fpga_0_DDR2_SDRAM_DDR2_CKE_pin + PORT DDR2_DM = fpga_0_DDR2_SDRAM_DDR2_DM_pin + PORT DDR2_CK = fpga_0_DDR2_SDRAM_DDR2_CK_pin + PORT DDR2_CK_N = fpga_0_DDR2_SDRAM_DDR2_CK_N_pin +END + +BEGIN xps_sysace + PARAMETER INSTANCE = SysACE_CompactFlash + PARAMETER C_MEM_WIDTH = 16 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.01.a + PARAMETER C_BASEADDR = 0x83600000 + PARAMETER C_HIGHADDR = 0x8360ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT SysACE_MPA = fpga_0_SysACE_CompactFlash_SysACE_MPA_pin + PORT SysACE_CLK = fpga_0_SysACE_CompactFlash_SysACE_CLK_pin + PORT SysACE_MPIRQ = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin + PORT SysACE_CEN = fpga_0_SysACE_CompactFlash_SysACE_CEN_pin + PORT SysACE_OEN = fpga_0_SysACE_CompactFlash_SysACE_OEN_pin + PORT SysACE_WEN = fpga_0_SysACE_CompactFlash_SysACE_WEN_pin + PORT SysACE_MPD = fpga_0_SysACE_CompactFlash_SysACE_MPD_pin +END + +BEGIN fcb_v20 + PARAMETER INSTANCE = ppc440_0_fcb_v20 + PARAMETER HW_VER = 1.00.a + PORT FCB_CLK = clk_125_0000MHzPLL0_ADJUST + PORT SYS_RST = sys_bus_reset +END + +BEGIN apu_fpu_virtex5 + PARAMETER INSTANCE = ppc440_0_apu_fpu_virtex5 + PARAMETER C_DOUBLE_PRECISION = 0 + PARAMETER HW_VER = 1.01.a + BUS_INTERFACE SFCB2 = ppc440_0_fcb_v20 +END + +BEGIN clock_generator + PARAMETER INSTANCE = clock_generator_0 + PARAMETER C_CLKIN_FREQ = 100000000 + PARAMETER C_CLKFBIN_FREQ = 125000000 + PARAMETER C_CLKOUT0_FREQ = 125000000 + PARAMETER C_CLKOUT0_PHASE = 90 + PARAMETER C_CLKOUT0_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT0_BUF = TRUE + PARAMETER C_CLKOUT1_FREQ = 125000000 + PARAMETER C_CLKOUT1_PHASE = 0 + PARAMETER C_CLKOUT1_GROUP = PLL0 + PARAMETER C_CLKOUT1_BUF = TRUE + PARAMETER C_CLKOUT2_FREQ = 125000000 + PARAMETER C_CLKOUT2_PHASE = 0 + PARAMETER C_CLKOUT2_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT2_BUF = TRUE + PARAMETER C_CLKOUT3_FREQ = 200000000 + PARAMETER C_CLKOUT3_PHASE = 0 + PARAMETER C_CLKOUT3_GROUP = NONE + PARAMETER C_CLKOUT3_BUF = TRUE + PARAMETER C_CLKOUT4_FREQ = 62500000 + PARAMETER C_CLKOUT4_PHASE = 0 + PARAMETER C_CLKOUT4_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT4_BUF = TRUE + PARAMETER C_CLKFBOUT_FREQ = 125000000 + PARAMETER C_CLKFBOUT_BUF = TRUE + PARAMETER HW_VER = 3.00.a + PORT CLKIN = dcm_clk_s + PORT CLKFBIN = SRAM_CLK_FB_s + PORT CLKOUT0 = clk_125_0000MHz90PLL0_ADJUST + PORT CLKOUT1 = clk_125_0000MHzPLL0 + PORT CLKOUT2 = clk_125_0000MHzPLL0_ADJUST + PORT CLKOUT3 = clk_200_0000MHz + PORT CLKOUT4 = clk_62_5000MHzPLL0_ADJUST + PORT CLKFBOUT = SRAM_CLK_OUT_s + PORT RST = net_gnd + PORT LOCKED = Dcm_all_locked +END + +BEGIN jtagppc_cntlr + PARAMETER INSTANCE = jtagppc_cntlr_inst + PARAMETER HW_VER = 2.01.c + BUS_INTERFACE JTAGPPC0 = ppc440_0_jtagppc_bus +END + +BEGIN proc_sys_reset + PARAMETER INSTANCE = proc_sys_reset_0 + PARAMETER C_EXT_RESET_HIGH = 0 + PARAMETER HW_VER = 2.00.a + BUS_INTERFACE RESETPPC0 = ppc_reset_bus + PORT Slowest_sync_clk = clk_125_0000MHzPLL0_ADJUST + PORT Ext_Reset_In = sys_rst_s + PORT Dcm_locked = Dcm_all_locked + PORT Bus_Struct_Reset = sys_bus_reset + PORT Peripheral_Reset = sys_periph_reset +END + +BEGIN xps_intc + PARAMETER INSTANCE = xps_intc_0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81800000 + PARAMETER C_HIGHADDR = 0x8180ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT Intr = fpga_0_Ethernet_MAC_MDINT_pin&RS232_Uart_1_Interrupt + PORT Irq = ppc440_0_EICC440EXTIRQ +END + diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_mss.11.1 b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_mss.11.1 new file mode 100644 index 000000000..aa363ea29 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_mss.11.1 @@ -0,0 +1,131 @@ + + PARAMETER VERSION = 2.2.0 + + +BEGIN OS + PARAMETER OS_NAME = standalone + PARAMETER OS_VER = 2.00.a + PARAMETER PROC_INSTANCE = ppc440_0 + PARAMETER STDIN = RS232_Uart_1 + PARAMETER STDOUT = RS232_Uart_1 +END + + +BEGIN PROCESSOR + PARAMETER DRIVER_NAME = cpu_ppc440 + PARAMETER DRIVER_VER = 1.00.b + PARAMETER HW_INSTANCE = ppc440_0 + PARAMETER COMPILER = powerpc-eabi-gcc + PARAMETER ARCHIVER = powerpc-eabi-ar +END + + +BEGIN DRIVER + PARAMETER DRIVER_NAME = bram + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1_bram +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = uartlite + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = RS232_Uart_1 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = LEDs_8Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = LEDs_Positions +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = Push_Buttons_5Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = DIP_Switches_8Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = iic + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = IIC_EEPROM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = emc + PARAMETER DRIVER_VER = 2.00.a + PARAMETER HW_INSTANCE = SRAM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = pcie + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = PCIe_Bridge +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = emaclite + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = Ethernet_MAC +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = memcon + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = DDR2_SDRAM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = sysace + PARAMETER DRIVER_VER = 1.12.a + PARAMETER HW_INSTANCE = SysACE_CompactFlash +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = apu_fpu_virtex5 + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = ppc440_0_apu_fpu_virtex5 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = clock_generator_0 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = jtagppc_cntlr_inst +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = proc_sys_reset_0 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = intc + PARAMETER DRIVER_VER = 1.11.a + PARAMETER HW_INSTANCE = xps_intc_0 +END + + diff --git a/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 new file mode 100644 index 000000000..8f5b60051 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_SP_FPU_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 @@ -0,0 +1,69 @@ +#Please do not modify this file by hand +XmpVersion: 11.1 +VerMgmt: 11.1 +IntStyle: default +MHS File: system.mhs +MSS File: system.mss +Architecture: virtex5 +Device: xc5vfx70t +Package: ff1136 +SpeedGrade: -1 +UserCmd1: +UserCmd1Type: 0 +UserCmd2: +UserCmd2Type: 0 +GenSimTB: 0 +SdkExportBmmBit: 1 +SdkExportDir: SDK/SDK_Export +InsertNoPads: 0 +WarnForEAArch: 1 +HdlLang: VHDL +SimModel: BEHAVIORAL +UcfFile: data/system.ucf +EnableParTimingError: 1 +ShowLicenseDialog: 1 +Processor: ppc440_0 +BootLoop: 1 +XmdStub: 0 +SwProj: RTOSDemo +Processor: ppc440_0 +Executable: RTOSDemo/executable.elf +Source: RTOSDemo/../../Common/Minimal/BlockQ.c +Source: RTOSDemo/../../Common/Minimal/blocktim.c +Source: RTOSDemo/../../Common/Minimal/comtest.c +Source: RTOSDemo/../../Common/Minimal/countsem.c +Source: RTOSDemo/../../Common/Minimal/death.c +Source: RTOSDemo/../../Common/Minimal/dynamic.c +Source: RTOSDemo/../../Common/Minimal/flash.c +Source: RTOSDemo/../../Common/Minimal/GenQTest.c +Source: RTOSDemo/../../Common/Minimal/integer.c +Source: RTOSDemo/../../Common/Minimal/QPeek.c +Source: RTOSDemo/../../Common/Minimal/recmutex.c +Source: RTOSDemo/../../Common/Minimal/semtest.c +Source: RTOSDemo/../../../Source/tasks.c +Source: RTOSDemo/../../../Source/list.c +Source: RTOSDemo/../../../Source/queue.c +Source: RTOSDemo/../../../Source/croutine.c +Source: RTOSDemo/../../../Source/portable/GCC/PPC440_Xilinx/portasm.S +Source: RTOSDemo/../../../Source/portable/GCC/PPC440_Xilinx/port.c +Source: RTOSDemo/../../../Source/portable/MemMang/heap_2.c +Source: RTOSDemo/flop/flop-reg-test.c +Source: RTOSDemo/flop/flop.c +Source: RTOSDemo/partest/partest.c +Source: RTOSDemo/serial/serial.c +Source: RTOSDemo/main.c +DefaultInit: EXECUTABLE +InitBram: 0 +Active: 1 +CompilerOptLevel: 0 +GlobPtrOpt: 0 +DebugSym: 1 +ProfileFlag: 0 +SearchIncl: ../../Source/include ../../Source/portable/GCC/PPC440_Xilinx ../Common/include ./RTOSDemo ./RTOSDemo/flop +ProgStart: +StackSize: +HeapSize: +LinkerScript: RTOSDemo/RTOSDemo_linker_script.ld +ProgCCFlags: -D GCC_PPC440 -mregnames +CompileInXps: 1 +NonXpsApp: 0 diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h index e7734800a..47e231bc7 100644 --- a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -60,6 +60,9 @@ #define configUSE_FPU 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 4 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c index 071e3922b..68551a1eb 100644 --- a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop-reg-test.c @@ -27,36 +27,36 @@ /* * Tests the floating point context save and restore mechanism. * - * Two tasks are created - each of which is allocated a buffer of + * Two tasks are created - each of which is allocated a buffer of * portNO_FLOP_REGISTERS_TO_SAVE 32bit variables into which the flop context * of the task is saved when the task is switched out, and from which the - * flop context of the task is restored when the task is switch in. Prior to - * the tasks being created each position in the two buffers is filled with a + * flop context of the task is restored when the task is switch in. Prior to + * the tasks being created each position in the two buffers is filled with a * unique value - this way the flop context of each task is different. * * The two test tasks never block so are always in either the Running or * Ready state. They execute at the lowest priority so will get pre-empted * regularly, although the yield frequently so will not get much execution - * time. The lack of execution time is not a problem as its only the + * time. The lack of execution time is not a problem as its only the * switching in and out that is being tested. * - * Whenever a task is moved from the Ready to the Running state its flop + * Whenever a task is moved from the Ready to the Running state its flop * context will be loaded from the buffer, but while the task is in the * Running state the buffer is not used and can contain any value - in this - * case and for test purposes the task itself clears the buffer to zero. + * case and for test purposes the task itself clears the buffer to zero. * The next time the task is moved out of the Running state into the - * Ready state the flop context will once more get saved to the buffer - + * Ready state the flop context will once more get saved to the buffer - * overwriting the zeros. * * Therefore whenever the task is not in the Running state its buffer contains * the most recent values of its floating point registers - the zeroing out - * of the buffer while the task was executing being used to ensure the values + * of the buffer while the task was executing being used to ensure the values * the buffer contains are not stale. * * When neither test task is in the Running state the buffers should contain * the unique values allocated before the tasks were created. If so then * the floating point context has been maintained. This check is performed - * by the 'check' task (defined in main.c) by calling + * by the 'check' task (defined in main.c) by calling * xAreFlopRegisterTestsStillRunning(). * * The test tasks also increment a value each time they execute. @@ -84,7 +84,7 @@ static void vFlopTest2( void *pvParameters ); /*-----------------------------------------------------------*/ -/* Buffers into which the flop registers will be saved. There is a buffer for +/* Buffers into which the flop registers will be saved. There is a buffer for both tasks. */ static volatile unsigned long ulFlopRegisters[ flopNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ]; @@ -99,7 +99,7 @@ void vStartFlopRegTests( void ) TaskHandle_t xTaskJustCreated; unsigned portBASE_TYPE x, y, z = flopSTART_VALUE; - /* Fill the arrays into which the flop registers are to be saved with + /* Fill the arrays into which the flop registers are to be saved with known values. These are the values that will be written to the flop registers when the tasks start, and as the tasks do not perform any flop operations the values should never change. Each position in the @@ -118,7 +118,7 @@ unsigned portBASE_TYPE x, y, z = flopSTART_VALUE; /* Create the first task. */ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated ); - /* The task tag value is a value that can be associated with a task, but + /* The task tag value is a value that can be associated with a task, but is not used by the scheduler itself. Its use is down to the application so it makes a convenient place in this case to store the pointer to the buffer into which the flop context of the task will be stored. The first created @@ -146,7 +146,7 @@ static void vFlopTest1( void *pvParameters ) memset( ( void * ) ulFlopRegisters[ 0 ], 0x00, ( portNO_FLOP_REGISTERS_TO_SAVE * sizeof( unsigned portBASE_TYPE ) ) ); portEXIT_CRITICAL(); - /* We don't have to do anything other than indicate that we are + /* We don't have to do anything other than indicate that we are still running. */ ulFlop1CycleCount++; taskYIELD(); @@ -168,7 +168,7 @@ static void vFlopTest2( void *pvParameters ) memset( ( void * ) ulFlopRegisters[ 1 ], 0x00, ( portNO_FLOP_REGISTERS_TO_SAVE * sizeof( unsigned portBASE_TYPE ) ) ); portEXIT_CRITICAL(); - /* We don't have to do anything other than indicate that we are + /* We don't have to do anything other than indicate that we are still running. */ ulFlop2CycleCount++; taskYIELD(); @@ -183,7 +183,7 @@ unsigned portBASE_TYPE x, y, z = flopSTART_VALUE; static unsigned long ulLastFlop1CycleCount = 0, ulLastFlop2CycleCount = 0; /* Called from the 'check' task. - + The flop tasks cannot be currently running, check their saved registers are as expected. The tests tasks do not perform any flop operations so their registers should be as per their initial setting. */ diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c index b7b610c67..4fd4215f4 100644 --- a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/flop/flop.c @@ -28,12 +28,12 @@ * Creates eight tasks, each of which loops continuously performing a * floating point calculation. * - * All the tasks run at the idle priority and never block or yield. This causes - * all eight tasks to time slice with the idle task. Running at the idle priority + * All the tasks run at the idle priority and never block or yield. This causes + * all eight tasks to time slice with the idle task. Running at the idle priority * means that these tasks will get pre-empted any time another task is ready to run - * or a time slice occurs. More often than not the pre-emption will occur mid - * calculation, creating a good test of the schedulers context switch mechanism - a - * calculation producing an unexpected result could be a symptom of a corruption in + * or a time slice occurs. More often than not the pre-emption will occur mid + * calculation, creating a good test of the schedulers context switch mechanism - a + * calculation producing an unexpected result could be a symptom of a corruption in * the context of a task. * * This file demonstrates the use of the task tag and traceTASK_SWITCHED_IN and @@ -54,18 +54,18 @@ #define mathSTACK_SIZE configMINIMAL_STACK_SIZE #define mathNUMBER_OF_TASKS ( 8 ) -/* Four tasks, each of which performs a different floating point calculation. +/* Four tasks, each of which performs a different floating point calculation. Each of the four is created twice. */ static portTASK_FUNCTION_PROTO( vCompetingMathTask1, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask2, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask3, pvParameters ); static portTASK_FUNCTION_PROTO( vCompetingMathTask4, pvParameters ); -/* These variables are used to check that all the tasks are still running. If a +/* These variables are used to check that all the tasks are still running. If a task gets a calculation wrong it will stop incrementing its check variable. */ static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 }; -/* Buffers into which the flop registers will be saved. There is a buffer for +/* Buffers into which the flop registers will be saved. There is a buffer for each task created within this file. Zeroing out this array is the normal and safe option as this will cause the task to start with all zeros in its flop context. */ @@ -78,11 +78,11 @@ void vStartMathTasks( unsigned portBASE_TYPE uxPriority ) TaskHandle_t xTaskJustCreated; portBASE_TYPE x, y; - /* Place known values into the buffers into which the flop registers are + /* Place known values into the buffers into which the flop registers are to be saved. This is for debug purposes only, it is not normally required. The last position in each array is left at zero as the status - register will be loaded from there. - + register will be loaded from there. + It is intended that these values can be viewed being loaded into the flop registers when a task is started - however the Insight debugger does not seem to want to show the flop register values. */ @@ -95,11 +95,11 @@ portBASE_TYPE x, y; } /* Create the first task - passing it the address of the check variable - that it is going to increment. This check variable is used as an + that it is going to increment. This check variable is used as an indication that the task is still running. */ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated ); - /* The task tag value is a value that can be associated with a task, but + /* The task tag value is a value that can be associated with a task, but is not used by the scheduler itself. Its use is down to the application so it makes a convenient place in this case to store the pointer to the buffer into which the flop context of the task will be stored. The first created @@ -143,7 +143,7 @@ short sError = pdFALSE; fAnswer = ( ff1 + ff2 ) * ff3; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; @@ -160,7 +160,7 @@ short sError = pdFALSE; taskYIELD(); #endif - /* If the calculation does not match the expected constant, stop the + /* If the calculation does not match the expected constant, stop the increment of the check variable. */ if( fabs( ff4 - fAnswer ) > 0.001F ) { @@ -169,7 +169,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } @@ -196,7 +196,7 @@ short sError = pdFALSE; fAnswer = ( ff1 / ff2 ) * ff3; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; @@ -212,8 +212,8 @@ short sError = pdFALSE; #if configUSE_PREEMPTION == 0 taskYIELD(); #endif - - /* If the calculation does not match the expected constant, stop the + + /* If the calculation does not match the expected constant, stop the increment of the check variable. */ if( fabs( ff4 - fAnswer ) > 0.001F ) { @@ -222,7 +222,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; @@ -243,14 +243,14 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) ); - /* Keep filling an array, keeping a running total of the values placed in the - array. Then run through the array adding up all the values. If the two totals + /* Keep filling an array, keeping a running total of the values placed in the + array. Then run through the array adding up all the values. If the two totals do not match, stop the check variable from incrementing. */ for( ;; ) { @@ -260,7 +260,7 @@ short sError = pdFALSE; for( xPosition = 0; xPosition < xArraySize; xPosition++ ) { pfArray[ xPosition ] = ( portFLOAT ) xPosition + 5.5F; - fTotal1 += ( portFLOAT ) xPosition + 5.5F; + fTotal1 += ( portFLOAT ) xPosition + 5.5F; } #if configUSE_PREEMPTION == 0 @@ -284,7 +284,7 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } @@ -300,14 +300,14 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; - /* The variable this task increments to show it is still running is passed in + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) ); - /* Keep filling an array, keeping a running total of the values placed in the - array. Then run through the array adding up all the values. If the two totals + /* Keep filling an array, keeping a running total of the values placed in the + array. Then run through the array adding up all the values. If the two totals do not match, stop the check variable from incrementing. */ for( ;; ) { @@ -317,7 +317,7 @@ short sError = pdFALSE; for( xPosition = 0; xPosition < xArraySize; xPosition++ ) { pfArray[ xPosition ] = ( portFLOAT ) xPosition * 12.123F; - fTotal1 += ( portFLOAT ) xPosition * 12.123F; + fTotal1 += ( portFLOAT ) xPosition * 12.123F; } #if configUSE_PREEMPTION == 0 @@ -341,23 +341,23 @@ short sError = pdFALSE; if( sError == pdFALSE ) { - /* If the calculation has always been correct, increment the check + /* If the calculation has always been correct, increment the check variable so we know this task is still running okay. */ ( *pusTaskCheckVariable )++; } } -} +} /*-----------------------------------------------------------*/ /* This is called to check that all the created tasks are still running. */ portBASE_TYPE xAreMathsTaskStillRunning( void ) { -/* Keep a history of the check variables so we know if they have been incremented +/* Keep a history of the check variables so we know if they have been incremented since the last call. */ static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 }; portBASE_TYPE xReturn = pdTRUE, xTask; - /* Check the maths tasks are still running by ensuring their check variables + /* Check the maths tasks are still running by ensuring their check variables are still incrementing. */ for( xTask = 0; xTask < mathNUMBER_OF_TASKS; xTask++ ) { diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/main.c b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/main.c index 2d0f2d86d..9bb172a0a 100644 --- a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/main.c +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/main.c @@ -27,19 +27,19 @@ /* * Creates all the demo application tasks, then starts the scheduler. The WEB * documentation provides more details of the demo application tasks. - * + * * In addition to the standard demo tasks, the follow demo specific tasks are * create: * - * The "Check" task. This only executes every three seconds but has the highest - * priority so is guaranteed to get processor time. Its main function is to - * check that all the other tasks are still operational. Most tasks maintain - * a unique count that is incremented each time the task successfully completes - * its function. Should any error occur within such a task the count is - * permanently halted. The check task inspects the count of each task to ensure - * it has changed since the last time the check task executed. If all the count - * variables have changed all the tasks are still executing error free, and the - * check task toggles the onboard LED. Should any task contain an error at any time + * The "Check" task. This only executes every three seconds but has the highest + * priority so is guaranteed to get processor time. Its main function is to + * check that all the other tasks are still operational. Most tasks maintain + * a unique count that is incremented each time the task successfully completes + * its function. Should any error occur within such a task the count is + * permanently halted. The check task inspects the count of each task to ensure + * it has changed since the last time the check task executed. If all the count + * variables have changed all the tasks are still executing error free, and the + * check task toggles the onboard LED. Should any task contain an error at any time * the LED toggle rate will change from 3 seconds to 500ms. * * The "Register Check" tasks. These tasks fill the CPU registers with known @@ -96,15 +96,15 @@ baud rate parameters passed into the comtest initialisation has no effect. */ /* Delay periods used by the check task. If no errors have been found then the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an -error has been found at any time then the toggle rate will increase to +error has been found at any time then the toggle rate will increase to mainERROR_CHECK_DELAY milliseconds. */ #define mainNO_ERROR_CHECK_DELAY ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) #define mainERROR_CHECK_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS ) -/* +/* * The tasks defined within this file - described within the comments at the - * head of this page. + * head of this page. */ static void prvRegTestTask1( void *pvParameters ); static void prvRegTestTask2( void *pvParameters ); @@ -145,12 +145,12 @@ int main( void ) /* Start the standard demo application tasks. Note that the baud rate used by the comtest tasks is set by the hardware, so the baud rate parameter passed has no effect. */ - vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); + vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); vStartIntegerMathTasks( tskIDLE_PRIORITY ); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED ); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); - vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); - vStartDynamicPriorityTasks(); + vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); + vStartDynamicPriorityTasks(); vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); vStartQueuePeekTasks(); vCreateBlockTimeTasks(); @@ -179,10 +179,10 @@ int main( void ) vCreateSuicidalTasks( mainDEATH_PRIORITY ); /* Now start the scheduler. Following this call the created tasks should - be executing. */ + be executing. */ vTaskStartScheduler(); - /* vTaskStartScheduler() will only return if an error occurs while the + /* vTaskStartScheduler() will only return if an error occurs while the idle task is being created. */ for( ;; ); @@ -196,7 +196,7 @@ portBASE_TYPE lReturn = pdPASS; static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; /* The demo tasks maintain a count that increments every cycle of the task - provided that the task has never encountered an error. This function + provided that the task has never encountered an error. This function checks the counts maintained by the tasks to ensure they are still being incremented. A count remaining at the same value between calls therefore indicates that an error has been detected. */ @@ -210,37 +210,37 @@ static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; { lReturn = pdFAIL; } - + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreBlockingQueuesStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xIsCreateTaskStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreGenericQueueTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; } - + if( xAreQueuePeekTasksStillRunning() != pdTRUE ) { lReturn = pdFAIL; @@ -325,14 +325,14 @@ volatile unsigned portBASE_TYPE uxFreeStack; uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); /* Wait until it is time to check again. The time we wait here depends - on whether an error has been detected or not. When an error is + on whether an error has been detected or not. When an error is detected the time is shortened resulting in a faster LED flash rate. */ vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); /* See if the other tasks are all ok. */ if( prvCheckOtherTasksAreStillRunning() != pdPASS ) { - /* An error occurred in one of the tasks so shorten the delay + /* An error occurred in one of the tasks so shorten the delay period - which has the effect of increasing the frequency of the LED toggle. */ xDelayPeriod = mainERROR_CHECK_DELAY; @@ -384,7 +384,7 @@ static void prvRegTestTask1( void *pvParameters ) ( void ) pvParameters; /* The first register test task as described at the top of this file. The - values used in the registers are different to those use in the second + values used in the registers are different to those use in the second register test task. Also, unlike the second register test task, this task yields between setting the register values and subsequently checking the register values. */ @@ -524,7 +524,7 @@ static void prvRegTestTask2( void *pvParameters ) /* Just to remove compiler warning. */ ( void ) pvParameters; - /* The second register test task as described at the top of this file. + /* The second register test task as described at the top of this file. Note that this task fills the registers with different values to the first register test task. */ asm volatile diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c index f4640975c..63b50cad0 100644 --- a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/partest/partest.c @@ -40,7 +40,7 @@ #define partstCHANNEL_1 0x01 #define partstMAX_8BIT_LED 0x07 -/* The outputs are split into two IO sections, these variables maintain the +/* The outputs are split into two IO sections, these variables maintain the current value of either section. */ static unsigned portBASE_TYPE uxCurrentOutput8Bit, uxCurrentOutput5Bit; @@ -74,7 +74,7 @@ unsigned portBASE_TYPE uxBaseAddress, *puxCurrentValue; { uxBaseAddress = XPAR_LEDS_8BIT_BASEADDR; puxCurrentValue = &uxCurrentOutput5Bit; - } + } else { uxBaseAddress = XPAR_LEDS_POSITIONS_BASEADDR; @@ -115,7 +115,7 @@ unsigned portBASE_TYPE uxBaseAddress, *puxCurrentValue; uxBaseAddress = XPAR_LEDS_8BIT_BASEADDR; puxCurrentValue = &uxCurrentOutput5Bit; - } + } else { uxBaseAddress = XPAR_LEDS_POSITIONS_BASEADDR; diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c index 6a495f10f..704a4060c 100644 --- a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/RTOSDemo/serial/serial.c @@ -25,7 +25,7 @@ */ -/* +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART */ @@ -46,8 +46,8 @@ /* Queues used to hold received characters, and characters waiting to be transmitted. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /* Structure that maintains information on the UART being used. */ static XUartLite xUART; @@ -82,13 +82,13 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port if( xPortInstallInterruptHandler( XPAR_XPS_INTC_0_RS232_UART_1_INTERRUPT_INTR, ( XInterruptHandler )vSerialISR, (void *)&xUART ) == pdPASS ) { - /* xPortInstallInterruptHandler() could fail if - vPortSetupInterruptController() has not been called prior to this + /* xPortInstallInterruptHandler() could fail if + vPortSetupInterruptController() has not been called prior to this function. */ XUartLite_EnableInterrupt( &xUART ); } } - + /* There is only one port so the handle is not used. */ return ( xComPortHandle ) 0; } @@ -131,17 +131,17 @@ portBASE_TYPE xReturn = pdTRUE; } } /* Otherwise, if there is data already in the queue we should add the - new data to the back of the queue to ensure the sequencing is + new data to the back of the queue to ensure the sequencing is maintained. */ else if( uxQueueMessagesWaiting( xCharsForTx ) ) { if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) { xReturn = pdFAIL; - } + } } /* If the UART FIFO is not full and there is no data already in the - queue we can write directly to the FIFO without disrupting the + queue we can write directly to the FIFO without disrupting the sequence. */ else { @@ -179,13 +179,13 @@ char cChar; if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) { /* A character is available - place it in the queue of received - characters. This might wake a task that was blocked waiting for + characters. This might wake a task that was blocked waiting for data. */ cChar = ( char ) XIo_In32( XPAR_RS232_UART_1_BASEADDR + XUL_RX_FIFO_OFFSET ); xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); lDidSomething = pdTRUE; } - + if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) { /* There is space in the FIFO - if there are any characters queue for @@ -195,7 +195,7 @@ char cChar; { XIo_Out32( XPAR_RS232_UART_1_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); lDidSomething = pdTRUE; - } + } } } while( lDidSomething == pdTRUE ); diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 new file mode 100644 index 000000000..886583480 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_mhs.11.1 @@ -0,0 +1,458 @@ + +# ############################################################################## +# Created by Base System Builder Wizard for Xilinx EDK 11.1 Build EDK_L.29.1 +# Thu Jun 11 19:28:07 2009 +# Target Board: Xilinx Virtex 5 ML507 Evaluation Platform Rev A +# Family: virtex5 +# Device: xc5vfx70t +# Package: ff1136 +# Speed Grade: -1 +# Processor number: 1 +# Processor 1: ppc440_0 +# Processor clock frequency: 125.0 +# Bus clock frequency: 125.0 +# Debug Interface: FPGA JTAG +# ############################################################################## + PARAMETER VERSION = 2.1.0 + + + PORT fpga_0_RS232_Uart_1_RX_pin = fpga_0_RS232_Uart_1_RX_pin, DIR = I + PORT fpga_0_RS232_Uart_1_TX_pin = fpga_0_RS232_Uart_1_TX_pin, DIR = O + PORT fpga_0_LEDs_8Bit_GPIO_IO_pin = fpga_0_LEDs_8Bit_GPIO_IO_pin, DIR = IO, VEC = [0:7] + PORT fpga_0_LEDs_Positions_GPIO_IO_pin = fpga_0_LEDs_Positions_GPIO_IO_pin, DIR = IO, VEC = [0:4] + PORT fpga_0_Push_Buttons_5Bit_GPIO_IO_pin = fpga_0_Push_Buttons_5Bit_GPIO_IO_pin, DIR = IO, VEC = [0:4] + PORT fpga_0_DIP_Switches_8Bit_GPIO_IO_pin = fpga_0_DIP_Switches_8Bit_GPIO_IO_pin, DIR = IO, VEC = [0:7] + PORT fpga_0_IIC_EEPROM_Sda_pin = fpga_0_IIC_EEPROM_Sda_pin, DIR = IO + PORT fpga_0_IIC_EEPROM_Scl_pin = fpga_0_IIC_EEPROM_Scl_pin, DIR = IO + PORT fpga_0_SRAM_Mem_A_pin = fpga_0_SRAM_Mem_A_pin_vslice_7_30_concat, DIR = O, VEC = [7:30] + PORT fpga_0_SRAM_Mem_CEN_pin = fpga_0_SRAM_Mem_CEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_OEN_pin = fpga_0_SRAM_Mem_OEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_WEN_pin = fpga_0_SRAM_Mem_WEN_pin, DIR = O + PORT fpga_0_SRAM_Mem_BEN_pin = fpga_0_SRAM_Mem_BEN_pin, DIR = O, VEC = [0:3] + PORT fpga_0_SRAM_Mem_ADV_LDN_pin = fpga_0_SRAM_Mem_ADV_LDN_pin, DIR = O + PORT fpga_0_SRAM_Mem_DQ_pin = fpga_0_SRAM_Mem_DQ_pin, DIR = IO, VEC = [0:31] + PORT fpga_0_SRAM_ZBT_CLK_OUT_pin = SRAM_CLK_OUT_s, DIR = O + PORT fpga_0_SRAM_ZBT_CLK_FB_pin = SRAM_CLK_FB_s, DIR = I, SIGIS = CLK, CLK_FREQ = 125000000 + PORT fpga_0_PCIe_Bridge_RXN_pin = fpga_0_PCIe_Bridge_RXN_pin, DIR = I + PORT fpga_0_PCIe_Bridge_RXP_pin = fpga_0_PCIe_Bridge_RXP_pin, DIR = I + PORT fpga_0_PCIe_Bridge_TXN_pin = fpga_0_PCIe_Bridge_TXN_pin, DIR = O + PORT fpga_0_PCIe_Bridge_TXP_pin = fpga_0_PCIe_Bridge_TXP_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_clk_pin = fpga_0_Ethernet_MAC_PHY_tx_clk_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_clk_pin = fpga_0_Ethernet_MAC_PHY_rx_clk_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_crs_pin = fpga_0_Ethernet_MAC_PHY_crs_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_dv_pin = fpga_0_Ethernet_MAC_PHY_dv_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_data_pin = fpga_0_Ethernet_MAC_PHY_rx_data_pin, DIR = I, VEC = [3:0] + PORT fpga_0_Ethernet_MAC_PHY_col_pin = fpga_0_Ethernet_MAC_PHY_col_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rx_er_pin = fpga_0_Ethernet_MAC_PHY_rx_er_pin, DIR = I + PORT fpga_0_Ethernet_MAC_PHY_rst_n_pin = fpga_0_Ethernet_MAC_PHY_rst_n_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_en_pin = fpga_0_Ethernet_MAC_PHY_tx_en_pin, DIR = O + PORT fpga_0_Ethernet_MAC_PHY_tx_data_pin = fpga_0_Ethernet_MAC_PHY_tx_data_pin, DIR = O, VEC = [3:0] + PORT fpga_0_Ethernet_MAC_MDINT_pin = fpga_0_Ethernet_MAC_MDINT_pin, DIR = I, SIGIS = INTERRUPT, SENSITIVITY = LEVEL_LOW, INTERRUPT_PRIORITY = MEDIUM + PORT fpga_0_DDR2_SDRAM_DDR2_DQ_pin = fpga_0_DDR2_SDRAM_DDR2_DQ_pin, DIR = IO, VEC = [63:0] + PORT fpga_0_DDR2_SDRAM_DDR2_DQS_pin = fpga_0_DDR2_SDRAM_DDR2_DQS_pin, DIR = IO, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin = fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin, DIR = IO, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_A_pin = fpga_0_DDR2_SDRAM_DDR2_A_pin, DIR = O, VEC = [12:0] + PORT fpga_0_DDR2_SDRAM_DDR2_BA_pin = fpga_0_DDR2_SDRAM_DDR2_BA_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin = fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin = fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_WE_N_pin = fpga_0_DDR2_SDRAM_DDR2_WE_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_CS_N_pin = fpga_0_DDR2_SDRAM_DDR2_CS_N_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_ODT_pin = fpga_0_DDR2_SDRAM_DDR2_ODT_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CKE_pin = fpga_0_DDR2_SDRAM_DDR2_CKE_pin, DIR = O + PORT fpga_0_DDR2_SDRAM_DDR2_DM_pin = fpga_0_DDR2_SDRAM_DDR2_DM_pin, DIR = O, VEC = [7:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CK_pin = fpga_0_DDR2_SDRAM_DDR2_CK_pin, DIR = O, VEC = [1:0] + PORT fpga_0_DDR2_SDRAM_DDR2_CK_N_pin = fpga_0_DDR2_SDRAM_DDR2_CK_N_pin, DIR = O, VEC = [1:0] + PORT fpga_0_SysACE_CompactFlash_SysACE_MPA_pin = fpga_0_SysACE_CompactFlash_SysACE_MPA_pin, DIR = O, VEC = [6:0] + PORT fpga_0_SysACE_CompactFlash_SysACE_CLK_pin = fpga_0_SysACE_CompactFlash_SysACE_CLK_pin, DIR = I + PORT fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin, DIR = I + PORT fpga_0_SysACE_CompactFlash_SysACE_CEN_pin = fpga_0_SysACE_CompactFlash_SysACE_CEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_OEN_pin = fpga_0_SysACE_CompactFlash_SysACE_OEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_WEN_pin = fpga_0_SysACE_CompactFlash_SysACE_WEN_pin, DIR = O + PORT fpga_0_SysACE_CompactFlash_SysACE_MPD_pin = fpga_0_SysACE_CompactFlash_SysACE_MPD_pin, DIR = IO, VEC = [15:0] + PORT fpga_0_clk_1_sys_clk_pin = dcm_clk_s, DIR = I, SIGIS = CLK, CLK_FREQ = 100000000 + PORT fpga_0_rst_1_sys_rst_pin = sys_rst_s, DIR = I, SIGIS = RST, RST_POLARITY = 0 + PORT fpga_0_PCIe_Diff_Clk_IBUF_DS_P_pin = PCIe_Diff_Clk, DIR = I, DIFFERENTIAL_POLARITY = P, SIGIS = CLK + PORT fpga_0_PCIe_Diff_Clk_IBUF_DS_N_pin = PCIe_Diff_Clk, DIR = I, DIFFERENTIAL_POLARITY = N, SIGIS = CLK + + +BEGIN ppc440_virtex5 + PARAMETER INSTANCE = ppc440_0 + PARAMETER C_IDCR_BASEADDR = 0b0000000000 + PARAMETER C_IDCR_HIGHADDR = 0b0011111111 + PARAMETER C_PPC440MC_ROW_CONFLICT_MASK = 0x003FFE00 + PARAMETER C_PPC440MC_BANK_CONFLICT_MASK = 0x00C00000 + PARAMETER C_PPC440MC_CONTROL = 0xF810008F + PARAMETER C_SPLB0_USE_MPLB_ADDR = 1 + PARAMETER C_SPLB0_NUM_MPLB_ADDR_RNG = 1 + PARAMETER C_SPLB1_NUM_MPLB_ADDR_RNG = 0 + PARAMETER HW_VER = 1.01.a + PARAMETER C_SPLB0_RNG0_MPLB_BASEADDR = 0x80000000 + PARAMETER C_SPLB0_RNG0_MPLB_HIGHADDR = 0xffffffff + PARAMETER C_SPLB0_RNG_MC_BASEADDR = 0x00000000 + PARAMETER C_SPLB0_RNG_MC_HIGHADDR = 0x0fffffff + BUS_INTERFACE MPLB = plb_v46_0 + BUS_INTERFACE SPLB0 = ppc440_0_SPLB0 + BUS_INTERFACE PPC440MC = ppc440_0_PPC440MC + BUS_INTERFACE JTAGPPC = ppc440_0_jtagppc_bus + BUS_INTERFACE RESETPPC = ppc_reset_bus + PORT CPMC440CLK = clk_125_0000MHzPLL0 + PORT CPMINTERCONNECTCLK = clk_125_0000MHzPLL0 + PORT CPMINTERCONNECTCLKNTO1 = net_vcc + PORT EICC440EXTIRQ = ppc440_0_EICC440EXTIRQ + PORT CPMMCCLK = clk_125_0000MHzPLL0_ADJUST + PORT CPMPPCMPLBCLK = clk_125_0000MHzPLL0_ADJUST + PORT CPMPPCS0PLBCLK = clk_125_0000MHzPLL0_ADJUST +END + +BEGIN plb_v46 + PARAMETER INSTANCE = plb_v46_0 + PARAMETER C_DCR_INTFCE = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.04.a + PORT PLB_Clk = clk_125_0000MHzPLL0_ADJUST + PORT SYS_Rst = sys_bus_reset +END + +BEGIN xps_bram_if_cntlr + PARAMETER INSTANCE = xps_bram_if_cntlr_1 + PARAMETER C_SPLB_NATIVE_DWIDTH = 64 + PARAMETER C_SPLB_SUPPORT_BURSTS = 1 + PARAMETER C_SPLB_P2P = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.00.b + PARAMETER C_BASEADDR = 0xffffe000 + PARAMETER C_HIGHADDR = 0xffffffff + BUS_INTERFACE SPLB = plb_v46_0 + BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port +END + +BEGIN bram_block + PARAMETER INSTANCE = xps_bram_if_cntlr_1_bram + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.00.a + BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port +END + +BEGIN xps_uartlite + PARAMETER INSTANCE = RS232_Uart_1 + PARAMETER C_FAMILY = virtex5 + PARAMETER C_BAUDRATE = 9600 + PARAMETER C_DATA_BITS = 8 + PARAMETER C_USE_PARITY = 0 + PARAMETER C_ODD_PARITY = 0 + PARAMETER HW_VER = 1.01.a + PARAMETER C_BASEADDR = 0x84000000 + PARAMETER C_HIGHADDR = 0x8400ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT RX = fpga_0_RS232_Uart_1_RX_pin + PORT TX = fpga_0_RS232_Uart_1_TX_pin + PORT Interrupt = RS232_Uart_1_Interrupt +END + +BEGIN xps_gpio + PARAMETER INSTANCE = LEDs_8Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 0 + PARAMETER C_GPIO_WIDTH = 8 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81440000 + PARAMETER C_HIGHADDR = 0x8144ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_LEDs_8Bit_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = LEDs_Positions + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 0 + PARAMETER C_GPIO_WIDTH = 5 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81420000 + PARAMETER C_HIGHADDR = 0x8142ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_LEDs_Positions_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = Push_Buttons_5Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 1 + PARAMETER C_GPIO_WIDTH = 5 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81400000 + PARAMETER C_HIGHADDR = 0x8140ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_Push_Buttons_5Bit_GPIO_IO_pin +END + +BEGIN xps_gpio + PARAMETER INSTANCE = DIP_Switches_8Bit + PARAMETER C_FAMILY = virtex5 + PARAMETER C_ALL_INPUTS = 1 + PARAMETER C_GPIO_WIDTH = 8 + PARAMETER C_INTERRUPT_PRESENT = 0 + PARAMETER C_IS_DUAL = 0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81460000 + PARAMETER C_HIGHADDR = 0x8146ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT GPIO_IO = fpga_0_DIP_Switches_8Bit_GPIO_IO_pin +END + +BEGIN xps_iic + PARAMETER INSTANCE = IIC_EEPROM + PARAMETER C_IIC_FREQ = 100000 + PARAMETER C_TEN_BIT_ADR = 0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 2.01.a + PARAMETER C_BASEADDR = 0x81600000 + PARAMETER C_HIGHADDR = 0x8160ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT Sda = fpga_0_IIC_EEPROM_Sda_pin + PORT Scl = fpga_0_IIC_EEPROM_Scl_pin +END + +BEGIN xps_mch_emc + PARAMETER INSTANCE = SRAM + PARAMETER C_FAMILY = virtex5 + PARAMETER C_NUM_BANKS_MEM = 1 + PARAMETER C_NUM_CHANNELS = 0 + PARAMETER C_MEM0_WIDTH = 32 + PARAMETER C_MAX_MEM_WIDTH = 32 + PARAMETER C_INCLUDE_DATAWIDTH_MATCHING_0 = 0 + PARAMETER C_SYNCH_MEM_0 = 1 + PARAMETER C_TCEDV_PS_MEM_0 = 0 + PARAMETER C_TAVDV_PS_MEM_0 = 0 + PARAMETER C_THZCE_PS_MEM_0 = 0 + PARAMETER C_THZOE_PS_MEM_0 = 0 + PARAMETER C_TWC_PS_MEM_0 = 0 + PARAMETER C_TWP_PS_MEM_0 = 0 + PARAMETER C_TLZWE_PS_MEM_0 = 0 + PARAMETER HW_VER = 3.00.a + PARAMETER C_MEM0_BASEADDR = 0xf8000000 + PARAMETER C_MEM0_HIGHADDR = 0xf80fffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT RdClk = clk_125_0000MHzPLL0_ADJUST + PORT Mem_A = 0b0000000 & fpga_0_SRAM_Mem_A_pin_vslice_7_30_concat & 0b0 + PORT Mem_CEN = fpga_0_SRAM_Mem_CEN_pin + PORT Mem_OEN = fpga_0_SRAM_Mem_OEN_pin + PORT Mem_WEN = fpga_0_SRAM_Mem_WEN_pin + PORT Mem_BEN = fpga_0_SRAM_Mem_BEN_pin + PORT Mem_ADV_LDN = fpga_0_SRAM_Mem_ADV_LDN_pin + PORT Mem_DQ = fpga_0_SRAM_Mem_DQ_pin +END + +BEGIN plbv46_pcie + PARAMETER INSTANCE = PCIe_Bridge + PARAMETER C_FAMILY = virtex5 + PARAMETER C_IPIFBAR_NUM = 2 + PARAMETER C_PCIBAR_NUM = 1 + PARAMETER C_DEVICE_ID = 0x0505 + PARAMETER C_VENDOR_ID = 0x10EE + PARAMETER C_CLASS_CODE = 0x058000 + PARAMETER C_REV_ID = 0x00 + PARAMETER C_SUBSYSTEM_ID = 0x0000 + PARAMETER C_SUBSYSTEM_VENDOR_ID = 0x0000 + PARAMETER C_COMP_TIMEOUT = 1 + PARAMETER C_IPIFBAR2PCIBAR_0 = 0x00000000 + PARAMETER C_IPIFBAR2PCIBAR_1 = 0x00000000 + PARAMETER C_PCIBAR2IPIFBAR_0 = 0xf8000000 + PARAMETER C_PCIBAR2IPIFBAR_1 = 0x00000000 + PARAMETER C_PCIBAR_LEN_0 = 20 + PARAMETER C_PCIBAR_LEN_1 = 28 + PARAMETER C_BOARD = ml507 + PARAMETER HW_VER = 3.00.b + PARAMETER C_BASEADDR = 0x85c00000 + PARAMETER C_HIGHADDR = 0x85c0ffff + PARAMETER C_IPIFBAR_0 = 0xc0000000 + PARAMETER C_IPIFBAR_HIGHADDR_0 = 0xdfffffff + PARAMETER C_IPIFBAR_1 = 0xe0000000 + PARAMETER C_IPIFBAR_HIGHADDR_1 = 0xefffffff + BUS_INTERFACE SPLB = plb_v46_0 + BUS_INTERFACE MPLB = ppc440_0_SPLB0 + PORT PERSTN = net_vcc + PORT REFCLK = PCIe_Diff_Clk + PORT RXN = fpga_0_PCIe_Bridge_RXN_pin + PORT RXP = fpga_0_PCIe_Bridge_RXP_pin + PORT TXN = fpga_0_PCIe_Bridge_TXN_pin + PORT TXP = fpga_0_PCIe_Bridge_TXP_pin + PORT MSI_request = net_gnd +END + +BEGIN plb_v46 + PARAMETER INSTANCE = ppc440_0_SPLB0 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.04.a + PORT PLB_Clk = clk_125_0000MHzPLL0_ADJUST + PORT SYS_Rst = sys_bus_reset +END + +BEGIN xps_ethernetlite + PARAMETER INSTANCE = Ethernet_MAC + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 2.01.a + PARAMETER C_BASEADDR = 0x81000000 + PARAMETER C_HIGHADDR = 0x8100ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT PHY_tx_clk = fpga_0_Ethernet_MAC_PHY_tx_clk_pin + PORT PHY_rx_clk = fpga_0_Ethernet_MAC_PHY_rx_clk_pin + PORT PHY_crs = fpga_0_Ethernet_MAC_PHY_crs_pin + PORT PHY_dv = fpga_0_Ethernet_MAC_PHY_dv_pin + PORT PHY_rx_data = fpga_0_Ethernet_MAC_PHY_rx_data_pin + PORT PHY_col = fpga_0_Ethernet_MAC_PHY_col_pin + PORT PHY_rx_er = fpga_0_Ethernet_MAC_PHY_rx_er_pin + PORT PHY_rst_n = fpga_0_Ethernet_MAC_PHY_rst_n_pin + PORT PHY_tx_en = fpga_0_Ethernet_MAC_PHY_tx_en_pin + PORT PHY_tx_data = fpga_0_Ethernet_MAC_PHY_tx_data_pin +END + +BEGIN ppc440mc_ddr2 + PARAMETER INSTANCE = DDR2_SDRAM + PARAMETER C_DDR_BAWIDTH = 2 + PARAMETER C_NUM_CLK_PAIRS = 2 + PARAMETER C_DDR_DWIDTH = 64 + PARAMETER C_DDR_CAWIDTH = 10 + PARAMETER C_NUM_RANKS_MEM = 1 + PARAMETER C_CS_BITS = 0 + PARAMETER C_DDR_DM_WIDTH = 8 + PARAMETER C_DQ_BITS = 8 + PARAMETER C_DDR2_ODT_WIDTH = 2 + PARAMETER C_DDR2_ADDT_LAT = 0 + PARAMETER C_INCLUDE_ECC_SUPPORT = 0 + PARAMETER C_DDR2_ODT_SETTING = 1 + PARAMETER C_DQS_BITS = 3 + PARAMETER C_DDR_DQS_WIDTH = 8 + PARAMETER C_DDR_RAWIDTH = 13 + PARAMETER C_DDR_BURST_LENGTH = 4 + PARAMETER C_DDR_CAS_LAT = 4 + PARAMETER C_REG_DIMM = 0 + PARAMETER C_MIB_MC_CLOCK_RATIO = 1 + PARAMETER C_DDR_TREFI = 3900 + PARAMETER C_DDR_TRAS = 40000 + PARAMETER C_DDR_TRCD = 15000 + PARAMETER C_DDR_TRFC = 75000 + PARAMETER C_DDR_TRP = 15000 + PARAMETER C_DDR_TRTP = 7500 + PARAMETER C_DDR_TWR = 15000 + PARAMETER C_DDR_TWTR = 7500 + PARAMETER C_MC_MIBCLK_PERIOD_PS = 8000 + PARAMETER C_IDEL_HIGH_PERF = TRUE + PARAMETER C_NUM_IDELAYCTRL = 3 + PARAMETER C_IDELAYCTRL_LOC = IDELAYCTRL_X0Y6-IDELAYCTRL_X0Y2-IDELAYCTRL_X0Y1 + PARAMETER C_DQS_IO_COL = 0b000000000000000000 + PARAMETER C_DQ_IO_MS = 0b000000000111010100111101000011110001111000101110110000111100000110111100 + PARAMETER HW_VER = 2.00.a + PARAMETER C_MEM_BASEADDR = 0x00000000 + PARAMETER C_MEM_HIGHADDR = 0x0fffffff + BUS_INTERFACE PPC440MC = ppc440_0_PPC440MC + PORT mc_mibclk = clk_125_0000MHzPLL0_ADJUST + PORT mi_mcclk90 = clk_125_0000MHz90PLL0_ADJUST + PORT mi_mcreset = sys_bus_reset + PORT mi_mcclkdiv2 = clk_62_5000MHzPLL0_ADJUST + PORT mi_mcclk_200 = clk_200_0000MHz + PORT DDR2_DQ = fpga_0_DDR2_SDRAM_DDR2_DQ_pin + PORT DDR2_DQS = fpga_0_DDR2_SDRAM_DDR2_DQS_pin + PORT DDR2_DQS_N = fpga_0_DDR2_SDRAM_DDR2_DQS_N_pin + PORT DDR2_A = fpga_0_DDR2_SDRAM_DDR2_A_pin + PORT DDR2_BA = fpga_0_DDR2_SDRAM_DDR2_BA_pin + PORT DDR2_RAS_N = fpga_0_DDR2_SDRAM_DDR2_RAS_N_pin + PORT DDR2_CAS_N = fpga_0_DDR2_SDRAM_DDR2_CAS_N_pin + PORT DDR2_WE_N = fpga_0_DDR2_SDRAM_DDR2_WE_N_pin + PORT DDR2_CS_N = fpga_0_DDR2_SDRAM_DDR2_CS_N_pin + PORT DDR2_ODT = fpga_0_DDR2_SDRAM_DDR2_ODT_pin + PORT DDR2_CKE = fpga_0_DDR2_SDRAM_DDR2_CKE_pin + PORT DDR2_DM = fpga_0_DDR2_SDRAM_DDR2_DM_pin + PORT DDR2_CK = fpga_0_DDR2_SDRAM_DDR2_CK_pin + PORT DDR2_CK_N = fpga_0_DDR2_SDRAM_DDR2_CK_N_pin +END + +BEGIN xps_sysace + PARAMETER INSTANCE = SysACE_CompactFlash + PARAMETER C_MEM_WIDTH = 16 + PARAMETER C_FAMILY = virtex5 + PARAMETER HW_VER = 1.01.a + PARAMETER C_BASEADDR = 0x83600000 + PARAMETER C_HIGHADDR = 0x8360ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT SysACE_MPA = fpga_0_SysACE_CompactFlash_SysACE_MPA_pin + PORT SysACE_CLK = fpga_0_SysACE_CompactFlash_SysACE_CLK_pin + PORT SysACE_MPIRQ = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin + PORT SysACE_CEN = fpga_0_SysACE_CompactFlash_SysACE_CEN_pin + PORT SysACE_OEN = fpga_0_SysACE_CompactFlash_SysACE_OEN_pin + PORT SysACE_WEN = fpga_0_SysACE_CompactFlash_SysACE_WEN_pin + PORT SysACE_MPD = fpga_0_SysACE_CompactFlash_SysACE_MPD_pin +END + +BEGIN clock_generator + PARAMETER INSTANCE = clock_generator_0 + PARAMETER C_CLKIN_FREQ = 100000000 + PARAMETER C_CLKFBIN_FREQ = 125000000 + PARAMETER C_CLKOUT0_FREQ = 125000000 + PARAMETER C_CLKOUT0_PHASE = 90 + PARAMETER C_CLKOUT0_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT0_BUF = TRUE + PARAMETER C_CLKOUT1_FREQ = 125000000 + PARAMETER C_CLKOUT1_PHASE = 0 + PARAMETER C_CLKOUT1_GROUP = PLL0 + PARAMETER C_CLKOUT1_BUF = TRUE + PARAMETER C_CLKOUT2_FREQ = 125000000 + PARAMETER C_CLKOUT2_PHASE = 0 + PARAMETER C_CLKOUT2_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT2_BUF = TRUE + PARAMETER C_CLKOUT3_FREQ = 200000000 + PARAMETER C_CLKOUT3_PHASE = 0 + PARAMETER C_CLKOUT3_GROUP = NONE + PARAMETER C_CLKOUT3_BUF = TRUE + PARAMETER C_CLKOUT4_FREQ = 62500000 + PARAMETER C_CLKOUT4_PHASE = 0 + PARAMETER C_CLKOUT4_GROUP = PLL0_ADJUST + PARAMETER C_CLKOUT4_BUF = TRUE + PARAMETER C_CLKFBOUT_FREQ = 125000000 + PARAMETER C_CLKFBOUT_BUF = TRUE + PARAMETER HW_VER = 3.00.a + PORT CLKIN = dcm_clk_s + PORT CLKFBIN = SRAM_CLK_FB_s + PORT CLKOUT0 = clk_125_0000MHz90PLL0_ADJUST + PORT CLKOUT1 = clk_125_0000MHzPLL0 + PORT CLKOUT2 = clk_125_0000MHzPLL0_ADJUST + PORT CLKOUT3 = clk_200_0000MHz + PORT CLKOUT4 = clk_62_5000MHzPLL0_ADJUST + PORT CLKFBOUT = SRAM_CLK_OUT_s + PORT RST = net_gnd + PORT LOCKED = Dcm_all_locked +END + +BEGIN jtagppc_cntlr + PARAMETER INSTANCE = jtagppc_cntlr_inst + PARAMETER HW_VER = 2.01.c + BUS_INTERFACE JTAGPPC0 = ppc440_0_jtagppc_bus +END + +BEGIN proc_sys_reset + PARAMETER INSTANCE = proc_sys_reset_0 + PARAMETER C_EXT_RESET_HIGH = 0 + PARAMETER HW_VER = 2.00.a + BUS_INTERFACE RESETPPC0 = ppc_reset_bus + PORT Slowest_sync_clk = clk_125_0000MHzPLL0_ADJUST + PORT Ext_Reset_In = sys_rst_s + PORT Dcm_locked = Dcm_all_locked + PORT Bus_Struct_Reset = sys_bus_reset + PORT Peripheral_Reset = sys_periph_reset +END + +BEGIN xps_intc + PARAMETER INSTANCE = xps_intc_0 + PARAMETER HW_VER = 2.00.a + PARAMETER C_BASEADDR = 0x81800000 + PARAMETER C_HIGHADDR = 0x8180ffff + BUS_INTERFACE SPLB = plb_v46_0 + PORT Intr = fpga_0_Ethernet_MAC_MDINT_pin&RS232_Uart_1_Interrupt + PORT Irq = ppc440_0_EICC440EXTIRQ +END + diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_mss.11.1 b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_mss.11.1 new file mode 100644 index 000000000..188abc721 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_mss.11.1 @@ -0,0 +1,125 @@ + + PARAMETER VERSION = 2.2.0 + + +BEGIN OS + PARAMETER OS_NAME = standalone + PARAMETER OS_VER = 2.00.a + PARAMETER PROC_INSTANCE = ppc440_0 + PARAMETER STDIN = RS232_Uart_1 + PARAMETER STDOUT = RS232_Uart_1 +END + + +BEGIN PROCESSOR + PARAMETER DRIVER_NAME = cpu_ppc440 + PARAMETER DRIVER_VER = 1.00.b + PARAMETER HW_INSTANCE = ppc440_0 + PARAMETER COMPILER = powerpc-eabi-gcc + PARAMETER ARCHIVER = powerpc-eabi-ar +END + + +BEGIN DRIVER + PARAMETER DRIVER_NAME = bram + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1_bram +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = uartlite + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = RS232_Uart_1 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = LEDs_8Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = LEDs_Positions +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = Push_Buttons_5Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = gpio + PARAMETER DRIVER_VER = 2.13.a + PARAMETER HW_INSTANCE = DIP_Switches_8Bit +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = iic + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = IIC_EEPROM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = emc + PARAMETER DRIVER_VER = 2.00.a + PARAMETER HW_INSTANCE = SRAM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = pcie + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = PCIe_Bridge +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = emaclite + PARAMETER DRIVER_VER = 1.14.a + PARAMETER HW_INSTANCE = Ethernet_MAC +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = memcon + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = DDR2_SDRAM +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = sysace + PARAMETER DRIVER_VER = 1.12.a + PARAMETER HW_INSTANCE = SysACE_CompactFlash +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = clock_generator_0 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = jtagppc_cntlr_inst +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = generic + PARAMETER DRIVER_VER = 1.00.a + PARAMETER HW_INSTANCE = proc_sys_reset_0 +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = intc + PARAMETER DRIVER_VER = 1.11.a + PARAMETER HW_INSTANCE = xps_intc_0 +END + + diff --git a/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 new file mode 100644 index 000000000..406959b34 --- /dev/null +++ b/FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/revup/system_xmp.11.1 @@ -0,0 +1,69 @@ +#Please do not modify this file by hand +XmpVersion: 11.1 +VerMgmt: 11.1 +IntStyle: default +MHS File: system.mhs +MSS File: system.mss +Architecture: virtex5 +Device: xc5vfx70t +Package: ff1136 +SpeedGrade: -1 +UserCmd1: +UserCmd1Type: 0 +UserCmd2: +UserCmd2Type: 0 +GenSimTB: 0 +SdkExportBmmBit: 1 +SdkExportDir: SDK/SDK_Export +InsertNoPads: 0 +WarnForEAArch: 1 +HdlLang: VHDL +SimModel: BEHAVIORAL +UcfFile: data/system.ucf +EnableParTimingError: 1 +ShowLicenseDialog: 1 +Processor: ppc440_0 +BootLoop: 1 +XmdStub: 0 +SwProj: RTOSDemo +Processor: ppc440_0 +Executable: RTOSDemo/executable.elf +Source: RTOSDemo/../../Common/Minimal/BlockQ.c +Source: RTOSDemo/../../Common/Minimal/blocktim.c +Source: RTOSDemo/../../Common/Minimal/comtest.c +Source: RTOSDemo/../../Common/Minimal/countsem.c +Source: RTOSDemo/../../Common/Minimal/death.c +Source: RTOSDemo/../../Common/Minimal/dynamic.c +Source: RTOSDemo/../../Common/Minimal/flash.c +Source: RTOSDemo/../../Common/Minimal/GenQTest.c +Source: RTOSDemo/../../Common/Minimal/integer.c +Source: RTOSDemo/../../Common/Minimal/QPeek.c +Source: RTOSDemo/../../Common/Minimal/recmutex.c +Source: RTOSDemo/../../Common/Minimal/semtest.c +Source: RTOSDemo/../../../Source/tasks.c +Source: RTOSDemo/../../../Source/list.c +Source: RTOSDemo/../../../Source/queue.c +Source: RTOSDemo/../../../Source/croutine.c +Source: RTOSDemo/../../../Source/portable/GCC/PPC440_Xilinx/portasm.S +Source: RTOSDemo/../../../Source/portable/GCC/PPC440_Xilinx/port.c +Source: RTOSDemo/../../../Source/portable/MemMang/heap_2.c +Source: RTOSDemo/flop/flop-reg-test.c +Source: RTOSDemo/flop/flop.c +Source: RTOSDemo/partest/partest.c +Source: RTOSDemo/serial/serial.c +Source: RTOSDemo/main.c +DefaultInit: EXECUTABLE +InitBram: 0 +Active: 1 +CompilerOptLevel: 0 +GlobPtrOpt: 0 +DebugSym: 1 +ProfileFlag: 0 +SearchIncl: ../../Source/include ../Common/include ./RTOSDemo ./RTOSDemo/flop +ProgStart: +StackSize: +HeapSize: +LinkerScript: RTOSDemo/RTOSDemo_linker_script.ld +ProgCCFlags: -D GCC_PPC440 -mregnames +CompileInXps: 1 +NonXpsApp: 0 diff --git a/FreeRTOS/Demo/Posix_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/Posix_GCC/FreeRTOSConfig.h index 9a315a988..2543bf432 100644 --- a/FreeRTOS/Demo/Posix_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/Posix_GCC/FreeRTOSConfig.h @@ -76,6 +76,10 @@ unsigned long ulGetRunTimeCounterValue( void ); /* Prototype of function that re void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that initialises the run time counter. */ #define configGENERATE_RUN_TIME_STATS 1 +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo can use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/FreeRTOSConfig.h index 34bec0c21..1d3d944ad 100644 --- a/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/FreeRTOSConfig.h @@ -77,6 +77,9 @@ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c b/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c index 2281a1932..529be64e4 100644 --- a/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c +++ b/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c @@ -49,7 +49,7 @@ * This project has only been tested in the QEMU emulation of the HiFive board * from SiFive. * - * NOTE - Requires QEMU 1908xx or higher. Start QEMU using the following command + * NOTE - Requires QEMU 1908xx or higher. Start QEMU using the following command * line: * * [your_path_1]\qemu-system-riscv32 -kernel [your_path_2]\FreeRTOS\Demo\RISC-V-Qemu-sifive_e-FreedomStudio\Debug\RTOSDemo.elf -S -s -machine sifive_e diff --git a/FreeRTOS/Demo/RISC-V-Qemu-virt_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V-Qemu-virt_GCC/FreeRTOSConfig.h index d2f57d109..5f58a5fcd 100644 --- a/FreeRTOS/Demo/RISC-V-Qemu-virt_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V-Qemu-virt_GCC/FreeRTOSConfig.h @@ -72,6 +72,9 @@ void vAssertCalled( void ); #define configASSERT_DEFINED 1 #define configASSERT( x ) do { if ( !(x) ) vAssertCalled(); } while(0) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RISC-V-spike-htif_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V-spike-htif_GCC/FreeRTOSConfig.h index f2b6cccf7..1754d5bc8 100644 --- a/FreeRTOS/Demo/RISC-V-spike-htif_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V-spike-htif_GCC/FreeRTOSConfig.h @@ -67,6 +67,9 @@ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RISC-V_RV32M1_Vega_GCC_Eclipse/projects/RTOSDemo_ri5cy/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_RV32M1_Vega_GCC_Eclipse/projects/RTOSDemo_ri5cy/FreeRTOSConfig.h index 103f48180..75ccb0ca8 100644 --- a/FreeRTOS/Demo/RISC-V_RV32M1_Vega_GCC_Eclipse/projects/RTOSDemo_ri5cy/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V_RV32M1_Vega_GCC_Eclipse/projects/RTOSDemo_ri5cy/FreeRTOSConfig.h @@ -70,6 +70,9 @@ #define configUSE_QUEUE_SETS 1 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 3 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/FreeRTOSConfig.h index f336cd581..e44cc1c82 100644 --- a/FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/FreeRTOSConfig.h @@ -57,6 +57,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -66,6 +67,7 @@ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configMAX_PRIORITIES ( 9UL ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configQUEUE_REGISTRY_SIZE 10 #define configSUPPORT_STATIC_ALLOCATION 1 diff --git a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio/FreeRTOSConfig.h index 019b012a1..16b1f1697 100644 --- a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio/FreeRTOSConfig.h @@ -63,6 +63,9 @@ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_IAR/FreeRTOSConfig.h index 2f08c5dd3..de3dbc8f2 100644 --- a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_IAR/FreeRTOSConfig.h @@ -65,6 +65,9 @@ #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/.project b/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/.project index 592621dc6..2911d6f88 100644 --- a/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/.project +++ b/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/.project @@ -108,6 +108,15 @@ 1.0-name-matches-false-false-comtest_strings.c + + 1629933988064 + full_demo/Demo_Tasks/Minimal + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-crhook.c + + 1629933988070 full_demo/Demo_Tasks/Minimal @@ -117,6 +126,15 @@ 1.0-name-matches-false-false-comtest.c + + 1629933988073 + full_demo/Demo_Tasks/Minimal + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-crflash.c + + 1629933988075 full_demo/Demo_Tasks/Minimal diff --git a/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/FreeRTOSConfig.h index 6005bb068..52daedbe0 100644 --- a/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/FreeRTOSConfig.h @@ -69,6 +69,9 @@ #define configUSE_QUEUE_SETS 1 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 3 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/FreeRTOSConfig.h index ce6027aab..80021cfcc 100644 --- a/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/FreeRTOSConfig.h @@ -69,6 +69,9 @@ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RL78_multiple_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/RL78_multiple_IAR/FreeRTOSConfig.h index d06aa9817..d52832b92 100644 --- a/FreeRTOS/Demo/RL78_multiple_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RL78_multiple_IAR/FreeRTOSConfig.h @@ -80,6 +80,9 @@ #define configTIMER_QUEUE_LENGTH 10 #define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* * Set the following definitions to 1 to include the API function, or zero diff --git a/FreeRTOS/Demo/RX100-RSK_GCC_e2studio/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/RX100-RSK_GCC_e2studio/RTOSDemo/FreeRTOSConfig.h index a5022d082..187632424 100644 --- a/FreeRTOS/Demo/RX100-RSK_GCC_e2studio/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX100-RSK_GCC_e2studio/RTOSDemo/FreeRTOSConfig.h @@ -64,6 +64,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -73,6 +74,7 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions - only included when the demo is configured to build the full demo (as opposed to the low power demo). */ diff --git a/FreeRTOS/Demo/RX100-RSK_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/RX100-RSK_IAR/FreeRTOSConfig.h index 61be0eee5..c28c0ae70 100644 --- a/FreeRTOS/Demo/RX100-RSK_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX100-RSK_IAR/FreeRTOSConfig.h @@ -65,6 +65,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -74,6 +75,7 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions - only included when the demo is configured to build the full demo (as opposed to the low power demo). */ diff --git a/FreeRTOS/Demo/RX100-RSK_Renesas_e2studio/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/RX100-RSK_Renesas_e2studio/RTOSDemo/FreeRTOSConfig.h index 955a4bb64..69310f5f5 100644 --- a/FreeRTOS/Demo/RX100-RSK_Renesas_e2studio/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX100-RSK_Renesas_e2studio/RTOSDemo/FreeRTOSConfig.h @@ -74,6 +74,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -83,6 +84,7 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions - only included when the demo is configured to build the full demo (as opposed to the low power demo). */ diff --git a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.project b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.project index 04f0b9cc7..e54f44fea 100644 --- a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.project +++ b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.project @@ -101,6 +101,15 @@ 1.0-name-matches-false-false-PriorityDefinitions.h + + 1442848178229 + src/FreeRTOS_Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 1443970320129 src/cg_src diff --git a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h index 9fd45a004..1e7a9912a 100644 --- a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h @@ -61,6 +61,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 diff --git a/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/.project b/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/.project index 61eb43c35..db6373871 100644 --- a/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/.project +++ b/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/.project @@ -57,6 +57,15 @@ + + 1443895064622 + src/FreeRTOS_Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 1443895064632 src/FreeRTOS_Source diff --git a/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/FreeRTOSConfig.h index 979a4519d..8867fd1ee 100644 --- a/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/FreeRTOSConfig.h @@ -56,6 +56,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 diff --git a/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c b/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c index 8a6680260..e67c978b0 100644 --- a/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c +++ b/FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c @@ -51,7 +51,7 @@ void vInitialiseTimerForIntQueueTest( void ) { SYSTEM.PRCR.WORD = 0xa502; - /* Cascade two 8bit timer channels to generate the interrupts. + /* Cascade two 8bit timer channels to generate the interrupts. 8bit timer unit 1 (TMR0 and TMR1) and 8bit timer unit 2 (TMR2 and TMR3 are utilised for this test. */ @@ -74,11 +74,11 @@ void vInitialiseTimerForIntQueueTest( void ) /* 16 bit operation ( count from timer 1,2 ). */ TMR0.TCCR.BIT.CSS = 3; TMR2.TCCR.BIT.CSS = 3; - + /* Use PCLK as the input. */ TMR1.TCCR.BIT.CSS = 1; TMR3.TCCR.BIT.CSS = 1; - + /* Divide PCLK by 8. */ TMR1.TCCR.BIT.CKS = 2; TMR3.TCCR.BIT.CKS = 2; diff --git a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ButtonAndLCD.c b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ButtonAndLCD.c index 13cd51faf..2f0f7fd2b 100644 --- a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ButtonAndLCD.c +++ b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ButtonAndLCD.c @@ -40,7 +40,7 @@ #define lcdRUNNING 0U /* Characters on each line. */ -#define lcdSTRING_LEN 8 +#define lcdSTRING_LEN 8 /* Commands sent from the IRQ to the task controlling the second line of the display. */ @@ -65,8 +65,8 @@ static void prvIRQ3_Handler( void ); #pragma interrupt ( prvIRQ4_Handler(vect = 68, enable ) ) static void prvIRQ4_Handler( void ); -/* - * Setup the IO needed for the buttons to generate interrupts. +/* + * Setup the IO needed for the buttons to generate interrupts. */ static void prvSetupButtonIOAndInterrupts( void ); @@ -80,20 +80,20 @@ static void prvLCDTaskLine1( void *pvParameters ); * If no buttons are pushed, then this task acts as per prvLCDTaskLine1(), but * using the second line of the display. * - * Using the buttons, it is possible to start and stop the scrolling of the + * Using the buttons, it is possible to start and stop the scrolling of the * text. Once the scrolling has been stopped, other buttons can be used to * manually scroll the text either left or right. - */ + */ static void prvLCDTaskLine2( void *pvParameters ); /* * Looks at the direction the string is currently being scrolled in, and moves * the index into the portion of the string that can be seen on the display - * either forward or backward as appropriate. + * either forward or backward as appropriate. */ static prvScrollString( unsigned char *pucDirection, unsigned short *pusPosition, size_t xStringLength ); -/* +/* * Displays lcdSTRING_LEN characters starting from pcString on the line of the * display requested by ucLine. */ @@ -101,9 +101,9 @@ static void prvDisplayNextString( unsigned char ucLine, char *pcString ); /* * Called from the IRQ interrupts, which are generated on button pushes. Send - * ucCommand to the task on the button command queue if + * ucCommand to the task on the button command queue if * lcdMIN_TIME_BETWEEN_INTERRUPTS_MS milliseconds have passed since the button - * was last pushed (for debouncing). + * was last pushed (for debouncing). */ static portBASE_TYPE prvSendCommandOnDebouncedInput( TickType_t *pxTimeLastInterrupt, unsigned char ucCommand ); @@ -120,18 +120,18 @@ static SemaphoreHandle_t xLCDMutex = NULL; /* The string that is scrolled up and down the first line of the display. */ static const char cDataString1[] = " http://www.FreeRTOS.org "; -/* The string that is scrolled/nudged up and down the second line of the +/* The string that is scrolled/nudged up and down the second line of the display. */ static const char cDataString2[] = "........Rx210 Highlights....1.56 DMips/MHz....DSP functions....1.62V-5.5V operation....200 uA/MHz....Up to 512 kBytes Flash....up to 64 kbytes SRAM....EE Dataflash with 100k w/e....1.3 uA in Real Time Clock Mode....Powerful Motor control timer....4 x 16-bit timers....4 x 8-bit timers....Full Real Time Clock calendar with calibration and alarm functions....Up to 16 channels 1 uS 12-bit ADC, with Dual group programmable SCAN, 3 sample and holds, sample accumulate function....DMA controller....Data Transfer Controller....Up to 9 serial Channels....Up to 6 USARTs ( with Simple I2C / SPI )....USART ( with unique Frame based protocol support )....Multimaster IIC....RSPI....Temperature Sensor....Event Link Controller....Comparators....Safety features include CRC....March X....Dual watchdog Timers with window and independent oscillator....ADC self test....I/O Pin Test....Supported with E1 on chip debugger and RSK210 evaluation system....Rx210 Highlights........"; /* Structures passed into the two tasks to inform them which line to use on the display, how long to delay for, and which string to use. */ -struct _LCD_Params xLCDLine1 = +struct _LCD_Params xLCDLine1 = { - LCD_LINE1, 215, ( char * ) cDataString1 + LCD_LINE1, 215, ( char * ) cDataString1 }; -struct _LCD_Params xLCDLine2 = +struct _LCD_Params xLCDLine2 = { LCD_LINE2, 350, ( char * ) cDataString2 }; @@ -147,7 +147,7 @@ void vStartButtonAndLCDDemo( void ) /* Create the mutex used to guard the LCD. */ xLCDMutex = xSemaphoreCreateMutex(); configASSERT( xLCDMutex ); - + /* Create the queue used to pass commands from the IRQ interrupts to the prvLCDTaskLine2() task. */ xButtonCommandQueue = xQueueCreate( lcdCOMMAND_QUEUE_LENGTH, sizeof( unsigned char ) ); @@ -164,10 +164,10 @@ static void prvLCDTaskLine1( void *pvParameters ) struct _LCD_Params *pxLCDParamaters = ( struct _LCD_Params * ) pvParameters; unsigned short usPosition = 0U; unsigned char ucDirection = lcdRIGHT_TO_LEFT; - + for( ;; ) { - vTaskDelay( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); + vTaskDelay( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); /* Write the string. */ prvDisplayNextString( pxLCDParamaters->Line, &( pxLCDParamaters->ptr_str[ usPosition ] ) ); @@ -185,7 +185,7 @@ struct _LCD_Params *pxLCDParamaters = ( struct _LCD_Params * ) pvParameters; unsigned short usPosition = 0U; unsigned char ucDirection = lcdRIGHT_TO_LEFT, ucStatus = lcdRUNNING, ucQueueData; TickType_t xDelayTicks = ( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); - + for(;;) { /* Wait for a message from an IRQ handler. */ @@ -194,10 +194,10 @@ TickType_t xDelayTicks = ( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); /* A message was not received before xDelayTicks ticks passed, so generate the next string to display and display it. */ prvDisplayNextString( pxLCDParamaters->Line, &( pxLCDParamaters->ptr_str[ usPosition ] ) ); - - /* Move the string in whichever direction the scroll is currently + + /* Move the string in whichever direction the scroll is currently going in. */ - prvScrollString( &ucDirection, &usPosition, strlen( pxLCDParamaters->ptr_str ) ); + prvScrollString( &ucDirection, &usPosition, strlen( pxLCDParamaters->ptr_str ) ); } else { @@ -209,7 +209,7 @@ TickType_t xDelayTicks = ( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); /* If the LCD is running, top it. If the LCD is stopped, start it. */ ucStatus = !ucStatus; - + if( ucStatus == lcdRUNNING ) { xDelayTicks = ( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); @@ -220,7 +220,7 @@ TickType_t xDelayTicks = ( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); } break; - + case lcdSHIFT_BACK_COMMAND : if( ucStatus != lcdRUNNING ) @@ -229,13 +229,13 @@ TickType_t xDelayTicks = ( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); if( usPosition != 0U ) { /* ....move the display position back by one char. */ - usPosition--; + usPosition--; prvDisplayNextString( pxLCDParamaters->Line, &( pxLCDParamaters->ptr_str[ usPosition ] ) ); } } break; - - + + case lcdSHIFT_FORWARD_COMMAND : if( ucStatus != lcdRUNNING ) @@ -243,7 +243,7 @@ TickType_t xDelayTicks = ( pxLCDParamaters->Speed / portTICK_PERIOD_MS ); /* If not already at the end of the display.... */ if( usPosition != ( strlen( pxLCDParamaters->ptr_str ) - ( lcdSTRING_LEN - 1 ) ) ) { - /* ....move the display position forward by one + /* ....move the display position forward by one char. */ usPosition++; prvDisplayNextString( pxLCDParamaters->Line, &( pxLCDParamaters->ptr_str[ usPosition ] ) ); @@ -274,19 +274,19 @@ void prvSetupButtonIOAndInterrupts( void ) MPC.P34PFS.BIT.ISEL = 1; /* IRQ1 */ - ICU.IER[ 0x08 ].BIT.IEN1 = 1; + ICU.IER[ 0x08 ].BIT.IEN1 = 1; ICU.IPR[ 65 ].BIT.IPR = configMAX_SYSCALL_INTERRUPT_PRIORITY - 1; ICU.IR[ 65 ].BIT.IR = 0; ICU.IRQCR[ 1 ].BIT.IRQMD = 2; /* Rising edge */ /* IRQ3 */ - ICU.IER[ 0x08 ].BIT.IEN3 = 1; + ICU.IER[ 0x08 ].BIT.IEN3 = 1; ICU.IPR[ 67 ].BIT.IPR = configMAX_SYSCALL_INTERRUPT_PRIORITY - 1; ICU.IR[ 67 ].BIT.IR = 0; ICU.IRQCR[ 3 ].BIT.IRQMD = 2; /* Rising edge */ /* IRQ4 */ - ICU.IER[ 0x08 ].BIT.IEN4 = 1; + ICU.IER[ 0x08 ].BIT.IEN4 = 1; ICU.IPR[ 68 ].BIT.IPR = configMAX_SYSCALL_INTERRUPT_PRIORITY - 1; ICU.IR[ 68 ].BIT.IR = 0; ICU.IRQCR[ 4 ].BIT.IRQMD = 2; /* Rising edge */ @@ -300,13 +300,13 @@ static prvScrollString( unsigned char *pucDirection, unsigned short *pusPosition { /* Move to the next character. */ ( *pusPosition )++; - + /* Has the end of the string been reached? */ if( ( *pusPosition ) == ( xStringLength - ( lcdSTRING_LEN - 1 ) ) ) { /* Switch direction. */ *pucDirection = lcdLEFT_TO_RIGHT; - ( *pusPosition )--; + ( *pusPosition )--; } } else @@ -316,7 +316,7 @@ static prvScrollString( unsigned char *pucDirection, unsigned short *pusPosition if( *pusPosition == 0U ) { /* Switch Direction. */ - *pucDirection = lcdRIGHT_TO_LEFT; + *pucDirection = lcdRIGHT_TO_LEFT; } } } @@ -337,10 +337,10 @@ static portBASE_TYPE prvSendCommandOnDebouncedInput( TickType_t *pxTimeLastInter { portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; TickType_t xCurrentTickCount; - + /* Check the time now for debouncing purposes. */ xCurrentTickCount = xTaskGetTickCountFromISR(); - + /* Has enough time passed since the button was last push to accept it as a unique press? */ if( ( xCurrentTickCount - *pxTimeLastInterrupt ) > lcdMIN_TIME_BETWEEN_INTERRUPTS_MS ) @@ -349,9 +349,9 @@ TickType_t xCurrentTickCount; } /* Remember the time now, so debounce can be performed again on the next - interrupt. */ + interrupt. */ *pxTimeLastInterrupt = xCurrentTickCount; - + return xHigherPriorityTaskWoken; } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h index 673edac09..8ef845cd9 100644 --- a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h @@ -54,6 +54,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 1 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -63,6 +64,7 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c index 64eef23a7..88daf86ab 100644 --- a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c +++ b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c @@ -24,8 +24,8 @@ * */ -/* - * High frequency timer test as described in main.c. +/* + * High frequency timer test as described in main.c. */ /* Scheduler includes. */ @@ -71,24 +71,24 @@ void vSetupHighFrequencyTimer( void ) /* Enable compare match timer 2 and 3. */ MSTP( CMT2 ) = 0; MSTP( CMT3 ) = 0; - + /* Interrupt on compare match. */ CMT2.CMCR.BIT.CMIE = 1; - + /* Set the compare match value. */ CMT2.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / timerINTERRUPT_FREQUENCY ) -1 ) / 8 ); - + /* Divide the PCLK by 8. */ CMT2.CMCR.BIT.CKS = 0; CMT3.CMCR.BIT.CKS = 0; - + /* Enable the interrupt... */ _IEN( _CMT2_CMI2 ) = 1; - + /* ...and set its priority to the maximum possible, this is above the priority set by configMAX_SYSCALL_INTERRUPT_PRIORITY so will nest. */ _IPR( _CMT2_CMI2 ) = timerHIGHEST_PRIORITY; - + /* Start the timers. */ CMT.CMSTR1.BIT.STR2 = 1; CMT.CMSTR1.BIT.STR3 = 1; @@ -121,16 +121,16 @@ static unsigned long ulErrorCount = 0UL; /* This should not happen! */ ulErrorCount++; } - + usMaxCount = usCurrentCount; } /* Used to generate the run time stats. */ ulHighFrequencyTickCount++; - + /* Clear the timer. */ timerTIMER_3_COUNT_VALUE = 0; - + /* Then start the clock again. */ CMT.CMSTR1.BIT.STR3 = 1; } diff --git a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/IntQueueTimer.c b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/IntQueueTimer.c index eaeaa15a1..ce1fe9059 100644 --- a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/IntQueueTimer.c +++ b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/IntQueueTimer.c @@ -49,7 +49,7 @@ void vInitialiseTimerForIntQueueTest( void ) /* Ensure interrupts do not start until full configuration is complete. */ portENTER_CRITICAL(); { - /* Cascade two 8bit timer channels to generate the interrupts. + /* Cascade two 8bit timer channels to generate the interrupts. 8bit timer unit 1 (TMR0 and TMR1) and 8bit timer unit 2 (TMR2 and TMR3 are utilised for this test. */ @@ -72,15 +72,15 @@ void vInitialiseTimerForIntQueueTest( void ) /* 16 bit operation ( count from timer 1,2 ). */ TMR0.TCCR.BIT.CSS = 3; TMR2.TCCR.BIT.CSS = 3; - + /* Use PCLK as the input. */ TMR1.TCCR.BIT.CSS = 1; TMR3.TCCR.BIT.CSS = 1; - + /* Divide PCLK by 8. */ TMR1.TCCR.BIT.CKS = 2; TMR3.TCCR.BIT.CKS = 2; - + /* Enable TMR 0, 2 interrupts. */ IEN( TMR0, CMIA0 ) = 1; IEN( TMR2, CMIA2 ) = 1; @@ -91,7 +91,7 @@ void vInitialiseTimerForIntQueueTest( void ) IPR( TMR2, CMIA2 ) = ( configMAX_SYSCALL_INTERRUPT_PRIORITY - 2 ); } portEXIT_CRITICAL(); - + /* Ensure the interrupts are clear as they are edge detected. */ IR( TMR0, CMIA0 ) = 0; IR( TMR2, CMIA2 ) = 0; diff --git a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ParTest.c b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ParTest.c index 48ffab73f..0b84dd9a6 100644 --- a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ParTest.c +++ b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/ParTest.c @@ -46,7 +46,7 @@ long lParTestGetLEDState( unsigned long ulLED ); void vParTestInitialise( void ) { - /* Port pin configuration is done by the low level set up prior to this + /* Port pin configuration is done by the low level set up prior to this function being called. */ } /*-----------------------------------------------------------*/ @@ -117,7 +117,7 @@ void vParTestToggleLED( unsigned long ulLED ) } } /*-----------------------------------------------------------*/ - + long lParTestGetLEDState( unsigned long ulLED ) { long lReturn = pdTRUE; @@ -130,26 +130,27 @@ long lReturn = pdTRUE; { lReturn = pdFALSE; } - break; + break; case 1 : if( LED1 != 0 ) { lReturn = pdFALSE; } - break; + break; case 2 : if( LED2 != 0 ) { lReturn = pdFALSE; } - break; + break; case 3 : if( LED3 != 0 ) { lReturn = pdFALSE; } - break; + break; } } - + return lReturn; } /*-----------------------------------------------------------*/ + \ No newline at end of file diff --git a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/main-full.c b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/main-full.c index b9a6b0da7..9d2815a27 100644 --- a/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/main-full.c +++ b/FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/main-full.c @@ -39,26 +39,26 @@ * In addition to the standard demo tasks, the following tasks and tests are * defined and/or created within this file: * - * "Reg test" tasks - These fill the registers with known values, then - * repeatedly check that each register still contains its expected value for - * the lifetime of the tasks. Each task uses different values. The tasks run - * with very low priority so get preempted very frequently. A check variable - * is incremented on each iteration of the test loop. A register containing an - * unexpected value is indicative of an error in the context switching - * mechanism and will result in a branch to a null loop - which in turn will - * prevent the check variable from incrementing any further and allow the check - * timer (described below) to determine that an error has occurred. The nature + * "Reg test" tasks - These fill the registers with known values, then + * repeatedly check that each register still contains its expected value for + * the lifetime of the tasks. Each task uses different values. The tasks run + * with very low priority so get preempted very frequently. A check variable + * is incremented on each iteration of the test loop. A register containing an + * unexpected value is indicative of an error in the context switching + * mechanism and will result in a branch to a null loop - which in turn will + * prevent the check variable from incrementing any further and allow the check + * timer (described below) to determine that an error has occurred. The nature * of the reg test tasks necessitates that they are written in assembly code. * - * "Check Timer" and Callback Function - The check timer period is initially - * set to five seconds. The check timer callback function checks that all the - * standard demo tasks are not only still executing, but are executing without - * reporting any errors. If the check timer discovers that a task has either - * stalled, or reported an error, then it changes its own period from the - * initial five seconds, to just 200ms. The check timer callback function - * also toggles LED 3 each time it is called. This provides a visual - * indication of the system status: If the LED toggles every five seconds, - * then no issues have been discovered. If the LED toggles every 200ms, then + * "Check Timer" and Callback Function - The check timer period is initially + * set to five seconds. The check timer callback function checks that all the + * standard demo tasks are not only still executing, but are executing without + * reporting any errors. If the check timer discovers that a task has either + * stalled, or reported an error, then it changes its own period from the + * initial five seconds, to just 200ms. The check timer callback function + * also toggles LED 3 each time it is called. This provides a visual + * indication of the system status: If the LED toggles every five seconds, + * then no issues have been discovered. If the LED toggles every 200ms, then * an issue has been discovered with at least one task. * * "High frequency timer test" - A high frequency periodic interrupt is @@ -73,7 +73,7 @@ * a message back and forth along the top line of the LCD display. If no * buttons are pushed, the second also scrolls a message back and forth, but * along the bottom line of the display. The automatic scrolling of the second - * line of the display can be started and stopped using button SW2. Once + * line of the display can be started and stopped using button SW2. Once * stopped it can then be manually nudged left using button SW3, and manually * nudged right using button SW1. Button pushes generate an interrupt, and the * interrupt communicates with the task using a queue. @@ -122,7 +122,7 @@ /* Peripheral includes. */ #include "lcd.h" -/* Values that are passed into the reg test tasks using the task parameter. +/* Values that are passed into the reg test tasks using the task parameter. The tasks check that the values are passed in correctly. */ #define mainREG_TEST_1_PARAMETER ( 0x12121212UL ) #define mainREG_TEST_2_PARAMETER ( 0x12345678UL ) @@ -224,7 +224,7 @@ extern void HardwareSetup( void ); /* Renesas provided CPU configuration routine. The clocks are configured in here. */ - HardwareSetup(); + HardwareSetup(); /* Turn all LEDs off. */ vParTestInitialise(); @@ -261,9 +261,9 @@ extern void HardwareSetup( void ); ( void * ) 0, /* The ID is not used, so can be set to anything. */ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */ ); - + configASSERT( xCheckTimer ); - + /* Start the check timer. It will actually start when the scheduler is started. */ xTimerStart( xCheckTimer, mainDONT_BLOCK ); @@ -344,16 +344,16 @@ static volatile unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2Cycl the LED toggles every 5 seconds then everything is ok. A faster toggle indicates an error. */ vParTestToggleLED( mainCHECK_LED ); - + /* Was an error detected this time through the callback execution? */ if( lErrorStatus != pdPASS ) { if( lChangedTimerPeriodAlready == pdFALSE ) { lChangedTimerPeriodAlready = pdTRUE; - - /* This call to xTimerChangePeriod() uses a zero block time. - Functions called from inside of a timer callback function must + + /* This call to xTimerChangePeriod() uses a zero block time. + Functions called from inside of a timer callback function must *never* attempt to block. */ xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK ); } diff --git a/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/.project b/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/.project index f43afbc7a..ffa737b75 100644 --- a/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/.project +++ b/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/.project @@ -122,6 +122,15 @@ 1.0-name-matches-false-false-IAR_Support + + 1442956878652 + src/FreeRTOS_Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 1443173361824 src/Full_Demo diff --git a/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h b/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h index f1fb09c2a..50205726a 100644 --- a/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h @@ -60,6 +60,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -70,6 +71,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s b/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s index 8e5883829..0f5a5a802 100644 --- a/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s +++ b/FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s @@ -26,7 +26,7 @@ PUBLIC _vRegTest1Implementation PUBLIC _vRegTest2Implementation - + EXTERN _ulRegTest1LoopCounter EXTERN _ulRegTest2LoopCounter @@ -42,22 +42,22 @@ _vRegTest1Implementation: MVTACGU R1, A1 /* Put a known value in each register. */ - MOV #1, R1 - MOV #2, R2 - MOV #3, R3 - MOV #4, R4 - MOV #5, R5 - MOV #6, R6 - MOV #7, R7 - MOV #8, R8 - MOV #9, R9 - MOV #10, R10 - MOV #11, R11 - MOV #12, R12 - MOV #13, R13 - MOV #14, R14 - MOV #15, R15 - + MOV #1, R1 + MOV #2, R2 + MOV #3, R3 + MOV #4, R4 + MOV #5, R5 + MOV #6, R6 + MOV #7, R7 + MOV #8, R8 + MOV #9, R9 + MOV #10, R10 + MOV #11, R11 + MOV #12, R12 + MOV #13, R13 + MOV #14, R14 + MOV #15, R15 + ;/* Put a known value in the hi and low of the accumulators. */ MVTACHI R1, A0 MVTACLO R2, A0 @@ -65,24 +65,24 @@ _vRegTest1Implementation: MVTACLO R4, A1 /* Loop, checking each iteration that each register still contains the expected value. */ -TestLoop1: +TestLoop1: /* Push the registers that are going to get clobbered. */ - PUSHM R14-R15 - + PUSHM R14-R15 + /* Increment the loop counter to show this task is still getting CPU time. */ - MOV #_ulRegTest1LoopCounter, R14 - MOV [ R14 ], R15 - ADD #1, R15 - MOV R15, [ R14 ] - + MOV #_ulRegTest1LoopCounter, R14 + MOV [ R14 ], R15 + ADD #1, R15 + MOV R15, [ R14 ] + /* Yield to extend the text coverage. Set the bit in the ITU SWINTR register. */ - MOV #1, R14 - MOV #0872E0H, R15 - MOV.B R14, [R15] - NOP - NOP - + MOV #1, R14 + MOV #0872E0H, R15 + MOV.B R14, [R15] + NOP + NOP + ;/* Check accumulators. */ MVFACHI #0, A0, R15 CMP #1, R15 @@ -104,48 +104,48 @@ TestLoop1: BNE RegTest1Error /* Restore the clobbered registers. */ - POPM R14-R15 - + POPM R14-R15 + /* Now compare each register to ensure it still contains the value that was set before this loop was entered. */ - CMP #1, R1 - BNE RegTest1Error - CMP #2, R2 - BNE RegTest1Error - CMP #3, R3 - BNE RegTest1Error - CMP #4, R4 - BNE RegTest1Error - CMP #5, R5 - BNE RegTest1Error - CMP #6, R6 - BNE RegTest1Error - CMP #7, R7 - BNE RegTest1Error - CMP #8, R8 - BNE RegTest1Error - CMP #9, R9 - BNE RegTest1Error - CMP #10, R10 - BNE RegTest1Error - CMP #11, R11 - BNE RegTest1Error - CMP #12, R12 - BNE RegTest1Error - CMP #13, R13 - BNE RegTest1Error - CMP #14, R14 - BNE RegTest1Error - CMP #15, R15 - BNE RegTest1Error + CMP #1, R1 + BNE RegTest1Error + CMP #2, R2 + BNE RegTest1Error + CMP #3, R3 + BNE RegTest1Error + CMP #4, R4 + BNE RegTest1Error + CMP #5, R5 + BNE RegTest1Error + CMP #6, R6 + BNE RegTest1Error + CMP #7, R7 + BNE RegTest1Error + CMP #8, R8 + BNE RegTest1Error + CMP #9, R9 + BNE RegTest1Error + CMP #10, R10 + BNE RegTest1Error + CMP #11, R11 + BNE RegTest1Error + CMP #12, R12 + BNE RegTest1Error + CMP #13, R13 + BNE RegTest1Error + CMP #14, R14 + BNE RegTest1Error + CMP #15, R15 + BNE RegTest1Error /* All comparisons passed, start a new itteratio of this loop. */ - BRA TestLoop1 - -RegTest1Error: + BRA TestLoop1 + +RegTest1Error: /* A compare failed, just loop here so the loop counter stops incrementing - causing the check task to indicate the error. */ - BRA RegTest1Error + BRA RegTest1Error /*-----------------------------------------------------------*/ /* This function is explained in the comments at the top of main.c. */ @@ -158,21 +158,21 @@ _vRegTest2Implementation: MVTACGU R1, A1 /* Put a known value in each register. */ - MOV #10H, R1 - MOV #20H, R2 - MOV #30H, R3 - MOV #40H, R4 - MOV #50H, R5 - MOV #60H, R6 - MOV #70H, R7 - MOV #80H, R8 - MOV #90H, R9 - MOV #100H, R10 - MOV #110H, R11 - MOV #120H, R12 - MOV #130H, R13 - MOV #140H, R14 - MOV #150H, R15 + MOV #10H, R1 + MOV #20H, R2 + MOV #30H, R3 + MOV #40H, R4 + MOV #50H, R5 + MOV #60H, R6 + MOV #70H, R7 + MOV #80H, R8 + MOV #90H, R9 + MOV #100H, R10 + MOV #110H, R11 + MOV #120H, R12 + MOV #130H, R13 + MOV #140H, R14 + MOV #150H, R15 ;/* Put a known value in the hi and low of the accumulators. */ MVTACHI R1, A0 @@ -182,17 +182,17 @@ _vRegTest2Implementation: /* Loop, checking each iteration that each register still contains the expected value. */ -TestLoop2: +TestLoop2: /* Push the registers that are going to get clobbered. */ - PUSHM R14-R15 - + PUSHM R14-R15 + /* Increment the loop counter to show this task is still getting CPU time. */ - MOV #_ulRegTest2LoopCounter, R14 - MOV [ R14 ], R15 - ADD #1, R15 - MOV R15, [ R14 ] - + MOV #_ulRegTest2LoopCounter, R14 + MOV [ R14 ], R15 + ADD #1, R15 + MOV R15, [ R14 ] + ;/* Check accumulators. */ MVFACHI #0, A0, R15 CMP #10H, R15 @@ -214,48 +214,48 @@ TestLoop2: BNE RegTest1Error /* Restore the clobbered registers. */ - POPM R14-R15 - + POPM R14-R15 + /* Now compare each register to ensure it still contains the value that was set before this loop was entered. */ - CMP #10H, R1 - BNE RegTest2Error - CMP #20H, R2 - BNE RegTest2Error - CMP #30H, R3 - BNE RegTest2Error - CMP #40H, R4 - BNE RegTest2Error - CMP #50H, R5 - BNE RegTest2Error - CMP #60H, R6 - BNE RegTest2Error - CMP #70H, R7 - BNE RegTest2Error - CMP #80H, R8 - BNE RegTest2Error - CMP #90H, R9 - BNE RegTest2Error - CMP #100H, R10 - BNE RegTest2Error - CMP #110H, R11 - BNE RegTest2Error - CMP #120H, R12 - BNE RegTest2Error - CMP #130H, R13 - BNE RegTest2Error - CMP #140H, R14 - BNE RegTest2Error - CMP #150H, R15 - BNE RegTest2Error + CMP #10H, R1 + BNE RegTest2Error + CMP #20H, R2 + BNE RegTest2Error + CMP #30H, R3 + BNE RegTest2Error + CMP #40H, R4 + BNE RegTest2Error + CMP #50H, R5 + BNE RegTest2Error + CMP #60H, R6 + BNE RegTest2Error + CMP #70H, R7 + BNE RegTest2Error + CMP #80H, R8 + BNE RegTest2Error + CMP #90H, R9 + BNE RegTest2Error + CMP #100H, R10 + BNE RegTest2Error + CMP #110H, R11 + BNE RegTest2Error + CMP #120H, R12 + BNE RegTest2Error + CMP #130H, R13 + BNE RegTest2Error + CMP #140H, R14 + BNE RegTest2Error + CMP #150H, R15 + BNE RegTest2Error /* All comparisons passed, start a new itteratio of this loop. */ - BRA TestLoop2 - -RegTest2Error: + BRA TestLoop2 + +RegTest2Error: /* A compare failed, just loop here so the loop counter stops incrementing - causing the check task to indicate the error. */ - BRA RegTest2Error - + BRA RegTest2Error + END diff --git a/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/.project b/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/.project index b9a771c7e..2d5073011 100644 --- a/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/.project +++ b/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/.project @@ -42,6 +42,15 @@ + + 1442942249601 + src/FreeRTOS_Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 1442942274534 src/FreeRTOS_Source/portable diff --git a/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/FreeRTOSConfig.h index e3285a90f..313fdfd1f 100644 --- a/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/FreeRTOSConfig.h @@ -54,6 +54,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -64,6 +65,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c b/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c index 2779dac3d..1d278f25d 100644 --- a/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c +++ b/FreeRTOS/Demo/RX200_RX231-RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c @@ -52,7 +52,7 @@ void vInitialiseTimerForIntQueueTest( void ) /* Give write access. */ SYSTEM.PRCR.WORD = 0xa502; - /* Cascade two 8bit timer channels to generate the interrupts. + /* Cascade two 8bit timer channels to generate the interrupts. 8bit timer unit 1 (TMR0 and TMR1) and 8bit timer unit 2 (TMR2 and TMR3 are utilised for this test. */ @@ -75,11 +75,11 @@ void vInitialiseTimerForIntQueueTest( void ) /* 16 bit operation ( count from timer 1,2 ). */ TMR0.TCCR.BIT.CSS = 3; TMR2.TCCR.BIT.CSS = 3; - + /* Use PCLK as the input. */ TMR1.TCCR.BIT.CSS = 1; TMR3.TCCR.BIT.CSS = 1; - + /* Divide PCLK by 8. */ TMR1.TCCR.BIT.CKS = 2; TMR3.TCCR.BIT.CKS = 2; diff --git a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h index 6138f344a..0d46a75b0 100644 --- a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/FreeRTOSConfig.h @@ -54,6 +54,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 1 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -63,6 +64,7 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c index 64eef23a7..88daf86ab 100644 --- a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c +++ b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/HighFrequencyTimerTest.c @@ -24,8 +24,8 @@ * */ -/* - * High frequency timer test as described in main.c. +/* + * High frequency timer test as described in main.c. */ /* Scheduler includes. */ @@ -71,24 +71,24 @@ void vSetupHighFrequencyTimer( void ) /* Enable compare match timer 2 and 3. */ MSTP( CMT2 ) = 0; MSTP( CMT3 ) = 0; - + /* Interrupt on compare match. */ CMT2.CMCR.BIT.CMIE = 1; - + /* Set the compare match value. */ CMT2.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / timerINTERRUPT_FREQUENCY ) -1 ) / 8 ); - + /* Divide the PCLK by 8. */ CMT2.CMCR.BIT.CKS = 0; CMT3.CMCR.BIT.CKS = 0; - + /* Enable the interrupt... */ _IEN( _CMT2_CMI2 ) = 1; - + /* ...and set its priority to the maximum possible, this is above the priority set by configMAX_SYSCALL_INTERRUPT_PRIORITY so will nest. */ _IPR( _CMT2_CMI2 ) = timerHIGHEST_PRIORITY; - + /* Start the timers. */ CMT.CMSTR1.BIT.STR2 = 1; CMT.CMSTR1.BIT.STR3 = 1; @@ -121,16 +121,16 @@ static unsigned long ulErrorCount = 0UL; /* This should not happen! */ ulErrorCount++; } - + usMaxCount = usCurrentCount; } /* Used to generate the run time stats. */ ulHighFrequencyTickCount++; - + /* Clear the timer. */ timerTIMER_3_COUNT_VALUE = 0; - + /* Then start the clock again. */ CMT.CMSTR1.BIT.STR3 = 1; } diff --git a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/IntQueueTimer.c b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/IntQueueTimer.c index eaeaa15a1..ce1fe9059 100644 --- a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/IntQueueTimer.c +++ b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/IntQueueTimer.c @@ -49,7 +49,7 @@ void vInitialiseTimerForIntQueueTest( void ) /* Ensure interrupts do not start until full configuration is complete. */ portENTER_CRITICAL(); { - /* Cascade two 8bit timer channels to generate the interrupts. + /* Cascade two 8bit timer channels to generate the interrupts. 8bit timer unit 1 (TMR0 and TMR1) and 8bit timer unit 2 (TMR2 and TMR3 are utilised for this test. */ @@ -72,15 +72,15 @@ void vInitialiseTimerForIntQueueTest( void ) /* 16 bit operation ( count from timer 1,2 ). */ TMR0.TCCR.BIT.CSS = 3; TMR2.TCCR.BIT.CSS = 3; - + /* Use PCLK as the input. */ TMR1.TCCR.BIT.CSS = 1; TMR3.TCCR.BIT.CSS = 1; - + /* Divide PCLK by 8. */ TMR1.TCCR.BIT.CKS = 2; TMR3.TCCR.BIT.CKS = 2; - + /* Enable TMR 0, 2 interrupts. */ IEN( TMR0, CMIA0 ) = 1; IEN( TMR2, CMIA2 ) = 1; @@ -91,7 +91,7 @@ void vInitialiseTimerForIntQueueTest( void ) IPR( TMR2, CMIA2 ) = ( configMAX_SYSCALL_INTERRUPT_PRIORITY - 2 ); } portEXIT_CRITICAL(); - + /* Ensure the interrupts are clear as they are edge detected. */ IR( TMR0, CMIA0 ) = 0; IR( TMR2, CMIA2 ) = 0; diff --git a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/ParTest.c b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/ParTest.c index 48ffab73f..0b84dd9a6 100644 --- a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/ParTest.c +++ b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/ParTest.c @@ -46,7 +46,7 @@ long lParTestGetLEDState( unsigned long ulLED ); void vParTestInitialise( void ) { - /* Port pin configuration is done by the low level set up prior to this + /* Port pin configuration is done by the low level set up prior to this function being called. */ } /*-----------------------------------------------------------*/ @@ -117,7 +117,7 @@ void vParTestToggleLED( unsigned long ulLED ) } } /*-----------------------------------------------------------*/ - + long lParTestGetLEDState( unsigned long ulLED ) { long lReturn = pdTRUE; @@ -130,26 +130,27 @@ long lReturn = pdTRUE; { lReturn = pdFALSE; } - break; + break; case 1 : if( LED1 != 0 ) { lReturn = pdFALSE; } - break; + break; case 2 : if( LED2 != 0 ) { lReturn = pdFALSE; } - break; + break; case 3 : if( LED3 != 0 ) { lReturn = pdFALSE; } - break; + break; } } - + return lReturn; } /*-----------------------------------------------------------*/ + \ No newline at end of file diff --git a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/main-full.c b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/main-full.c index 737f136c7..c10a5b9a8 100644 --- a/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/main-full.c +++ b/FreeRTOS/Demo/RX600_RX630-RSK_Renesas/RTOSDemo/main-full.c @@ -41,26 +41,26 @@ * In addition to the standard demo tasks, the following tasks and tests are * defined and/or created within this file: * - * "Reg test" tasks - These fill the registers with known values, then - * repeatedly check that each register still contains its expected value for - * the lifetime of the tasks. Each task uses different values. The tasks run - * with very low priority so get preempted very frequently. A check variable - * is incremented on each iteration of the test loop. A register containing an - * unexpected value is indicative of an error in the context switching - * mechanism and will result in a branch to a null loop - which in turn will - * prevent the check variable from incrementing any further and allow the check - * timer (described below) to determine that an error has occurred. The nature + * "Reg test" tasks - These fill the registers with known values, then + * repeatedly check that each register still contains its expected value for + * the lifetime of the tasks. Each task uses different values. The tasks run + * with very low priority so get preempted very frequently. A check variable + * is incremented on each iteration of the test loop. A register containing an + * unexpected value is indicative of an error in the context switching + * mechanism and will result in a branch to a null loop - which in turn will + * prevent the check variable from incrementing any further and allow the check + * timer (described below) to determine that an error has occurred. The nature * of the reg test tasks necessitates that they are written in assembly code. * - * "Check Timer" and Callback Function - The check timer period is initially - * set to five seconds. The check timer callback function checks that all the - * standard demo tasks are not only still executing, but are executing without - * reporting any errors. If the check timer discovers that a task has either - * stalled, or reported an error, then it changes its own period from the - * initial five seconds, to just 200ms. The check timer callback function - * also toggles LED 3 each time it is called. This provides a visual - * indication of the system status: If the LED toggles every five seconds, - * then no issues have been discovered. If the LED toggles every 200ms, then + * "Check Timer" and Callback Function - The check timer period is initially + * set to five seconds. The check timer callback function checks that all the + * standard demo tasks are not only still executing, but are executing without + * reporting any errors. If the check timer discovers that a task has either + * stalled, or reported an error, then it changes its own period from the + * initial five seconds, to just 200ms. The check timer callback function + * also toggles LED 3 each time it is called. This provides a visual + * indication of the system status: If the LED toggles every five seconds, + * then no issues have been discovered. If the LED toggles every 200ms, then * an issue has been discovered with at least one task. * * "High frequency timer test" - A high frequency periodic interrupt is @@ -249,10 +249,10 @@ extern void HardwareSetup( void ); ( void * ) 0, /* The ID is not used, so can be set to anything. */ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */ ); - + /* Sanity check that the check timer was indeed created. */ configASSERT( xCheckTimer ); - + /* Start the check timer. It will actually start when the scheduler is started. */ xTimerStart( xCheckTimer, mainDONT_BLOCK ); @@ -260,7 +260,7 @@ extern void HardwareSetup( void ); /* Start the tasks running. */ vTaskStartScheduler(); - /* If all is well, the following line will never be reached as the scheduler + /* If all is well, the following line will never be reached as the scheduler will be running. If the following line is reached, there was insufficient FreeRTOS heap available for the idle task to be created. See http://www.freertos.org/a00111.html and the malloc failed hook function for @@ -339,16 +339,16 @@ static volatile unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2Cycl the LED toggles every 5 seconds then everything is ok. A faster toggle indicates an error. */ vParTestToggleLED( mainCHECK_LED ); - + /* Was an error detected this time through the callback execution? */ if( lErrorStatus != pdPASS ) { if( lChangedTimerPeriodAlready == pdFALSE ) { lChangedTimerPeriodAlready = pdTRUE; - - /* This call to xTimerChangePeriod() uses a zero block time. - Functions called from inside of a timer callback function must + + /* This call to xTimerChangePeriod() uses a zero block time. + Functions called from inside of a timer callback function must *never* attempt to block. */ xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK ); } diff --git a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/FreeRTOSConfig.h index f64de2c9f..1c71cb653 100644 --- a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/FreeRTOSConfig.h @@ -54,6 +54,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -64,6 +65,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/IntQueueTimer.c b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/IntQueueTimer.c index 100d2d6eb..ce35edd3b 100644 --- a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/IntQueueTimer.c +++ b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/IntQueueTimer.c @@ -65,7 +65,7 @@ void vInitialiseTimerForIntQueueTest( void ) /* Give write access. */ SYSTEM.PRCR.WORD = 0xa502; - /* Cascade two 8bit timer channels to generate the interrupts. + /* Cascade two 8bit timer channels to generate the interrupts. 8bit timer unit 1 (TMR0 and TMR1) and 8bit timer unit 2 (TMR2 and TMR3 are utilised for this test. */ @@ -88,11 +88,11 @@ void vInitialiseTimerForIntQueueTest( void ) /* 16 bit operation ( count from timer 1,2 ). */ TMR0.TCCR.BIT.CSS = 3; TMR2.TCCR.BIT.CSS = 3; - + /* Use PCLK as the input. */ TMR1.TCCR.BIT.CSS = 1; TMR3.TCCR.BIT.CSS = 1; - + /* Divide PCLK by 8. */ TMR1.TCCR.BIT.CKS = 2; TMR3.TCCR.BIT.CKS = 2; diff --git a/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/FreeRTOSConfig.h b/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/FreeRTOSConfig.h index f64de2c9f..1c71cb653 100644 --- a/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/FreeRTOSConfig.h @@ -54,6 +54,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -64,6 +65,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/IntQueueTimer.c b/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/IntQueueTimer.c index 82cd24db0..103197cdc 100644 --- a/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/IntQueueTimer.c +++ b/FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/IntQueueTimer.c @@ -52,7 +52,7 @@ void vInitialiseTimerForIntQueueTest( void ) { EnablePRCR( PRC1_BIT ); - /* Cascade two 8bit timer channels to generate the interrupts. + /* Cascade two 8bit timer channels to generate the interrupts. 8bit timer unit 1 (TMR0 and TMR1) and 8bit timer unit 2 (TMR2 and TMR3 are utilised for this test. */ @@ -75,11 +75,11 @@ void vInitialiseTimerForIntQueueTest( void ) /* 16 bit operation ( count from timer 1,2 ). */ TMR0.TCCR.BIT.CSS = 3; TMR2.TCCR.BIT.CSS = 3; - + /* Use PCLK as the input. */ TMR1.TCCR.BIT.CSS = 1; TMR3.TCCR.BIT.CSS = 1; - + /* Divide PCLK by 8. */ TMR1.TCCR.BIT.CKS = 2; TMR3.TCCR.BIT.CKS = 2; diff --git a/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/.project b/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/.project index d5d8db36c..519bf9232 100644 --- a/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/.project +++ b/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/.project @@ -128,6 +128,15 @@ 1.0-name-matches-false-false-settings + + 1442756186478 + src/FreeRTOS_Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 1442924751731 src/Full_Demo diff --git a/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h b/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h index fd73b4c6c..e122b0dcf 100644 --- a/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/FreeRTOSConfig.h @@ -61,6 +61,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -71,6 +72,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human diff --git a/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s b/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s index 8e5883829..0f5a5a802 100644 --- a/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s +++ b/FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s @@ -26,7 +26,7 @@ PUBLIC _vRegTest1Implementation PUBLIC _vRegTest2Implementation - + EXTERN _ulRegTest1LoopCounter EXTERN _ulRegTest2LoopCounter @@ -42,22 +42,22 @@ _vRegTest1Implementation: MVTACGU R1, A1 /* Put a known value in each register. */ - MOV #1, R1 - MOV #2, R2 - MOV #3, R3 - MOV #4, R4 - MOV #5, R5 - MOV #6, R6 - MOV #7, R7 - MOV #8, R8 - MOV #9, R9 - MOV #10, R10 - MOV #11, R11 - MOV #12, R12 - MOV #13, R13 - MOV #14, R14 - MOV #15, R15 - + MOV #1, R1 + MOV #2, R2 + MOV #3, R3 + MOV #4, R4 + MOV #5, R5 + MOV #6, R6 + MOV #7, R7 + MOV #8, R8 + MOV #9, R9 + MOV #10, R10 + MOV #11, R11 + MOV #12, R12 + MOV #13, R13 + MOV #14, R14 + MOV #15, R15 + ;/* Put a known value in the hi and low of the accumulators. */ MVTACHI R1, A0 MVTACLO R2, A0 @@ -65,24 +65,24 @@ _vRegTest1Implementation: MVTACLO R4, A1 /* Loop, checking each iteration that each register still contains the expected value. */ -TestLoop1: +TestLoop1: /* Push the registers that are going to get clobbered. */ - PUSHM R14-R15 - + PUSHM R14-R15 + /* Increment the loop counter to show this task is still getting CPU time. */ - MOV #_ulRegTest1LoopCounter, R14 - MOV [ R14 ], R15 - ADD #1, R15 - MOV R15, [ R14 ] - + MOV #_ulRegTest1LoopCounter, R14 + MOV [ R14 ], R15 + ADD #1, R15 + MOV R15, [ R14 ] + /* Yield to extend the text coverage. Set the bit in the ITU SWINTR register. */ - MOV #1, R14 - MOV #0872E0H, R15 - MOV.B R14, [R15] - NOP - NOP - + MOV #1, R14 + MOV #0872E0H, R15 + MOV.B R14, [R15] + NOP + NOP + ;/* Check accumulators. */ MVFACHI #0, A0, R15 CMP #1, R15 @@ -104,48 +104,48 @@ TestLoop1: BNE RegTest1Error /* Restore the clobbered registers. */ - POPM R14-R15 - + POPM R14-R15 + /* Now compare each register to ensure it still contains the value that was set before this loop was entered. */ - CMP #1, R1 - BNE RegTest1Error - CMP #2, R2 - BNE RegTest1Error - CMP #3, R3 - BNE RegTest1Error - CMP #4, R4 - BNE RegTest1Error - CMP #5, R5 - BNE RegTest1Error - CMP #6, R6 - BNE RegTest1Error - CMP #7, R7 - BNE RegTest1Error - CMP #8, R8 - BNE RegTest1Error - CMP #9, R9 - BNE RegTest1Error - CMP #10, R10 - BNE RegTest1Error - CMP #11, R11 - BNE RegTest1Error - CMP #12, R12 - BNE RegTest1Error - CMP #13, R13 - BNE RegTest1Error - CMP #14, R14 - BNE RegTest1Error - CMP #15, R15 - BNE RegTest1Error + CMP #1, R1 + BNE RegTest1Error + CMP #2, R2 + BNE RegTest1Error + CMP #3, R3 + BNE RegTest1Error + CMP #4, R4 + BNE RegTest1Error + CMP #5, R5 + BNE RegTest1Error + CMP #6, R6 + BNE RegTest1Error + CMP #7, R7 + BNE RegTest1Error + CMP #8, R8 + BNE RegTest1Error + CMP #9, R9 + BNE RegTest1Error + CMP #10, R10 + BNE RegTest1Error + CMP #11, R11 + BNE RegTest1Error + CMP #12, R12 + BNE RegTest1Error + CMP #13, R13 + BNE RegTest1Error + CMP #14, R14 + BNE RegTest1Error + CMP #15, R15 + BNE RegTest1Error /* All comparisons passed, start a new itteratio of this loop. */ - BRA TestLoop1 - -RegTest1Error: + BRA TestLoop1 + +RegTest1Error: /* A compare failed, just loop here so the loop counter stops incrementing - causing the check task to indicate the error. */ - BRA RegTest1Error + BRA RegTest1Error /*-----------------------------------------------------------*/ /* This function is explained in the comments at the top of main.c. */ @@ -158,21 +158,21 @@ _vRegTest2Implementation: MVTACGU R1, A1 /* Put a known value in each register. */ - MOV #10H, R1 - MOV #20H, R2 - MOV #30H, R3 - MOV #40H, R4 - MOV #50H, R5 - MOV #60H, R6 - MOV #70H, R7 - MOV #80H, R8 - MOV #90H, R9 - MOV #100H, R10 - MOV #110H, R11 - MOV #120H, R12 - MOV #130H, R13 - MOV #140H, R14 - MOV #150H, R15 + MOV #10H, R1 + MOV #20H, R2 + MOV #30H, R3 + MOV #40H, R4 + MOV #50H, R5 + MOV #60H, R6 + MOV #70H, R7 + MOV #80H, R8 + MOV #90H, R9 + MOV #100H, R10 + MOV #110H, R11 + MOV #120H, R12 + MOV #130H, R13 + MOV #140H, R14 + MOV #150H, R15 ;/* Put a known value in the hi and low of the accumulators. */ MVTACHI R1, A0 @@ -182,17 +182,17 @@ _vRegTest2Implementation: /* Loop, checking each iteration that each register still contains the expected value. */ -TestLoop2: +TestLoop2: /* Push the registers that are going to get clobbered. */ - PUSHM R14-R15 - + PUSHM R14-R15 + /* Increment the loop counter to show this task is still getting CPU time. */ - MOV #_ulRegTest2LoopCounter, R14 - MOV [ R14 ], R15 - ADD #1, R15 - MOV R15, [ R14 ] - + MOV #_ulRegTest2LoopCounter, R14 + MOV [ R14 ], R15 + ADD #1, R15 + MOV R15, [ R14 ] + ;/* Check accumulators. */ MVFACHI #0, A0, R15 CMP #10H, R15 @@ -214,48 +214,48 @@ TestLoop2: BNE RegTest1Error /* Restore the clobbered registers. */ - POPM R14-R15 - + POPM R14-R15 + /* Now compare each register to ensure it still contains the value that was set before this loop was entered. */ - CMP #10H, R1 - BNE RegTest2Error - CMP #20H, R2 - BNE RegTest2Error - CMP #30H, R3 - BNE RegTest2Error - CMP #40H, R4 - BNE RegTest2Error - CMP #50H, R5 - BNE RegTest2Error - CMP #60H, R6 - BNE RegTest2Error - CMP #70H, R7 - BNE RegTest2Error - CMP #80H, R8 - BNE RegTest2Error - CMP #90H, R9 - BNE RegTest2Error - CMP #100H, R10 - BNE RegTest2Error - CMP #110H, R11 - BNE RegTest2Error - CMP #120H, R12 - BNE RegTest2Error - CMP #130H, R13 - BNE RegTest2Error - CMP #140H, R14 - BNE RegTest2Error - CMP #150H, R15 - BNE RegTest2Error + CMP #10H, R1 + BNE RegTest2Error + CMP #20H, R2 + BNE RegTest2Error + CMP #30H, R3 + BNE RegTest2Error + CMP #40H, R4 + BNE RegTest2Error + CMP #50H, R5 + BNE RegTest2Error + CMP #60H, R6 + BNE RegTest2Error + CMP #70H, R7 + BNE RegTest2Error + CMP #80H, R8 + BNE RegTest2Error + CMP #90H, R9 + BNE RegTest2Error + CMP #100H, R10 + BNE RegTest2Error + CMP #110H, R11 + BNE RegTest2Error + CMP #120H, R12 + BNE RegTest2Error + CMP #130H, R13 + BNE RegTest2Error + CMP #140H, R14 + BNE RegTest2Error + CMP #150H, R15 + BNE RegTest2Error /* All comparisons passed, start a new itteratio of this loop. */ - BRA TestLoop2 - -RegTest2Error: + BRA TestLoop2 + +RegTest2Error: /* A compare failed, just loop here so the loop counter stops incrementing - causing the check task to indicate the error. */ - BRA RegTest2Error - + BRA RegTest2Error + END diff --git a/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/FreeRTOSConfig.h index a1ff75824..3759cf111 100644 --- a/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/FreeRTOSConfig.h @@ -54,6 +54,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -64,6 +65,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES ( 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human diff --git a/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c b/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c index f38dd06af..d43f9f1b8 100644 --- a/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c +++ b/FreeRTOS/Demo/RX700_RX71M_RSK_Renesas_e2studio/src/Full_Demo/IntQueueTimer.c @@ -52,7 +52,7 @@ void vInitialiseTimerForIntQueueTest( void ) /* Give write access. */ SYSTEM.PRCR.WORD = 0xa502; - /* Cascade two 8bit timer channels to generate the interrupts. + /* Cascade two 8bit timer channels to generate the interrupts. 8bit timer unit 1 (TMR0 and TMR1) and 8bit timer unit 2 (TMR2 and TMR3 are utilised for this test. */ @@ -75,11 +75,11 @@ void vInitialiseTimerForIntQueueTest( void ) /* 16 bit operation ( count from timer 1,2 ). */ TMR0.TCCR.BIT.CSS = 3; TMR2.TCCR.BIT.CSS = 3; - + /* Use PCLK as the input. */ TMR1.TCCR.BIT.CSS = 1; TMR3.TCCR.BIT.CSS = 1; - + /* Divide PCLK by 8. */ TMR1.TCCR.BIT.CKS = 2; TMR3.TCCR.BIT.CKS = 2; diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/.project b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/.project index cf08720ff..41f60e1b6 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/.project +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/.project @@ -61,6 +61,15 @@ + + 0 + src/FreeRTOS/Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 0 src/FreeRTOS/Source/portable diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/main_full.c b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/main_full.c index 6d38810c4..64fbed10b 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/main_full.c +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/main_full.c @@ -453,7 +453,7 @@ static void prvRegTest1Task( void *pvParameters ) #if defined(__DPFPU) - /* Tell the kernel that this task require a DPFPU context before any DPFPU + /* Tell the kernel that this task require a DPFPU context before any DPFPU instructions are executed. */ portTASK_USES_DPFPU(); @@ -479,7 +479,7 @@ static void prvRegTest2Task( void *pvParameters ) #if defined(__DPFPU) - /* Tell the kernel that this task require a DPFPU context before any DPFPU + /* Tell the kernel that this task require a DPFPU context before any DPFPU instructions are executed. */ portTASK_USES_DPFPU(); diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/serial.c b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/serial.c index b94d2c33a..a2468dbc7 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/serial.c +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/FreeRTOS_Demo/Full_Demo/serial.c @@ -60,7 +60,7 @@ void vSerialSciCallback( void *pvArgs ) sci_cb_args_t *pxArgs = (sci_cb_args_t *)pvArgs; /* Renesas API has a built-in queue but we will ignore it. If the queue is not - full, a received character is passed with SCI_EVT_RX_CHAR event. If the queue + full, a received character is passed with SCI_EVT_RX_CHAR event. If the queue is full, a received character is passed with SCI_EVT_RXBUF_OVFL event. */ if( SCI_EVT_RX_CHAR == pxArgs->event || SCI_EVT_RXBUF_OVFL == pxArgs->event ) { diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/frtos_config/FreeRTOSConfig.h b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/frtos_config/FreeRTOSConfig.h index 4111684a6..91cbfd6e0 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/frtos_config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/frtos_config/FreeRTOSConfig.h @@ -52,6 +52,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -62,6 +63,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES (7) +#define configMAX_CO_ROUTINE_PRIORITIES (2) #define configUSE_TASK_NOTIFICATIONS 1 #define configRECORD_STACK_HIGH_ADDRESS 0 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/smc_gen/r_bsp/mcu/all/r_rtos.h b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/smc_gen/r_bsp/mcu/all/r_rtos.h index 9fb757c01..6d4d8268d 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/smc_gen/r_bsp/mcu/all/r_rtos.h +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_GCC_e2studio/src/smc_gen/r_bsp/mcu/all/r_rtos.h @@ -37,6 +37,7 @@ Includes , "Project Includes" #include "task.h" #include "semphr.h" #include "queue.h" +#include "croutine.h" #include "timers.h" #include "event_groups.h" #include "freertos_start.h" diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/.project b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/.project index 8d86fae3e..6247a011d 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/.project +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/.project @@ -79,6 +79,15 @@ 1.0-name-matches-false-false-RTOSDemo_ICCRX.ipcf + + 0 + src/FreeRTOS/Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 0 src/FreeRTOS/Source/portable diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewp b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewp index 9796b0ebe..e963ac438 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewp +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewp @@ -2113,6 +2113,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewt b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewt index f3b7791e8..a9480e84d 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewt +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/RTOSDemo.ewt @@ -2316,6 +2316,9 @@ $PROJ_DIR$\..\..\Source\include\atomic.h + + $PROJ_DIR$\..\..\Source\include\croutine.h + $PROJ_DIR$\..\..\Source\include\deprecated_definitions.h diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/main_full.c b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/main_full.c index 6d38810c4..64fbed10b 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/main_full.c +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/main_full.c @@ -453,7 +453,7 @@ static void prvRegTest1Task( void *pvParameters ) #if defined(__DPFPU) - /* Tell the kernel that this task require a DPFPU context before any DPFPU + /* Tell the kernel that this task require a DPFPU context before any DPFPU instructions are executed. */ portTASK_USES_DPFPU(); @@ -479,7 +479,7 @@ static void prvRegTest2Task( void *pvParameters ) #if defined(__DPFPU) - /* Tell the kernel that this task require a DPFPU context before any DPFPU + /* Tell the kernel that this task require a DPFPU context before any DPFPU instructions are executed. */ portTASK_USES_DPFPU(); diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/serial.c b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/serial.c index b94d2c33a..a2468dbc7 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/serial.c +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/FreeRTOS_Demo/Full_Demo/serial.c @@ -60,7 +60,7 @@ void vSerialSciCallback( void *pvArgs ) sci_cb_args_t *pxArgs = (sci_cb_args_t *)pvArgs; /* Renesas API has a built-in queue but we will ignore it. If the queue is not - full, a received character is passed with SCI_EVT_RX_CHAR event. If the queue + full, a received character is passed with SCI_EVT_RX_CHAR event. If the queue is full, a received character is passed with SCI_EVT_RXBUF_OVFL event. */ if( SCI_EVT_RX_CHAR == pxArgs->event || SCI_EVT_RXBUF_OVFL == pxArgs->event ) { diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/frtos_config/FreeRTOSConfig.h b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/frtos_config/FreeRTOSConfig.h index 4111684a6..91cbfd6e0 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/frtos_config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/frtos_config/FreeRTOSConfig.h @@ -52,6 +52,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -62,6 +63,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES (7) +#define configMAX_CO_ROUTINE_PRIORITIES (2) #define configUSE_TASK_NOTIFICATIONS 1 #define configRECORD_STACK_HIGH_ADDRESS 0 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/smc_gen/r_bsp/mcu/all/r_rtos.h b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/smc_gen/r_bsp/mcu/all/r_rtos.h index 9fb757c01..6d4d8268d 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/smc_gen/r_bsp/mcu/all/r_rtos.h +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_IAR_e2studio_EWRX/src/smc_gen/r_bsp/mcu/all/r_rtos.h @@ -37,6 +37,7 @@ Includes , "Project Includes" #include "task.h" #include "semphr.h" #include "queue.h" +#include "croutine.h" #include "timers.h" #include "event_groups.h" #include "freertos_start.h" diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/.project b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/.project index ebb934036..3396379b4 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/.project +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/.project @@ -66,6 +66,15 @@ + + 0 + src/FreeRTOS/Source + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-croutine.c + + 0 src/FreeRTOS/Source/portable diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/RTOSDemo.mtpj b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/RTOSDemo.mtpj index 0af4ac271..e4ca73f65 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/RTOSDemo.mtpj +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/RTOSDemo.mtpj @@ -159,6 +159,13 @@ 03cad1e8-2eb3-4cde-a8a3-982423631122 f3fa751d-c0a0-4678-bd40-d2230caccbbb + + croutine.h + File + ..\..\Source\include\croutine.h + 03cad1e8-2eb3-4cde-a8a3-982423631122 + f3fa751d-c0a0-4678-bd40-d2230caccbbb + deprecated_definitions.h File @@ -647,6 +654,20 @@ 03cad1e8-2eb3-4cde-a8a3-982423631122 61ddca75-90bd-4cf7-958a-f95eca44d615 + + crflash.h + File + ..\Common\include\crflash.h + 03cad1e8-2eb3-4cde-a8a3-982423631122 + 61ddca75-90bd-4cf7-958a-f95eca44d615 + + + crhook.h + File + ..\Common\include\crhook.h + 03cad1e8-2eb3-4cde-a8a3-982423631122 + 61ddca75-90bd-4cf7-958a-f95eca44d615 + death.h File diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/main_full.c b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/main_full.c index 6d38810c4..64fbed10b 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/main_full.c +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/main_full.c @@ -453,7 +453,7 @@ static void prvRegTest1Task( void *pvParameters ) #if defined(__DPFPU) - /* Tell the kernel that this task require a DPFPU context before any DPFPU + /* Tell the kernel that this task require a DPFPU context before any DPFPU instructions are executed. */ portTASK_USES_DPFPU(); @@ -479,7 +479,7 @@ static void prvRegTest2Task( void *pvParameters ) #if defined(__DPFPU) - /* Tell the kernel that this task require a DPFPU context before any DPFPU + /* Tell the kernel that this task require a DPFPU context before any DPFPU instructions are executed. */ portTASK_USES_DPFPU(); diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/serial.c b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/serial.c index b94d2c33a..a2468dbc7 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/serial.c +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/FreeRTOS_Demo/Full_Demo/serial.c @@ -60,7 +60,7 @@ void vSerialSciCallback( void *pvArgs ) sci_cb_args_t *pxArgs = (sci_cb_args_t *)pvArgs; /* Renesas API has a built-in queue but we will ignore it. If the queue is not - full, a received character is passed with SCI_EVT_RX_CHAR event. If the queue + full, a received character is passed with SCI_EVT_RX_CHAR event. If the queue is full, a received character is passed with SCI_EVT_RXBUF_OVFL event. */ if( SCI_EVT_RX_CHAR == pxArgs->event || SCI_EVT_RXBUF_OVFL == pxArgs->event ) { diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/frtos_config/FreeRTOSConfig.h b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/frtos_config/FreeRTOSConfig.h index 4111684a6..91cbfd6e0 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/frtos_config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/frtos_config/FreeRTOSConfig.h @@ -52,6 +52,7 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configGENERATE_RUN_TIME_STATS 0 #define configCHECK_FOR_STACK_OVERFLOW 2 @@ -62,6 +63,7 @@ #define configUSE_QUEUE_SETS 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configMAX_PRIORITIES (7) +#define configMAX_CO_ROUTINE_PRIORITIES (2) #define configUSE_TASK_NOTIFICATIONS 1 #define configRECORD_STACK_HIGH_ADDRESS 0 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 diff --git a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/smc_gen/r_bsp/mcu/all/r_rtos.h b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/smc_gen/r_bsp/mcu/all/r_rtos.h index 9fb757c01..6d4d8268d 100644 --- a/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/smc_gen/r_bsp/mcu/all/r_rtos.h +++ b/FreeRTOS/Demo/RX700_RX72N_EnvisionKit_Renesas_e2studio_CS+/src/smc_gen/r_bsp/mcu/all/r_rtos.h @@ -37,6 +37,7 @@ Includes , "Project Includes" #include "task.h" #include "semphr.h" #include "queue.h" +#include "croutine.h" #include "timers.h" #include "event_groups.h" #include "freertos_start.h" diff --git a/FreeRTOS/Demo/Safer_Interrupts_M33F_NXP_LPC55S69_MCUXpresso/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/Safer_Interrupts_M33F_NXP_LPC55S69_MCUXpresso/Config/FreeRTOSConfig.h index a3b4280d3..1b936bf92 100644 --- a/FreeRTOS/Demo/Safer_Interrupts_M33F_NXP_LPC55S69_MCUXpresso/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/Safer_Interrupts_M33F_NXP_LPC55S69_MCUXpresso/Config/FreeRTOSConfig.h @@ -86,6 +86,10 @@ /* Task aware debugging. */ #define configRECORD_STACK_HIGH_ADDRESS 1 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/T-HEAD_CB2201_CDK/FreeRTOSConfig.h b/FreeRTOS/Demo/T-HEAD_CB2201_CDK/FreeRTOSConfig.h index 96d98447a..270e4daf0 100644 --- a/FreeRTOS/Demo/T-HEAD_CB2201_CDK/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/T-HEAD_CB2201_CDK/FreeRTOSConfig.h @@ -50,6 +50,7 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #define configUSE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 1 #define configUSE_RECURSIVE_MUTEXES 0 @@ -71,6 +72,7 @@ /*#define configGENERATE_RUN_TIME_STATS 1*/ #define configMAX_PRIORITIES ( 200 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/T-HEAD_CB2201_CDK/RTOSDemo_CDK/RTOSDemo/RTOSDemo.cdkproj b/FreeRTOS/Demo/T-HEAD_CB2201_CDK/RTOSDemo_CDK/RTOSDemo/RTOSDemo.cdkproj index 809365ac0..2b45bdf88 100644 --- a/FreeRTOS/Demo/T-HEAD_CB2201_CDK/RTOSDemo_CDK/RTOSDemo/RTOSDemo.cdkproj +++ b/FreeRTOS/Demo/T-HEAD_CB2201_CDK/RTOSDemo_CDK/RTOSDemo/RTOSDemo.cdkproj @@ -92,6 +92,9 @@ + + + @@ -114,6 +117,9 @@ + + + diff --git a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/FreeRTOSConfig.h b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/FreeRTOSConfig.h index 2ed883e42..c2b48f97f 100644 --- a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/FreeRTOSConfig.h @@ -118,6 +118,9 @@ #define configCHECK_FOR_STACK_OVERFLOW 2 #endif +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /** * Set the following definitions to 1 to include the API function, or zero to diff --git a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.c b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.c index 4cc3cdebf..d48742f3e 100644 --- a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.c +++ b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.c @@ -10,7 +10,8 @@ * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * copies or substantial portions of the Software. If you wish to use our Amazon + * FreeRTOS name, please do so in a fair use way that does not cause confusion. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS diff --git a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.h b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.h index 8f9c40df2..2fdd6b75d 100644 --- a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.h +++ b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/IntQueueTimer.h @@ -10,7 +10,8 @@ * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * copies or substantial portions of the Software. If you wish to use our Amazon + * FreeRTOS name, please do so in a fair use way that does not cause confusion. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS diff --git a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/regtest_xtensa.S b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/regtest_xtensa.S index 709d28e15..cbb766cea 100644 --- a/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/regtest_xtensa.S +++ b/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC/regtest_xtensa.S @@ -30,7 +30,7 @@ .extern ulRegTest1Counter .extern ulRegTest2Counter .extern vPortYield - + .global vRegTest1 .global vRegTest2 diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/OnEitherCore/FreeRTOSConfig.h b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/OnEitherCore/FreeRTOSConfig.h index 6995c682c..25ea19de6 100644 --- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/OnEitherCore/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/OnEitherCore/FreeRTOSConfig.h @@ -83,6 +83,10 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES 1 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/FreeRTOSConfig.h b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/FreeRTOSConfig.h index 39acddd1f..e7843e291 100644 --- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/FreeRTOSConfig.h @@ -83,6 +83,10 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES 1 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/UsingCMSIS/FreeRTOSConfig.h b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/UsingCMSIS/FreeRTOSConfig.h index ebde05e93..3003aa29d 100644 --- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/UsingCMSIS/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/UsingCMSIS/FreeRTOSConfig.h @@ -83,6 +83,10 @@ #define configUSE_TRACE_FACILITY 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 0 +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES 1 + /* Software timer related definitions. */ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) diff --git a/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.c b/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.c index a5d1c47ca..8a19ba542 100644 --- a/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.c +++ b/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.c @@ -10,7 +10,8 @@ * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * copies or substantial portions of the Software. If you wish to use our Amazon + * FreeRTOS name, please do so in a fair use way that does not cause confusion. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS diff --git a/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.h b/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.h index ddd497756..bb7f02d9f 100644 --- a/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.h +++ b/FreeRTOS/Demo/ThirdParty/Template/IntQueueTimer.h @@ -10,7 +10,8 @@ * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * copies or substantial portions of the Software. If you wish to use our Amazon + * FreeRTOS name, please do so in a fair use way that does not cause confusion. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS diff --git a/FreeRTOS/Demo/ThirdParty/Template/README.md b/FreeRTOS/Demo/ThirdParty/Template/README.md index e417949a0..e5ddb8013 100644 --- a/FreeRTOS/Demo/ThirdParty/Template/README.md +++ b/FreeRTOS/Demo/ThirdParty/Template/README.md @@ -19,7 +19,7 @@ 1. Compile the following additional files in your project: * All files in the [FreeRTOS/Demo/Common/Minimal](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS/Demo/Common/Minimal) directory except - `comtest_strings.c` , `comtest.c` ,`flash.c`, `flash_timer.c` and `sp_flop.c`. + `comtest_strings.c`, `crhook.c` , `comtest.c` ,`crflash.c`,`flash.c`, `flash_timer.c` and `sp_flop.c`. 2. Add the following paths to your include search path: * `FreeRTOS/Demo/Common/include`. 3. Call the `void vStartTests( void )` function from your `main` function after @@ -156,7 +156,7 @@ No errors ## Running All Tests -1. Define all the `configSTART__TESTS` macros to `1` in your +1. Define all the `configSTART__TESTS` macros to `1` in your `FreeRTOSConfig.h`. 2. Build and run the tests. The output should look like the following: ``` diff --git a/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h index 7edd45fba..79f21b349 100644 --- a/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/FreeRTOSConfig.h @@ -70,6 +70,9 @@ peripheral clock. */ #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_MUTEXES 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer configuration. */ #define configUSE_TIMERS 1 diff --git a/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/InterruptNestTest.c b/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/InterruptNestTest.c index f2ad7179e..12b2a80d6 100644 --- a/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/InterruptNestTest.c +++ b/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/InterruptNestTest.c @@ -102,13 +102,13 @@ unsigned long ulCompareMatchBits; interrupt and the task. */ vSemaphoreCreateBinary( xHighFrequencyTimerSemaphore ); configASSERT( xHighFrequencyTimerSemaphore ); - + /* Create the task that pends on the semaphore that is given by the high frequency interrupt. */ xTaskCreate( prvHighFrequencyTimerTask, "HFTmr", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL ); - - /* Setup the interrupt itself. The STM module clock divider is setup when - the tick interrupt is configured - which is when the scheduler is started - + + /* Setup the interrupt itself. The STM module clock divider is setup when + the tick interrupt is configured - which is when the scheduler is started - so there is no need to do it here. The tick interrupt uses compare match 0, so this test uses compare match @@ -116,7 +116,7 @@ unsigned long ulCompareMatchBits; register. */ ulCompareMatchBits = ( 0x1fUL - __CLZ( ulCompareMatchValue ) ); ulCompareMatchBits <<= 16UL; - + /* Write the values to the relevant SMT registers, without changing other bits. */ taskENTER_CRITICAL(); @@ -129,7 +129,7 @@ unsigned long ulCompareMatchBits; { /* Set-up the interrupt. */ STM_SRC1.reg = ( configHIGH_FREQUENCY_TIMER_PRIORITY | 0x00005000UL ); - + /* Enable the Interrupt. */ STM_ISRR.reg &= ~( 0x03UL << 2UL ); STM_ISRR.reg |= ( 0x1UL << 2UL ); @@ -170,7 +170,7 @@ static void prvHighFrequencyTimerTask( void *pvParameters ) { /* Wait for the next trigger from the high frequency timer interrupt. */ xSemaphoreTake( xHighFrequencyTimerSemaphore, portMAX_DELAY ); - + /* Just count how many times the task has been unblocked before returning to wait for the semaphore again. */ ulHighFrequencyTaskIterations++; @@ -193,18 +193,18 @@ unsigned long ulHigherPriorityTaskWoken = pdFALSE; STM_CMP1.reg += ulCompareMatchValue; ulExecutionCounter++; - + if( ulExecutionCounter >= ulInterruptsPer10ms ) { ulExecutionCounter = xSemaphoreGiveFromISR( xHighFrequencyTimerSemaphore, &ulHigherPriorityTaskWoken ); - + /* If the semaphore was given ulExeuctionCounter will now be pdTRUE. */ configASSERT( ulExecutionCounter == pdTRUE ); - + /* Start counting again. */ ulExecutionCounter = 0UL; } - + /* Context switch on exit if necessary. */ portYIELD_FROM_ISR( ulHigherPriorityTaskWoken ); } diff --git a/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/main.c b/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/main.c index 046e547d6..22bf7b385 100644 --- a/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/main.c +++ b/FreeRTOS/Demo/TriCore_TC1782_TriBoard_GCC/RTOSDemo/main.c @@ -87,6 +87,7 @@ /* Scheduler includes. */ #include "FreeRTOS.h" #include "task.h" +#include "croutine.h" /* Demo application includes. */ #include "partest.h" diff --git a/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/FreeRTOSConfig.h b/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/FreeRTOSConfig.h index 4bbdbe270..504f296e9 100644 --- a/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/FreeRTOSConfig.h @@ -88,6 +88,9 @@ configTOTAL_HEAP_SIZE is not defined. */ #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() #define portGET_RUN_TIME_COUNTER_VALUE() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 + /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj b/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj index 226fff60b..97f11d53f 100644 --- a/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj +++ b/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj @@ -232,6 +232,7 @@ + diff --git a/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj.filters b/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj.filters index 2d9d90033..ff4d1e759 100644 --- a/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj.filters +++ b/FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj.filters @@ -45,6 +45,9 @@ + + FreeRTOS Source\Include + FreeRTOS Source\Include diff --git a/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h b/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h index 527ba27cb..6170a062d 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h @@ -82,6 +82,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that initi #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj index 0b8ff54c7..e8a9a5c6a 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj +++ b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj @@ -76,6 +76,7 @@ + @@ -139,6 +140,7 @@ + diff --git a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters index 0c2c777f5..c941adb79 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters +++ b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters @@ -103,6 +103,9 @@ Demo App Source + + FreeRTOS Source\Source + Demo App Source\Full_Demo\Common Demo Tasks @@ -168,6 +171,9 @@ Configuration Files + + FreeRTOS Source\Include + FreeRTOS Source\Include diff --git a/FreeRTOS/Demo/WIN32-MingW/DemosModifiedForLowTickRate/recmutex.c b/FreeRTOS/Demo/WIN32-MingW/DemosModifiedForLowTickRate/recmutex.c index 04219407e..fea12c485 100644 --- a/FreeRTOS/Demo/WIN32-MingW/DemosModifiedForLowTickRate/recmutex.c +++ b/FreeRTOS/Demo/WIN32-MingW/DemosModifiedForLowTickRate/recmutex.c @@ -34,27 +34,27 @@ This demo creates three tasks all of which access the same recursive mutex: - prvRecursiveMutexControllingTask() has the highest priority so executes - first and grabs the mutex. It then performs some recursive accesses - - between each of which it sleeps for a short period to let the lower + prvRecursiveMutexControllingTask() has the highest priority so executes + first and grabs the mutex. It then performs some recursive accesses - + between each of which it sleeps for a short period to let the lower priority tasks execute. When it has completed its demo functionality it gives the mutex back before suspending itself. prvRecursiveMutexBlockingTask() attempts to access the mutex by performing - a blocking 'take'. The blocking task has a lower priority than the + a blocking 'take'. The blocking task has a lower priority than the controlling task so by the time it executes the mutex has already been - taken by the controlling task, causing the blocking task to block. It - does not unblock until the controlling task has given the mutex back, - and it does not actually run until the controlling task has suspended + taken by the controlling task, causing the blocking task to block. It + does not unblock until the controlling task has given the mutex back, + and it does not actually run until the controlling task has suspended itself (due to the relative priorities). When it eventually does obtain - the mutex all it does is give the mutex back prior to also suspending - itself. At this point both the controlling task and the blocking task are + the mutex all it does is give the mutex back prior to also suspending + itself. At this point both the controlling task and the blocking task are suspended. prvRecursiveMutexPollingTask() runs at the idle priority. It spins round a tight loop attempting to obtain the mutex with a non-blocking call. As the lowest priority task it will not successfully obtain the mutex until - both the controlling and blocking tasks are suspended. Once it eventually + both the controlling and blocking tasks are suspended. Once it eventually does obtain the mutex it first unsuspends both the controlling task and blocking task prior to giving the mutex back - resulting in the polling task temporarily inheriting the controlling tasks priority. @@ -96,7 +96,7 @@ static SemaphoreHandle_t xMutex; static volatile portBASE_TYPE xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE; static volatile unsigned portBASE_TYPE uxControllingCycles = 0, uxBlockingCycles = 0, uxPollingCycles = 0; -/* Handles of the two higher priority tasks, required so they can be resumed +/* Handles of the two higher priority tasks, required so they can be resumed (unsuspended). */ static TaskHandle_t xControllingTaskHandle, xBlockingTaskHandle, xPollingTaskHandle; @@ -109,10 +109,10 @@ void vStartRecursiveMutexTasks( void ) xMutex = xSemaphoreCreateRecursiveMutex(); /* vQueueAddToRegistry() adds the mutex to the registry, if one is - in use. The registry is provided as a means for kernel aware + in use. The registry is provided as a means for kernel aware debuggers to locate mutex and has no purpose if a kernel aware debugger is not being used. The call to vQueueAddToRegistry() will be removed - by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is + by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is defined to be less than 1. */ vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Recursive_Mutex" ); @@ -148,7 +148,7 @@ unsigned portBASE_TYPE ux; { /* We should now be able to take the mutex as many times as we like. - + The first time through the mutex will be immediately available, on subsequent times through the mutex will be held by the polling task at this point and this Take will cause the polling task to inherit @@ -163,7 +163,7 @@ unsigned portBASE_TYPE ux; /* Ensure the other task attempting to access the mutex (and the other demo tasks) are able to execute to ensure they either block - (where a block time is specified) or return an error (where no + (where a block time is specified) or return an error (where no block time is specified) as the mutex is held by this task. */ vTaskDelay( recmuSHORT_DELAY ); } @@ -197,7 +197,7 @@ unsigned portBASE_TYPE ux; xErrorOccurred = pdTRUE; } - /* Keep count of the number of cycles this task has performed so a + /* Keep count of the number of cycles this task has performed so a stall can be detected. */ uxControllingCycles++; @@ -218,8 +218,8 @@ static void prvRecursiveMutexBlockingTask( void *pvParameters ) { /* This task will run while the controlling task is blocked, and the controlling task will block only once it has the mutex - therefore - this call should block until the controlling task has given up the - mutex, and not actually execute past this call until the controlling + this call should block until the controlling task has given up the + mutex, and not actually execute past this call until the controlling task is suspended. */ if( xSemaphoreTakeRecursive( xMutex, portMAX_DELAY ) == pdPASS ) { @@ -256,7 +256,7 @@ static void prvRecursiveMutexBlockingTask( void *pvParameters ) xErrorOccurred = pdTRUE; } - /* Keep count of the number of cycles this task has performed so a + /* Keep count of the number of cycles this task has performed so a stall can be detected. */ uxBlockingCycles++; } @@ -282,7 +282,7 @@ static void prvRecursiveMutexPollingTask( void *pvParameters ) } else { - /* Keep count of the number of cycles this task has performed + /* Keep count of the number of cycles this task has performed so a stall can be detected. */ uxPollingCycles++; @@ -294,7 +294,7 @@ static void prvRecursiveMutexPollingTask( void *pvParameters ) block indefinitely when it attempts to obtain the mutex, the Controlling task will only block for a fixed period and an error will be latched if the polling task has not returned the - mutex by the time this fixed period has expired. */ + mutex by the time this fixed period has expired. */ vTaskResume( xBlockingTaskHandle ); #if configUSE_PREEMPTION == 0 taskYIELD(); @@ -310,8 +310,8 @@ static void prvRecursiveMutexPollingTask( void *pvParameters ) if( ( xBlockingIsSuspended == pdTRUE ) || ( xControllingIsSuspended == pdTRUE ) ) { xErrorOccurred = pdTRUE; - } - + } + /* Release the mutex, disinheriting the higher priority again. */ if( xSemaphoreGiveRecursive( xMutex ) != pdPASS ) { diff --git a/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h b/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h index 5d3767034..c3d8ddb75 100644 --- a/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h @@ -79,6 +79,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that initi #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo can use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Demo/WIN32-MingW/Run-time-stats-utils.c b/FreeRTOS/Demo/WIN32-MingW/Run-time-stats-utils.c index 204a535d5..ef30de296 100644 --- a/FreeRTOS/Demo/WIN32-MingW/Run-time-stats-utils.c +++ b/FreeRTOS/Demo/WIN32-MingW/Run-time-stats-utils.c @@ -50,7 +50,7 @@ void vConfigureTimerForRunTimeStats( void ) LARGE_INTEGER liPerformanceCounterFrequency, liInitialRunTimeValue; /* Initialise the variables used to create the run time stats time base. - Run time stats record how much time each task spends in the Running + Run time stats record how much time each task spends in the Running state. */ if( QueryPerformanceFrequency( &liPerformanceCounterFrequency ) == 0 ) @@ -79,7 +79,7 @@ unsigned long ulReturn; /* What is the performance counter value now? */ QueryPerformanceCounter( &liCurrentCount ); - /* Subtract the performance counter value reading taken when the + /* Subtract the performance counter value reading taken when the application started to get a count from that reference point, then scale to (simulated) 1/100ths of a millisecond. */ if( llTicksPerHundedthMillisecond == 0 ) diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h index bdf4689d7..3cd6855c1 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h @@ -37,7 +37,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -55,6 +55,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c index 717124d98..742c037b3 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c @@ -59,7 +59,7 @@ void vHTTPServerTask( void *pvParameters ) in the WIZnet hardware, so simply resets all the buffers for each connection - and only processes one connection at a time. */ if( lTCPSoftReset() ) - { + { /* Create the socket that is going to accept incoming connections. */ if( lTCPCreateSocket() ) { @@ -72,9 +72,9 @@ void vHTTPServerTask( void *pvParameters ) } } - /* If we get here then the connection completed or failed. Wait a + /* If we get here then the connection completed or failed. Wait a while then try or start again. */ - vTaskDelay( tcpCONNECTION_DELAY ); + vTaskDelay( tcpCONNECTION_DELAY ); } } diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/Makefile b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/Makefile index 182405d26..eca1bcf45 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/Makefile +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/Makefile @@ -108,6 +108,6 @@ clean : - + diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCP.c b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCP.c index 34e0ac93a..899c66466 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCP.c +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCP.c @@ -26,7 +26,7 @@ /* Changes from V3.2.3 - + + Modified char* types to compile without warning when using GCC V4.0.1. + Corrected the address to which the MAC address is written. Thanks to Bill Knight for this correction. @@ -98,7 +98,7 @@ device. */ /* Length of the data to read for various register reads. */ #define tcpSTATUS_READ_LEN ( ( unsigned long ) 1 ) #define tcpSHADOW_READ_LEN ( ( unsigned long ) 1 ) - + /* Register addresses within the WIZnet device. */ #define tcpCOMMAND_REG ( ( unsigned short ) 0x0000 ) #define tcpGATEWAY_ADDR_REG ( ( unsigned short ) 0x0080 ) @@ -155,8 +155,8 @@ const unsigned char const ucDataSIPR[] = { 172, 25, 218, 201 };/* IP address. const unsigned char const ucDataSHAR[] = { 00, 23, 30, 41, 15, 26 }; /* MAC address - DO NOT USE THIS ON A PUBLIC NETWORK! */ /* Other fixed messages. */ -const unsigned char const ucDataReset[] = { tcpRESET_CMD }; -const unsigned char const ucDataInit[] = { tcpSYS_INIT_CMD }; +const unsigned char const ucDataReset[] = { tcpRESET_CMD }; +const unsigned char const ucDataInit[] = { tcpSYS_INIT_CMD }; const unsigned char const ucDataProtocol[] = { tcpSOCK_STREAM }; const unsigned char const ucDataPort[] = { 0xBA, 0xCC }; const unsigned char const ucDataSockInit[] = { tcpSOCK_INIT }; @@ -198,7 +198,7 @@ void ultoa( unsigned long ulVal, char *pcBuffer, long lIgnore ) unsigned long lNibble; long lIndex; - /* Simple routine to convert an unsigned long value into a string in hex + /* Simple routine to convert an unsigned long value into a string in hex format. */ /* For each nibble in the number we are converting. */ @@ -221,7 +221,7 @@ long lIndex; /* Shift off the top nibble so we use the next nibble next time around. */ ulVal <<= 4; - } + } /* Mark the end of the string with a null terminator. */ pcBuffer[ lIndex ] = 0x00; @@ -236,12 +236,12 @@ unsigned char ucRxBuffer[ tcpMAX_REGISTER_LEN ]; /* First write out the address of the register we want to read. */ i2cMessage( ucRxBuffer, i2cNO_DATA_REQUIRED, tcpDEVICE_ADDRESS, usAddress, i2cWRITE, NULL, portMAX_DELAY ); - + /* Then read back from that address. */ i2cMessage( ( unsigned char * ) pucDestination, ulLength, tcpDEVICE_ADDRESS, i2cNO_ADDR_REQUIRED, i2cREAD, xMessageComplete, portMAX_DELAY ); - /* I2C messages are queued so use the semaphore to wait for the read to - complete - otherwise we will leave this function before the I2C + /* I2C messages are queued so use the semaphore to wait for the read to + complete - otherwise we will leave this function before the I2C transactions have completed. */ xSemaphoreTake( xMessageComplete, tcpLONG_DELAY ); } @@ -249,13 +249,13 @@ unsigned char ucRxBuffer[ tcpMAX_REGISTER_LEN ]; void vTCPHardReset( void ) { - /* Physical reset of the WIZnet device by using the GPIO lines to hold the + /* Physical reset of the WIZnet device by using the GPIO lines to hold the WIZnet reset lines active for a few milliseconds. */ /* Make sure the interrupt from the WIZnet is disabled. */ VICIntEnClear |= tcpEINT0_VIC_CHANNEL_BIT; - /* If xMessageComplete is NULL then this is the first time that this + /* If xMessageComplete is NULL then this is the first time that this function has been called and the queue and semaphore used in this file have not yet been created. */ if( xMessageComplete == NULL ) @@ -284,7 +284,7 @@ void vTCPHardReset( void ) /* Setup the EINT0 to interrupt on required events from the WIZnet device. First enable the EINT0 function of the pin. */ PCB_PINSEL1 |= tcpENABLE_EINT0_FUNCTION; - + /* We want the TCP comms to wake us from power save. */ SCB_EXTWAKE = tcpWAKE_ON_EINT0; @@ -318,13 +318,13 @@ extern volatile long lTransactionCompleted; /* Reset the internal WIZnet registers. */ i2cMessage( ucDataReset, sizeof( ucDataReset ), tcpDEVICE_ADDRESS, tcpCOMMAND_REG, i2cWRITE, NULL, portMAX_DELAY ); - /* Now we can configure the protocol. Here the MAC address, gateway + /* Now we can configure the protocol. Here the MAC address, gateway address, subnet mask and IP address are configured. */ i2cMessage( ucDataSHAR, sizeof( ucDataSHAR ), tcpDEVICE_ADDRESS, tcpSOURCE_HA_REG, i2cWRITE, NULL, portMAX_DELAY ); i2cMessage( ucDataGAR, sizeof( ucDataGAR ), tcpDEVICE_ADDRESS, tcpGATEWAY_ADDR_REG, i2cWRITE, NULL, portMAX_DELAY ); i2cMessage( ucDataMSR, sizeof( ucDataMSR ), tcpDEVICE_ADDRESS, tcpSUBNET_MASK_REG, i2cWRITE, NULL, portMAX_DELAY ); i2cMessage( ucDataSIPR, sizeof( ucDataSIPR ), tcpDEVICE_ADDRESS, tpcSOURCE_IP_REG, i2cWRITE, NULL, portMAX_DELAY ); - + /* Next the memory buffers are configured to give all the WIZnet internal memory over to a single socket. This gives the socket the maximum internal Tx and Rx buffer space. */ @@ -380,7 +380,7 @@ unsigned char ucStatus; /* Read back the status to ensure the socket initialised ok. */ prvReadRegister( &ucStatus, tcpINTERRUPT_STATUS_REG, tcpSTATUS_READ_LEN ); - + /* We should find that the socket init was successful. */ if( ucStatus != tcpISR_SOCKET_INIT ) { @@ -406,11 +406,11 @@ unsigned char ucISR; /* Start a passive listen on the socket. */ - /* Enable interrupts in the WizNet device after ensuring none are + /* Enable interrupts in the WizNet device after ensuring none are currently pending. */ while( SCB_EXTINT & tcpCLEAR_EINT0 ) { - /* The WIZnet device is still asserting and interrupt so tell it to + /* The WIZnet device is still asserting and interrupt so tell it to clear. */ i2cMessage( ucDataClearInterrupt, sizeof( ucDataClearInterrupt ), tcpDEVICE_ADDRESS, tcpINTERRUPT_REG, i2cWRITE, xMessageComplete, portMAX_DELAY ); xSemaphoreTake( xMessageComplete, tcpLONG_DELAY ); @@ -425,7 +425,7 @@ unsigned char ucISR; that the WIZnet device needs attention. */ } - /* Now all the pending interrupts have been cleared we can enable the + /* Now all the pending interrupts have been cleared we can enable the processor interrupts. */ VICIntEnable |= tcpEINT0_VIC_CHANNEL_BIT; @@ -446,13 +446,13 @@ unsigned long ulWritePointer, ulAckPointer; lTransactionCompleted = pdTRUE; portEXIT_CRITICAL(); - /* Keep looping - processing interrupts, until we have completed a + /* Keep looping - processing interrupts, until we have completed a transaction. This uses the WIZnet in it's simplest form. The socket accepts a connection - we process the connection - then close the socket. We then go back to reinitialise everything and start again. */ while( lTransactionCompleted == pdTRUE ) { - /* Wait for a message on the queue from the WIZnet ISR. When the + /* Wait for a message on the queue from the WIZnet ISR. When the WIZnet device asserts an interrupt the ISR simply posts a message onto this queue to wake this task. */ if( xQueueReceive( xTCPISRQueue, &ucISR, tcpCONNECTION_WAIT_DELAY ) ) @@ -472,7 +472,7 @@ unsigned long ulWritePointer, ulAckPointer; the next. */ SCB_EXTINT = tcpCLEAR_EINT0; VICIntEnable |= tcpEINT0_VIC_CHANNEL_BIT; - + /* Process the interrupt ... */ if( ucISR & tcpISR_ESTABLISHED ) @@ -481,39 +481,39 @@ unsigned long ulWritePointer, ulAckPointer; a receive command. */ i2cMessage( ucDataReceiveCmd, sizeof( ucDataReceiveCmd ), tcpDEVICE_ADDRESS, tcpCOMMAND_REG, i2cWRITE, NULL, portMAX_DELAY ); } - + if( ucISR & tcpISR_RX_COMPLETE ) { - /* We message has been received. This will be an HTTP get + /* We message has been received. This will be an HTTP get command. We only have one page to send so just send it without regard to what the actual requested page was. */ prvSendSamplePage(); } - + if( ucISR & tcpISR_TX_COMPLETE ) { - /* We have a TX complete interrupt - which oddly does not + /* We have a TX complete interrupt - which oddly does not indicate that the message being sent is complete so we cannot yet close the socket. Instead we read the position of the Tx pointer within the WIZnet device so we know how much data it - has to send. Later we will read the ack pointer and compare - this to the Tx pointer to ascertain whether the transmission + has to send. Later we will read the ack pointer and compare + this to the Tx pointer to ascertain whether the transmission has completed. */ /* First read the shadow register. */ prvReadRegister( &ucShadow, tcpTX_WRITE_SHADOW_REG, tcpSHADOW_READ_LEN ); - + /* Now a short delay is required. */ vTaskDelay( tcpSHORT_DELAY ); /* Then we can read the real register. */ prvReadRegister( ( unsigned char * ) &ulWritePointer, tcpTX_WRITE_POINTER_REG, sizeof( ulWritePointer ) ); - /* We cannot do anything more here but need to remember that + /* We cannot do anything more here but need to remember that this interrupt has occurred. */ lDataSent = pdTRUE; } - + if( ucISR & tcpISR_CLOSED ) { /* The socket has been closed so we can leave this function. */ @@ -522,20 +522,20 @@ unsigned long ulWritePointer, ulAckPointer; } else { - /* We have not received an interrupt from the WIZnet device for a + /* We have not received an interrupt from the WIZnet device for a while. Read the socket status and check that everything is as expected. */ prvReadRegister( &ucState, tcpSOCKET_STATE_REG, tcpSTATUS_READ_LEN ); - - if( ( ucState == tcpSTATUS_ESTABLISHED ) && ( lDataSent > 0 ) ) + + if( ( ucState == tcpSTATUS_ESTABLISHED ) && ( lDataSent > 0 ) ) { /* The socket is established and we have already received a Tx end interrupt. We must therefore be waiting for the Tx buffer inside the WIZnet device to be empty before we can close the - socket. + socket. Read the Ack pointer register to see if it has caught up with - the Tx pointer register. First we have to read the shadow + the Tx pointer register. First we have to read the shadow register. */ prvReadRegister( &ucShadow, tcpTX_ACK_SHADOW_REG, tcpSHADOW_READ_LEN ); vTaskDelay( tcpSHORT_DELAY ); @@ -543,7 +543,7 @@ unsigned long ulWritePointer, ulAckPointer; if( ulAckPointer == ulWritePointer ) { - /* The Ack and write pointer are now equal and we can + /* The Ack and write pointer are now equal and we can safely close the socket. */ i2cMessage( ucDataDisconnect, sizeof( ucDataDisconnect ), tcpDEVICE_ADDRESS, tcpCOMMAND_REG, i2cWRITE, NULL, portMAX_DELAY ); } @@ -554,7 +554,7 @@ unsigned long ulWritePointer, ulAckPointer; lDataSent++; if( lDataSent > tcpMAX_ATTEMPTS_TO_CHECK_BUFFER ) { - /* Assume we cannot complete sending the data and + /* Assume we cannot complete sending the data and therefore cannot safely close the socket. Start over. */ vTCPHardReset(); lTransactionCompleted = pdFALSE; @@ -563,14 +563,14 @@ unsigned long ulWritePointer, ulAckPointer; } else if( ucState != tcpSTATUS_LISTEN ) { - /* If we have not yet received a Tx end interrupt we would only - ever expect to find the socket still listening for any + /* If we have not yet received a Tx end interrupt we would only + ever expect to find the socket still listening for any sustained period. */ if( ucState == ucLastState ) { lSameStateCount++; if( lSameStateCount > tcpMAX_NON_LISTEN_STAUS_READS ) - { + { /* We are persistently in an unexpected state. Assume we cannot safely close the socket and start over. */ vTCPHardReset(); @@ -591,7 +591,7 @@ unsigned long ulWritePointer, ulAckPointer; } } - /* We are going to reinitialise the WIZnet device so do not want our + /* We are going to reinitialise the WIZnet device so do not want our interrupts from the WIZnet to be processed. */ VICIntEnClear |= tcpEINT0_VIC_CHANNEL_BIT; return lTransactionCompleted; @@ -617,7 +617,7 @@ unsigned long ulSendAddress; return; } - /* Return the new address of the end of the buffer (within the WIZnet + /* Return the new address of the end of the buffer (within the WIZnet device). */ *pulTxAddress += ( unsigned long ) lTxLen; } @@ -629,7 +629,7 @@ unsigned char ucTxBuffer[ tcpMAX_REGISTER_LEN ]; /* We have written some data to the Tx buffer internal to the WIZnet device. Now we update the Tx pointer inside the WIZnet then send a - Send command - which causes the data up to the new Tx pointer to be + Send command - which causes the data up to the new Tx pointer to be transmitted. */ /* Make sure endieness is correct for transmission. */ @@ -710,14 +710,14 @@ static char cPageBuffer[ tcpBUFFER_LEN ]; strcat( cPageBuffer, "
Refresh = 0x" ); lIndex = strlen( cPageBuffer ); ultoa( ( unsigned long ) ulRefreshCount, &( cPageBuffer[ lIndex ] ), 0 ); - + if( lErrorInTask ) { strcat( cPageBuffer, "

An error has occurred in at least one task." ); } else { - strcat( cPageBuffer, "

All tasks executing without error." ); + strcat( cPageBuffer, "

All tasks executing without error." ); } ulRefreshCount++; diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c index 1edf0d025..2cf061547 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c @@ -45,7 +45,7 @@ static long lDummyVariable; /* * When the WIZnet device asserts an interrupt we send an (empty) message to * the TCP task. This wakes the task so the interrupt can be processed. The - * source of the interrupt has to be ascertained by the TCP task as this + * source of the interrupt has to be ascertained by the TCP task as this * requires an I2C transaction which cannot be performed from this ISR. * Note this code predates the introduction of semaphores, a semaphore should * be used in place of the empty queue message. @@ -56,14 +56,14 @@ extern QueueHandle_t xTCPISRQueue; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; /* Just wake the TCP task so it knows an ISR has occurred. */ - xQueueSendFromISR( xTCPISRQueue, ( void * ) &lDummyVariable, &xHigherPriorityTaskWoken ); + xQueueSendFromISR( xTCPISRQueue, ( void * ) &lDummyVariable, &xHigherPriorityTaskWoken ); - /* We cannot carry on processing interrupts until the TCP task has + /* We cannot carry on processing interrupts until the TCP task has processed this one - so for now interrupts are disabled. The TCP task will re-enable it. */ VICIntEnClear |= tcpEINT0_VIC_CHANNEL_BIT; - /* Clear the interrupt bit. */ + /* Clear the interrupt bit. */ VICVectAddr = tcpCLEAR_VIC_INTERRUPT; if( xHigherPriorityTaskWoken ) diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h index 0dec42c8e..6c3acce8c 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h @@ -32,7 +32,7 @@ const char * const cSamplePageFirstPart = "HTTP/1.0 200 OK\r\n" "Content-type: text/html\r\n" -"\r\n" +"\r\n" "\r\n" "\r\n" "\r\n" diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.c b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.c index 208a1e252..4631c2134 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.c +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.c @@ -96,11 +96,11 @@ signed portBASE_TYPE xReturn; /* Fill the message with the data to be sent. */ - /* Pointer to the actual data. Only a pointer is stored (i.e. the + /* Pointer to the actual data. Only a pointer is stored (i.e. the actual data is not copied, so the data being pointed to must still be valid when the message eventually gets sent (it may be queued for a while. */ - pxNextFreeMessage->pucBuffer = ( unsigned char * ) pucMessage; + pxNextFreeMessage->pucBuffer = ( unsigned char * ) pucMessage; /* This is the address of the I2C device we are going to transmit this message to. */ @@ -114,7 +114,7 @@ signed portBASE_TYPE xReturn; /* How many bytes are to be sent? */ pxNextFreeMessage->lMessageLength = lMessageLength; - /* The address within the WIZnet device to which the data will be + /* The address within the WIZnet device to which the data will be written. This could be the address of a register, or alternatively a location within the WIZnet Tx buffer. */ pxNextFreeMessage->ucBufferAddressLowByte = ( unsigned char ) ( usBufferAddress & 0xff ); @@ -137,9 +137,9 @@ signed portBASE_TYPE xReturn; can start the ISR sending this message immediately. */ pxCurrentMessage = pxNextFreeMessage; - I2C_I2CONCLR = i2cSI_BIT; + I2C_I2CONCLR = i2cSI_BIT; I2C_I2CONSET = i2cSTA_BIT; - + *pulBusFree = ( unsigned long ) pdFALSE; } else @@ -154,15 +154,15 @@ signed portBASE_TYPE xReturn; message. */ if( ( *pulBusFree == ( unsigned long ) pdTRUE ) && ( xReturn == pdPASS ) ) { - /* Get the next message in the queue (this should be the + /* Get the next message in the queue (this should be the message we just posted) and start off the transmission again. */ xQueueReceive( xMessagesForTx, &pxNextFreeMessage, i2cNO_BLOCK ); pxCurrentMessage = pxNextFreeMessage; - I2C_I2CONCLR = i2cSI_BIT; + I2C_I2CONCLR = i2cSI_BIT; I2C_I2CONSET = i2cSTA_BIT; - + *pulBusFree = ( unsigned long ) pdFALSE; } } @@ -180,7 +180,7 @@ extern void ( vI2C_ISR_Wrapper )( void ); /* Configure the I2C hardware. */ - I2C_I2CONCLR = 0xff; + I2C_I2CONCLR = 0xff; PCB_PINSEL0 |= mainSDA_ENABLE; PCB_PINSEL0 |= mainSCL_ENABLE; diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.h b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.h index e8d73cfbf..10282fa86 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.h +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2c.h @@ -28,7 +28,7 @@ #define I2C_H /* Structure used to capture the I2C message details. The structure is then - * queued for processing by the I2C ISR. + * queued for processing by the I2C ISR. */ typedef struct AN_I2C_MESSAGE { @@ -53,7 +53,7 @@ void i2cInit( void ); * Send or receive a message over the I2C bus. * * @param pucMessage The data to be transmitted or the buffer into which - * received data will be placed. + * received data will be placed. * * @param lMessageLength The number of bytes to either transmit or receive. * @@ -66,12 +66,12 @@ void i2cInit( void ); * @param ulDirection Must be either i2cWRITE or i2cREAD as #defined above. * * @param xMessageCompleteSemaphore - * Can be used to pass a semaphore reference if the + * Can be used to pass a semaphore reference if the * calling task want notification of when the message has * completed. Otherwise NULL can be passed. - * - * @param xBlockTime The time to wait for a space in the message queue to - * become available should one not be available + * + * @param xBlockTime The time to wait for a space in the message queue to + * become available should one not be available * immediately. */ void i2cMessage( const unsigned char * const pucMessage, long lMessageLength, unsigned char ucSlaveAddress, unsigned short usBufferAddress, unsigned long ulDirection, SemaphoreHandle_t xMessageCompleteSemaphore, TickType_t xBlockTime ); diff --git a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c index 9c669f177..6eabeb365 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c +++ b/FreeRTOS/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c @@ -83,7 +83,7 @@ typedef enum /*-----------------------------------------------------------*/ /* Points to the message currently being sent. */ -volatile xI2CMessage *pxCurrentMessage = NULL; +volatile xI2CMessage *pxCurrentMessage = NULL; /* The queue of messages waiting to be transmitted. */ static QueueHandle_t xMessagesForTx; @@ -91,7 +91,7 @@ static QueueHandle_t xMessagesForTx; /* Flag used to indicate whether or not the ISR is amid sending a message. */ unsigned long ulBusFree = ( unsigned long ) pdTRUE; -/* Setting this to true will cause the TCP task to think a message is +/* Setting this to true will cause the TCP task to think a message is complete and thus restart. It can therefore be used under error states to force a restart. */ volatile long lTransactionCompleted = pdTRUE; @@ -103,7 +103,7 @@ void vI2CISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *p /* Create the queues used to hold Rx and Tx characters. */ xMessagesForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( xI2CMessage * ) ); - /* Pass back a reference to the queue and bus free flag so the I2C API file + /* Pass back a reference to the queue and bus free flag so the I2C API file can post messages. */ *pxTxMessages = xMessagesForTx; *ppulBusFree = &ulBusFree; @@ -135,7 +135,7 @@ void vI2C_ISR_Wrapper( void ) void vI2C_ISR_Handler( void ) { -/* Holds the current transmission state. */ +/* Holds the current transmission state. */ static I2C_STATE eCurrentState = eSentStart; static long lMessageIndex = -i2cBUFFER_ADDRESS_BYTES; /* There are two address bytes to send prior to the data. */ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; @@ -144,7 +144,7 @@ long lBytesLeft; /* The action taken for this interrupt depends on our current state. */ switch( eCurrentState ) { - case eSentStart : + case eSentStart : /* We sent a start bit, if it was successful we can go on to send the slave address. */ @@ -155,10 +155,10 @@ long lBytesLeft; if( pxCurrentMessage->ucSlaveAddress & i2cREAD ) { - /* We are then going to read bytes back from the + /* We are then going to read bytes back from the slave. */ eCurrentState = eSentAddressForRead; - + /* Initialise the buffer index so the first byte goes into the first buffer position. */ lMessageIndex = 0; @@ -177,10 +177,10 @@ long lBytesLeft; else { /* Could not send the start bit so give up. */ - i2cEND_TRANSMISSION( pdFAIL ); + i2cEND_TRANSMISSION( pdFAIL ); } - I2C_I2CONCLR = i2cSTA_BIT; + I2C_I2CONCLR = i2cSTA_BIT; break; @@ -190,8 +190,8 @@ long lBytesLeft; If this was acknowledged we can go on to send the data. */ if( I2C_I2STAT == i2cSTATUS_TX_ADDR_ACKED ) { - /* Start the first byte transmitting which is the - first byte of the buffer address to which the data will + /* Start the first byte transmitting which is the + first byte of the buffer address to which the data will be sent. */ I2C_I2DAT = pxCurrentMessage->ucBufferAddressHighByte; eCurrentState = eSentData; @@ -199,8 +199,8 @@ long lBytesLeft; else { /* Address was not acknowledged so give up. */ - i2cEND_TRANSMISSION( pdFAIL ); - } + i2cEND_TRANSMISSION( pdFAIL ); + } break; case eSentAddressForRead : @@ -214,21 +214,21 @@ long lBytesLeft; { /* Don't ack the last byte of the message. */ I2C_I2CONSET = i2cAA_BIT; - } + } } else { /* Something unexpected happened - give up. */ - i2cEND_TRANSMISSION( pdFAIL ); + i2cEND_TRANSMISSION( pdFAIL ); } break; case eReceiveData : - + /* We have just received a byte from the slave. */ if( ( I2C_I2STAT == i2cSTATUS_DATA_RXED ) || ( I2C_I2STAT == i2cSTATUS_LAST_BYTE_RXED ) ) { - /* Buffer the byte just received then increment the index + /* Buffer the byte just received then increment the index so it points to the next free space. */ pxCurrentMessage->pucBuffer[ lMessageIndex ] = I2C_I2DAT; lMessageIndex++; @@ -259,30 +259,30 @@ long lBytesLeft; { /* No more messages were found to be waiting for transaction so the bus is free. */ - ulBusFree = ( unsigned long ) pdTRUE; - } + ulBusFree = ( unsigned long ) pdTRUE; + } } else { - /* There are more bytes to receive but don't ack the + /* There are more bytes to receive but don't ack the last byte. */ if( lBytesLeft <= i2cJUST_ONE_BYTE_TO_RX ) { I2C_I2CONCLR = i2cAA_BIT; - } + } } } else { /* Something unexpected happened - give up. */ - i2cEND_TRANSMISSION( pdFAIL ); + i2cEND_TRANSMISSION( pdFAIL ); } break; + + case eSentData : - case eSentData : - - /* We sent a data byte, if successful send the next byte in + /* We sent a data byte, if successful send the next byte in the message. */ if( I2C_I2STAT == i2cSTATUS_DATA_TXED ) { @@ -290,21 +290,21 @@ long lBytesLeft; lMessageIndex++; if( lMessageIndex < 0 ) { - /* lMessage index is still negative so we have so far - only sent the first byte of the buffer address. Send + /* lMessage index is still negative so we have so far + only sent the first byte of the buffer address. Send the second byte now, then initialise the buffer index - to zero so the next byte sent comes from the actual + to zero so the next byte sent comes from the actual data buffer. */ I2C_I2DAT = pxCurrentMessage->ucBufferAddressLowByte; } else if( lMessageIndex < pxCurrentMessage->lMessageLength ) { /* Simply send the next byte in the tx buffer. */ - I2C_I2DAT = pxCurrentMessage->pucBuffer[ lMessageIndex ]; + I2C_I2DAT = pxCurrentMessage->pucBuffer[ lMessageIndex ]; } else { - /* No more bytes in this message to be send. Finished + /* No more bytes in this message to be send. Finished sending message - send a stop bit. */ i2cEND_TRANSMISSION( pdPASS ); @@ -324,25 +324,25 @@ long lBytesLeft; } else { - /* No more message were queues for transaction so + /* No more message were queues for transaction so the bus is free. */ - ulBusFree = ( unsigned long ) pdTRUE; + ulBusFree = ( unsigned long ) pdTRUE; } } } else { /* Something unexpected happened, give up. */ - i2cEND_TRANSMISSION( pdFAIL ); + i2cEND_TRANSMISSION( pdFAIL ); } break; - default : - + default : + /* Should never get here. */ eCurrentState = eSentStart; break; - } + } /* Clear the interrupt. */ I2C_I2CONCLR = i2cSI_BIT; diff --git a/FreeRTOS/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h b/FreeRTOS/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h index 132694dec..57e965825 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -46,12 +46,15 @@ #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) /* This can be made smaller if required. */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 20 * 1024 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 20 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -66,7 +69,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/WizNET_DEMO_TERN_186/main.c b/FreeRTOS/Demo/WizNET_DEMO_TERN_186/main.c index 11d81ac3e..c9cc2c162 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_TERN_186/main.c +++ b/FreeRTOS/Demo/WizNET_DEMO_TERN_186/main.c @@ -25,8 +25,8 @@ */ /* - * Creates all the demo application tasks then starts the scheduler. In - * addition to the standard demo application tasks main() creates the + * Creates all the demo application tasks then starts the scheduler. In + * addition to the standard demo application tasks main() creates the * HTTPServer task, and a "Check" task. The Check task periodically inspects * all the other tasks in the system to see if any errors have been reported. * The error status is then displayed on the served WEB page. @@ -64,7 +64,7 @@ #define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 ) /* Used to indicate the error status. A value of 0 means that an error has not -been detected in any task. A non zero value indicates which group of demo +been detected in any task. A non zero value indicates which group of demo tasks has reported an error. See prvCheckTask() for bit definitions. */ unsigned short usCheckStatus = 0; @@ -90,7 +90,7 @@ void main(void) /* Start the HTTP server task. */ xTaskCreate( vHTTPTask, "WizNet", configMINIMAL_STACK_SIZE, NULL, mainHTTP_TASK_PRIORITY, NULL ); - /* Start the demo/test application tasks. See the demo application + /* Start the demo/test application tasks. See the demo application section of the FreeRTOS.org WEB site for more information. */ vStartIntegerMathTasks( tskIDLE_PRIORITY ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); @@ -106,7 +106,7 @@ void main(void) tasks in the system to ensure there are no more or fewer than expected compared to the number that were executing when the task started. */ vCreateSuicidalTasks( mainSUICIDE_TASKS_PRIORITY ); - + /* Finally start the scheduler. */ vTaskStartScheduler(); @@ -131,7 +131,7 @@ static void prvCheckTask( void *pvParameters ) { /* Block until it is time to check again. */ vTaskDelay( mainCHECK_DELAY ); - + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) { usCheckStatus |= 0x01; diff --git a/FreeRTOS/Demo/WizNET_DEMO_TERN_186/serial/serial.c b/FreeRTOS/Demo/WizNET_DEMO_TERN_186/serial/serial.c index 1fa3b9d99..57b08b342 100644 --- a/FreeRTOS/Demo/WizNET_DEMO_TERN_186/serial/serial.c +++ b/FreeRTOS/Demo/WizNET_DEMO_TERN_186/serial/serial.c @@ -68,33 +68,33 @@ #define serDONT_BLOCK ( ( TickType_t ) 0 ) typedef enum -{ - serCOM1 = 0, - serCOM2, - serCOM3, - serCOM4, - serCOM5, - serCOM6, - serCOM7, - serCOM8 +{ + serCOM1 = 0, + serCOM2, + serCOM3, + serCOM4, + serCOM5, + serCOM6, + serCOM7, + serCOM8 } eCOMPort; -typedef enum -{ - serNO_PARITY, - serODD_PARITY, - serEVEN_PARITY, - serMARK_PARITY, - serSPACE_PARITY +typedef enum +{ + serNO_PARITY, + serODD_PARITY, + serEVEN_PARITY, + serMARK_PARITY, + serSPACE_PARITY } eParity; -typedef enum -{ - serSTOP_1, - serSTOP_2 +typedef enum +{ + serSTOP_1, + serSTOP_2 } eStopBits; -typedef enum +typedef enum { serBITS_5, serBITS_6, @@ -137,7 +137,7 @@ typedef struct xCOM_PORT unsigned short usIRQVector; /* Queues used for communications with com test task. */ - QueueHandle_t xRxedChars; + QueueHandle_t xRxedChars; QueueHandle_t xCharsForTx; /* This semaphore does nothing useful except test a feature of the @@ -146,7 +146,7 @@ typedef struct xCOM_PORT } xComPort; -static xComPort xPorts[ serMAX_PORTS ] = +static xComPort xPorts[ serMAX_PORTS ] = { { pdFALSE, serPORT_0_INT_REG, serPORT_0_BAUD_REG, serPORT_0_RX_REG, serPORT_0_TX_REG, serPORT_0_STATUS_REG, serPORT_0_CTRL_REG, serPORT_0_IRQ, NULL, NULL, NULL }, { pdFALSE, serPORT_1_INT_REG, serPORT_1_BAUD_REG, serPORT_1_RX_REG, serPORT_1_TX_REG, serPORT_1_STATUS_REG, serPORT_1_CTRL_REG, serPORT_1_IRQ, NULL, NULL, NULL } @@ -157,7 +157,7 @@ typedef xComPort * xComPortHandle; /** * Lookup the baud rate from the enum. */ -static unsigned long prvBaud( eBaud eWantedBaud ); +static unsigned long prvBaud( eBaud eWantedBaud ); /* These prototypes are repeated here so we don't have to include the serial header. This allows the xComPortHandle structure details to be private to this file. */ @@ -185,7 +185,7 @@ unsigned short usIn; \ } \ } \ portEXIT_CRITICAL(); \ -} +} /*-----------------------------------------------------------*/ #define vInterruptOff( pxPort, usInterrupt ) \ @@ -210,14 +210,14 @@ unsigned short usIn; \ } \ } - + COM_IRQ_WRAPPER( 0 ) COM_IRQ_WRAPPER( 1 ) -static pxISR xISRs[ serMAX_PORTS ] = +static pxISR xISRs[ serMAX_PORTS ] = { - COM_IRQ0_WRAPPER, + COM_IRQ0_WRAPPER, COM_IRQ1_WRAPPER }; @@ -267,7 +267,7 @@ unsigned long ulBaudDiv; /* Currently only n,8,1 is supported. */ usPort = ( unsigned short ) ePort; - + if( usPort < serMAX_PORTS ) { pxPort = &( xPorts[ usPort ] ); @@ -322,7 +322,7 @@ char *pcNextChar; portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, char *pcRxedChar, TickType_t xBlockTime ) { - /* Get the next character from the buffer, note that this routine is only + /* Get the next character from the buffer, note that this routine is only called having checked that the is (at least) one to get */ if( xQueueReceive( pxPort->xRxedChars, pcRxedChar, xBlockTime ) ) { @@ -352,7 +352,7 @@ portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort ) { const TickType_t xBlockTime = ( TickType_t ) 0xffff; - /* This function does nothing interesting, but test the + /* This function does nothing interesting, but test the semaphore from ISR mechanism. */ return xSemaphoreTake( xPort->xTestSem, xBlockTime ); } diff --git a/FreeRTOS/Demo/dsPIC_MPLAB/FreeRTOSConfig.h b/FreeRTOS/Demo/dsPIC_MPLAB/FreeRTOSConfig.h index 9cc388886..6103687cb 100644 --- a/FreeRTOS/Demo/dsPIC_MPLAB/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/dsPIC_MPLAB/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -54,6 +54,10 @@ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/dsPIC_MPLAB/ParTest/ParTest.c b/FreeRTOS/Demo/dsPIC_MPLAB/ParTest/ParTest.c index 5c4f622e2..e37e38737 100644 --- a/FreeRTOS/Demo/dsPIC_MPLAB/ParTest/ParTest.c +++ b/FreeRTOS/Demo/dsPIC_MPLAB/ParTest/ParTest.c @@ -42,7 +42,7 @@ unsigned portBASE_TYPE uxOutput; void vParTestInitialise( void ) { /* The explorer 16 board has LED's on port A. All bits are set as output - so PORTA is read-modified-written directly. Two pins have change + so PORTA is read-modified-written directly. Two pins have change notification pullups that need disabling. */ CNPU2bits.CN22PUE = 0; CNPU2bits.CN23PUE = 0; diff --git a/FreeRTOS/Demo/dsPIC_MPLAB/RTOSDemo_dsPIC.mcp b/FreeRTOS/Demo/dsPIC_MPLAB/RTOSDemo_dsPIC.mcp index 4aacc2ec8..d422901dd 100644 --- a/FreeRTOS/Demo/dsPIC_MPLAB/RTOSDemo_dsPIC.mcp +++ b/FreeRTOS/Demo/dsPIC_MPLAB/RTOSDemo_dsPIC.mcp @@ -44,6 +44,9 @@ file_016=FreeRTOS Source file_017=. file_018=. file_019=. +file_020=. +file_021=. +file_022=. [GENERATED_FILES] file_000=no file_001=no @@ -65,6 +68,9 @@ file_016=no file_017=no file_018=no file_019=no +file_020=no +file_021=no +file_022=no [OTHER_FILES] file_000=no file_001=no @@ -86,6 +92,9 @@ file_016=no file_017=no file_018=no file_019=no +file_020=no +file_021=no +file_022=no [FILE_INFO] file_000=main.c file_001=ParTest\ParTest.c @@ -95,18 +104,21 @@ file_004=lcd.c file_005=..\Common\Minimal\BlockQ.c file_006=..\Common\Minimal\blocktim.c file_007=..\Common\Minimal\comtest.c -file_008=..\..\source\portable\MemMang\heap_1.c -file_009=..\Common\Minimal\integer.c -file_010=..\..\source\list.c -file_011=..\..\source\portable\MPLAB\PIC24_dsPIC\port.c -file_012=..\..\Source\portable\MPLAB\PIC24_dsPIC\portasm_dsPIC.S -file_013=..\..\source\queue.c -file_014=..\..\source\tasks.c -file_015=..\..\source\include\semphr.h -file_016=..\..\source\include\task.h -file_017=..\..\source\include\queue.h -file_018=FreeRTOSConfig.h -file_019=p33FJ256GP710.gld +file_008=..\Common\Minimal\crflash.c +file_009=..\..\source\croutine.c +file_010=..\..\source\portable\MemMang\heap_1.c +file_011=..\Common\Minimal\integer.c +file_012=..\..\source\list.c +file_013=..\..\source\portable\MPLAB\PIC24_dsPIC\port.c +file_014=..\..\Source\portable\MPLAB\PIC24_dsPIC\portasm_dsPIC.S +file_015=..\..\source\queue.c +file_016=..\..\source\tasks.c +file_017=..\..\source\include\semphr.h +file_018=..\..\source\include\task.h +file_019=..\..\source\include\croutine.h +file_020=..\..\source\include\queue.h +file_021=FreeRTOSConfig.h +file_022=p33FJ256GP710.gld [SUITE_INFO] suite_guid={479DDE59-4D56-455E-855E-FFF59A3DB57E} suite_state= diff --git a/FreeRTOS/Demo/dsPIC_MPLAB/main.c b/FreeRTOS/Demo/dsPIC_MPLAB/main.c index e72c9b9db..fd1522110 100644 --- a/FreeRTOS/Demo/dsPIC_MPLAB/main.c +++ b/FreeRTOS/Demo/dsPIC_MPLAB/main.c @@ -63,9 +63,11 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "croutine.h" /* Demo application includes. */ #include "BlockQ.h" +#include "crflash.h" #include "blocktim.h" #include "integer.h" #include "comtest2.h" @@ -84,6 +86,9 @@ /* The execution period of the check task. */ #define mainCHECK_TASK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_COROUTINES ( 5 ) + /* Baud rate used by the comtest tasks. */ #define mainCOM_TEST_BAUD_RATE ( 19200 ) @@ -135,6 +140,7 @@ int main( void ) /* Create the standard demo tasks. */ vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartIntegerMathTasks( tskIDLE_PRIORITY ); + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); vCreateBlockTimeTasks(); @@ -233,6 +239,8 @@ unsigned short usErrorDetected = pdFALSE; void vApplicationIdleHook( void ) { + /* Schedule the co-routines from within the idle task hook. */ + vCoRoutineSchedule(); } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/dsPIC_MPLAB/serial/serial.c b/FreeRTOS/Demo/dsPIC_MPLAB/serial/serial.c index 1d38e26af..6f70cf2b6 100644 --- a/FreeRTOS/Demo/dsPIC_MPLAB/serial/serial.c +++ b/FreeRTOS/Demo/dsPIC_MPLAB/serial/serial.c @@ -25,7 +25,7 @@ */ -/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. NOTE: This driver is primarily to test the scheduler functionality. It does not effectively use the buffers or DMA and is therefore not intended to be @@ -66,8 +66,8 @@ an example of an efficient driver. */ /* The queues used to communicate between tasks and ISR's. */ -static QueueHandle_t xRxedChars; -static QueueHandle_t xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; static portBASE_TYPE xTxHasEnded; /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/dsPIC_MPLAB/timertest.c b/FreeRTOS/Demo/dsPIC_MPLAB/timertest.c index a67aa00fc..06ca0a572 100644 --- a/FreeRTOS/Demo/dsPIC_MPLAB/timertest.c +++ b/FreeRTOS/Demo/dsPIC_MPLAB/timertest.c @@ -42,7 +42,7 @@ /*-----------------------------------------------------------*/ /* - * Measure the time between this interrupt and the previous interrupt to + * Measure the time between this interrupt and the previous interrupt to * calculate the timing jitter. Remember the maximum value the jitter has * ever been calculated to be. */ @@ -71,7 +71,7 @@ void vSetupTimerTest( unsigned short usFrequencyHz ) /* Timer 4 is going to free run from minimum to maximum value. */ PR4 = ( unsigned short ) timerMAX_COUNT; - /* 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. */ IPC1bits.T2IP = configKERNEL_INTERRUPT_PRIORITY + 1; @@ -102,7 +102,7 @@ unsigned short usThisCount, usDifference; usDifference = usThisCount - usLastCount; /* Store the difference in the timer values if it is larger than the - currently stored largest value. The difference over and above the + currently stored largest value. The difference over and above the expected difference will give the 'jitter' in the processing of these interrupts. */ if( usDifference > usMaxJitter ) @@ -112,7 +112,7 @@ unsigned short usThisCount, usDifference; } else { - /* Don't bother storing any values for the first couple of + /* Don't bother storing any values for the first couple of interrupts. */ usSettleCount++; } diff --git a/FreeRTOS/Demo/lwIP_AVR32_UC3/AT32UC3A/GCC/config.mk b/FreeRTOS/Demo/lwIP_AVR32_UC3/AT32UC3A/GCC/config.mk index e7f21c087..4712cdf6b 100644 --- a/FreeRTOS/Demo/lwIP_AVR32_UC3/AT32UC3A/GCC/config.mk +++ b/FreeRTOS/Demo/lwIP_AVR32_UC3/AT32UC3A/GCC/config.mk @@ -140,6 +140,7 @@ CSRCS = \ $(FREERTOS_PATH)/Source/tasks.c \ $(FREERTOS_PATH)/Source/queue.c \ $(FREERTOS_PATH)/Source/list.c \ + $(FREERTOS_PATH)/Source/croutine.c \ $(FREERTOS_PATH)/Demo/Common/Minimal/flash.c \ $(FREERTOS_PORT_PATH)/port.c \ $(FREERTOS_MEM_PATH)/heap_3.c \ diff --git a/FreeRTOS/Demo/lwIP_AVR32_UC3/FreeRTOSConfig.h b/FreeRTOS/Demo/lwIP_AVR32_UC3/FreeRTOSConfig.h index 6dc311982..84e40cb9d 100644 --- a/FreeRTOS/Demo/lwIP_AVR32_UC3/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/lwIP_AVR32_UC3/FreeRTOSConfig.h @@ -53,7 +53,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -73,6 +73,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 0 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -100,7 +103,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC.c b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC.c index 3bb63df78..ebe209d1d 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC.c +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC.c @@ -27,7 +27,7 @@ /* * Interrupt driven driver for the EMAC peripheral. This driver is not * reentrant, re-entrancy is handled by a semaphore at the network interface - * level. + * level. */ @@ -164,7 +164,7 @@ void vEMACISR_Wrapper( void ) __attribute__ ((naked)); static void prvSetupDescriptors(void); /* - * Write our MAC address into the EMAC. + * Write our MAC address into the EMAC. */ static void prvSetupMACAddress( void ); @@ -223,13 +223,13 @@ unsigned long ulLastBuffer, ulDataBuffered = 0, ulDataRemainingToSend, ulLengthT vTaskDelay( emacBUFFER_WAIT_DELAY ); } } - + /* lReturn will only be pdPASS if a buffer is available. */ if( lReturn == pdPASS ) { portENTER_CRITICAL(); { - /* Get the address of the buffer from the descriptor, then copy + /* Get the address of the buffer from the descriptor, then copy the data into the buffer. */ pcBuffer = ( char * ) xTxDescriptors[ uxTxBufferIndex ].addr; @@ -253,7 +253,7 @@ unsigned long ulLastBuffer, ulDataBuffered = 0, ulDataRemainingToSend, ulLengthT /* Is this the last data for the frame? */ if( lEndOfFrame && ( ulDataBuffered >= ulLength ) ) { - /* No more data remains for this frame so we can start the + /* No more data remains for this frame so we can start the transmission. */ ulLastBuffer = AT91C_LAST_BUFFER; } @@ -262,11 +262,11 @@ unsigned long ulLastBuffer, ulDataBuffered = 0, ulDataRemainingToSend, ulLengthT /* More data to come for this frame. */ ulLastBuffer = 0; } - - /* Fill out the necessary in the descriptor to get the data sent, + + /* Fill out the necessary in the descriptor to get the data sent, then move to the next descriptor, wrapping if necessary. */ if( uxTxBufferIndex >= ( NB_TX_BUFFERS - 1 ) ) - { + { xTxDescriptors[ uxTxBufferIndex ].U_Status.status = ( ulLengthToSend & ( unsigned long ) AT91C_LENGTH_FRAME ) | ulLastBuffer | AT91C_TRANSMIT_WRAP; @@ -278,7 +278,7 @@ unsigned long ulLastBuffer, ulDataBuffered = 0, ulDataRemainingToSend, ulLengthT | ulLastBuffer; uxTxBufferIndex++; } - + /* If this is the last buffer to be sent for this frame we can start the transmission. */ if( ulLastBuffer ) @@ -308,7 +308,7 @@ register unsigned long ulIndex, ulLength = 0; while( ( xRxDescriptors[ ulNextRxBuffer ].addr & AT91C_OWNERSHIP_BIT ) && !( xRxDescriptors[ ulNextRxBuffer ].U_Status.status & AT91C_SOF ) ) { /* Ignoring this buffer. Mark it as free again. */ - xRxDescriptors[ ulNextRxBuffer ].addr &= ~( AT91C_OWNERSHIP_BIT ); + xRxDescriptors[ ulNextRxBuffer ].addr &= ~( AT91C_OWNERSHIP_BIT ); ulNextRxBuffer++; if( ulNextRxBuffer >= NB_RX_BUFFERS ) { @@ -316,12 +316,12 @@ register unsigned long ulIndex, ulLength = 0; } } - /* We are going to walk through the descriptors that make up this frame, + /* We are going to walk through the descriptors that make up this frame, but don't want to alter ulNextRxBuffer as this would prevent vEMACRead() from finding the data. Therefore use a copy of ulNextRxBuffer instead. */ ulIndex = ulNextRxBuffer; - /* Walk through the descriptors until we find the last buffer for this + /* Walk through the descriptors until we find the last buffer for this frame. The last buffer will give us the length of the entire frame. */ while( ( xRxDescriptors[ ulIndex ].addr & AT91C_OWNERSHIP_BIT ) && !ulLength ) { @@ -348,19 +348,19 @@ register unsigned long ulBytesRemainingInBuffer, ulRemainingSectionBytes; /* Read ulSectionLength bytes from the Rx buffers. This is not necessarily any correspondence between the length of our Rx buffers, and the length of the - data we are returning or the length of the data being requested. Therefore, - between calls we have to remember not only which buffer we are currently + data we are returning or the length of the data being requested. Therefore, + between calls we have to remember not only which buffer we are currently processing, but our position within that buffer. This would be greatly simplified if PBUF_POOL_BUFSIZE could be guaranteed to be greater than the size of each Rx buffer, and that memory fragmentation did not occur. - + This function should only be called after a call to ulEMACInputLength(). This will ensure ulNextRxBuffer is set to the correct buffer. */ /* vEMACRead is called with pcTo set to NULL to indicate that we are about - to read a new frame. Any fragments remaining in the frame we were + to read a new frame. Any fragments remaining in the frame we were processing during the last call should be dropped. */ if( pcTo == NULL ) { @@ -383,14 +383,14 @@ register unsigned long ulBytesRemainingInBuffer, ulRemainingSectionBytes; data remains in the buffer? */ ulBytesRemainingInBuffer = ( ETH_RX_BUFFER_SIZE - ulBufferPosition ); - /* How many more bytes do we need to read before we have the + /* How many more bytes do we need to read before we have the required amount of data? */ ulRemainingSectionBytes = ulSectionLength - ulSectionBytesReadSoFar; /* Do we want more data than remains in the buffer? */ if( ulRemainingSectionBytes > ulBytesRemainingInBuffer ) { - /* We want more data than remains in the buffer so we can + /* We want more data than remains in the buffer so we can write the remains of the buffer to the destination, then move onto the next buffer to get the rest. */ memcpy( &( pcTo[ ulSectionBytesReadSoFar ] ), &( pcSource[ ulBufferPosition ] ), ulBytesRemainingInBuffer ); @@ -417,7 +417,7 @@ register unsigned long ulBytesRemainingInBuffer, ulRemainingSectionBytes; enough data and remember how far we read up to. */ memcpy( &( pcTo[ ulSectionBytesReadSoFar ] ), &( pcSource[ ulBufferPosition ] ), ulRemainingSectionBytes ); - /* There may be more data in this buffer yet. Increment our + /* There may be more data in this buffer yet. Increment our position in this buffer past the data we have just read. */ ulBufferPosition += ulRemainingSectionBytes; ulSectionBytesReadSoFar += ulRemainingSectionBytes; @@ -435,7 +435,7 @@ register unsigned long ulBytesRemainingInBuffer, ulRemainingSectionBytes; { ulNextRxBuffer = 0; } - + pcSource = ( char * )( xRxDescriptors[ ulNextRxBuffer ].addr & emacADDRESS_MASK ); ulBufferPosition = 0; } @@ -482,10 +482,10 @@ SemaphoreHandle_t xEMACInit( void ) /* Enable com between EMAC PHY. Enable management port. */ - AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE; + AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE; /* MDC = MCK/32. */ - AT91C_BASE_EMAC->EMAC_NCFGR |= ( 2 ) << 10; + AT91C_BASE_EMAC->EMAC_NCFGR |= ( 2 ) << 10; /* Wait for PHY auto init end (rather crude delay!). */ vTaskDelay( emacPHY_INIT_DELAY ); @@ -519,7 +519,7 @@ SemaphoreHandle_t xEMACInit( void ) /* Setup the buffers and descriptors. */ prvSetupDescriptors(); - + /* Load our MAC address into the EMAC. */ prvSetupMACAddress(); @@ -544,7 +544,7 @@ void vClearEMACTxBuffer( void ) { static unsigned portBASE_TYPE uxNextBufferToClear = 0; - /* Called on Tx interrupt events to reset the AT91C_TRANSMIT_OK bit in each + /* Called on Tx interrupt events to reset the AT91C_TRANSMIT_OK bit in each Tx buffer within the frame just transmitted. This marks all the buffers as available again. @@ -591,7 +591,7 @@ unsigned long ulAddress; the data at this address when this descriptor is being used. Mask off the bottom bits of the address as these have special meaning. */ xRxDescriptors[ xIndex ].addr = ulAddress & emacADDRESS_MASK; - } + } /* The last buffer has the wrap bit set so the EMAC knows to wrap back to the first buffer. */ @@ -607,7 +607,7 @@ unsigned long ulAddress; data from here when the descriptor is being used. */ xTxDescriptors[ xIndex ].addr = ulAddress & emacADDRESS_MASK; xTxDescriptors[ xIndex ].U_Status.status = AT91C_TRANSMIT_OK; - } + } /* The last buffer has the wrap bit set so the EMAC knows to wrap back to the first buffer. */ @@ -616,17 +616,17 @@ unsigned long ulAddress; /* Tell the EMAC where to find the descriptors. */ AT91C_BASE_EMAC->EMAC_RBQP = ( unsigned long ) xRxDescriptors; AT91C_BASE_EMAC->EMAC_TBQP = ( unsigned long ) xTxDescriptors; - + /* Clear all the bits in the receive status register. */ AT91C_BASE_EMAC->EMAC_RSR = ( AT91C_EMAC_OVR | AT91C_EMAC_REC | AT91C_EMAC_BNA ); - /* Enable the copy of data into the buffers, ignore broadcasts, + /* Enable the copy of data into the buffers, ignore broadcasts, and don't copy FCS. */ AT91C_BASE_EMAC->EMAC_NCFGR |= ( AT91C_EMAC_CAF | AT91C_EMAC_NBC | AT91C_EMAC_DRFCS); /* Enable Rx and Tx, plus the stats register. */ AT91C_BASE_EMAC->EMAC_NCR |= ( AT91C_EMAC_TE | AT91C_EMAC_RE | AT91C_EMAC_WESTAT ); -} +} /*-----------------------------------------------------------*/ static void prvSetupMACAddress( void ) @@ -678,11 +678,11 @@ static portBASE_TYPE prvProbePHY( void ) { unsigned long ulPHYId1, ulPHYId2, ulStatus; portBASE_TYPE xReturn = pdPASS; - + /* Code supplied by Atmel (reformatted) -----------------*/ /* Enable management port */ - AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE; + AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE; AT91C_BASE_EMAC->EMAC_NCFGR |= ( 2 ) << 10; /* Read the PHY ID. */ @@ -711,7 +711,7 @@ portBASE_TYPE xReturn = pdPASS; } /* Disable management port */ - AT91C_BASE_EMAC->EMAC_NCR &= ~AT91C_EMAC_MPE; + AT91C_BASE_EMAC->EMAC_NCR &= ~AT91C_EMAC_MPE; /* End of code supplied by Atmel ------------------------*/ @@ -734,7 +734,7 @@ static void vReadPHY( unsigned char ucPHYAddress, unsigned char ucAddress, unsig __asm( "NOP" ); } - *pulValue = ( AT91C_BASE_EMAC->EMAC_MAN & 0x0000ffff ); + *pulValue = ( AT91C_BASE_EMAC->EMAC_MAN & 0x0000ffff ); /* End of code supplied by Atmel ------------------------*/ } @@ -773,20 +773,20 @@ static portBASE_TYPE xGetLinkSpeed( void ) vReadPHY(AT91C_PHY_ADDR, MII_BMSR, &ulBMSR); if( !( ulBMSR & BMSR_LSTATUS ) ) - { + { /* No Link. */ return pdFAIL; } vReadPHY(AT91C_PHY_ADDR, MII_BMCR, &ulBMCR); if (ulBMCR & BMCR_ANENABLE) - { + { /* AutoNegotiation is enabled. */ if (!(ulBMSR & BMSR_ANEGCOMPLETE)) { /* Auto-negotitation in progress. */ - return pdFAIL; - } + return pdFAIL; + } vReadPHY(AT91C_PHY_ADDR, MII_LPA, &ulLPA); if( ( ulLPA & LPA_100FULL ) || ( ulLPA & LPA_100HALF ) ) @@ -823,7 +823,7 @@ static portBASE_TYPE xGetLinkSpeed( void ) AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_SPD | AT91C_EMAC_FD; } else - { + { /* 100 Half Duplex */ AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_SPD; } diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC_ISR.c b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC_ISR.c index 6edd59213..dc930ff26 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC_ISR.c +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/EMAC/SAM7_EMAC_ISR.c @@ -77,7 +77,7 @@ extern void vClearEMACTxBuffer( void ); /* Clear the interrupt. */ AT91C_BASE_AIC->AIC_EOICR = 0; - /* If a task was woken by either a frame being received then we may need to + /* If a task was woken by either a frame being received then we may need to switch to another task. If the unblocked task was of higher priority then the interrupted task it will then execute immediately that the ISR completes. */ diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/FreeRTOSConfig.h b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/FreeRTOSConfig.h index 300e288f2..ec6eb53f6 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/FreeRTOSConfig.h @@ -34,7 +34,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -56,6 +56,9 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ @@ -71,7 +74,7 @@ to exclude the API function. */ /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human -readable ASCII form. See the notes in the implementation of vTaskList() within +readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/ParTest/ParTest.c b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/ParTest/ParTest.c index e5844b8d2..6ed025d25 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/ParTest/ParTest.c +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/ParTest/ParTest.c @@ -41,7 +41,7 @@ const unsigned long ulLED_MASK[ NB_LED ]= { LED1, LED2, LED3, LED4 }; void vParTestInitialise( void ) -{ +{ /* Start with all LED's off. */ AT91C_BASE_PIOB->PIO_SODR = LED_MASK; } diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.c b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.c index a5ad5f134..fd2bd0161 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.c +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.c @@ -26,9 +26,9 @@ /* USB Communications Device Class driver. - Implements task vUSBCDCTask and provides an Abstract Control Model serial - interface. Control is through endpoint 0, device-to-host notification is - provided by interrupt-in endpoint 3, and raw data is transferred through + Implements task vUSBCDCTask and provides an Abstract Control Model serial + interface. Control is through endpoint 0, device-to-host notification is + provided by interrupt-in endpoint 3, and raw data is transferred through bulk endpoints 1 and 2. - developed from original FreeRTOS HID example by Scott Miller @@ -104,12 +104,12 @@ static xCONTROL_MESSAGE pxControlTx; static xCONTROL_MESSAGE pxControlRx; /* Queue holding pointers to pending messages */ -QueueHandle_t xUSBInterruptQueue; +QueueHandle_t xUSBInterruptQueue; /* Queues used to hold received characters, and characters waiting to be transmitted. Rx queue must be larger than FIFO size. */ -static QueueHandle_t xRxCDC; -static QueueHandle_t xTxCDC; +static QueueHandle_t xRxCDC; +static QueueHandle_t xTxCDC; /* Line coding - 115,200 baud, N-8-1 */ static const unsigned char pxLineCoding[] = { 0x00, 0xC2, 0x01, 0x00, 0x00, 0x00, 0x08 }; @@ -136,16 +136,16 @@ portBASE_TYPE xByte; portENTER_CRITICAL(); vDetachUSBInterface(); portEXIT_CRITICAL(); - + vTaskDelay( portTICK_PERIOD_MS * 60 ); /* Init USB interface */ portENTER_CRITICAL(); vInitUSBInterface(); portEXIT_CRITICAL(); - + /* Main task loop. Process incoming endpoint 0 interrupts, handle data transfers. */ - + for( ;; ) { /* Look for data coming from the ISR. */ @@ -160,18 +160,18 @@ portBASE_TYPE xByte; if( pxMessage->ulISR & AT91C_UDP_ENDBUSRES ) { /* End of bus reset - reset the endpoints and de-configure. */ - prvResetEndPoints(); + prvResetEndPoints(); } } - + /* See if we're ready to send and receive data. */ - if( eDriverState == eREADY_TO_SEND && ucControlState ) + if( eDriverState == eREADY_TO_SEND && ucControlState ) { if( ( !(AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_2 ] & AT91C_UDP_TXPKTRDY) ) && uxQueueMessagesWaiting( xTxCDC ) ) { for( xByte = 0; xByte < 64; xByte++ ) - { - if( !xQueueReceive( xTxCDC, &ucByte, 0 ) ) + { + if( !xQueueReceive( xTxCDC, &ucByte, 0 ) ) { /* No data buffered to transmit. */ break; @@ -179,7 +179,7 @@ portBASE_TYPE xByte; /* Got a byte to transmit. */ AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_2 ] = ucByte; - } + } AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_2 ] |= AT91C_UDP_TXPKTRDY; } @@ -208,19 +208,19 @@ portBASE_TYPE xByte; /* Re-enable endpoint 1's interrupts */ AT91C_BASE_UDP->UDP_IER = AT91C_UDP_EPINT1; - + /* Update the current bank in use */ - if( uiCurrentBank == AT91C_UDP_RX_DATA_BK0 ) + if( uiCurrentBank == AT91C_UDP_RX_DATA_BK0 ) { uiCurrentBank = AT91C_UDP_RX_DATA_BK1; } - else + else { uiCurrentBank = AT91C_UDP_RX_DATA_BK0; } } - else + else { break; } @@ -322,54 +322,54 @@ unsigned long ulRxBytes; { /* We sent an acknowledgement of a SET_CONFIG request. We are now at the end of the enumeration. - + TODO: Config 0 sets unconfigured state, should enter Address state. Request for unsupported config should stall. */ AT91C_BASE_UDP->UDP_GLBSTATE = AT91C_UDP_CONFG; - + /* Set up endpoints */ portENTER_CRITICAL(); { unsigned long ulTemp; /* Set endpoint 1 to bulk-out */ - ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ]; + ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ]; usbCSR_SET_BIT( &ulTemp, AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT ); - AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] = ulTemp; + AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] = ulTemp; AT91C_BASE_UDP->UDP_IER = AT91C_UDP_EPINT1; /* Set endpoint 2 to bulk-in */ - ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_2 ]; + ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_2 ]; usbCSR_SET_BIT( &ulTemp, AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_IN ); - AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_2 ] = ulTemp; + AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_2 ] = ulTemp; AT91C_BASE_UDP->UDP_IER = AT91C_UDP_EPINT2; /* Set endpoint 3 to interrupt-in, enable it, and enable interrupts */ - ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_3 ]; + ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_3 ]; usbCSR_SET_BIT( &ulTemp, AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_INT_IN ); - AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_3 ] = ulTemp; + AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_3 ] = ulTemp; /*AT91F_UDP_EnableIt( AT91C_BASE_UDP, AT91C_UDP_EPINT3 ); */ } portEXIT_CRITICAL(); eDriverState = eREADY_TO_SEND; - } + } else if( eDriverState == eJUST_GOT_ADDRESS ) { /* We sent an acknowledgement of a SET_ADDRESS request. Move to the addressed state. */ if( ulReceivedAddress != ( unsigned long ) 0 ) - { + { AT91C_BASE_UDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; } else { AT91C_BASE_UDP->UDP_GLBSTATE = 0; - } + } - AT91C_BASE_UDP->UDP_FADDR = ( AT91C_UDP_FEN | ulReceivedAddress ); + AT91C_BASE_UDP->UDP_FADDR = ( AT91C_UDP_FEN | ulReceivedAddress ); eDriverState = eNOTHING; } else - { + { /* The TXCOMP was not for any special type of transmission. See if there is any more data to send. */ prvSendNextSegment(); @@ -380,14 +380,14 @@ unsigned long ulRxBytes; { /* Received a control data packet. May be a 0-length ACK or a data stage. */ unsigned char ucBytesToGet; - + /* Got data. Cancel any outgoing data. */ pxControlTx.ulNextCharIndex = pxControlTx.ulTotalDataLength; - + /* Determine how many bytes we need to receive. */ ucBytesToGet = pxControlRx.ulTotalDataLength - pxControlRx.ulNextCharIndex; - if( ucBytesToGet > ulRxBytes ) - { + if( ucBytesToGet > ulRxBytes ) + { ucBytesToGet = ulRxBytes; } @@ -399,7 +399,7 @@ unsigned long ulRxBytes; /* Get the required data and update the index. */ memcpy( pxControlRx.ucBuffer, pxMessage->ucFifoData, ucBytesToGet ); - pxControlRx.ulNextCharIndex += ucBytesToGet; + pxControlRx.ulNextCharIndex += ucBytesToGet; } if( pxMessage->ulCSR0 & AT91C_UDP_RXSETUP ) @@ -407,7 +407,7 @@ unsigned long ulRxBytes; /* Received a SETUP packet. May be followed by data packets. */ if( ulRxBytes >= usbEXPECTED_NUMBER_OF_BYTES ) - { + { /* Create an xUSB_REQUEST variable from the raw bytes array. */ xRequest.ucReqType = pxMessage->ucFifoData[ usbREQUEST_TYPE_INDEX ]; @@ -416,11 +416,11 @@ unsigned long ulRxBytes; xRequest.usValue = pxMessage->ucFifoData[ usbVALUE_HIGH_BYTE ]; xRequest.usValue <<= 8; xRequest.usValue |= pxMessage->ucFifoData[ usbVALUE_LOW_BYTE ]; - + xRequest.usIndex = pxMessage->ucFifoData[ usbINDEX_HIGH_BYTE ]; xRequest.usIndex <<= 8; xRequest.usIndex |= pxMessage->ucFifoData[ usbINDEX_LOW_BYTE ]; - + xRequest.usLength = pxMessage->ucFifoData[ usbLENGTH_HIGH_BYTE ]; xRequest.usLength <<= 8; xRequest.usLength |= pxMessage->ucFifoData[ usbLENGTH_LOW_BYTE ]; @@ -429,7 +429,7 @@ unsigned long ulRxBytes; if( ! (xRequest.ucReqType & 0x80) ) /* Host-to-Device transfer, may need to get data first */ { if( xRequest.usLength > usbMAX_CONTROL_MESSAGE_SIZE ) - { + { /* Too big! No space for control data, stall and abort. */ prvSendStall(); return; @@ -440,49 +440,49 @@ unsigned long ulRxBytes; else { /* We're sending the data, don't wait for any. */ - pxControlRx.ulTotalDataLength = 0; + pxControlRx.ulTotalDataLength = 0; } } } /* See if we've got a pending request and all its associated data ready */ - if( ( pxMessage->ulCSR0 & ( AT91C_UDP_RX_DATA_BK0 | AT91C_UDP_RXSETUP ) ) + if( ( pxMessage->ulCSR0 & ( AT91C_UDP_RX_DATA_BK0 | AT91C_UDP_RXSETUP ) ) && ( pxControlRx.ulNextCharIndex >= pxControlRx.ulTotalDataLength ) ) { unsigned char ucRequest; - /* Manipulate the ucRequestType and the ucRequest parameters to - generate a zero based request selection. This is just done to - break up the requests into subsections for clarity. The + /* Manipulate the ucRequestType and the ucRequest parameters to + generate a zero based request selection. This is just done to + break up the requests into subsections for clarity. The alternative would be to have more huge switch statement that would be difficult to optimise. */ ucRequest = ( ( xRequest.ucReqType & 0x60 ) >> 3 ); ucRequest |= ( xRequest.ucReqType & 0x03 ); - + switch( ucRequest ) { - case usbSTANDARD_DEVICE_REQUEST: + case usbSTANDARD_DEVICE_REQUEST: /* Standard Device request */ prvHandleStandardDeviceRequest( &xRequest ); break; - case usbSTANDARD_INTERFACE_REQUEST: + case usbSTANDARD_INTERFACE_REQUEST: /* Standard Interface request */ prvHandleStandardInterfaceRequest( &xRequest ); break; - case usbSTANDARD_END_POINT_REQUEST: + case usbSTANDARD_END_POINT_REQUEST: /* Standard Endpoint request */ prvHandleStandardEndPointRequest( &xRequest ); break; - case usbCLASS_INTERFACE_REQUEST: + case usbCLASS_INTERFACE_REQUEST: /* Class Interface request */ prvHandleClassInterfaceRequest( &xRequest ); break; default: /* This is not something we want to respond to. */ - prvSendStall(); + prvSendStall(); } } } @@ -505,7 +505,7 @@ static void prvGetStandardDeviceDescriptor( xUSB_REQUEST *pxRequest ) /* The index to the string descriptor is the lower byte. */ switch( pxRequest->usValue & 0xff ) - { + { case usbLANGUAGE_STRING: prvSendControlData( ( unsigned char * ) &pxLanguageStringDescriptor, pxRequest->usLength, sizeof(pxLanguageStringDescriptor), pdTRUE ); break; @@ -564,10 +564,10 @@ unsigned short usStatus = 0; prvSendZLP(); break; - case usbSET_ADDRESS_REQUEST: + case usbSET_ADDRESS_REQUEST: /* Get assigned address and send ack, but don't implement new address until we get a TXCOMP */ - prvSendZLP(); - eDriverState = eJUST_GOT_ADDRESS; + prvSendZLP(); + eDriverState = eJUST_GOT_ADDRESS; ulReceivedAddress = ( unsigned long ) pxRequest->usValue; break; @@ -645,13 +645,13 @@ unsigned short usStatus = 0; break; case usbGET_DESCRIPTOR_REQUEST: - prvGetStandardInterfaceDescriptor( pxRequest ); + prvGetStandardInterfaceDescriptor( pxRequest ); break; /* This minimal implementation does not respond to these. */ case usbGET_INTERFACE_REQUEST: case usbSET_FEATURE_REQUEST: - case usbSET_INTERFACE_REQUEST: + case usbSET_INTERFACE_REQUEST: default: prvSendStall(); @@ -666,10 +666,10 @@ static void prvHandleStandardEndPointRequest( xUSB_REQUEST *pxRequest ) { /* This minimal implementation does not expect to respond to these. */ case usbGET_STATUS_REQUEST: - case usbCLEAR_FEATURE_REQUEST: + case usbCLEAR_FEATURE_REQUEST: case usbSET_FEATURE_REQUEST: - default: + default: prvSendStall(); break; } @@ -685,7 +685,7 @@ static void vDetachUSBInterface( void) /* Disable pull up */ AT91C_BASE_PIOA->PIO_SODR = AT91C_PIO_PA16; -} +} /*-----------------------------------------------------------*/ static void vInitUSBInterface( void ) @@ -694,17 +694,17 @@ extern void ( vUSB_ISR_Wrapper )( void ); /* Create the queue used to communicate between the USB ISR and task. */ xUSBInterruptQueue = xQueueCreate( usbQUEUE_LENGTH + 1, sizeof( xISRStatus * ) ); - + /* Create the queues used to hold Rx and Tx characters. */ xRxCDC = xQueueCreate( USB_CDC_QUEUE_SIZE, ( unsigned char ) sizeof( signed char ) ); xTxCDC = xQueueCreate( USB_CDC_QUEUE_SIZE + 1, ( unsigned char ) sizeof( signed char ) ); if( (!xUSBInterruptQueue) || (!xRxCDC) || (!xTxCDC) ) - { + { /* Not enough RAM to create queues!. */ return; } - + /* Initialise a few state variables. */ pxControlTx.ulNextCharIndex = ( unsigned long ) 0; pxControlRx.ulNextCharIndex = ( unsigned long ) 0; @@ -728,7 +728,7 @@ extern void ( vUSB_ISR_Wrapper )( void ); AT91C_BASE_PIOA->PIO_OER = AT91C_PIO_PA16; - /* Start without the pullup - this will get set at the end of this + /* Start without the pullup - this will get set at the end of this function. */ AT91C_BASE_PIOA->PIO_SODR = AT91C_PIO_PA16; @@ -748,7 +748,7 @@ extern void ( vUSB_ISR_Wrapper )( void ); /* Enable the transceiver. */ AT91C_UDP_TRANSCEIVER_ENABLE = 0; - /* Enable the USB interrupts - other interrupts get enabled as the + /* Enable the USB interrupts - other interrupts get enabled as the enumeration process progresses. */ AT91F_AIC_ConfigureIt( AT91C_ID_UDP, usbINTERRUPT_PRIORITY, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, ( void (*)( void ) ) vUSB_ISR_Wrapper ); AT91C_BASE_AIC->AIC_IECR = 0x1 << AT91C_ID_UDP; @@ -769,7 +769,7 @@ static void prvSendControlData( unsigned char *pucData, unsigned short usRequest } else if( ( ulLengthToSend < ( unsigned long ) usRequestedLength ) && lSendingDescriptor ) { - /* We are sending a descriptor. If the descriptor is an exact + /* We are sending a descriptor. If the descriptor is an exact multiple of the FIFO length then it will have to be terminated with a NULL packet. Set the state to indicate this if necessary. */ @@ -786,12 +786,12 @@ static void prvSendControlData( unsigned char *pucData, unsigned short usRequest (if it is greater than 8 bytes in length). */ memcpy( pxControlTx.ucBuffer, pucData, ulLengthToSend ); - /* Reinitialise the buffer index so we start sending from the start of + /* Reinitialise the buffer index so we start sending from the start of the data. */ pxControlTx.ulTotalDataLength = ulLengthToSend; pxControlTx.ulNextCharIndex = ( unsigned long ) 0; - /* Send the first 8 bytes now. The rest will get sent in response to + /* Send the first 8 bytes now. The rest will get sent in response to TXCOMP interrupts. */ prvSendNextSegment(); } @@ -805,7 +805,7 @@ volatile unsigned long ulNextLength, ulStatus, ulLengthLeftToSend; if( pxControlTx.ulTotalDataLength > pxControlTx.ulNextCharIndex ) { ulLengthLeftToSend = pxControlTx.ulTotalDataLength - pxControlTx.ulNextCharIndex; - + /* We can only send 8 bytes to the fifo at a time. */ if( ulLengthLeftToSend > usbFIFO_LENGTH ) { @@ -827,11 +827,11 @@ volatile unsigned long ulNextLength, ulStatus, ulLengthLeftToSend; while( ulNextLength > ( unsigned long ) 0 ) { AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_0 ] = pxControlTx.ucBuffer[ pxControlTx.ulNextCharIndex ]; - + ulNextLength--; pxControlTx.ulNextCharIndex++; } - + /* Start the transmission. */ portENTER_CRITICAL(); { @@ -843,7 +843,7 @@ volatile unsigned long ulNextLength, ulStatus, ulLengthLeftToSend; } else { - /* There is no data to send. If we were sending a descriptor and the + /* There is no data to send. If we were sending a descriptor and the descriptor was an exact multiple of the max packet size then we need to send a null to terminate the transmission. */ if( eDriverState == eSENDING_EVEN_DESCRIPTOR ) diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.h b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.h index e6328838c..4689dd76f 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.h +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.h @@ -40,7 +40,7 @@ typedef struct X_ISR_STATUS } xISRStatus; /* Structure used to hold the received requests. */ -typedef struct +typedef struct { unsigned char ucReqType; unsigned char ucRequest; diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USBIsr.c b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USBIsr.c index 1264e046b..8e941f1e7 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USBIsr.c +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/USBIsr.c @@ -25,8 +25,8 @@ */ -/* - BASIC INTERRUPT DRIVEN DRIVER FOR USB. +/* + BASIC INTERRUPT DRIVEN DRIVER FOR USB. This file contains all the usb components that must be compiled to ARM mode. The components that can be compiled to either ARM or THUMB @@ -78,14 +78,14 @@ unsigned char ucFifoIndex; /* Clear interrupts from ICR. */ AT91C_BASE_UDP->UDP_ICR = AT91C_BASE_UDP->UDP_IMR | AT91C_UDP_ENDBUSRES; - - - /* Process incoming FIFO data. Must set DIR (if needed) and clear RXSETUP + + + /* Process incoming FIFO data. Must set DIR (if needed) and clear RXSETUP before exit. */ /* Read CSR and get incoming byte count. */ ulRxBytes = ( pxMessage->ulCSR0 >> 16 ) & usbRX_COUNT_MASK; - + /* Receive control transfers on endpoint 0. */ if( pxMessage->ulCSR0 & ( AT91C_UDP_RXSETUP | AT91C_UDP_RX_DATA_BK0 ) ) { @@ -95,7 +95,7 @@ unsigned char ucFifoIndex; pxMessage->ucFifoData[ ucFifoIndex ] = AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_0 ]; } - /* Set direction for data stage. Must be done before RXSETUP is + /* Set direction for data stage. Must be done before RXSETUP is cleared. */ if( ( AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_0 ] & AT91C_UDP_RXSETUP ) ) { @@ -122,17 +122,17 @@ unsigned char ucFifoIndex; while ( AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_0 ] & AT91C_UDP_RX_DATA_BK0 ); } } - - /* If we received data on endpoint 1, disable its interrupts until it is + + /* If we received data on endpoint 1, disable its interrupts until it is processed in the main loop */ if( AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] & ( AT91C_UDP_RX_DATA_BK0 | AT91C_UDP_RX_DATA_BK1 ) ) { AT91C_BASE_UDP->UDP_IDR = AT91C_UDP_EPINT1; } - + AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_0 ] &= ~( AT91C_UDP_TXCOMP | AT91C_UDP_STALLSENT ); - - /* Clear interrupts for the other endpoints, retain data flags for endpoint + + /* Clear interrupts for the other endpoints, retain data flags for endpoint 1. */ AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] &= ~( AT91C_UDP_TXCOMP | AT91C_UDP_STALLSENT | AT91C_UDP_RXSETUP ); AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_2 ] &= ~usbINT_CLEAR_MASK; diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h index 1013311d5..4197f2591 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h @@ -45,7 +45,7 @@ const char pxLanguageStringDescriptor[] = 0x09, 0x04 }; -const char pxManufacturerStringDescriptor[] = +const char pxManufacturerStringDescriptor[] = { 18, usbDESCRIPTOR_TYPE_STRING, @@ -53,7 +53,7 @@ const char pxManufacturerStringDescriptor[] = 'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00 }; -const char pxProductStringDescriptor[] = +const char pxProductStringDescriptor[] = { 36, usbDESCRIPTOR_TYPE_STRING, @@ -62,7 +62,7 @@ const char pxProductStringDescriptor[] = 'C', 0x00, ' ', 0x00, 'D', 0x00, 'E', 0x00, 'M', 0x00, 'O', 0x00 }; -const char pxConfigurationStringDescriptor[] = +const char pxConfigurationStringDescriptor[] = { 38, usbDESCRIPTOR_TYPE_STRING, @@ -71,7 +71,7 @@ const char pxConfigurationStringDescriptor[] = 'o', 0x00, 'n', 0x00, ' ', 0x00, 'N', 0x00, 'a', 0x00, 'm', 0x00, 'e', 0x00 }; -const char pxInterfaceStringDescriptor[] = +const char pxInterfaceStringDescriptor[] = { 30, usbDESCRIPTOR_TYPE_STRING, @@ -81,7 +81,7 @@ const char pxInterfaceStringDescriptor[] = }; /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */ -const char pxDeviceDescriptor[] = +const char pxDeviceDescriptor[] = { /* Device descriptor */ 0x12, /* bLength */ diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/usb.h b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/usb.h index 80bbdec86..74a9d0b84 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/usb.h +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/usb.h @@ -101,9 +101,9 @@ #define usbCLASS_INTERFACE_REQUEST ( 5 ) -/* Macros to manipulate the control and status registers. These registers -cannot be accessed using a direct read modify write operation outside of the -ISR as some bits are left unchanged by writing with a 0, and some are left +/* Macros to manipulate the control and status registers. These registers +cannot be accessed using a direct read modify write operation outside of the +ISR as some bits are left unchanged by writing with a 0, and some are left unchanged by writing with a 1. */ diff --git a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/makefile b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/makefile index b48dda078..a64166f06 100644 --- a/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/makefile +++ b/FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/makefile @@ -84,7 +84,7 @@ DEMO_APP_THMUB_SRC= \ ../Common/Minimal/PollQ.c \ ../Common/Minimal/semtest.c \ BasicWEB.c \ - USB/USB-CDC.c + USB/USB-CDC.c LWIP_THUMB_SRC= \ lwip-1.1.0/src/core/tcp_out.c \ @@ -119,7 +119,7 @@ ARM_SRC= \ ../../Source/portable/GCC/ARM7_AT91SAM7S/portISR.c \ EMAC/SAM7_EMAC_ISR.c \ USB/USBIsr.c \ - Cstartup_SAM7.c + Cstartup_SAM7.c # diff --git a/FreeRTOS/Demo/msp430_CrossWorks/FreeRTOSConfig.h b/FreeRTOS/Demo/msp430_CrossWorks/FreeRTOSConfig.h index f8ce768d1..1048a5bc4 100644 --- a/FreeRTOS/Demo/msp430_CrossWorks/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/msp430_CrossWorks/FreeRTOSConfig.h @@ -29,32 +29,32 @@ #include -/* -Two interrupt examples are provided - +/* +Two interrupt examples are provided - + Method 1 does everything in C code. + Method 2 uses an assembly file wrapper. Code size: -Method 1 uses assembly macros to save and restore the task context, whereas -method 2 uses functions. This means method 1 will be faster, but method 2 will -use less code space. +Method 1 uses assembly macros to save and restore the task context, whereas +method 2 uses functions. This means method 1 will be faster, but method 2 will +use less code space. Simplicity: -Method 1 is very simplistic, whereas method 2 is more elaborate. This -elaboration results in the code space saving, but also requires a slightly more -complex procedure to define interrupt service routines. +Method 1 is very simplistic, whereas method 2 is more elaborate. This +elaboration results in the code space saving, but also requires a slightly more +complex procedure to define interrupt service routines. Interrupt efficiency: -Method 1 uses the compiler generated function prologue and epilogue code to save -and restore the necessary registers within an interrupt service routine (other -than the RTOS tick ISR). Should a context switch be required from within the ISR -the entire processor context is saved. This can result in some registers being saved +Method 1 uses the compiler generated function prologue and epilogue code to save +and restore the necessary registers within an interrupt service routine (other +than the RTOS tick ISR). Should a context switch be required from within the ISR +the entire processor context is saved. This can result in some registers being saved twice - once by the compiler generated code, and then again by the FreeRTOS code. -Method 2 saves and restores all the processor registers within each interrupt service -routine, whether or not a context switch actually occurs. This means no registers -ever get saved twice, but imposes an overhead on the occasions that no context switch -occurs. +Method 2 saves and restores all the processor registers within each interrupt service +routine, whether or not a context switch actually occurs. This means no registers +ever get saved twice, but imposes an overhead on the occasions that no context switch +occurs. */ #define configINTERRUPT_EXAMPLE_METHOD 1 @@ -66,7 +66,7 @@ occurs. * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -84,6 +84,9 @@ occurs. #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/msp430_CrossWorks/ParTest/ParTest.c b/FreeRTOS/Demo/msp430_CrossWorks/ParTest/ParTest.c index 2f1161c51..ebbe4dc11 100644 --- a/FreeRTOS/Demo/msp430_CrossWorks/ParTest/ParTest.c +++ b/FreeRTOS/Demo/msp430_CrossWorks/ParTest/ParTest.c @@ -61,16 +61,16 @@ and off to generate '*' characters. */ #define mainON_BOARD_LED_BIT ( ( unsigned char ) 0x01 ) /* The LCD segments used to generate the '*' characters for LED's 0 to 5. */ -unsigned char * const ucRHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa4, - ( unsigned char * )0xa2, - ( unsigned char * )0xa0, +unsigned char * const ucRHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa4, + ( unsigned char * )0xa2, + ( unsigned char * )0xa0, ( unsigned char * )0x9e, ( unsigned char * )0x9c, ( unsigned char * )0x9a }; -unsigned char * const ucLHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa3, - ( unsigned char * )0xa1, - ( unsigned char * )0x9f, +unsigned char * const ucLHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa3, + ( unsigned char * )0xa1, + ( unsigned char * )0x9f, ( unsigned char * )0x9d, ( unsigned char * )0x9b, ( unsigned char * )0x99 }; @@ -98,28 +98,28 @@ void vParTestInitialise( void ) P3SEL = 0x00; P4SEL = 0xFC; P5SEL = 0xFF; - + /* Initialise all segments to off. */ - LCDM1 = partstSEGMENTS_OFF; - LCDM2 = partstSEGMENTS_OFF; - LCDM3 = partstSEGMENTS_OFF; - LCDM4 = partstSEGMENTS_OFF; - LCDM5 = partstSEGMENTS_OFF; - LCDM6 = partstSEGMENTS_OFF; - LCDM7 = partstSEGMENTS_OFF; - LCDM8 = partstSEGMENTS_OFF; - LCDM9 = partstSEGMENTS_OFF; - LCDM10 = partstSEGMENTS_OFF; - LCDM11 = partstSEGMENTS_OFF; - LCDM12 = partstSEGMENTS_OFF; - LCDM13 = partstSEGMENTS_OFF; - LCDM14 = partstSEGMENTS_OFF; - LCDM15 = partstSEGMENTS_OFF; - LCDM16 = partstSEGMENTS_OFF; - LCDM17 = partstSEGMENTS_OFF; - LCDM18 = partstSEGMENTS_OFF; - LCDM19 = partstSEGMENTS_OFF; - LCDM20 = partstSEGMENTS_OFF; + LCDM1 = partstSEGMENTS_OFF; + LCDM2 = partstSEGMENTS_OFF; + LCDM3 = partstSEGMENTS_OFF; + LCDM4 = partstSEGMENTS_OFF; + LCDM5 = partstSEGMENTS_OFF; + LCDM6 = partstSEGMENTS_OFF; + LCDM7 = partstSEGMENTS_OFF; + LCDM8 = partstSEGMENTS_OFF; + LCDM9 = partstSEGMENTS_OFF; + LCDM10 = partstSEGMENTS_OFF; + LCDM11 = partstSEGMENTS_OFF; + LCDM12 = partstSEGMENTS_OFF; + LCDM13 = partstSEGMENTS_OFF; + LCDM14 = partstSEGMENTS_OFF; + LCDM15 = partstSEGMENTS_OFF; + LCDM16 = partstSEGMENTS_OFF; + LCDM17 = partstSEGMENTS_OFF; + LCDM18 = partstSEGMENTS_OFF; + LCDM19 = partstSEGMENTS_OFF; + LCDM20 = partstSEGMENTS_OFF; /* Setup LCD control. */ LCDCTL = (LCDSG0_7|LCD4MUX|LCDON); @@ -179,7 +179,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) /* The request related to the genuine on board LED. */ prvToggleOnBoardLED(); } - } + } } /*-----------------------------------------------------------*/ @@ -188,7 +188,7 @@ static void prvToggleOnBoardLED( void ) static unsigned short sState = pdFALSE; /* Toggle the state of the single genuine on board LED. */ - if( sState ) + if( sState ) { P1OUT |= mainON_BOARD_LED_BIT; } diff --git a/FreeRTOS/Demo/msp430_CrossWorks/serial/serial.c b/FreeRTOS/Demo/msp430_CrossWorks/serial/serial.c index 06b1ce6e4..446cd3e2e 100644 --- a/FreeRTOS/Demo/msp430_CrossWorks/serial/serial.c +++ b/FreeRTOS/Demo/msp430_CrossWorks/serial/serial.c @@ -25,8 +25,8 @@ */ -/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. - * +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. + * * This file only supports UART 1 */ @@ -51,10 +51,10 @@ #define vInterruptOn() IFG2 |= UTXIFG1 /* The queue used to hold received characters. */ -static QueueHandle_t xRxedChars; +static QueueHandle_t xRxedChars; /* The queue used to hold characters waiting transmission. */ -static QueueHandle_t xCharsForTx; +static QueueHandle_t xCharsForTx; static volatile short sTHREEmpty; @@ -81,7 +81,7 @@ unsigned long ulBaudRateCount; /* Set pin function. */ P4SEL |= serTX_AND_RX; - /* All other bits remain at zero for n, 8, 1 interrupt driven operation. + /* All other bits remain at zero for n, 8, 1 interrupt driven operation. LOOPBACK MODE!*/ U1CTL |= CHAR + LISTEN; U1TCTL |= SSEL1; @@ -106,7 +106,7 @@ unsigned long ulBaudRateCount; IE2 |= URXIE1 + UTXIE1; } 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. */ @@ -139,7 +139,7 @@ signed portBASE_TYPE xReturn; { if( sTHREEmpty == pdTRUE ) { - /* If sTHREEmpty is true then the UART Tx ISR has indicated that + /* If sTHREEmpty is true then the UART Tx ISR has indicated that there are no characters queued to be transmitted - so we can write the character directly to the shift Tx register. */ sTHREEmpty = pdFALSE; @@ -149,17 +149,17 @@ signed portBASE_TYPE xReturn; else { /* sTHREEmpty is false, so there are still characters waiting to be - transmitted. We have to queue this character so it gets + transmitted. We have to queue this character so it gets transmitted in turn. */ - /* Return false if after the block time there is no room on the Tx + /* Return false if after the block time there is no room on the Tx queue. It is ok to block inside a critical section as each task maintains it's own critical section status. */ xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime ); - /* Depending on queue sizing and task prioritisation: While we - were blocked waiting to post on the queue interrupts were not - disabled. It is possible that the serial ISR has emptied the + /* Depending on queue sizing and task prioritisation: While we + were blocked waiting to post on the queue interrupts were not + disabled. It is possible that the serial ISR has emptied the Tx queue, in which case we need to start the Tx off again writing directly to the Tx register. */ if( ( sTHREEmpty == pdTRUE ) && ( xReturn == pdPASS ) ) @@ -186,17 +186,17 @@ signed portBASE_TYPE xReturn; { signed char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - - /* Get the character from the UART and post it on the queue of Rxed + + /* Get the character from the UART and post it on the queue of Rxed characters. */ cChar = U1RXBUF; - + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); if( xHigherPriorityTaskWoken ) { - /*If the post causes a task to wake force a context switch - as the woken task may have a higher priority than the task we have + /*If the post causes a task to wake force a context switch + as the woken task may have a higher priority than the task we have interrupted. */ taskYIELD(); } @@ -205,7 +205,7 @@ signed portBASE_TYPE xReturn; __bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF ); } /*-----------------------------------------------------------*/ - + /* * UART Tx interrupt service routine. */ @@ -213,10 +213,10 @@ signed portBASE_TYPE xReturn; { signed char cChar; portBASE_TYPE xTaskWoken = pdFALSE; - + /* The previous character has been transmitted. See if there are any further characters waiting transmission. */ - + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE ) { /* There was another character queued - transmit it now. */ @@ -241,30 +241,30 @@ signed portBASE_TYPE xReturn; { signed char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - - /* Get the character from the UART and post it on the queue of Rxed + + /* Get the character from the UART and post it on the queue of Rxed characters. */ cChar = U1RXBUF; - + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - /*If the post causes a task to wake force a context switch - as the woken task may have a higher priority than the task we have + /*If the post causes a task to wake force a context switch + as the woken task may have a higher priority than the task we have interrupted. */ portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); } /*-----------------------------------------------------------*/ - + /* This is a standard C function as an assembly file wrapper is used as an interrupt entry point. */ void vTxISR( void ) { signed char cChar; portBASE_TYPE xTaskWoken = pdFALSE; - + /* The previous character has been transmitted. See if there are any further characters waiting transmission. */ - + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE ) { /* There was another character queued - transmit it now. */ diff --git a/FreeRTOS/Demo/msp430_CrossWorks/serial/serialASM.asm b/FreeRTOS/Demo/msp430_CrossWorks/serial/serialASM.asm index 5544648da..db410e1e4 100644 --- a/FreeRTOS/Demo/msp430_CrossWorks/serial/serialASM.asm +++ b/FreeRTOS/Demo/msp430_CrossWorks/serial/serialASM.asm @@ -56,7 +56,7 @@ _vUARTTx_Wrapper /*-----------------------------------------------------------*/ - + /* Place the UART ISRs in the correct vectors. */ @@ -68,11 +68,11 @@ _vUARTTx_Wrapper DW _vUARTRx_Wrapper ORG UART1TX_VECTOR - DW _vUARTTx_Wrapper - + DW _vUARTTx_Wrapper + #endif /* configINTERRUPT_EXAMPLE_METHOD */ END - - + + diff --git a/FreeRTOS/Demo/msp430_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/msp430_GCC/FreeRTOSConfig.h index 518430269..72d9aa66e 100644 --- a/FreeRTOS/Demo/msp430_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/msp430_GCC/FreeRTOSConfig.h @@ -36,7 +36,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html *----------------------------------------------------------*/ @@ -54,6 +54,9 @@ #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/msp430_GCC/ParTest/ParTest.c b/FreeRTOS/Demo/msp430_GCC/ParTest/ParTest.c index 3bdba45d6..2f6de5ad7 100644 --- a/FreeRTOS/Demo/msp430_GCC/ParTest/ParTest.c +++ b/FreeRTOS/Demo/msp430_GCC/ParTest/ParTest.c @@ -63,16 +63,16 @@ and off to generate '*' characters. */ #define mainON_BOARD_LED_BIT ( ( unsigned char ) 0x01 ) /* The LCD segments used to generate the '*' characters for LED's 0 to 5. */ -unsigned char * const ucRHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa4, - ( unsigned char * )0xa2, - ( unsigned char * )0xa0, +unsigned char * const ucRHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa4, + ( unsigned char * )0xa2, + ( unsigned char * )0xa0, ( unsigned char * )0x9e, ( unsigned char * )0x9c, ( unsigned char * )0x9a }; -unsigned char * const ucLHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa3, - ( unsigned char * )0xa1, - ( unsigned char * )0x9f, +unsigned char * const ucLHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa3, + ( unsigned char * )0xa1, + ( unsigned char * )0x9f, ( unsigned char * )0x9d, ( unsigned char * )0x9b, ( unsigned char * )0x99 }; @@ -100,28 +100,28 @@ void vParTestInitialise( void ) P3SEL = 0x00; P4SEL = 0xFC; P5SEL = 0xFF; - + /* Initialise all segments to off. */ - LCDM1 = partstSEGMENTS_OFF; - LCDM2 = partstSEGMENTS_OFF; - LCDM3 = partstSEGMENTS_OFF; - LCDM4 = partstSEGMENTS_OFF; - LCDM5 = partstSEGMENTS_OFF; - LCDM6 = partstSEGMENTS_OFF; - LCDM7 = partstSEGMENTS_OFF; - LCDM8 = partstSEGMENTS_OFF; - LCDM9 = partstSEGMENTS_OFF; - LCDM10 = partstSEGMENTS_OFF; - LCDM11 = partstSEGMENTS_OFF; - LCDM12 = partstSEGMENTS_OFF; - LCDM13 = partstSEGMENTS_OFF; - LCDM14 = partstSEGMENTS_OFF; - LCDM15 = partstSEGMENTS_OFF; - LCDM16 = partstSEGMENTS_OFF; - LCDM17 = partstSEGMENTS_OFF; - LCDM18 = partstSEGMENTS_OFF; - LCDM19 = partstSEGMENTS_OFF; - LCDM20 = partstSEGMENTS_OFF; + LCDM1 = partstSEGMENTS_OFF; + LCDM2 = partstSEGMENTS_OFF; + LCDM3 = partstSEGMENTS_OFF; + LCDM4 = partstSEGMENTS_OFF; + LCDM5 = partstSEGMENTS_OFF; + LCDM6 = partstSEGMENTS_OFF; + LCDM7 = partstSEGMENTS_OFF; + LCDM8 = partstSEGMENTS_OFF; + LCDM9 = partstSEGMENTS_OFF; + LCDM10 = partstSEGMENTS_OFF; + LCDM11 = partstSEGMENTS_OFF; + LCDM12 = partstSEGMENTS_OFF; + LCDM13 = partstSEGMENTS_OFF; + LCDM14 = partstSEGMENTS_OFF; + LCDM15 = partstSEGMENTS_OFF; + LCDM16 = partstSEGMENTS_OFF; + LCDM17 = partstSEGMENTS_OFF; + LCDM18 = partstSEGMENTS_OFF; + LCDM19 = partstSEGMENTS_OFF; + LCDM20 = partstSEGMENTS_OFF; /* Setup LCD control. */ LCDCTL = (LCDSG0_7|LCD4MUX|LCDON); @@ -181,7 +181,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) /* The request related to the genuine on board LED. */ prvToggleOnBoardLED(); } - } + } } /*-----------------------------------------------------------*/ @@ -190,7 +190,7 @@ static void prvToggleOnBoardLED( void ) static unsigned short sState = pdFALSE; /* Toggle the state of the single genuine on board LED. */ - if( sState ) + if( sState ) { P1OUT |= mainON_BOARD_LED_BIT; } diff --git a/FreeRTOS/Demo/msp430_GCC/main.c b/FreeRTOS/Demo/msp430_GCC/main.c index 6ab53ec19..09b6b63d5 100644 --- a/FreeRTOS/Demo/msp430_GCC/main.c +++ b/FreeRTOS/Demo/msp430_GCC/main.c @@ -27,23 +27,23 @@ /* * Creates all the demo application tasks, then starts the scheduler. The WEB * documentation provides more details of the demo application tasks. - * + * * This demo is configured to execute on the ES449 prototyping board from * SoftBaugh. The ES449 has a built in LCD display and a single built in user * LED. Therefore, in place of flashing an LED, the 'flash' and 'check' tasks * toggle '*' characters on the LCD. The left most '*' represents LED 0, the * next LED 1, etc. * - * Main. c also creates a task called 'Check'. This only executes every three - * seconds but has the highest priority so is guaranteed to get processor time. - * Its main function is to check that all the other tasks are still operational. - * Each task that does not flash an LED maintains a unique count that is - * incremented each time the task successfully completes its function. Should - * any error occur within such a task the count is permanently halted. The + * Main. c also creates a task called 'Check'. This only executes every three + * seconds but has the highest priority so is guaranteed to get processor time. + * Its main function is to check that all the other tasks are still operational. + * Each task that does not flash an LED maintains a unique count that is + * incremented each time the task successfully completes its function. Should + * any error occur within such a task the count is permanently halted. The * 'check' task inspects the count of each task to ensure it has changed since - * the last time the check task executed. If all the count variables have + * the last time the check task executed. If all the count variables have * changed all the tasks are still executing error free, and the check task - * toggles an LED with a three second period. Should any task contain an error + * toggles an LED with a three second period. Should any task contain an error * at any time the LED toggle rate will increase to 500ms. * * Please read the documentation for the MSP430 port available on @@ -83,18 +83,18 @@ the '*' characters on the LCD represent LED's] */ /* Baud rate used by the COM test tasks. */ #define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 19200 ) -/* The frequency at which the 'Check' tasks executes. See the comments at the +/* The frequency at which the 'Check' tasks executes. See the comments at the top of the page. When the system is operating error free the 'Check' task toggles an LED every three seconds. If an error is discovered in any task the -rate is increased to 500 milliseconds. [in this case the '*' characters on the +rate is increased to 500 milliseconds. [in this case the '*' characters on the LCD represent LED's]*/ #define mainNO_ERROR_CHECK_DELAY ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) #define mainERROR_CHECK_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS ) -/* +/* * The function that implements the Check task. See the comments at the head * of the page for implementation details. - */ + */ static void vErrorChecks( void *pvParameters ); /* @@ -103,7 +103,7 @@ static void vErrorChecks( void *pvParameters ); */ static short prvCheckOtherTasksAreStillRunning( void ); -/* +/* * Perform the hardware setup required by the ES449 in order to run the demo * application. */ @@ -130,7 +130,7 @@ int main( void ) vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); /* Start the 'Check' task which is defined in this file. */ - xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); /* Start the scheduler. */ vTaskStartScheduler(); @@ -151,22 +151,22 @@ TickType_t xDelayPeriod = mainNO_ERROR_CHECK_DELAY; for( ;; ) { /* Wait until it is time to check again. The time we wait here depends - on whether an error has been detected or not. When an error is + on whether an error has been detected or not. When an error is detected the time is shortened resulting in a faster LED flash rate. */ vTaskDelay( xDelayPeriod ); - /* Perform a bit of 32bit maths to ensure the registers used by the - integer tasks get some exercise outside of the integer tasks + /* Perform a bit of 32bit maths to ensure the registers used by the + integer tasks get some exercise outside of the integer tasks themselves. The result here is not important we are just deliberately changing registers used by other tasks to ensure that their context - switch is operating as required. - see the demo application + switch is operating as required. - see the demo application documentation for more info. */ ulDummyVariable *= 3UL; - + /* See if the other tasks are all ok. */ if( prvCheckOtherTasksAreStillRunning() != pdPASS ) { - /* An error occurred in one of the tasks so shorten the delay + /* An error occurred in one of the tasks so shorten the delay period - which has the effect of increasing the frequency of the LED toggle. */ xDelayPeriod = mainERROR_CHECK_DELAY; @@ -184,7 +184,7 @@ static short sNoErrorFound = pdTRUE; static unsigned long ulLastIdleLoops = 0UL; /* The demo tasks maintain a count that increments every cycle of the task - provided that the task has never encountered an error. This function + provided that the task has never encountered an error. This function checks the counts maintained by the tasks to ensure they are still being incremented. A count remaining at the same value between calls therefore indicates that an error has been detected. Only tasks that do not flash @@ -199,7 +199,7 @@ static unsigned long ulLastIdleLoops = 0UL; { sNoErrorFound = pdFALSE; } - + if( xArePollingQueuesStillRunning() != pdTRUE ) { sNoErrorFound = pdFALSE; @@ -211,7 +211,7 @@ static unsigned long ulLastIdleLoops = 0UL; } ulLastIdleLoops = ulIdleLoops; - + return sNoErrorFound; } /*-----------------------------------------------------------*/ @@ -222,10 +222,10 @@ static void prvSetupHardware( void ) WDTCTL = WDTPW + WDTHOLD; /* Setup DCO+ for ( xtal * D * (N + 1) ) operation. */ - FLL_CTL0 |= DCOPLUS + XCAP18PF; + FLL_CTL0 |= DCOPLUS + XCAP18PF; /* X2 DCO frequency, 8MHz nominal DCO */ - SCFI0 |= FN_4; + SCFI0 |= FN_4; /* (121+1) x 32768 x 2 = 7.99 Mhz */ SCFQCTL = mainMAX_FREQUENCY; diff --git a/FreeRTOS/Demo/msp430_GCC/makefile b/FreeRTOS/Demo/msp430_GCC/makefile index 581b51285..4ed245e68 100644 --- a/FreeRTOS/Demo/msp430_GCC/makefile +++ b/FreeRTOS/Demo/msp430_GCC/makefile @@ -66,7 +66,7 @@ a.out : $(OBJ) makefile $(CC) $(OBJ) $(CFLAGS) $(OBJ) : %.o : %.c makefile - $(CC) -c $(CFLAGS) $< -o $@ - + $(CC) -c $(CFLAGS) $< -o $@ + clean : ${RM} ${OBJ} a.out diff --git a/FreeRTOS/Demo/msp430_GCC/serial/serial.c b/FreeRTOS/Demo/msp430_GCC/serial/serial.c index b7ac031b7..e480d1fe3 100644 --- a/FreeRTOS/Demo/msp430_GCC/serial/serial.c +++ b/FreeRTOS/Demo/msp430_GCC/serial/serial.c @@ -25,8 +25,8 @@ */ -/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. - * +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. + * * This file only supports UART 1 */ @@ -52,10 +52,10 @@ #define vInterruptOn() IFG2 |= UTXIFG1 /* The queue used to hold received characters. */ -static QueueHandle_t xRxedChars; +static QueueHandle_t xRxedChars; /* The queue used to hold characters waiting transmission. */ -static QueueHandle_t xCharsForTx; +static QueueHandle_t xCharsForTx; static volatile short sTHREEmpty; @@ -86,7 +86,7 @@ unsigned long ulBaudRateCount; /* Set pin function. */ P4SEL |= serTX_AND_RX; - /* All other bits remain at zero for n, 8, 1 interrupt driven operation. + /* All other bits remain at zero for n, 8, 1 interrupt driven operation. LOOPBACK MODE!*/ U1CTL |= CHAR + LISTEN; U1TCTL |= SSEL1; @@ -111,7 +111,7 @@ unsigned long ulBaudRateCount; IE2 |= URXIE1 + UTXIE1; } 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. */ @@ -144,7 +144,7 @@ signed portBASE_TYPE xReturn; { if( sTHREEmpty == pdTRUE ) { - /* If sTHREEmpty is true then the UART Tx ISR has indicated that + /* If sTHREEmpty is true then the UART Tx ISR has indicated that there are no characters queued to be transmitted - so we can write the character directly to the shift Tx register. */ sTHREEmpty = pdFALSE; @@ -154,17 +154,17 @@ signed portBASE_TYPE xReturn; else { /* sTHREEmpty is false, so there are still characters waiting to be - transmitted. We have to queue this character so it gets + transmitted. We have to queue this character so it gets transmitted in turn. */ - /* Return false if after the block time there is no room on the Tx + /* Return false if after the block time there is no room on the Tx queue. It is ok to block inside a critical section as each task maintains it's own critical section status. */ xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime ); - /* Depending on queue sizing and task prioritisation: While we - were blocked waiting to post on the queue interrupts were not - disabled. It is possible that the serial ISR has emptied the + /* Depending on queue sizing and task prioritisation: While we + were blocked waiting to post on the queue interrupts were not + disabled. It is possible that the serial ISR has emptied the Tx queue, in which case we need to start the Tx off again writing directly to the Tx register. */ if( ( sTHREEmpty == pdTRUE ) && ( xReturn == pdPASS ) ) @@ -190,7 +190,7 @@ interrupt (UART1RX_VECTOR) wakeup vRxISR( void ) signed char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - /* Get the character from the UART and post it on the queue of Rxed + /* Get the character from the UART and post it on the queue of Rxed characters. */ cChar = U1RXBUF; @@ -198,8 +198,8 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( xHigherPriorityTaskWoken ) { - /*If the post causes a task to wake force a context switch - as the woken task may have a higher priority than the task we have + /*If the post causes a task to wake force a context switch + as the woken task may have a higher priority than the task we have interrupted. */ taskYIELD(); } diff --git a/FreeRTOS/Demo/msp430_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/msp430_IAR/FreeRTOSConfig.h index 91b6e5bb5..f48984f78 100644 --- a/FreeRTOS/Demo/msp430_IAR/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/msp430_IAR/FreeRTOSConfig.h @@ -84,6 +84,9 @@ occurs. #define configUSE_16_BIT_TICKS 1 #define configIDLE_SHOULD_YIELD 1 +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ diff --git a/FreeRTOS/Demo/msp430_IAR/ParTest/ParTest.c b/FreeRTOS/Demo/msp430_IAR/ParTest/ParTest.c index 2f1161c51..ebbe4dc11 100644 --- a/FreeRTOS/Demo/msp430_IAR/ParTest/ParTest.c +++ b/FreeRTOS/Demo/msp430_IAR/ParTest/ParTest.c @@ -61,16 +61,16 @@ and off to generate '*' characters. */ #define mainON_BOARD_LED_BIT ( ( unsigned char ) 0x01 ) /* The LCD segments used to generate the '*' characters for LED's 0 to 5. */ -unsigned char * const ucRHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa4, - ( unsigned char * )0xa2, - ( unsigned char * )0xa0, +unsigned char * const ucRHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa4, + ( unsigned char * )0xa2, + ( unsigned char * )0xa0, ( unsigned char * )0x9e, ( unsigned char * )0x9c, ( unsigned char * )0x9a }; -unsigned char * const ucLHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa3, - ( unsigned char * )0xa1, - ( unsigned char * )0x9f, +unsigned char * const ucLHSSegments[ partstNUM_LEDS ] = { ( unsigned char * )0xa3, + ( unsigned char * )0xa1, + ( unsigned char * )0x9f, ( unsigned char * )0x9d, ( unsigned char * )0x9b, ( unsigned char * )0x99 }; @@ -98,28 +98,28 @@ void vParTestInitialise( void ) P3SEL = 0x00; P4SEL = 0xFC; P5SEL = 0xFF; - + /* Initialise all segments to off. */ - LCDM1 = partstSEGMENTS_OFF; - LCDM2 = partstSEGMENTS_OFF; - LCDM3 = partstSEGMENTS_OFF; - LCDM4 = partstSEGMENTS_OFF; - LCDM5 = partstSEGMENTS_OFF; - LCDM6 = partstSEGMENTS_OFF; - LCDM7 = partstSEGMENTS_OFF; - LCDM8 = partstSEGMENTS_OFF; - LCDM9 = partstSEGMENTS_OFF; - LCDM10 = partstSEGMENTS_OFF; - LCDM11 = partstSEGMENTS_OFF; - LCDM12 = partstSEGMENTS_OFF; - LCDM13 = partstSEGMENTS_OFF; - LCDM14 = partstSEGMENTS_OFF; - LCDM15 = partstSEGMENTS_OFF; - LCDM16 = partstSEGMENTS_OFF; - LCDM17 = partstSEGMENTS_OFF; - LCDM18 = partstSEGMENTS_OFF; - LCDM19 = partstSEGMENTS_OFF; - LCDM20 = partstSEGMENTS_OFF; + LCDM1 = partstSEGMENTS_OFF; + LCDM2 = partstSEGMENTS_OFF; + LCDM3 = partstSEGMENTS_OFF; + LCDM4 = partstSEGMENTS_OFF; + LCDM5 = partstSEGMENTS_OFF; + LCDM6 = partstSEGMENTS_OFF; + LCDM7 = partstSEGMENTS_OFF; + LCDM8 = partstSEGMENTS_OFF; + LCDM9 = partstSEGMENTS_OFF; + LCDM10 = partstSEGMENTS_OFF; + LCDM11 = partstSEGMENTS_OFF; + LCDM12 = partstSEGMENTS_OFF; + LCDM13 = partstSEGMENTS_OFF; + LCDM14 = partstSEGMENTS_OFF; + LCDM15 = partstSEGMENTS_OFF; + LCDM16 = partstSEGMENTS_OFF; + LCDM17 = partstSEGMENTS_OFF; + LCDM18 = partstSEGMENTS_OFF; + LCDM19 = partstSEGMENTS_OFF; + LCDM20 = partstSEGMENTS_OFF; /* Setup LCD control. */ LCDCTL = (LCDSG0_7|LCD4MUX|LCDON); @@ -179,7 +179,7 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) /* The request related to the genuine on board LED. */ prvToggleOnBoardLED(); } - } + } } /*-----------------------------------------------------------*/ @@ -188,7 +188,7 @@ static void prvToggleOnBoardLED( void ) static unsigned short sState = pdFALSE; /* Toggle the state of the single genuine on board LED. */ - if( sState ) + if( sState ) { P1OUT |= mainON_BOARD_LED_BIT; } diff --git a/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewp b/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewp index 4a17a0c5c..ed784d394 100644 --- a/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewp +++ b/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewp @@ -2185,6 +2185,9 @@ FreeRTOS Source + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\list.c @@ -2202,3 +2205,5 @@ + + diff --git a/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewt b/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewt index b64ac9bea..20153c749 100644 --- a/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewt +++ b/FreeRTOS/Demo/msp430_IAR/RTOSDemo.ewt @@ -48,6 +48,9 @@ FreeRTOS Source + + $PROJ_DIR$\..\..\Source\croutine.c + $PROJ_DIR$\..\..\Source\list.c @@ -65,3 +68,5 @@ + + diff --git a/FreeRTOS/Demo/msp430_IAR/serial/serial.c b/FreeRTOS/Demo/msp430_IAR/serial/serial.c index bbd812033..80cbaa932 100644 --- a/FreeRTOS/Demo/msp430_IAR/serial/serial.c +++ b/FreeRTOS/Demo/msp430_IAR/serial/serial.c @@ -106,7 +106,7 @@ unsigned long ulBaudRateCount; IE2 |= URXIE1 + UTXIE1; } 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. */ @@ -187,11 +187,11 @@ signed portBASE_TYPE xReturn; { signed char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + /* Get the character from the UART and post it on the queue of Rxed characters. */ cChar = U1RXBUF; - + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); if( xHigherPriorityTaskWoken ) @@ -206,7 +206,7 @@ signed portBASE_TYPE xReturn; __bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF ); } /*-----------------------------------------------------------*/ - + /* * UART Tx interrupt service routine. */ @@ -215,10 +215,10 @@ signed portBASE_TYPE xReturn; { signed char cChar; portBASE_TYPE xTaskWoken = pdFALSE; - + /* The previous character has been transmitted. See if there are any further characters waiting transmission. */ - + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE ) { /* There was another character queued - transmit it now. */ @@ -243,11 +243,11 @@ signed portBASE_TYPE xReturn; { signed char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; - + /* Get the character from the UART and post it on the queue of Rxed characters. */ cChar = U1RXBUF; - + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); /*If the post causes a task to wake force a context switch @@ -256,17 +256,17 @@ signed portBASE_TYPE xReturn; portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); } /*-----------------------------------------------------------*/ - + /* This is a standard C function as an assembly file wrapper is used as an interrupt entry point. */ void vTxISR( void ) { signed char cChar; portBASE_TYPE xTaskWoken = pdFALSE; - + /* The previous character has been transmitted. See if there are any further characters waiting transmission. */ - + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE ) { /* There was another character queued - transmit it now. */ diff --git a/FreeRTOS/Demo/msp430_IAR/serial/serialASM.s43 b/FreeRTOS/Demo/msp430_IAR/serial/serialASM.s43 index b5468f6f8..2ed36154e 100644 --- a/FreeRTOS/Demo/msp430_IAR/serial/serialASM.s43 +++ b/FreeRTOS/Demo/msp430_IAR/serial/serialASM.s43 @@ -54,19 +54,19 @@ vUARTTx_Wrapper portRESTORE_CONTEXT /*-----------------------------------------------------------*/ - + /* Place the UART ISRs in the correct vectors. */ ASEG - ORG 0xFFE0 + UART1RX_VECTOR + ORG 0xFFE0 + UART1RX_VECTOR _vRxISR_: DC16 vUARTRx_Wrapper - - ORG 0xFFE0 + UART1TX_VECTOR + + ORG 0xFFE0 + UART1TX_VECTOR _vTxISR_: DC16 vUARTTx_Wrapper #endif /* configINTERRUPT_EXAMPLE_METHOD */ END - - + + diff --git a/FreeRTOS/Source b/FreeRTOS/Source index 953c1ee6c..d3c289fe5 160000 --- a/FreeRTOS/Source +++ b/FreeRTOS/Source @@ -1 +1 @@ -Subproject commit 953c1ee6cbf460092826bab772e4119c6d9e51e8 +Subproject commit d3c289fe5b48b6c4a92187c05d29d1a25175f5ab diff --git a/FreeRTOS/Test/CBMC/patches/FreeRTOSConfig.h b/FreeRTOS/Test/CBMC/patches/FreeRTOSConfig.h index 83314504a..d74971765 100644 --- a/FreeRTOS/Test/CBMC/patches/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CBMC/patches/FreeRTOSConfig.h @@ -51,6 +51,7 @@ #define configMAX_TASK_NAME_LEN ( 15 ) #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 #ifndef configUSE_MUTEXES #define configUSE_MUTEXES 1 #endif @@ -66,20 +67,24 @@ /* Hook function related definitions. */ #ifndef configUSE_TICK_HOOK - #define configUSE_TICK_HOOK 0 + #define configUSE_TICK_HOOK 0 #endif -#define configUSE_IDLE_HOOK 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */ +#define configUSE_IDLE_HOOK 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */ /* Software timer related definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) -#define configTIMER_QUEUE_LENGTH 5 -#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) /* Event group related definitions. */ -#define configUSE_EVENT_GROUPS 1 +#define configUSE_EVENT_GROUPS 1 + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Memory allocation strategy. */ #ifndef configSUPPORT_DYNAMIC_ALLOCATION diff --git a/FreeRTOS/Test/CMock/config/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/config/FreeRTOSConfig.h index 88e9c21a2..1c5f4c2ff 100644 --- a/FreeRTOS/Test/CMock/config/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/config/FreeRTOSConfig.h @@ -87,6 +87,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portHAS_STACK_OVERFLOW_CHECKING 1 #define configENABLE_MPU 0 +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/message_buffer/size_mismatch/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/message_buffer/size_mismatch/FreeRTOSConfig.h index 788d993b1..dce6d86ff 100644 --- a/FreeRTOS/Test/CMock/message_buffer/size_mismatch/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/message_buffer/size_mismatch/FreeRTOSConfig.h @@ -85,6 +85,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/queue/dynamic/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/queue/dynamic/FreeRTOSConfig.h index 18e408217..2a46fe083 100644 --- a/FreeRTOS/Test/CMock/queue/dynamic/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/queue/dynamic/FreeRTOSConfig.h @@ -84,6 +84,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/queue/generic/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/queue/generic/FreeRTOSConfig.h index c6346c92d..defe87b41 100644 --- a/FreeRTOS/Test/CMock/queue/generic/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/queue/generic/FreeRTOSConfig.h @@ -83,6 +83,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/queue/semaphore/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/queue/semaphore/FreeRTOSConfig.h index c6346c92d..defe87b41 100644 --- a/FreeRTOS/Test/CMock/queue/semaphore/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/queue/semaphore/FreeRTOSConfig.h @@ -83,6 +83,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/queue/sets/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/queue/sets/FreeRTOSConfig.h index fe1397315..9d4aad487 100644 --- a/FreeRTOS/Test/CMock/queue/sets/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/queue/sets/FreeRTOSConfig.h @@ -83,6 +83,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/queue/static/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/queue/static/FreeRTOSConfig.h index b69a34871..03f5db091 100644 --- a/FreeRTOS/Test/CMock/queue/static/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/queue/static/FreeRTOSConfig.h @@ -84,6 +84,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/queue/tracing/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/queue/tracing/FreeRTOSConfig.h index 61f17e50f..38dee7681 100644 --- a/FreeRTOS/Test/CMock/queue/tracing/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/queue/tracing/FreeRTOSConfig.h @@ -83,6 +83,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/stream_buffer/api/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/stream_buffer/api/FreeRTOSConfig.h index 6168f557f..29d43a905 100644 --- a/FreeRTOS/Test/CMock/stream_buffer/api/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/stream_buffer/api/FreeRTOSConfig.h @@ -82,6 +82,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/stream_buffer/callback/FreeRTOSConfig.h b/FreeRTOS/Test/CMock/stream_buffer/callback/FreeRTOSConfig.h index 1c1143027..bf35e5c57 100644 --- a/FreeRTOS/Test/CMock/stream_buffer/callback/FreeRTOSConfig.h +++ b/FreeRTOS/Test/CMock/stream_buffer/callback/FreeRTOSConfig.h @@ -83,6 +83,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue() +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_1.h b/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_1.h index 5242f0ed7..1791c18ef 100644 --- a/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_1.h +++ b/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_1.h @@ -94,6 +94,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portHAS_STACK_OVERFLOW_CHECKING 0 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5 +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + #define portSTACK_GROWTH ( -1 ) #define configRECORD_STACK_HIGH_ADDRESS 1 diff --git a/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_2.h b/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_2.h index 7b5148468..c099c2b24 100644 --- a/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_2.h +++ b/FreeRTOS/Test/CMock/tasks/FreeRTOSConfig_2.h @@ -93,6 +93,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portHAS_STACK_OVERFLOW_CHECKING 1 #define portCRITICAL_NESTING_IN_TCB 1 +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + /* This demo makes use of one or more example stats formatting functions. These * format the raw data provided by the uxTaskGetSystemState() function in to human * readable ASCII form. See the notes in the implementation of vTaskList() within diff --git a/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_1.h b/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_1.h index bad96bbce..d1d124d8b 100644 --- a/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_1.h +++ b/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_1.h @@ -94,6 +94,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portHAS_STACK_OVERFLOW_CHECKING 0 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5 +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + #define portSTACK_GROWTH ( -1 ) #define configRECORD_STACK_HIGH_ADDRESS 1 diff --git a/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_dynamic.h b/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_dynamic.h index 349775e57..1eb07d81d 100644 --- a/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_dynamic.h +++ b/FreeRTOS/Test/CMock/timers/FreeRTOSConfig_dynamic.h @@ -94,6 +94,10 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that in #define portHAS_STACK_OVERFLOW_CHECKING 0 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5 +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + #define portSTACK_GROWTH ( -1 ) #define configRECORD_STACK_HIGH_ADDRESS 1 diff --git a/manifest.yml b/manifest.yml index 86156aa80..ade5b7fdc 100644 --- a/manifest.yml +++ b/manifest.yml @@ -4,7 +4,7 @@ description: "This is the standard distribution of FreeRTOS." dependencies: - name: "FreeRTOS-Kernel" - version: "953c1ee6c" + version: "d3c289f" repository: type: "git" url: "https://github.com/FreeRTOS/FreeRTOS-Kernel.git"