Update the demo directory to use the version 8 type naming conventions.

pull/4/head
Richard Barry 11 years ago
parent c6d8892b0d
commit 5a2a8fc319

@ -89,7 +89,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 66000000 ) /* = 66.000MHz clk gen */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 25 * 1024 ) )

@ -136,8 +136,8 @@
/* The rate at which the on board LED will toggle when there is/is not an
error. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainNO_ERROR_FLASH_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainERROR_FLASH_PERIOD ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
#define mainON_BOARD_LED_BIT ( ( unsigned long ) 7 )
/* Constants used by the vMemCheckTask() task. */
@ -229,9 +229,9 @@ int main( void )
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
unsigned long ulMemCheckTaskRunningCount;
xTaskHandle xCreatedTask;
TaskHandle_t xCreatedTask;
/* Just to stop compiler warnings. */
( void ) pvParameters;

@ -91,16 +91,16 @@
/* Constants to setup and access the UART. */
#define portUSART0_AIC_CHANNEL ( ( unsigned long ) 2 )
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -108,7 +108,7 @@ static xQueueHandle xCharsForTx;
* The queues are created in serialISR.c as they are used from the ISR.
* Obtain references to the queues and THRE Empty flag.
*/
extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx );
extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx );
/*-----------------------------------------------------------*/
@ -197,7 +197,7 @@ extern void ( vUART_ISR_Wrapper )( void );
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
@ -236,7 +236,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
( void ) pxPort;

@ -100,8 +100,8 @@
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -114,7 +114,7 @@ from the wrapper to ensure the correct stack frame is set up. */
void vUART_ISR_Handler( void ) __attribute__ ((noinline));
/*-----------------------------------------------------------*/
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx )
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx )
{
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );

@ -85,7 +85,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 47923200 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 14200 )

@ -168,9 +168,9 @@ little odd. */
#define usbMAX_TX_MESSAGE_SIZE ( 128 )
#define usbRX_COUNT_MASK ( ( unsigned long ) 0x7ff )
#define AT91C_UDP_STALLSENT AT91C_UDP_ISOERROR
#define usbSHORTEST_DELAY ( ( portTickType ) 1 )
#define usbINIT_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )
#define usbSHORT_DELAY ( ( portTickType ) 50 / portTICK_RATE_MS )
#define usbSHORTEST_DELAY ( ( TickType_t ) 1 )
#define usbINIT_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
#define usbSHORT_DELAY ( ( TickType_t ) 50 / portTICK_PERIOD_MS )
#define usbEND_POINT_RESET_MASK ( ( unsigned long ) 0x0f )
#define usbDATA_INC ( ( char ) 5 )
#define usbEXPECTED_NUMBER_OF_BYTES ( ( unsigned long ) 8 )
@ -542,7 +542,7 @@ static xISRStatus xISRMessages[ usbQUEUE_LENGTH + 1 ];
static xTX_MESSAGE pxCharsForTx;
/* Queue used to pass messages between the ISR and the task. */
static xQueueHandle xUSBInterruptQueue;
static QueueHandle_t xUSBInterruptQueue;
/* ISR entry has to be written in the asm file as we want a context switch
to occur from within the ISR. See the port documentation on the FreeRTOS.org

@ -118,8 +118,8 @@
#define mainUSB_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* Constants required by the 'Check' task. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainNO_ERROR_FLASH_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainERROR_FLASH_PERIOD ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
#define mainCHECK_TASK_LED ( 3 )
/* Constants for the ComTest tasks. */
@ -212,7 +212,7 @@ static void prvSetupHardware( void )
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
/* The parameters are not used in this task. */
( void ) pvParameters;

@ -88,17 +88,17 @@
#define vInterruptOff() AT91F_US_DisableIt( serCOM0, AT91C_US_TXRDY )
/* Misc constants. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
#define serNO_TIMEGUARD ( ( unsigned long ) 0 )
#define serNO_PERIPHERAL_B_SETUP ( ( unsigned long ) 0 )
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -160,7 +160,7 @@ extern void ( vUART_ISR )( void );
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -202,7 +202,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
/* Place the character in the queue of characters to be transmitted. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )

@ -85,7 +85,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned long ) 47923200 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24 * 1024 ) )

@ -151,9 +151,9 @@ little odd. */
#define usbYDOWN ( 4 )
#define usbMAX_COORD ( 120 )
#define usbMAX_TX_MESSAGE_SIZE ( 128 )
#define usbSHORTEST_DELAY ( ( portTickType ) 1 )
#define usbINIT_DELAY ( ( portTickType ) 1000 / portTICK_RATE_MS )
#define usbSHORT_DELAY ( ( portTickType ) 50 / portTICK_RATE_MS )
#define usbSHORTEST_DELAY ( ( TickType_t ) 1 )
#define usbINIT_DELAY ( ( TickType_t ) 1000 / portTICK_PERIOD_MS )
#define usbSHORT_DELAY ( ( TickType_t ) 50 / portTICK_PERIOD_MS )
#define usbEND_POINT_RESET_MASK ( ( unsigned long ) 0x0f )
#define usbDATA_INC ( ( char ) 5 )
#define usbEXPECTED_NUMBER_OF_BYTES ( ( unsigned long ) 8 )
@ -522,7 +522,7 @@ static eDRIVER_STATE eDriverState = eNOTHING;
static xTX_MESSAGE pxCharsForTx;
/* Queue used to pass messages between the ISR and the task. */
xQueueHandle xUSBInterruptQueue;
QueueHandle_t xUSBInterruptQueue;
/*-----------------------------------------------------------*/

@ -109,7 +109,7 @@ void vUSB_ISR_Handler( void ) __attribute__((noinline));
static xISRStatus xISRMessages[ usbQUEUE_LENGTH + 1 ];
/* Queue used to pass messages between the ISR and the task. */
extern xQueueHandle xUSBInterruptQueue;
extern QueueHandle_t xUSBInterruptQueue;
/*-----------------------------------------------------------*/

@ -203,11 +203,11 @@ static unsigned long ulCallCount = 0, ulErrorFound = pdFALSE;
/* The rate at which LED D4 will toggle if an error has been found in one or
more of the standard demo tasks. */
const unsigned long ulErrorFlashRate = 500 / portTICK_RATE_MS;
const unsigned long ulErrorFlashRate = 500 / portTICK_PERIOD_MS;
/* The rate at which LED D4 will toggle if no errors have been found in any
of the standard demo tasks. */
const unsigned long ulNoErrorCheckRate = 5000 / portTICK_RATE_MS;
const unsigned long ulNoErrorCheckRate = 5000 / portTICK_PERIOD_MS;
ulCallCount++;

@ -74,11 +74,11 @@ void vEMACISR_Wrapper( void ) __attribute__((naked));
function to ensure the stack frame is correctly set up. */
void vEMACISR_Handler( void ) __attribute__((noinline));
static xSemaphoreHandle xEMACSemaphore;
static SemaphoreHandle_t xEMACSemaphore;
/*-----------------------------------------------------------*/
void vPassEMACSemaphore( xSemaphoreHandle xSemaphore )
void vPassEMACSemaphore( SemaphoreHandle_t xSemaphore )
{
xEMACSemaphore = xSemaphore;
}

@ -109,7 +109,7 @@ one not be immediately available when trying to transmit a frame. */
#define emacINTERRUPT_LEVEL ( 5 )
#define emacNO_DELAY ( 0 )
#define emacTOTAL_FRAME_HEADER_SIZE ( 54 )
#define emacPHY_INIT_DELAY ( 5000 / portTICK_RATE_MS )
#define emacPHY_INIT_DELAY ( 5000 / portTICK_PERIOD_MS )
#define emacRESET_KEY ( ( unsigned long ) 0xA5000000 )
#define emacRESET_LENGTH ( ( unsigned long ) ( 0x01 << 8 ) )
@ -191,11 +191,11 @@ const char cMACAddress[ 6 ] = { uipMAC_ADDR0, uipMAC_ADDR1, uipMAC_ADDR2, uipMAC
const unsigned char ucIPAddress[ 4 ] = { uipIP_ADDR0, uipIP_ADDR1, uipIP_ADDR2, uipIP_ADDR3 };
/* The semaphore used by the EMAC ISR to wake the EMAC task. */
static xSemaphoreHandle xSemaphore = NULL;
static SemaphoreHandle_t xSemaphore = NULL;
/*-----------------------------------------------------------*/
xSemaphoreHandle xEMACInit( void )
SemaphoreHandle_t xEMACInit( void )
{
/* Code supplied by Atmel -------------------------------*/

@ -72,7 +72,7 @@
* is used by the EMAC ISR to indicate that Rx packets have been received.
* If the initialisation fails then NULL is returned.
*/
xSemaphoreHandle xEMACInit( void );
SemaphoreHandle_t xEMACInit( void );
/*
* Send the current uIP buffer. This copies the uIP buffer to one of the

@ -54,13 +54,13 @@
#include "partest.h"
/* How long to wait before attempting to connect the MAC again. */
#define uipINIT_WAIT ( 100 / portTICK_RATE_MS )
#define uipINIT_WAIT ( 100 / portTICK_PERIOD_MS )
/* Shortcut to the header within the Rx buffer. */
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
/* The semaphore used by the ISR to wake the uIP task. */
static xSemaphoreHandle xEMACSemaphore;
static SemaphoreHandle_t xEMACSemaphore;
/*-----------------------------------------------------------*/

@ -85,7 +85,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 58982400 ) /* =14.7456MHz xtal multiplied by 4 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24 * 1024 ) )

@ -167,8 +167,8 @@
/* The rate at which the on board LED will toggle when there is/is not an
error. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainNO_ERROR_FLASH_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainERROR_FLASH_PERIOD ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
#define mainON_BOARD_LED_BIT ( ( unsigned long ) 0x80 )
/* Constants used by the vMemCheckTask() task. */
@ -253,9 +253,9 @@ int main( void )
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
unsigned long ulMemCheckTaskRunningCount;
xTaskHandle xCreatedTask;
TaskHandle_t xCreatedTask;
/* The parameters are not used in this function. */
( void ) pvParameters;

@ -120,16 +120,16 @@
#define serUART0_VIC_ENABLE ( ( unsigned long ) 0x0020 )
#define serCLEAR_VIC_INTERRUPT ( ( unsigned long ) 0 )
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -140,7 +140,7 @@ 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.
*/
extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx, long volatile **pplTHREEmptyFlag );
extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx, long volatile **pplTHREEmptyFlag );
/*-----------------------------------------------------------*/
@ -200,7 +200,7 @@ extern void ( vUART_ISR_Wrapper )( void );
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
@ -239,7 +239,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
signed portBASE_TYPE xReturn;

@ -98,8 +98,8 @@
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
static volatile long lTHREEmpty;
/*-----------------------------------------------------------*/
@ -108,7 +108,7 @@ 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.
*/
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx, long volatile **pplTHREEmptyFlag );
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx, long volatile **pplTHREEmptyFlag );
/* UART0 interrupt service routine entry point. */
void vUART_ISR_Wrapper( void ) __attribute__ ((naked));
@ -117,8 +117,8 @@ void vUART_ISR_Wrapper( void ) __attribute__ ((naked));
void vUART_ISR_Handler( void ) __attribute__ ((noinline));
/*-----------------------------------------------------------*/
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars,
xQueueHandle *pxCharsForTx, long volatile **pplTHREEmptyFlag )
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 ) );

@ -85,7 +85,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 60000000 ) /* =12.0MHz xtal multiplied by 5 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 14200 )

@ -117,8 +117,8 @@
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* Constants required by the 'Check' task. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainNO_ERROR_FLASH_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainERROR_FLASH_PERIOD ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
#define mainCHECK_TASK_LED ( 7 )
/* Constants for the ComTest tasks. */
@ -244,7 +244,7 @@ static void prvSetupHardware( void )
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
/* The parameters are not used in this task. */
( void ) pvParameters;

@ -105,16 +105,16 @@
#define serINTERRUPT_SOURCE_MASK ( ( unsigned char ) 0x0f )
/* Misc. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
static volatile long lTHREEmpty = pdFALSE;
/*-----------------------------------------------------------*/
@ -187,7 +187,7 @@ extern void ( vSerialISREntry) ( void );
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
@ -226,7 +226,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
signed portBASE_TYPE xReturn;

@ -84,7 +84,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 60000000 ) /* =12.0MHz xtal multiplied by 5 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 13 * 1024 )

@ -133,8 +133,8 @@ indicate whether an error has been detected or not. If the LED toggles every
3 seconds then no errors have been detected. If the rate increases to 500ms
then an error has been detected in at least one of the demo application tasks. */
#define mainCHECK_LED ( 7 )
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainNO_ERROR_FLASH_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainERROR_FLASH_PERIOD ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
/*-----------------------------------------------------------*/
@ -201,7 +201,7 @@ int main( void )
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
/* Parameters are not used. */
( void ) pvParameters;

@ -100,9 +100,9 @@
#define serU1VIC_ENABLE ( ( unsigned long ) 0x0020 )
/* Misc. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/* Constant to access the VIC. */
#define serCLEAR_VIC_INTERRUPT ( ( unsigned long ) 0 )
@ -131,8 +131,8 @@ void vUART_ISRHandler( void );
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/* Communication flag between the interrupt service routine and serial API. */
static volatile long lTHREEmpty;
@ -197,7 +197,7 @@ xComPortHandle xReturn = serHANDLE;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
@ -236,7 +236,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
signed portBASE_TYPE xReturn;

@ -96,7 +96,7 @@
/* In this case configCPU_CLOCK_HZ is actually set to the pclk frequency, not
the CPU frequency. */
#define configCPU_CLOCK_HZ ( 58982400UL ) /* =14.7456MHz xtal multiplied by 4 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 6 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )

@ -125,12 +125,12 @@
/* Demo application definitions. */
#define mainQUEUE_SIZE ( 3 )
#define mainLED_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainERROR_LED_DELAY ( ( portTickType ) 50 / portTICK_RATE_MS )
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
#define mainLED_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
#define mainERROR_LED_DELAY ( ( TickType_t ) 50 / portTICK_PERIOD_MS )
#define mainCHECK_DELAY ( ( TickType_t ) 5000 / portTICK_PERIOD_MS )
#define mainLIST_BUFFER_SIZE 2048
#define mainNO_DELAY ( 0 )
#define mainSHORT_DELAY ( 150 / portTICK_RATE_MS )
#define mainSHORT_DELAY ( 150 / portTICK_PERIOD_MS )
/* Task priorities. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
@ -144,15 +144,15 @@
/* The semaphore used to wake the button task from within the external interrupt
handler. */
xSemaphoreHandle xButtonSemaphore;
SemaphoreHandle_t xButtonSemaphore;
/* The queue that is used to send message to vPrintTask for display in the
terminal output window. */
xQueueHandle xPrintQueue;
QueueHandle_t xPrintQueue;
/* The rate at which the LED will toggle. The toggle rate increases if an
error is detected in any task. */
static portTickType xLED_Delay = mainLED_DELAY;
static TickType_t xLED_Delay = mainLED_DELAY;
/*-----------------------------------------------------------*/
/*
@ -261,7 +261,7 @@ static void vLEDTask( void *pvParameters )
static void vCheckTask( void *pvParameters )
{
portBASE_TYPE xErrorOccurred = pdFALSE;
portTickType xLastExecutionTime;
TickType_t xLastExecutionTime;
const char * const pcPassMessage = "PASS\n";
const char * const pcFailMessage = "FAIL\n";
@ -402,7 +402,7 @@ extern void (vButtonISRWrapper) ( void );
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
/* Check pcTaskName for the name of the offending task, or pxCurrentTCB
if pcTaskName has itself been corrupted. */

@ -79,7 +79,7 @@ void vButtonHandler( void ) __attribute__ ((noinline));
void vButtonHandler( void )
{
extern xSemaphoreHandle xButtonSemaphore;
extern SemaphoreHandle_t xButtonSemaphore;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );

@ -49,7 +49,7 @@ function add_list(list, state)
for (i = 0; i < list.uxNumberOfItems; i++)
{
item = Debug.evaluate("*(xListItem *)" + index);
item = Debug.evaluate("*(ListItem_t *)" + index);
task = item ? item.pvOwner : 0;

@ -95,7 +95,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned long ) 48000000 ) /* =12Mhz xtal multiplied by 5 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 104 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )

@ -105,7 +105,7 @@
/* Demo application definitions. */
#define mainQUEUE_SIZE ( 3 )
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
#define mainCHECK_DELAY ( ( TickType_t ) 5000 / portTICK_PERIOD_MS )
#define mainBASIC_WEB_STACK_SIZE ( configMINIMAL_STACK_SIZE * 6 )
/* Task priorities. */
@ -152,7 +152,7 @@ static void vLCDTask( void *pvParameters );
static void prvSetupHardware( void );
/* The queue used to send messages to the LCD task. */
xQueueHandle xLCDQueue;
QueueHandle_t xLCDQueue;
/*-----------------------------------------------------------*/

@ -8,7 +8,7 @@ void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
/* The handler that does the actual work. */
void vEMAC_ISR_Handler( void ) __attribute__((noinline));
extern xSemaphoreHandle xEMACSemaphore;
extern SemaphoreHandle_t xEMACSemaphore;
void vEMAC_ISR_Handler( void )

@ -23,7 +23,7 @@
#include "emac.h"
/* The semaphore used to wake the uIP task when data arives. */
xSemaphoreHandle xEMACSemaphore = NULL;
SemaphoreHandle_t xEMACSemaphore = NULL;
static unsigned short *rptr;
static unsigned short *tptr;

@ -127,7 +127,7 @@ clock_time_t clock_time( void );
/*-----------------------------------------------------------*/
/* The semaphore used by the ISR to wake the uIP task. */
extern xSemaphoreHandle xEMACSemaphore;
extern SemaphoreHandle_t xEMACSemaphore;
/*-----------------------------------------------------------*/
@ -285,7 +285,7 @@ void vApplicationProcessFormInput( char *pcInputString, portBASE_TYPE xInputLeng
{
char *c, *pcText;
static char cMessageForDisplay[ 32 ];
extern xQueueHandle xLCDQueue;
extern QueueHandle_t xLCDQueue;
xLCDMessage xLCDMessage;
/* Process the form input sent by the IO page of the served HTML. */

@ -97,7 +97,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 57600000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )

@ -85,7 +85,7 @@
/* Demo application definitions. */
#define mainQUEUE_SIZE ( 3 )
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
#define mainCHECK_DELAY ( ( TickType_t ) 5000 / portTICK_PERIOD_MS )
#define mainBASIC_WEB_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 )
/* Task priorities. */
@ -124,7 +124,7 @@ extern void vuIP_Task( void *pvParameters );
static void vLCDTask( void *pvParameters );
/* The queue used to send messages to the LCD task. */
xQueueHandle xLCDQueue;
QueueHandle_t xLCDQueue;
/*-----------------------------------------------------------*/
@ -170,7 +170,7 @@ int main (void)
static void vCheckTask( void *pvParameters )
{
portBASE_TYPE xErrorOccurred = pdFALSE;
portTickType xLastExecutionTime;
TickType_t xLastExecutionTime;
unsigned portBASE_TYPE uxColumn = 0;
xLCDMessage xMessage;

@ -9,7 +9,7 @@ void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
separate to the wrapper to ensure the correct stack frame is set up. */
void vEMAC_ISR_Handler( void ) __attribute__((noinline));
extern xSemaphoreHandle xEMACSemaphore;
extern SemaphoreHandle_t xEMACSemaphore;
void vEMAC_ISR_Handler( void )
{

@ -23,7 +23,7 @@
#include "emac.h"
/* The semaphore used to wake the uIP task when data arives. */
xSemaphoreHandle xEMACSemaphore = NULL;
SemaphoreHandle_t xEMACSemaphore = NULL;
static unsigned short *rptr;
static unsigned short *tptr;

@ -127,7 +127,7 @@ clock_time_t clock_time( void );
/*-----------------------------------------------------------*/
/* The semaphore used by the ISR to wake the uIP task. */
extern xSemaphoreHandle xEMACSemaphore;
extern SemaphoreHandle_t xEMACSemaphore;
/*-----------------------------------------------------------*/
@ -296,7 +296,7 @@ void vApplicationProcessFormInput( char *pcInputString, portBASE_TYPE xInputLeng
{
char *c, *pcText;
static char cMessageForDisplay[ 32 ];
extern xQueueHandle xLCDQueue;
extern QueueHandle_t xLCDQueue;
xLCDMessage xLCDMessage;
/* Process the form input sent by the IO page of the served HTML. */

@ -83,7 +83,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 48000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 20480 )

@ -116,8 +116,8 @@
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* Constants required by the 'Check' task. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainNO_ERROR_FLASH_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainERROR_FLASH_PERIOD ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
#define mainCHECK_TASK_LED ( 4 )
/* Constants for the ComTest tasks. */
@ -200,8 +200,8 @@ static void prvSetupHardware( void )
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
portTickType xLastWakeTime;
TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
TickType_t xLastWakeTime;
/* The parameters are not used in this task. */
( void ) pvParameters;

@ -82,8 +82,8 @@
#define UART0_Rx_Pin ( 0x0001<< 8 )
#define UART0_Tx_Pin ( 0x0001<< 9 )
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/* Macros to turn on and off the Tx empty interrupt. */
#define serINTERRUPT_ON() UART0->IER |= UART_TxHalfEmpty
@ -93,8 +93,8 @@
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -155,7 +155,7 @@ xComPortHandle xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -197,7 +197,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
/* Place the character in the queue of characters to be transmitted. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )

@ -85,7 +85,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 60000000 ) /* Timer clock. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 12800 )

@ -168,7 +168,7 @@ static void vPrintTask( void *pvParameters );
/*-----------------------------------------------------------*/
/* The queue used to communicate with the LCD print task. */
static xQueueHandle xLCDQueue;
static QueueHandle_t xLCDQueue;
/*-----------------------------------------------------------*/
@ -206,7 +206,7 @@ int main( void )
static void vCheckTask( void *pvParameters )
{
static unsigned long ulErrorDetected = pdFALSE;
portTickType xLastExecutionTime;
TickType_t xLastExecutionTime;
unsigned char *ucErrorMessage = ( unsigned char * )" FAIL";
unsigned char *ucSuccessMessage = ( unsigned char * )" PASS";
unsigned portBASE_TYPE uxColumn = mainMAX_WRITE_COLUMN;

@ -89,15 +89,15 @@
/* Demo application includes. */
#include "serial.h"
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
static volatile portBASE_TYPE xQueueEmpty = pdTRUE;
@ -105,7 +105,7 @@ static volatile portBASE_TYPE xQueueEmpty = pdTRUE;
/* The interrupt service routine - called from the assembly entry point. */
void vSerialISR( void );
void vConfigureQueues( xQueueHandle xQForRx, xQueueHandle xQForTx, volatile portBASE_TYPE *pxEmptyFlag );
void vConfigureQueues( QueueHandle_t xQForRx, QueueHandle_t xQForTx, volatile portBASE_TYPE *pxEmptyFlag );
/*-----------------------------------------------------------*/
@ -181,7 +181,7 @@ EIC_IRQInitTypeDef EIC_IRQInitStructure;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -223,7 +223,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
portBASE_TYPE xReturn;

@ -78,11 +78,11 @@
#include "FreeRTOS.h"
#include "queue.h"
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
static portBASE_TYPE volatile *pxQueueEmpty;
void vConfigureQueues( xQueueHandle xQForRx, xQueueHandle xQForTx, portBASE_TYPE volatile *pxEmptyFlag )
void vConfigureQueues( QueueHandle_t xQForRx, QueueHandle_t xQForTx, portBASE_TYPE volatile *pxEmptyFlag )
{
xRxedChars = xQForRx;
xCharsForTx = xQForTx;

@ -83,7 +83,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 60000000 ) /* Timer clock. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 12800 )

@ -168,7 +168,7 @@ static void vPrintTask( void *pvParameters );
/*-----------------------------------------------------------*/
/* The queue used to communicate with the LCD print task. */
static xQueueHandle xLCDQueue;
static QueueHandle_t xLCDQueue;
/*-----------------------------------------------------------*/
@ -205,7 +205,7 @@ void main( void )
static void vCheckTask( void *pvParameters )
{
static unsigned long ulErrorDetected = pdFALSE;
portTickType xLastExecutionTime;
TickType_t xLastExecutionTime;
unsigned char *cErrorMessage = " FAIL";
unsigned char *cSuccessMessage = " PASS";
unsigned portBASE_TYPE uxColumn = mainMAX_WRITE_COLUMN;

@ -80,15 +80,15 @@
/* Demo application includes. */
#include "serial.h"
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
static volatile portBASE_TYPE xQueueEmpty = pdTRUE;
@ -168,7 +168,7 @@ EIC_IRQInitTypeDef EIC_IRQInitStructure;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -210,7 +210,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
portBASE_TYPE xReturn;

@ -84,7 +84,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) BOARD_MCK )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 190 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40000 ) )
#define configMAX_TASK_NAME_LEN ( 12 )

@ -111,8 +111,8 @@
#define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY )
/* The period of the check task both in and out of the presense of an error. */
#define mainNO_ERROR_PERIOD ( 5000 / portTICK_RATE_MS )
#define mainERROR_PERIOD ( 500 / portTICK_RATE_MS );
#define mainNO_ERROR_PERIOD ( 5000 / portTICK_PERIOD_MS )
#define mainERROR_PERIOD ( 500 / portTICK_PERIOD_MS );
/* Constants used by the ComTest task. */
#define mainCOM_TEST_BAUD_RATE ( 38400 )
@ -167,7 +167,7 @@ int main()
static void prvCheckTask( void * pvParameters )
{
portTickType xNextWakeTime, xPeriod = mainNO_ERROR_PERIOD;
TickType_t xNextWakeTime, xPeriod = mainNO_ERROR_PERIOD;
static volatile unsigned long ulErrorCode = 0UL;
/* Just to remove the compiler warning. */

@ -93,17 +93,17 @@
#define vInterruptOff() serCOM0->US_IDR = AT91C_US_TXRDY
/* Misc constants. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
#define serNO_TIMEGUARD ( ( unsigned long ) 0 )
#define serNO_PERIPHERAL_B_SETUP ( ( unsigned long ) 0 )
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -157,7 +157,7 @@ xComPortHandle xReturn = serHANDLE;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -199,7 +199,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
/* Just to remove compiler warning. */
( void ) pxPort;

@ -92,7 +92,7 @@
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 96000000 )
#define configCPU_PERIPH_HZ ( ( unsigned long ) 48000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 100 )
#define configTICK_RATE_HZ ( ( TickType_t ) 100 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 180 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 52000 )

@ -400,12 +400,12 @@ void ENET_Init ()
ENET_MIIWriteReg(0x0,MAC_MII_REG_XCR, 0x8000);
/* Delay to assure PHY reset */
vTaskDelay( 3000 / portTICK_RATE_MS );
vTaskDelay( 3000 / portTICK_PERIOD_MS );
/* initialize the opearting mode */
while( ENET_SetOperatingMode() == pdFAIL )
{
vTaskDelay( 3000 / portTICK_RATE_MS );
vTaskDelay( 3000 / portTICK_PERIOD_MS );
}
/*set MAC physical*/

@ -45,7 +45,7 @@
struct timeoutlist
{
struct sys_timeouts timeouts;
xTaskHandle pid;
TaskHandle_t pid;
};
/* This is the number of threads that can be started with sys_thread_new() */
@ -62,7 +62,7 @@ static sys_arch_state_t s_sys_arch_state;
sys_mbox_t
sys_mbox_new(void)
{
xQueueHandle mbox;
QueueHandle_t mbox;
mbox = xQueueCreate( archMESG_QUEUE_LENGTH, sizeof( void * ) );
@ -92,7 +92,7 @@ sys_mbox_free(sys_mbox_t mbox)
void
sys_mbox_post(sys_mbox_t mbox, void *data)
{
xQueueSend( mbox, &data, ( portTickType ) ( archPOST_BLOCK_TIME_MS / portTICK_RATE_MS ) );
xQueueSend( mbox, &data, ( TickType_t ) ( archPOST_BLOCK_TIME_MS / portTICK_PERIOD_MS ) );
}
@ -115,7 +115,7 @@ sys_mbox_post(sys_mbox_t mbox, void *data)
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)
{
void *dummyptr;
portTickType StartTime, EndTime, Elapsed;
TickType_t StartTime, EndTime, Elapsed;
StartTime = xTaskGetTickCount();
@ -164,7 +164,7 @@ portTickType StartTime, EndTime, Elapsed;
sys_sem_t
sys_sem_new(u8_t count)
{
xSemaphoreHandle xSemaphore;
SemaphoreHandle_t xSemaphore;
portENTER_CRITICAL();
vSemaphoreCreateBinary( xSemaphore );
@ -203,7 +203,7 @@ sys_sem_new(u8_t count)
u32_t
sys_arch_sem_wait(sys_sem_t sem, u32_t timeout)
{
portTickType StartTime, EndTime, Elapsed;
TickType_t StartTime, EndTime, Elapsed;
StartTime = xTaskGetTickCount();
@ -296,7 +296,7 @@ struct sys_timeouts *
sys_arch_timeouts(void)
{
int i;
xTaskHandle pid;
TaskHandle_t pid;
struct timeoutlist *tl;
pid = xTaskGetCurrentTaskHandle( );
@ -326,7 +326,7 @@ struct timeoutlist *tl;
*/
sys_thread_t sys_thread_new(void (* thread)(void *arg), void *arg, int prio)
{
xTaskHandle CreatedTask;
TaskHandle_t CreatedTask;
int result;
result = xTaskCreate(thread, s_sys_arch_state.cTaskName, s_sys_arch_state.nStackDepth, arg, prio, &CreatedTask );

@ -37,13 +37,13 @@
#include "queue.h"
#include "semphr.h"
#define SYS_MBOX_NULL (xQueueHandle)0
#define SYS_SEM_NULL (xSemaphoreHandle)0
#define SYS_MBOX_NULL (QueueHandle_t)0
#define SYS_SEM_NULL (SemaphoreHandle_t)0
#define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE
typedef xSemaphoreHandle sys_sem_t;
typedef xQueueHandle sys_mbox_t;
typedef xTaskHandle sys_thread_t;
typedef SemaphoreHandle_t sys_sem_t;
typedef QueueHandle_t sys_mbox_t;
typedef TaskHandle_t sys_thread_t;
typedef struct _sys_arch_state_t
{

@ -77,7 +77,7 @@
#define webHTTP_PORT ( 80 )
/* Delay on close error. */
#define webSHORT_DELAY ( 10 / portTICK_RATE_MS )
#define webSHORT_DELAY ( 10 / portTICK_PERIOD_MS )
/* The IP address being used. */
#define emacIPADDR0 172

@ -58,7 +58,7 @@
#define IFNAME1 'm'
/* The time to block waiting for input. */
#define emacBLOCK_TIME_WAITING_FOR_INPUT ( ( portTickType ) 100 )
#define emacBLOCK_TIME_WAITING_FOR_INPUT ( ( TickType_t ) 100 )
/* Interrupt status bit definition. */
#define DMI_RX_CURRENT_DONE 0x8000
@ -68,7 +68,7 @@ extern u8 TxBuff[1520];
static u8_t s_rxBuff[1520];
/* The semaphore used by the ISR to wake the lwIP task. */
static xSemaphoreHandle s_xSemaphore = NULL;
static SemaphoreHandle_t s_xSemaphore = NULL;
struct ethernetif {
struct eth_addr *ethaddr;
@ -146,7 +146,7 @@ static void low_level_init(struct netif *netif)
static err_t low_level_output(struct netif *netif, struct pbuf *p)
{
static xSemaphoreHandle xTxSemaphore = NULL;
static SemaphoreHandle_t xTxSemaphore = NULL;
struct pbuf *q;
u32_t l = 0;
@ -199,7 +199,7 @@ static err_t low_level_output(struct netif *netif, struct pbuf *p)
static struct pbuf *
low_level_input(struct netif *netif)
{
static xSemaphoreHandle xRxSemaphore = NULL;
static SemaphoreHandle_t xRxSemaphore = NULL;
struct pbuf *p, *q;
u16_t len, l;

@ -143,9 +143,9 @@
#define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY )
/* Delays used by the various tasks defined in this file. */
#define mainCHECK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainSTRING_WRITE_DELAY ( 500 / portTICK_RATE_MS )
#define mainLCD_DELAY ( 20 / portTICK_RATE_MS )
#define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainSTRING_WRITE_DELAY ( 500 / portTICK_PERIOD_MS )
#define mainLCD_DELAY ( 20 / portTICK_PERIOD_MS )
/* Constants for the ComTest tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 115200 )
@ -205,7 +205,7 @@ static void prvLCDMessageTask( void * pvParameters );
/*-----------------------------------------------------------*/
/* The queue used to pass messages to the LCD task. */
static xQueueHandle xLCDQueue;
static QueueHandle_t xLCDQueue;
/* Error status flag. */
static unsigned long ulErrorFlags = 0;
@ -314,7 +314,7 @@ static void vErrorChecks( void *pvParameters )
static char cCheckVal[ mainMAX_FLAG_STRING_LEN ];
char *pcFlagString;
xLCDMessage xMessageToSend;
portTickType xLastWakeTime;
TickType_t xLastWakeTime;
char *pcStringsToDisplay[] = {
"Check status flag"
};
@ -406,7 +406,7 @@ static void prvCheckOtherTasksAreStillRunning( void )
static void prvLCDMessageTask( void * pvParameters )
{
xQueueHandle *pxLCDQueue;
QueueHandle_t *pxLCDQueue;
xLCDMessage xMessageToSend;
portBASE_TYPE xIndex = 0;
@ -423,7 +423,7 @@ char *pcStringsToDisplay[] = {
/* To test the parameter passing mechanism, the queue on which messages are
posted is passed in as a parameter even though it is available as a file
scope variable anyway. */
pxLCDQueue = ( xQueueHandle * ) pvParameters;
pxLCDQueue = ( QueueHandle_t * ) pvParameters;
for( ;; )
{
@ -452,14 +452,14 @@ char *pcStringsToDisplay[] = {
void prvLCDTask( void * pvParameters )
{
xQueueHandle *pxLCDQueue;
QueueHandle_t *pxLCDQueue;
xLCDMessage xReceivedMessage;
char *pcString;
/* 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
scope variable anyway. */
pxLCDQueue = ( xQueueHandle * ) pvParameters;
pxLCDQueue = ( QueueHandle_t * ) pvParameters;
LCD_Init();

@ -80,9 +80,9 @@
/*-----------------------------------------------------------*/
/* Misc defines. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serTX_BLOCK_TIME ( 40 / portTICK_RATE_MS )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
#define serTX_BLOCK_TIME ( 40 / portTICK_PERIOD_MS )
/* Interrupt and status bit definitions. */
#define mainTXRIS 0x20
@ -92,11 +92,11 @@
/*-----------------------------------------------------------*/
/* The queue used to hold received characters. */
static xQueueHandle xRxedChars;
static QueueHandle_t xRxedChars;
/* The semaphore used to wake a task waiting for space to become available
in the FIFO. */
static xSemaphoreHandle xTxFIFOSemaphore;
static SemaphoreHandle_t xTxFIFOSemaphore;
/*-----------------------------------------------------------*/
@ -198,7 +198,7 @@ GPIO_InitTypeDef GPIO_InitStructure;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -240,7 +240,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
portBASE_TYPE xReturn;

@ -119,7 +119,7 @@
#define uipDMI_RX_CURRENT_DONE 0x8000
/* If no buffers are available, then wait this long before looking again. */
#define uipBUFFER_WAIT_DELAY ( 10 / portTICK_RATE_MS )
#define uipBUFFER_WAIT_DELAY ( 10 / portTICK_PERIOD_MS )
#define uipBUFFER_WAIT_ATTEMPTS ( 10 )
/* Standard constant. */
@ -151,7 +151,7 @@ clock_time_t clock_time( void );
/*-----------------------------------------------------------*/
/* The semaphore used by the ISR to wake the uIP task. */
xSemaphoreHandle xSemaphore = NULL;
SemaphoreHandle_t xSemaphore = NULL;
/*-----------------------------------------------------------*/

@ -63,7 +63,7 @@
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( FOSC0 ) /* Hz clk gen */
#define configPBA_CLOCK_HZ ( FOSC0 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 8 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
/* configTOTAL_HEAP_SIZE is not used when heap_3.c is used. */

@ -148,11 +148,11 @@
#define mainERROR_LED ( 7 )
//! The period between executions of the check task.
#define mainCHECK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
//! If an error is detected in a task, the vErrorChecks task will enter in an
//! infinite loop flashing the LED at this rate.
#define mainERROR_FLASH_RATE ( (portTickType) 500 / portTICK_RATE_MS )
#define mainERROR_FLASH_RATE ( (TickType_t) 500 / portTICK_PERIOD_MS )
/*! \name Constants used by the vMemCheckTask() task.
*/
@ -246,7 +246,7 @@ static void vErrorChecks( void *pvParameters )
{
static volatile unsigned long ulDummyVariable = 3UL;
unsigned long ulMemCheckTaskRunningCount;
xTaskHandle xCreatedTask;
TaskHandle_t xCreatedTask;
portBASE_TYPE bSuicidalTask = 0;
/* The parameters are not used. Prevent compiler warnings. */

@ -59,23 +59,23 @@
/* Constants to setup and access the USART. */
#define serINVALID_COMPORT_HANDLER ( ( xComPortHandle ) 0 )
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
/* Forward declaration. */
static void vprvSerialCreateQueues( unsigned portBASE_TYPE uxQueueLength,
xQueueHandle *pxRxedChars,
xQueueHandle *pxCharsForTx );
QueueHandle_t *pxRxedChars,
QueueHandle_t *pxCharsForTx );
/*-----------------------------------------------------------*/
@ -290,7 +290,7 @@ int cd; /* USART Clock Divider. */
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
@ -328,7 +328,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
volatile avr32_usart_t *usart = serialPORT_USART;
@ -359,7 +359,7 @@ void vSerialClose( xComPortHandle xPort )
/*
* Create the rx and tx queues.
*/
static void vprvSerialCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx )
static void vprvSerialCreateQueues( unsigned portBASE_TYPE uxQueueLength, QueueHandle_t *pxRxedChars, QueueHandle_t *pxCharsForTx )
{
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );

@ -86,7 +86,7 @@
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 8000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 85 )
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 1500 ) )

@ -101,7 +101,7 @@ Changes from V1.2.5
Changes from V2.0.0
+ Delay periods are now specified using variables and constants of
portTickType rather than unsigned long.
TickType_t rather than unsigned long.
Changes from V2.2.0
@ -160,7 +160,7 @@ again. */
#define mainCHECK_TASK_LED ( 7 )
/* The period between executions of the check task. */
#define mainCHECK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
/* An address in the EEPROM used to count resets. This is used to check that
the demo application is not unexpectedly resetting. */

@ -85,8 +85,8 @@
#define serUCSRC_SELECT ( ( unsigned char ) 0x80 )
#define serEIGHT_DATA_BITS ( ( unsigned char ) 0x06 )
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
#define vInterruptOn() \
{ \
@ -147,7 +147,7 @@ unsigned char ucByte;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
@ -162,7 +162,7 @@ signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedC
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
/* Return false if after the block time there is no room on the Tx queue. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )

@ -84,7 +84,7 @@
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 8000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 85 )
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 1500 ) )

@ -101,7 +101,7 @@ Changes from V1.2.5
Changes from V2.0.0
+ Delay periods are now specified using variables and constants of
portTickType rather than unsigned long.
TickType_t rather than unsigned long.
Changes from V2.6.1
@ -157,7 +157,7 @@ again. */
#define mainCHECK_TASK_LED ( 7 )
/* The period between executions of the check task. */
#define mainCHECK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
/* An address in the EEPROM used to count resets. This is used to check that
the demo application is not unexpectedly resetting. */

@ -73,7 +73,7 @@ Changes from V1.2.3
Changes from V2.0.0
+ Delay periods are now specified using variables and constants of
portTickType rather than unsigned long.
TickType_t rather than unsigned long.
+ xQueueReceiveFromISR() used in place of xQueueReceive() within the ISR.
Changes from V2.6.0
@ -105,8 +105,8 @@ Changes from V2.6.0
#define serUCSRC_SELECT ( ( unsigned char ) 0x80 )
#define serEIGHT_DATA_BITS ( ( unsigned char ) 0x06 )
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
#define vInterruptOn() \
{ \
@ -167,7 +167,7 @@ unsigned char ucByte;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* Only one port is supported. */
( void ) pxPort;
@ -185,7 +185,7 @@ signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedC
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
/* Only one port is supported. */
( void ) pxPort;

@ -94,7 +94,7 @@ assembly files that include this header file. */
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( SystemFrequency )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 30 * 1024 ) )

@ -331,7 +331,7 @@ typedef struct mss_i2c_instance
mss_i2c_slave_wr_handler_t slave_write_handler;
/* Used to get access to and wait for completion of an I2C transaction. */
xSemaphoreHandle xI2CCompleteSemaphore;
SemaphoreHandle_t xI2CCompleteSemaphore;
} mss_i2c_instance_t;

@ -129,8 +129,8 @@
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* The rate at which data is sent to the queue, specified in milliseconds, and
converted to ticks using the portTICK_RATE_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_RATE_MS )
converted to ticks using the portTICK_PERIOD_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS )
/* The number of items the queue can hold. This is 1 as the receive task
will remove items as they are added, meaning the send task should always find
@ -160,16 +160,16 @@ static void prvQueueSendTask( void *pvParameters );
* The LED timer callback function. This does nothing but switch off the
* LED defined by the mainTIMER_CONTROLLED_LED constant.
*/
static void vLEDTimerCallback( xTimerHandle xTimer );
static void vLEDTimerCallback( TimerHandle_t xTimer );
/*-----------------------------------------------------------*/
/* The queue used by both tasks. */
static xQueueHandle xQueue = NULL;
static QueueHandle_t xQueue = NULL;
/* The LED software timer. This uses vLEDTimerCallback() as its callback
function. */
static xTimerHandle xLEDTimer = NULL;
static TimerHandle_t xLEDTimer = NULL;
/* Maintains the current LED output state. */
static volatile unsigned long ulGPIOState = 0UL;
@ -195,7 +195,7 @@ int main(void)
if the button is not pushed within 5000ms, as described at the top of
this file. */
xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */
( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */
( 5000 / portTICK_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */
pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */
( void * ) 0, /* The ID is not used, so can be set to anything. */
vLEDTimerCallback /* The callback function that switches the LED off. */
@ -214,7 +214,7 @@ int main(void)
}
/*-----------------------------------------------------------*/
static void vLEDTimerCallback( xTimerHandle xTimer )
static void vLEDTimerCallback( TimerHandle_t xTimer )
{
/* The timer has expired - so no button pushes have occurred in the last
five seconds - turn the LED off. NOTE - accessing the LED port should use
@ -256,7 +256,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
static void prvQueueSendTask( void *pvParameters )
{
portTickType xNextWakeTime;
TickType_t xNextWakeTime;
const unsigned long ulValueToSend = 100UL;
/* Initialise xNextWakeTime - this only needs to be done once. */
@ -355,7 +355,7 @@ void vApplicationMallocFailedHook( void )
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;

@ -174,8 +174,8 @@
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* The rate at which data is sent to the queue, specified in milliseconds, and
converted to ticks using the portTICK_RATE_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_RATE_MS )
converted to ticks using the portTICK_PERIOD_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS )
/* The number of items the queue can hold. This is 1 as the receive task
will remove items as they are added, meaning the send task should always find
@ -212,19 +212,19 @@ stack than most of the other tasks. */
/* The period at which the check timer will expire, in ms, provided no errors
have been reported by any of the standard demo tasks. */
#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_RATE_MS )
#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_PERIOD_MS )
/* The period at which the OLED timer will expire. Each time it expires, it's
callback function updates the OLED text. */
#define mainOLED_PERIOD_MS ( 75UL / portTICK_RATE_MS )
#define mainOLED_PERIOD_MS ( 75UL / portTICK_PERIOD_MS )
/* The period at which the check timer will expire, in ms, if an error has been
reported in one of the standard demo tasks. */
#define mainERROR_CHECK_TIMER_PERIOD_MS ( 500UL / portTICK_RATE_MS )
#define mainERROR_CHECK_TIMER_PERIOD_MS ( 500UL / portTICK_PERIOD_MS )
/* The LED will remain on until the button has not been pushed for a full
5000ms. */
#define mainLED_TIMER_PERIOD_MS ( 5000UL / portTICK_RATE_MS )
#define mainLED_TIMER_PERIOD_MS ( 5000UL / portTICK_PERIOD_MS )
/* A zero block time. */
#define mainDONT_BLOCK ( 0UL )
@ -245,12 +245,12 @@ static void prvQueueSendTask( void *pvParameters );
* The LED timer callback function. This does nothing but switch the red LED
* off.
*/
static void prvLEDTimerCallback( xTimerHandle xTimer );
static void prvLEDTimerCallback( TimerHandle_t xTimer );
/*
* The check timer callback function, as described at the top of this file.
*/
static void prvCheckTimerCallback( xTimerHandle xTimer );
static void prvCheckTimerCallback( TimerHandle_t xTimer );
/*
* This is not a 'standard' partest function, so the prototype is not in
@ -273,15 +273,15 @@ static void prvOLEDTask( void * pvParameters);
/*-----------------------------------------------------------*/
/* The queue used by both application specific demo tasks defined in this file. */
static xQueueHandle xQueue = NULL;
static QueueHandle_t xQueue = NULL;
/* The LED software timer. This uses prvLEDTimerCallback() as it's callback
function. */
static xTimerHandle xLEDTimer = NULL;
static TimerHandle_t xLEDTimer = NULL;
/* The check timer. This uses prvCheckTimerCallback() as it's callback
function. */
static xTimerHandle xCheckTimer = NULL;
static TimerHandle_t xCheckTimer = NULL;
/* The status message that is displayed at the bottom of the "task stats" web
page, which is served by the uIP task. This will report any errors picked up
@ -357,7 +357,7 @@ int main(void)
}
/*-----------------------------------------------------------*/
static void prvCheckTimerCallback( xTimerHandle xTimer )
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
/* Check the standard demo tasks are running without error. Latch the
latest reported error in the pcStatusMessage character pointer. */
@ -420,7 +420,7 @@ static void prvCheckTimerCallback( xTimerHandle xTimer )
}
/*-----------------------------------------------------------*/
static void prvLEDTimerCallback( xTimerHandle xTimer )
static void prvLEDTimerCallback( TimerHandle_t xTimer )
{
/* The timer has expired - so no button pushes have occurred in the last
five seconds - turn the LED off. */
@ -457,7 +457,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
static void prvQueueSendTask( void *pvParameters )
{
portTickType xNextWakeTime;
TickType_t xNextWakeTime;
const unsigned long ulValueToSend = 100UL;
/* The timer command queue will have been filled when the timer test tasks
@ -512,7 +512,7 @@ static void prvOLEDTask( void * pvParameters)
{
static struct oled_data xOLEDData;
static unsigned char ucOffset1 = 0, ucOffset2 = 5;
static portTickType xLastScrollTime = 0UL;
static TickType_t xLastScrollTime = 0UL;
/* Initialise the display. */
OLED_init();
@ -580,7 +580,7 @@ void vApplicationMallocFailedHook( void )
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;

@ -106,7 +106,7 @@ driver to the uIP stack. */
#define uipDONT_BLOCK 0UL
/* How long to wait before attempting to connect the MAC again. */
#define uipINIT_WAIT ( 100 / portTICK_RATE_MS )
#define uipINIT_WAIT ( 100 / portTICK_PERIOD_MS )
/* Shortcut to the header within the Rx buffer. */
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
@ -136,7 +136,7 @@ static void prvEMACEventListener( unsigned long ulISREvents );
* The callback function that is assigned to both the periodic timer and the
* ARP timer.
*/
static void prvUIPTimerCallback( xTimerHandle xTimer );
static void prvUIPTimerCallback( TimerHandle_t xTimer );
/*
* Initialise the MAC hardware.
@ -158,7 +158,7 @@ clock_time_t clock_time( void );
/*-----------------------------------------------------------*/
/* The queue used to send TCP/IP events to the uIP stack. */
xQueueHandle xEMACEventQueue = NULL;
QueueHandle_t xEMACEventQueue = NULL;
/*-----------------------------------------------------------*/
@ -286,7 +286,7 @@ struct uip_eth_addr xAddr;
static void prvInitialise_uIP( void )
{
uip_ipaddr_t xIPAddr;
xTimerHandle xARPTimer, xPeriodicTimer;
TimerHandle_t xARPTimer, xPeriodicTimer;
uip_init();
uip_ipaddr( &xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );
@ -301,14 +301,14 @@ xTimerHandle xARPTimer, xPeriodicTimer;
/* Create and start the uIP timers. */
xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */
( 10000UL / portTICK_RATE_MS ), /* Timer period. */
( 10000UL / portTICK_PERIOD_MS ), /* Timer period. */
pdTRUE, /* Autor-reload. */
( void * ) uipARP_TIMER,
prvUIPTimerCallback
);
xPeriodicTimer = xTimerCreate( "PeriodicTimer",
( 500UL / portTICK_RATE_MS ),
( 500UL / portTICK_PERIOD_MS ),
pdTRUE, /* Autor-reload. */
( void * ) uipPERIODIC_TIMER,
prvUIPTimerCallback
@ -370,7 +370,7 @@ void vEMACWrite( void )
{
const long lMaxAttempts = 10;
long lAttempt;
const portTickType xShortDelay = ( 5 / portTICK_RATE_MS );
const TickType_t xShortDelay = ( 5 / portTICK_PERIOD_MS );
/* Try to send data to the Ethernet. Keep trying for a while if data cannot
be sent immediately. Note that this will actually cause the data to be sent
@ -390,7 +390,7 @@ const portTickType xShortDelay = ( 5 / portTICK_RATE_MS );
}
/*-----------------------------------------------------------*/
static void prvUIPTimerCallback( xTimerHandle xTimer )
static void prvUIPTimerCallback( TimerHandle_t xTimer )
{
static const unsigned long ulARPTimerExpired = uipARP_TIMER_EVENT;
static const unsigned long ulPeriodicTimerExpired = uipPERIODIC_TIMER_EVENT;

@ -97,7 +97,7 @@ extern uint32_t SystemFrequency;
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( SystemFrequency )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 30 * 1024 ) )

@ -331,7 +331,7 @@ typedef struct mss_i2c_instance
mss_i2c_slave_wr_handler_t slave_write_handler;
/* Used to get access to and wait for completion of an I2C transaction. */
xSemaphoreHandle xI2CCompleteSemaphore;
SemaphoreHandle_t xI2CCompleteSemaphore;
} mss_i2c_instance_t;

@ -129,8 +129,8 @@
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* The rate at which data is sent to the queue, specified in milliseconds, and
converted to ticks using the portTICK_RATE_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_RATE_MS )
converted to ticks using the portTICK_PERIOD_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS )
/* The number of items the queue can hold. This is 1 as the receive task
will remove items as they are added, meaning the send task should always find
@ -160,16 +160,16 @@ static void prvQueueSendTask( void *pvParameters );
* The LED timer callback function. This does nothing but switch off the
* LED defined by the mainTIMER_CONTROLLED_LED constant.
*/
static void vLEDTimerCallback( xTimerHandle xTimer );
static void vLEDTimerCallback( TimerHandle_t xTimer );
/*-----------------------------------------------------------*/
/* The queue used by both tasks. */
static xQueueHandle xQueue = NULL;
static QueueHandle_t xQueue = NULL;
/* The LED software timer. This uses vLEDTimerCallback() as its callback
function. */
static xTimerHandle xLEDTimer = NULL;
static TimerHandle_t xLEDTimer = NULL;
/* Maintains the current LED output state. */
static volatile unsigned long ulGPIOState = 0UL;
@ -195,7 +195,7 @@ int main(void)
if the button is not pushed within 5000ms, as described at the top of
this file. */
xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */
( 5000 / portTICK_RATE_MS ),/* The timer period, in this case 5000ms (5s). */
( 5000 / portTICK_PERIOD_MS ),/* The timer period, in this case 5000ms (5s). */
pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */
( void * ) 0, /* The ID is not used, so can be set to anything. */
vLEDTimerCallback /* The callback function that switches the LED off. */
@ -214,7 +214,7 @@ int main(void)
}
/*-----------------------------------------------------------*/
static void vLEDTimerCallback( xTimerHandle xTimer )
static void vLEDTimerCallback( TimerHandle_t xTimer )
{
/* The timer has expired - so no button pushes have occurred in the last
five seconds - turn the LED off. NOTE - accessing the LED port should use
@ -256,7 +256,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
static void prvQueueSendTask( void *pvParameters )
{
portTickType xNextWakeTime;
TickType_t xNextWakeTime;
const unsigned long ulValueToSend = 100UL;
/* Initialise xNextWakeTime - this only needs to be done once. */
@ -355,7 +355,7 @@ void vApplicationMallocFailedHook( void )
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;

@ -174,8 +174,8 @@
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* The rate at which data is sent to the queue, specified in milliseconds, and
converted to ticks using the portTICK_RATE_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_RATE_MS )
converted to ticks using the portTICK_PERIOD_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS )
/* The number of items the queue can hold. This is 1 as the receive task
will remove items as they are added, meaning the send task should always find
@ -212,19 +212,19 @@ stack than most of the other tasks. */
/* The period at which the check timer will expire, in ms, provided no errors
have been reported by any of the standard demo tasks. */
#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_RATE_MS )
#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_PERIOD_MS )
/* The period at which the OLED timer will expire. Each time it expires, it's
callback function updates the OLED text. */
#define mainOLED_PERIOD_MS ( 75UL / portTICK_RATE_MS )
#define mainOLED_PERIOD_MS ( 75UL / portTICK_PERIOD_MS )
/* The period at which the check timer will expire, in ms, if an error has been
reported in one of the standard demo tasks. */
#define mainERROR_CHECK_TIMER_PERIOD_MS ( 500UL / portTICK_RATE_MS )
#define mainERROR_CHECK_TIMER_PERIOD_MS ( 500UL / portTICK_PERIOD_MS )
/* The LED will remain on until the button has not been pushed for a full
5000ms. */
#define mainLED_TIMER_PERIOD_MS ( 5000UL / portTICK_RATE_MS )
#define mainLED_TIMER_PERIOD_MS ( 5000UL / portTICK_PERIOD_MS )
/* A zero block time. */
#define mainDONT_BLOCK ( 0UL )
@ -245,12 +245,12 @@ static void prvQueueSendTask( void *pvParameters );
* The LED timer callback function. This does nothing but switch the red LED
* off.
*/
static void prvLEDTimerCallback( xTimerHandle xTimer );
static void prvLEDTimerCallback( TimerHandle_t xTimer );
/*
* The check timer callback function, as described at the top of this file.
*/
static void prvCheckTimerCallback( xTimerHandle xTimer );
static void prvCheckTimerCallback( TimerHandle_t xTimer );
/*
* This is not a 'standard' partest function, so the prototype is not in
@ -273,15 +273,15 @@ static void prvOLEDTask( void * pvParameters);
/*-----------------------------------------------------------*/
/* The queue used by both application specific demo tasks defined in this file. */
static xQueueHandle xQueue = NULL;
static QueueHandle_t xQueue = NULL;
/* The LED software timer. This uses prvLEDTimerCallback() as it's callback
function. */
static xTimerHandle xLEDTimer = NULL;
static TimerHandle_t xLEDTimer = NULL;
/* The check timer. This uses prvCheckTimerCallback() as it's callback
function. */
static xTimerHandle xCheckTimer = NULL;
static TimerHandle_t xCheckTimer = NULL;
/* The status message that is displayed at the bottom of the "task stats" web
page, which is served by the uIP task. This will report any errors picked up
@ -357,7 +357,7 @@ int main(void)
}
/*-----------------------------------------------------------*/
static void prvCheckTimerCallback( xTimerHandle xTimer )
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
/* Check the standard demo tasks are running without error. Latch the
latest reported error in the pcStatusMessage character pointer. */
@ -420,7 +420,7 @@ static void prvCheckTimerCallback( xTimerHandle xTimer )
}
/*-----------------------------------------------------------*/
static void prvLEDTimerCallback( xTimerHandle xTimer )
static void prvLEDTimerCallback( TimerHandle_t xTimer )
{
/* The timer has expired - so no button pushes have occurred in the last
five seconds - turn the LED off. */
@ -457,7 +457,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
static void prvQueueSendTask( void *pvParameters )
{
portTickType xNextWakeTime;
TickType_t xNextWakeTime;
const unsigned long ulValueToSend = 100UL;
/* The timer command queue will have been filled when the timer test tasks
@ -512,7 +512,7 @@ static void prvOLEDTask( void * pvParameters)
{
static struct oled_data xOLEDData;
static unsigned char ucOffset1 = 0, ucOffset2 = 5;
static portTickType xLastScrollTime = 0UL;
static TickType_t xLastScrollTime = 0UL;
/* Initialise the display. */
OLED_init();
@ -580,7 +580,7 @@ void vApplicationMallocFailedHook( void )
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;

@ -106,7 +106,7 @@ driver to the uIP stack. */
#define uipDONT_BLOCK 0UL
/* How long to wait before attempting to connect the MAC again. */
#define uipINIT_WAIT ( 100 / portTICK_RATE_MS )
#define uipINIT_WAIT ( 100 / portTICK_PERIOD_MS )
/* Shortcut to the header within the Rx buffer. */
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
@ -136,7 +136,7 @@ static void prvEMACEventListener( unsigned long ulISREvents );
* The callback function that is assigned to both the periodic timer and the
* ARP timer.
*/
static void prvUIPTimerCallback( xTimerHandle xTimer );
static void prvUIPTimerCallback( TimerHandle_t xTimer );
/*
* Initialise the MAC hardware.
@ -158,7 +158,7 @@ clock_time_t clock_time( void );
/*-----------------------------------------------------------*/
/* The queue used to send TCP/IP events to the uIP stack. */
xQueueHandle xEMACEventQueue = NULL;
QueueHandle_t xEMACEventQueue = NULL;
/*-----------------------------------------------------------*/
@ -286,7 +286,7 @@ struct uip_eth_addr xAddr;
static void prvInitialise_uIP( void )
{
uip_ipaddr_t xIPAddr;
xTimerHandle xARPTimer, xPeriodicTimer;
TimerHandle_t xARPTimer, xPeriodicTimer;
uip_init();
uip_ipaddr( &xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );
@ -301,14 +301,14 @@ xTimerHandle xARPTimer, xPeriodicTimer;
/* Create and start the uIP timers. */
xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */
( 10000UL / portTICK_RATE_MS ), /* Timer period. */
( 10000UL / portTICK_PERIOD_MS ), /* Timer period. */
pdTRUE, /* Autor-reload. */
( void * ) uipARP_TIMER,
prvUIPTimerCallback
);
xPeriodicTimer = xTimerCreate( "PeriodicTimer",
( 500UL / portTICK_RATE_MS ),
( 500UL / portTICK_PERIOD_MS ),
pdTRUE, /* Autor-reload. */
( void * ) uipPERIODIC_TIMER,
prvUIPTimerCallback
@ -370,7 +370,7 @@ void vEMACWrite( void )
{
const long lMaxAttempts = 10;
long lAttempt;
const portTickType xShortDelay = ( 5 / portTICK_RATE_MS );
const TickType_t xShortDelay = ( 5 / portTICK_PERIOD_MS );
/* Try to send data to the Ethernet. Keep trying for a while if data cannot
be sent immediately. Note that this will actually cause the data to be sent
@ -390,7 +390,7 @@ const portTickType xShortDelay = ( 5 / portTICK_RATE_MS );
}
/*-----------------------------------------------------------*/
static void prvUIPTimerCallback( xTimerHandle xTimer )
static void prvUIPTimerCallback( TimerHandle_t xTimer )
{
static const unsigned long ulARPTimerExpired = uipARP_TIMER_EVENT;
static const unsigned long ulPeriodicTimerExpired = uipPERIODIC_TIMER_EVENT;

@ -113,8 +113,8 @@
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* The rate at which data is sent to the queue. The 200ms value is converted
to ticks using the portTICK_RATE_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_RATE_MS )
to ticks using the portTICK_PERIOD_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS )
/* The number of items the queue can hold. This is 1 as the receive task
will remove items as they are added, meaning the send task should always find
@ -141,7 +141,7 @@ void main_blinky( void );
/*-----------------------------------------------------------*/
/* The queue used by both tasks. */
static xQueueHandle xQueue = NULL;
static QueueHandle_t xQueue = NULL;
/*-----------------------------------------------------------*/
@ -181,7 +181,7 @@ void main_blinky( void )
static void prvQueueSendTask( void *pvParameters )
{
portTickType xNextWakeTime;
TickType_t xNextWakeTime;
const unsigned long ulValueToSend = 100UL;
/* Remove compiler warning about unused parameter. */

@ -108,7 +108,7 @@
#define configCPU_CLOCK_HZ 100000000UL
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configUSE_TICKLESS_IDLE 0
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configPERIPHERAL_CLOCK_HZ ( 33333000UL )
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1

@ -72,7 +72,7 @@
#define cmdMAX_INPUT_SIZE 50
/* The maximum time in ticks to wait for the UART access mutex. */
#define cmdMAX_MUTEX_WAIT ( 200 / portTICK_RATE_MS )
#define cmdMAX_MUTEX_WAIT ( 200 / portTICK_PERIOD_MS )
/*-----------------------------------------------------------*/

@ -189,13 +189,13 @@ the COM test tasks, so just set both to invalid values. */
/* The period after which the check timer will expire, in ms, provided no errors
have been reported by any of the standard demo tasks. ms are converted to the
equivalent in ticks using the portTICK_RATE_MS constant. */
#define mainNO_ERROR_CHECK_TASK_PERIOD ( 3000UL / portTICK_RATE_MS )
equivalent in ticks using the portTICK_PERIOD_MS constant. */
#define mainNO_ERROR_CHECK_TASK_PERIOD ( 3000UL / portTICK_PERIOD_MS )
/* The period at which the check timer will expire, in ms, if an error has been
reported in one of the standard demo tasks. ms are converted to the equivalent
in ticks using the portTICK_RATE_MS constant. */
#define mainERROR_CHECK_TASK_PERIOD ( 200UL / portTICK_RATE_MS )
in ticks using the portTICK_PERIOD_MS constant. */
#define mainERROR_CHECK_TASK_PERIOD ( 200UL / portTICK_PERIOD_MS )
/* Parameters that are passed into the register check tasks solely for the
purpose of ensuring parameters are passed into tasks correctly. */
@ -346,8 +346,8 @@ void main_full( void )
static void prvCheckTask( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
portTickType xLastExecutionTime;
TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
TickType_t xLastExecutionTime;
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
unsigned long ulErrorFound = pdFALSE;
@ -411,7 +411,7 @@ unsigned long ulErrorFound = pdFALSE;
ulErrorFound = pdTRUE;
}
if( xAreTimerDemoTasksStillRunning( ( portTickType ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS )
if( xAreTimerDemoTasksStillRunning( ( TickType_t ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS )
{
ulErrorFound = pdTRUE;
}

@ -95,8 +95,8 @@
/*-----------------------------------------------------------*/
/* Misc defines. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
/*-----------------------------------------------------------*/
@ -107,8 +107,8 @@ static void prvTXI_Handler( uint32_t ulUnusedParameter );
/*-----------------------------------------------------------*/
/* The queue used to hold received characters. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -157,7 +157,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -193,7 +193,7 @@ char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
signed portBASE_TYPE xReturn;

@ -119,7 +119,7 @@ static void prvSetupHardware( void );
within this file. */
void vApplicationMallocFailedHook( void );
void vApplicationIdleHook( void );
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName );
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
void vApplicationTickHook( void );
/*
@ -175,7 +175,7 @@ void vApplicationMallocFailedHook( void )
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;

@ -113,8 +113,8 @@
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* The rate at which data is sent to the queue. The 200ms value is converted
to ticks using the portTICK_RATE_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_RATE_MS )
to ticks using the portTICK_PERIOD_MS constant. */
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS )
/* The number of items the queue can hold. This is 1 as the receive task
will remove items as they are added, meaning the send task should always find
@ -141,7 +141,7 @@ void main_blinky( void );
/*-----------------------------------------------------------*/
/* The queue used by both tasks. */
static xQueueHandle xQueue = NULL;
static QueueHandle_t xQueue = NULL;
/*-----------------------------------------------------------*/
@ -181,7 +181,7 @@ void main_blinky( void )
static void prvQueueSendTask( void *pvParameters )
{
portTickType xNextWakeTime;
TickType_t xNextWakeTime;
const unsigned long ulValueToSend = 100UL;
/* Remove compiler warning about unused parameter. */

@ -110,7 +110,7 @@
#define configCPU_CLOCK_HZ 100000000UL
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configUSE_TICKLESS_IDLE 0
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configPERIPHERAL_CLOCK_HZ ( 33333000UL )
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1

@ -293,8 +293,8 @@ void main_full( void )
static void prvCheckTask( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
portTickType xLastExecutionTime;
TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
TickType_t xLastExecutionTime;
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
unsigned long ulErrorFound = pdFALSE;
@ -363,7 +363,7 @@ unsigned long ulErrorFound = pdFALSE;
ulErrorFound = pdTRUE;
}
if( xAreTimerDemoTasksStillRunning( ( portTickType ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS )
if( xAreTimerDemoTasksStillRunning( ( TickType_t ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS )
{
ulErrorFound = pdTRUE;
}

@ -178,7 +178,7 @@ XUartPs_Config *pxConfig;
}
/*-----------------------------------------------------------*/
BaseType_t xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
BaseType_t xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
BaseType_t xReturn;
@ -213,7 +213,7 @@ const TickType_t xMaxWait = 200UL / portTICK_PERIOD_MS;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
/* Only a single port is supported. */
( void ) pxPort;

@ -1,343 +1,343 @@
/*
FreeRTOS V8.0.0:rc2 - Copyright (C) 2014 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that has become a de facto standard. *
* *
* Help yourself get started quickly and support the FreeRTOS *
* project by purchasing a FreeRTOS tutorial book, reference *
* manual, or both from: http://www.FreeRTOS.org/Documentation *
* *
* Thank you! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
>>! NOTE: The modification to the GPL is included to allow you to distribute
>>! a combined work that includes FreeRTOS without being obliged to provide
>>! the source code for proprietary components outside of the FreeRTOS
>>! kernel.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available from the following
link: http://www.freertos.org/a00114.html
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
license and Real Time Engineers Ltd. contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/******************************************************************************
* 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 (defined in this file) is used to
* select between the two. The simply blinky demo is implemented and described
* in main_blinky.c. The more comprehensive test and demo application is
* implemented and described in main_full.c.
*
* This file implements the code that is not demo specific, including the
* hardware setup and FreeRTOS hook functions.
*
* !!! IMPORTANT NOTE !!!
* The GCC libraries that ship with the Xilinx SDK make use of the floating
* point registers. To avoid this causing corruption it is necessary to avoid
* their use. For this reason main.c contains very basic C implementations of
* the standard C library functions memset(), memcpy() and memcmp(), which are
* are used by FreeRTOS itself. Defining these functions in the project
* prevents the linker pulling them in from the library. Any other standard C
* library functions that are used by the application must likewise be defined
* in C.
*
* ENSURE TO READ THE DOCUMENTATION PAGE FOR THIS PORT AND DEMO APPLICATION ON
* THE http://www.FreeRTOS.org WEB SITE FOR FULL INFORMATION ON USING THIS DEMO
* APPLICATION, AND ITS ASSOCIATE FreeRTOS ARCHITECTURE PORT!
*
*/
/* Standard includes. */
#include <stdio.h>
/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* Standard demo includes. */
#include "partest.h"
#include "TimerDemo.h"
#include "QueueOverwrite.h"
#include "EventGroupsDemo.h"
/* Xilinx includes. */
#include "platform.h"
#include "xparameters.h"
#include "xscutimer.h"
#include "xscugic.h"
#include "xil_exception.h"
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
or 0 to run the more comprehensive test and demo application. */
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
/*-----------------------------------------------------------*/
/*
* Configure the hardware as necessary to run this demo.
*/
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.
*/
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1
extern void main_blinky( void );
#else
extern void main_full( void );
#endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */
/*
* The Xilinx projects use a BSP that do not allow the start up code to be
* altered easily. Therefore the vector table used by FreeRTOS is defined in
* FreeRTOS_asm_vectors.S, which is part of this project. Switch to use the
* FreeRTOS vector table.
*/
extern void vPortInstallFreeRTOSVectorTable( void );
/* Prototypes for the standard FreeRTOS callback/hook functions implemented
within this file. */
void vApplicationMallocFailedHook( void );
void vApplicationIdleHook( void );
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName );
void vApplicationTickHook( void );
/*-----------------------------------------------------------*/
/* The interrupt controller is initialised in this file, and made available to
other modules. */
XScuGic xInterruptController;
/*-----------------------------------------------------------*/
int main( void )
{
/* Configure the hardware ready to run the demo. */
prvSetupHardware();
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
of this file. */
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
{
main_blinky();
}
#else
{
main_full();
}
#endif
/* Don't expect to reach here. */
return 0;
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
BaseType_t xStatus;
XScuGic_Config *pxGICConfig;
/* Ensure no interrupts execute while the scheduler is in an inconsistent
state. Interrupts are automatically enabled when the scheduler is
started. */
portDISABLE_INTERRUPTS();
/* Obtain the configuration of the GIC. */
pxGICConfig = XScuGic_LookupConfig( XPAR_SCUGIC_SINGLE_DEVICE_ID );
/* Sanity check the FreeRTOSConfig.h settings are correct for the
hardware. */
configASSERT( pxGICConfig );
configASSERT( pxGICConfig->CpuBaseAddress == ( configINTERRUPT_CONTROLLER_BASE_ADDRESS + configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET ) );
configASSERT( pxGICConfig->DistBaseAddress == configINTERRUPT_CONTROLLER_BASE_ADDRESS );
/* Install a default handler for each GIC interrupt. */
xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress );
configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Initialise the LED port. */
vParTestInitialise();
/* The Xilinx projects use a BSP that do not allow the start up code to be
altered easily. Therefore the vector table used by FreeRTOS is defined in
FreeRTOS_asm_vectors.S, which is part of this project. Switch to use the
FreeRTOS vector table. */
vPortInstallFreeRTOSVectorTable();
}
/*-----------------------------------------------------------*/
void vApplicationMallocFailedHook( void )
{
/* Called if a call to pvPortMalloc() fails because there is insufficient
free memory available in the FreeRTOS heap. pvPortMalloc() is called
internally by FreeRTOS API functions that create tasks, queues, software
timers, and semaphores. The size of the FreeRTOS heap is set by the
configTOTAL_HEAP_SIZE configuration constant in FreeRTOSConfig.h. */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;
/* Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationIdleHook( void )
{
volatile size_t xFreeHeapSpace;
/* This is just a trivial example of an idle hook. It is called on each
cycle of the idle task. It must *NOT* attempt to block. In this case the
idle task just queries the amount of FreeRTOS heap that remains. See the
memory management section on the http://www.FreeRTOS.org web site for memory
management options. If there is a lot of heap memory free then the
configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up
RAM. */
xFreeHeapSpace = xPortGetFreeHeapSize();
/* Remove compiler warning about xFreeHeapSpace being set but never used. */
( void ) xFreeHeapSpace;
}
/*-----------------------------------------------------------*/
void vAssertCalled( const char * pcFile, unsigned long ulLine )
{
volatile unsigned long ul = 0;
( void ) pcFile;
( void ) ulLine;
taskENTER_CRITICAL();
{
/* Set ul to a non-zero value using the debugger to step out of this
function. */
while( ul == 0 )
{
portNOP();
}
}
taskEXIT_CRITICAL();
}
/*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )
{
/* The full demo includes a software timer demo/test that requires
prodding periodically from the tick interrupt. */
vTimerPeriodicISRTests();
/* Call the periodic queue overwrite from ISR demo. */
vQueueOverwritePeriodicISRDemo();
/* Call the periodic event group from ISR demo. */
vPeriodicEventGroupsProcessing();
}
#endif
}
/*-----------------------------------------------------------*/
void *memcpy( void *pvDest, const void *pvSource, size_t ulBytes )
{
unsigned char *pcDest = ( unsigned char * ) pvDest, *pcSource = ( unsigned char * ) pvSource;
size_t x;
for( x = 0; x < ulBytes; x++ )
{
*pcDest = *pcSource;
pcDest++;
pcSource++;
}
return pvDest;
}
/*-----------------------------------------------------------*/
void *memset( void *pvDest, int iValue, size_t ulBytes )
{
unsigned char *pcDest = ( unsigned char * ) pvDest;
size_t x;
for( x = 0; x < ulBytes; x++ )
{
*pcDest = ( unsigned char ) iValue;
pcDest++;
}
return pvDest;
}
/*-----------------------------------------------------------*/
int memcmp( const void *pvMem1, const void *pvMem2, size_t ulBytes )
{
const unsigned char *pucMem1 = pvMem1, *pucMem2 = pvMem2;
size_t x;
for( x = 0; x < ulBytes; x++ )
{
if( pucMem1[ x ] != pucMem2[ x ] )
{
break;
}
}
return ulBytes - x;
}
/*
FreeRTOS V8.0.0:rc2 - Copyright (C) 2014 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that has become a de facto standard. *
* *
* Help yourself get started quickly and support the FreeRTOS *
* project by purchasing a FreeRTOS tutorial book, reference *
* manual, or both from: http://www.FreeRTOS.org/Documentation *
* *
* Thank you! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
>>! NOTE: The modification to the GPL is included to allow you to distribute
>>! a combined work that includes FreeRTOS without being obliged to provide
>>! the source code for proprietary components outside of the FreeRTOS
>>! kernel.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available from the following
link: http://www.freertos.org/a00114.html
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
license and Real Time Engineers Ltd. contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/******************************************************************************
* 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 (defined in this file) is used to
* select between the two. The simply blinky demo is implemented and described
* in main_blinky.c. The more comprehensive test and demo application is
* implemented and described in main_full.c.
*
* This file implements the code that is not demo specific, including the
* hardware setup and FreeRTOS hook functions.
*
* !!! IMPORTANT NOTE !!!
* The GCC libraries that ship with the Xilinx SDK make use of the floating
* point registers. To avoid this causing corruption it is necessary to avoid
* their use. For this reason main.c contains very basic C implementations of
* the standard C library functions memset(), memcpy() and memcmp(), which are
* are used by FreeRTOS itself. Defining these functions in the project
* prevents the linker pulling them in from the library. Any other standard C
* library functions that are used by the application must likewise be defined
* in C.
*
* ENSURE TO READ THE DOCUMENTATION PAGE FOR THIS PORT AND DEMO APPLICATION ON
* THE http://www.FreeRTOS.org WEB SITE FOR FULL INFORMATION ON USING THIS DEMO
* APPLICATION, AND ITS ASSOCIATE FreeRTOS ARCHITECTURE PORT!
*
*/
/* Standard includes. */
#include <stdio.h>
/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* Standard demo includes. */
#include "partest.h"
#include "TimerDemo.h"
#include "QueueOverwrite.h"
#include "EventGroupsDemo.h"
/* Xilinx includes. */
#include "platform.h"
#include "xparameters.h"
#include "xscutimer.h"
#include "xscugic.h"
#include "xil_exception.h"
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
or 0 to run the more comprehensive test and demo application. */
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
/*-----------------------------------------------------------*/
/*
* Configure the hardware as necessary to run this demo.
*/
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.
*/
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1
extern void main_blinky( void );
#else
extern void main_full( void );
#endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */
/*
* The Xilinx projects use a BSP that do not allow the start up code to be
* altered easily. Therefore the vector table used by FreeRTOS is defined in
* FreeRTOS_asm_vectors.S, which is part of this project. Switch to use the
* FreeRTOS vector table.
*/
extern void vPortInstallFreeRTOSVectorTable( void );
/* Prototypes for the standard FreeRTOS callback/hook functions implemented
within this file. */
void vApplicationMallocFailedHook( void );
void vApplicationIdleHook( void );
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
void vApplicationTickHook( void );
/*-----------------------------------------------------------*/
/* The interrupt controller is initialised in this file, and made available to
other modules. */
XScuGic xInterruptController;
/*-----------------------------------------------------------*/
int main( void )
{
/* Configure the hardware ready to run the demo. */
prvSetupHardware();
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
of this file. */
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
{
main_blinky();
}
#else
{
main_full();
}
#endif
/* Don't expect to reach here. */
return 0;
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
BaseType_t xStatus;
XScuGic_Config *pxGICConfig;
/* Ensure no interrupts execute while the scheduler is in an inconsistent
state. Interrupts are automatically enabled when the scheduler is
started. */
portDISABLE_INTERRUPTS();
/* Obtain the configuration of the GIC. */
pxGICConfig = XScuGic_LookupConfig( XPAR_SCUGIC_SINGLE_DEVICE_ID );
/* Sanity check the FreeRTOSConfig.h settings are correct for the
hardware. */
configASSERT( pxGICConfig );
configASSERT( pxGICConfig->CpuBaseAddress == ( configINTERRUPT_CONTROLLER_BASE_ADDRESS + configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET ) );
configASSERT( pxGICConfig->DistBaseAddress == configINTERRUPT_CONTROLLER_BASE_ADDRESS );
/* Install a default handler for each GIC interrupt. */
xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress );
configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Initialise the LED port. */
vParTestInitialise();
/* The Xilinx projects use a BSP that do not allow the start up code to be
altered easily. Therefore the vector table used by FreeRTOS is defined in
FreeRTOS_asm_vectors.S, which is part of this project. Switch to use the
FreeRTOS vector table. */
vPortInstallFreeRTOSVectorTable();
}
/*-----------------------------------------------------------*/
void vApplicationMallocFailedHook( void )
{
/* Called if a call to pvPortMalloc() fails because there is insufficient
free memory available in the FreeRTOS heap. pvPortMalloc() is called
internally by FreeRTOS API functions that create tasks, queues, software
timers, and semaphores. The size of the FreeRTOS heap is set by the
configTOTAL_HEAP_SIZE configuration constant in FreeRTOSConfig.h. */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;
/* Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationIdleHook( void )
{
volatile size_t xFreeHeapSpace;
/* This is just a trivial example of an idle hook. It is called on each
cycle of the idle task. It must *NOT* attempt to block. In this case the
idle task just queries the amount of FreeRTOS heap that remains. See the
memory management section on the http://www.FreeRTOS.org web site for memory
management options. If there is a lot of heap memory free then the
configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up
RAM. */
xFreeHeapSpace = xPortGetFreeHeapSize();
/* Remove compiler warning about xFreeHeapSpace being set but never used. */
( void ) xFreeHeapSpace;
}
/*-----------------------------------------------------------*/
void vAssertCalled( const char * pcFile, unsigned long ulLine )
{
volatile unsigned long ul = 0;
( void ) pcFile;
( void ) ulLine;
taskENTER_CRITICAL();
{
/* Set ul to a non-zero value using the debugger to step out of this
function. */
while( ul == 0 )
{
portNOP();
}
}
taskEXIT_CRITICAL();
}
/*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )
{
/* The full demo includes a software timer demo/test that requires
prodding periodically from the tick interrupt. */
vTimerPeriodicISRTests();
/* Call the periodic queue overwrite from ISR demo. */
vQueueOverwritePeriodicISRDemo();
/* Call the periodic event group from ISR demo. */
vPeriodicEventGroupsProcessing();
}
#endif
}
/*-----------------------------------------------------------*/
void *memcpy( void *pvDest, const void *pvSource, size_t ulBytes )
{
unsigned char *pcDest = ( unsigned char * ) pvDest, *pcSource = ( unsigned char * ) pvSource;
size_t x;
for( x = 0; x < ulBytes; x++ )
{
*pcDest = *pcSource;
pcDest++;
pcSource++;
}
return pvDest;
}
/*-----------------------------------------------------------*/
void *memset( void *pvDest, int iValue, size_t ulBytes )
{
unsigned char *pcDest = ( unsigned char * ) pvDest;
size_t x;
for( x = 0; x < ulBytes; x++ )
{
*pcDest = ( unsigned char ) iValue;
pcDest++;
}
return pvDest;
}
/*-----------------------------------------------------------*/
int memcmp( const void *pvMem1, const void *pvMem2, size_t ulBytes )
{
const unsigned char *pucMem1 = pvMem1, *pucMem2 = pvMem2;
size_t x;
for( x = 0; x < ulBytes; x++ )
{
if( pucMem1[ x ] != pucMem2[ x ] )
{
break;
}
}
return ulBytes - x;
}

@ -158,7 +158,7 @@ typedef volatile unsigned short REG16;
// External delay 1 ms function
#include "FreeRTOS.h"
#include "task.h"
#define Delay(ms) vTaskDelay(ms/portTICK_RATE_MS)
#define Delay(ms) vTaskDelay(ms/portTICK_PERIOD_MS)
//------------------------------------------------------------------------------
// Global functions

@ -82,7 +82,7 @@
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned long ) 48000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24000 ) )
#define configMAX_TASK_NAME_LEN ( 12 )

@ -123,7 +123,7 @@
/* The time between cycles of the 'check' functionality (defined within the
tick hook). */
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
#define mainCHECK_DELAY ( ( TickType_t ) 5000 / portTICK_PERIOD_MS )
/* The LCD task uses the sprintf function so requires a little more stack too. */
#define mainLCD_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 )
@ -163,7 +163,7 @@ static void prvLCDTask( void *pvParameters );
* Hook functions that can get called by the kernel. The 'check' functionality
* is implemented within the tick hook.
*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName );
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
/*
* The tick hook function as described in the comments at the top of this file.
@ -177,7 +177,7 @@ void vApplicationTickHook( void );
/*-----------------------------------------------------------*/
/* The queue used to send messages to the LCD task. */
static xQueueHandle xLCDQueue;
static QueueHandle_t xLCDQueue;
/*-----------------------------------------------------------*/
@ -280,7 +280,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pxTask;
( void ) pcTaskName;

@ -91,17 +91,17 @@
#define vInterruptOff() BOARD_USART_BASE->US_IDR = AT91C_US_TXRDY
/* Misc constants. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_BLOCK ( ( TickType_t ) 0 )
#define serNO_TIMEGUARD ( ( unsigned long ) 0 )
#define serNO_PERIPHERAL_B_SETUP ( ( unsigned long ) 0 )
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static QueueHandle_t xRxedChars;
static QueueHandle_t xCharsForTx;
/*-----------------------------------------------------------*/
@ -161,7 +161,7 @@ const Pin xUSART_Pins[] = { BOARD_PIN_USART_RXD, BOARD_PIN_USART_TXD };
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
@ -203,7 +203,7 @@ signed char *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )
{
/* Place the character in the queue of characters to be transmitted. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )

@ -112,16 +112,16 @@
/* The Tx task will transmit the sequence of characters at a pseudo random
interval. This is the maximum and minimum block time between sends. */
#define comTX_MAX_BLOCK_TIME ( ( portTickType ) 0x96 )
#define comTX_MIN_BLOCK_TIME ( ( portTickType ) 0x32 )
#define comOFFSET_TIME ( ( portTickType ) 3 )
#define comTX_MAX_BLOCK_TIME ( ( TickType_t ) 0x96 )
#define comTX_MIN_BLOCK_TIME ( ( TickType_t ) 0x32 )
#define comOFFSET_TIME ( ( TickType_t ) 3 )
/* We should find that each character can be queued for Tx immediately and we
don't have to block to send. */
#define comNO_BLOCK ( ( portTickType ) 0 )
#define comNO_BLOCK ( ( TickType_t ) 0 )
/* The Rx task will block on the Rx queue for a long period. */
#define comRX_BLOCK_TIME ( ( portTickType ) 0xffff )
#define comRX_BLOCK_TIME ( ( TickType_t ) 0xffff )
/* The sequence transmitted is from comFIRST_BYTE to and including comLAST_BYTE. */
#define comFIRST_BYTE ( 'A' )
@ -158,15 +158,15 @@ void vAltStartComTestTasks( unsigned portBASE_TYPE uxPriority, unsigned long ulB
xSerialPortInitMinimal( ulBaudRate, comBUFFER_LEN );
/* The Tx task is spawned with a lower priority than the Rx task. */
xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );
xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );
xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( TaskHandle_t * ) NULL );
xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION( vComTxTask, pvParameters )
{
signed char cByteToSend;
portTickType xTimeToWait;
TickType_t xTimeToWait;
/* Just to stop compiler warnings. */
( void ) pvParameters;

@ -127,8 +127,8 @@ typedef enum
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength );
xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength );
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength );
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime );
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime );
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime );
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime );
portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort );
void vSerialClose( xComPortHandle xPort );

@ -93,7 +93,7 @@ extern uint32_t SystemCoreClock;
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40960 ) )

@ -112,7 +112,7 @@ extern void main_full( void );
within this file. */
void vApplicationMallocFailedHook( void );
void vApplicationIdleHook( void );
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName );
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
void vApplicationTickHook( void );
/*-----------------------------------------------------------*/
@ -191,7 +191,7 @@ void vApplicationIdleHook( void )
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save