-
-/* Basic FreeRTOS definitions. */
-#include "projdefs.h"
-
-/* Application specific configuration options. */
-#include "FreeRTOSConfig.h"
-
-/* Definitions specific to the port being used. */
-#include "portable.h"
-
-
-
-
-
-
-
-/*
- * Check all the required application specific macros have been defined.
- * These macros are application specific and (as downloaded) are defined
- * within FreeRTOSConfig.h.
- */
-
-#ifndef configUSE_PREEMPTION
- #error Missing definition: configUSE_PREEMPTION should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef configUSE_IDLE_HOOK
- #error Missing definition: configUSE_IDLE_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef configUSE_TICK_HOOK
- #error Missing definition: configUSE_TICK_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef configUSE_CO_ROUTINES
- #error Missing definition: configUSE_CO_ROUTINES should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef INCLUDE_vTaskPrioritySet
- #error Missing definition: INCLUDE_vTaskPrioritySet should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef INCLUDE_uxTaskPriorityGet
- #error Missing definition: INCLUDE_uxTaskPriorityGet should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef INCLUDE_vTaskDelete
- #error Missing definition: INCLUDE_vTaskDelete should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef INCLUDE_vTaskCleanUpResources
- #error Missing definition: INCLUDE_vTaskCleanUpResources should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef INCLUDE_vTaskSuspend
- #error Missing definition: INCLUDE_vTaskSuspend should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef INCLUDE_vTaskDelayUntil
- #error Missing definition: INCLUDE_vTaskDelayUntil should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef INCLUDE_vTaskDelay
- #error Missing definition: INCLUDE_vTaskDelay should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#ifndef configUSE_16_BIT_TICKS
- #error Missing definition: configUSE_16_BIT_TICKS should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
-#endif
-
-#endif
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/croutine.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/croutine.h
deleted file mode 100644
index d3b52163d..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/croutine.h
+++ /dev/null
@@ -1,716 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-#ifndef CO_ROUTINE_H
-#define CO_ROUTINE_H
-
-#include "list.h"
-
-/* Used to hide the implementation of the co-routine control block. The
-control block structure however has to be included in the header due to
-the macro implementation of the co-routine functionality. */
-typedef void * xCoRoutineHandle;
-
-/* Defines the prototype to which co-routine functions must conform. */
-typedef void (*crCOROUTINE_CODE)( xCoRoutineHandle, unsigned portBASE_TYPE );
-
-typedef struct corCoRoutineControlBlock
-{
- crCOROUTINE_CODE pxCoRoutineFunction;
- xListItem xGenericListItem; /*< List item used to place the CRCB in ready and blocked queues. */
- xListItem xEventListItem; /*< List item used to place the CRCB in event lists. */
- unsigned portBASE_TYPE uxPriority; /*< The priority of the co-routine in relation to other co-routines. */
- unsigned portBASE_TYPE uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
- unsigned portSHORT uxState; /*< Used internally by the co-routine implementation. */
-} corCRCB; /* Co-routine control block. Note must be identical in size down to uxPriority with tskTCB. */
-
-/**
- * croutine. h
- *
- portBASE_TYPE xCoRoutineCreate(
- crCOROUTINE_CODE pxCoRoutineCode,
- unsigned portBASE_TYPE uxPriority,
- unsigned portBASE_TYPE uxIndex
- );
- *
- * Create a new co-routine and add it to the list of co-routines that are
- * ready to run.
- *
- * @param pxCoRoutineCode Pointer to the co-routine function. Co-routine
- * functions require special syntax - see the co-routine section of the WEB
- * documentation for more information.
- *
- * @param uxPriority The priority with respect to other co-routines at which
- * the co-routine will run.
- *
- * @param uxIndex Used to distinguish between different co-routines that
- * execute the same function. See the example below and the co-routine section
- * of the WEB documentation for further information.
- *
- * @return pdPASS if the co-routine was successfully created and added to a ready
- * list, otherwise an error code defined with ProjDefs.h.
- *
- * Example usage:
-
- // Co-routine to be created.
- void vFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- // This may not be necessary for const variables.
- static const char cLedToFlash[ 2 ] = { 5, 6 };
- static const portTickType xTimeToDelay[ 2 ] = { 200, 400 };
-
- // Must start every co-routine with a call to crSTART();
- crSTART( xHandle );
-
- for( ;; )
- {
- // This co-routine just delays for a fixed period, then toggles
- // an LED. Two co-routines are created using this function, so
- // the uxIndex parameter is used to tell the co-routine which
- // LED to flash and how long to delay. This assumes xQueue has
- // already been created.
- vParTestToggleLED( cLedToFlash[ uxIndex ] );
- crDELAY( xHandle, uxFlashRates[ uxIndex ] );
- }
-
- // Must end every co-routine with a call to crEND();
- crEND();
- }
-
- // Function that creates two co-routines.
- void vOtherFunction( void )
- {
- unsigned char ucParameterToPass;
- xTaskHandle xHandle;
-
- // Create two co-routines at priority 0. The first is given index 0
- // so (from the code above) toggles LED 5 every 200 ticks. The second
- // is given index 1 so toggles LED 6 every 400 ticks.
- for( uxIndex = 0; uxIndex < 2; uxIndex++ )
- {
- xCoRoutineCreate( vFlashCoRoutine, 0, uxIndex );
- }
- }
-
- * \defgroup xCoRoutineCreate xCoRoutineCreate
- * \ingroup Tasks
- */
-signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex );
-
-
-/**
- * croutine. h
- *
- void vCoRoutineSchedule( void );
- *
- * Run a co-routine.
- *
- * vCoRoutineSchedule() executes the highest priority co-routine that is able
- * to run. The co-routine will execute until it either blocks, yields or is
- * preempted by a task. Co-routines execute cooperatively so one
- * co-routine cannot be preempted by another, but can be preempted by a task.
- *
- * If an application comprises of both tasks and co-routines then
- * vCoRoutineSchedule should be called from the idle task (in an idle task
- * hook).
- *
- * Example usage:
-
- // This idle task hook will schedule a co-routine each time it is called.
- // The rest of the idle task will execute between co-routine calls.
- void vApplicationIdleHook( void )
- {
- vCoRoutineSchedule();
- }
-
- // Alternatively, if you do not require any other part of the idle task to
- // execute, the idle task hook can call vCoRoutineScheduler() within an
- // infinite loop.
- void vApplicationIdleHook( void )
- {
- for( ;; )
- {
- vCoRoutineSchedule();
- }
- }
-
- * \defgroup vCoRoutineSchedule vCoRoutineSchedule
- * \ingroup Tasks
- */
-void vCoRoutineSchedule( void );
-
-/**
- * croutine. h
- *
- crSTART( xCoRoutineHandle xHandle );
- *
- * This macro MUST always be called at the start of a co-routine function.
- *
- * Example usage:
-
- // Co-routine to be created.
- void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static portLONG ulAVariable;
-
- // Must start every co-routine with a call to crSTART();
- crSTART( xHandle );
-
- for( ;; )
- {
- // Co-routine functionality goes here.
- }
-
- // Must end every co-routine with a call to crEND();
- crEND();
- }
- * \defgroup crSTART crSTART
- * \ingroup Tasks
- */
-#define crSTART( pxCRCB ) switch( ( ( corCRCB * )pxCRCB )->uxState ) { case 0:
-
-/**
- * croutine. h
- *
- crEND();
- *
- * This macro MUST always be called at the end of a co-routine function.
- *
- * Example usage:
-
- // Co-routine to be created.
- void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static portLONG ulAVariable;
-
- // Must start every co-routine with a call to crSTART();
- crSTART( xHandle );
-
- for( ;; )
- {
- // Co-routine functionality goes here.
- }
-
- // Must end every co-routine with a call to crEND();
- crEND();
- }
- * \defgroup crSTART crSTART
- * \ingroup Tasks
- */
-#define crEND() }
-
-/*
- * These macros are intended for internal use by the co-routine implementation
- * only. The macros should not be used directly by application writers.
- */
-#define crSET_STATE0( xHandle ) ( ( corCRCB * )xHandle)->uxState = (__LINE__ * 2); return; case (__LINE__ * 2):
-#define crSET_STATE1( xHandle ) ( ( corCRCB * )xHandle)->uxState = ((__LINE__ * 2)+1); return; case ((__LINE__ * 2)+1):
-
-/**
- * croutine. h
- *
- crDELAY( xCoRoutineHandle xHandle, portTickType xTicksToDelay );
- *
- * Delay a co-routine for a fixed period of time.
- *
- * crDELAY can only be called from the co-routine function itself - not
- * from within a function called by the co-routine function. This is because
- * co-routines do not maintain their own stack.
- *
- * @param xHandle The handle of the co-routine to delay. This is the xHandle
- * parameter of the co-routine function.
- *
- * @param xTickToDelay The number of ticks that the co-routine should delay
- * for. The actual amount of time this equates to is defined by
- * configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant portTICK_RATE_MS
- * can be used to convert ticks to milliseconds.
- *
- * Example usage:
-
- // Co-routine to be created.
- void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- // This may not be necessary for const variables.
- // We are to delay for 200ms.
- static const xTickType xDelayTime = 200 / portTICK_RATE_MS;
-
- // Must start every co-routine with a call to crSTART();
- crSTART( xHandle );
-
- for( ;; )
- {
- // Delay for 200ms.
- crDELAY( xHandle, xDelayTime );
-
- // Do something here.
- }
-
- // Must end every co-routine with a call to crEND();
- crEND();
- }
- * \defgroup crDELAY crDELAY
- * \ingroup Tasks
- */
-#define crDELAY( xHandle, xTicksToDelay ) \
- if( xTicksToDelay > 0 ) \
- { \
- vCoRoutineAddToDelayedList( xTicksToDelay, NULL ); \
- } \
- crSET_STATE0( xHandle );
-
-/**
- *
- crQUEUE_SEND(
- xCoRoutineHandle xHandle,
- xQueueHandle pxQueue,
- void *pvItemToQueue,
- portTickType xTicksToWait,
- portBASE_TYPE *pxResult
- )
- *
- * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
- * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
- *
- * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas
- * xQueueSend() and xQueueReceive() can only be used from tasks.
- *
- * crQUEUE_SEND can only be called from the co-routine function itself - not
- * from within a function called by the co-routine function. This is because
- * co-routines do not maintain their own stack.
- *
- * See the co-routine section of the WEB documentation for information on
- * passing data between tasks and co-routines and between ISR's and
- * co-routines.
- *
- * @param xHandle The handle of the calling co-routine. This is the xHandle
- * parameter of the co-routine function.
- *
- * @param pxQueue The handle of the queue on which the data will be posted.
- * The handle is obtained as the return value when the queue is created using
- * the xQueueCreate() API function.
- *
- * @param pvItemToQueue A pointer to the data being posted onto the queue.
- * The number of bytes of each queued item is specified when the queue is
- * created. This number of bytes is copied from pvItemToQueue into the queue
- * itself.
- *
- * @param xTickToDelay The number of ticks that the co-routine should block
- * to wait for space to become available on the queue, should space not be
- * available immediately. The actual amount of time this equates to is defined
- * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant
- * portTICK_RATE_MS can be used to convert ticks to milliseconds (see example
- * below).
- *
- * @param pxResult The variable pointed to by pxResult will be set to pdPASS if
- * data was successfully posted onto the queue, otherwise it will be set to an
- * error defined within ProjDefs.h.
- *
- * Example usage:
-
- // Co-routine function that blocks for a fixed period then posts a number onto
- // a queue.
- static void prvCoRoutineFlashTask( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static portBASE_TYPE xNumberToPost = 0;
- static portBASE_TYPE xResult;
-
- // Co-routines must begin with a call to crSTART().
- crSTART( xHandle );
-
- for( ;; )
- {
- // This assumes the queue has already been created.
- crQUEUE_SEND( xHandle, xCoRoutineQueue, &xNumberToPost, NO_DELAY, &xResult );
-
- if( xResult != pdPASS )
- {
- // The message was not posted!
- }
-
- // Increment the number to be posted onto the queue.
- xNumberToPost++;
-
- // Delay for 100 ticks.
- crDELAY( xHandle, 100 );
- }
-
- // Co-routines must end with a call to crEND().
- crEND();
- }
- * \defgroup crQUEUE_SEND crQUEUE_SEND
- * \ingroup Tasks
- */
-#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
-{ \
- *pxResult = xQueueCRSend( pxQueue, pvItemToQueue, xTicksToWait ); \
- if( *pxResult == errQUEUE_BLOCKED ) \
- { \
- crSET_STATE0( xHandle ); \
- *pxResult = xQueueCRSend( pxQueue, pvItemToQueue, 0 ); \
- } \
- if( *pxResult == errQUEUE_YIELD ) \
- { \
- crSET_STATE1( xHandle ); \
- *pxResult = pdPASS; \
- } \
-}
-
-/**
- * croutine. h
- *
- crQUEUE_RECEIVE(
- xCoRoutineHandle xHandle,
- xQueueHandle pxQueue,
- void *pvBuffer,
- portTickType xTicksToWait,
- portBASE_TYPE *pxResult
- )
- *
- * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
- * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
- *
- * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas
- * xQueueSend() and xQueueReceive() can only be used from tasks.
- *
- * crQUEUE_RECEIVE can only be called from the co-routine function itself - not
- * from within a function called by the co-routine function. This is because
- * co-routines do not maintain their own stack.
- *
- * See the co-routine section of the WEB documentation for information on
- * passing data between tasks and co-routines and between ISR's and
- * co-routines.
- *
- * @param xHandle The handle of the calling co-routine. This is the xHandle
- * parameter of the co-routine function.
- *
- * @param pxQueue The handle of the queue from which the data will be received.
- * The handle is obtained as the return value when the queue is created using
- * the xQueueCreate() API function.
- *
- * @param pvBuffer The buffer into which the received item is to be copied.
- * The number of bytes of each queued item is specified when the queue is
- * created. This number of bytes is copied into pvBuffer.
- *
- * @param xTickToDelay The number of ticks that the co-routine should block
- * to wait for data to become available from the queue, should data not be
- * available immediately. The actual amount of time this equates to is defined
- * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant
- * portTICK_RATE_MS can be used to convert ticks to milliseconds (see the
- * crQUEUE_SEND example).
- *
- * @param pxResult The variable pointed to by pxResult will be set to pdPASS if
- * data was successfully retrieved from the queue, otherwise it will be set to
- * an error code as defined within ProjDefs.h.
- *
- * Example usage:
-
- // A co-routine receives the number of an LED to flash from a queue. It
- // blocks on the queue until the number is received.
- static void prvCoRoutineFlashWorkTask( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static portBASE_TYPE xResult;
- static unsigned portBASE_TYPE uxLEDToFlash;
-
- // All co-routines must start with a call to crSTART().
- crSTART( xHandle );
-
- for( ;; )
- {
- // Wait for data to become available on the queue.
- crQUEUE_RECEIVE( xHandle, xCoRoutineQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );
-
- if( xResult == pdPASS )
- {
- // We received the LED to flash - flash it!
- vParTestToggleLED( uxLEDToFlash );
- }
- }
-
- crEND();
- }
- * \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
- * \ingroup Tasks
- */
-#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
-{ \
- *pxResult = xQueueCRReceive( pxQueue, pvBuffer, xTicksToWait ); \
- if( *pxResult == errQUEUE_BLOCKED ) \
- { \
- crSET_STATE0( xHandle ); \
- *pxResult = xQueueCRReceive( pxQueue, pvBuffer, 0 ); \
- } \
- if( *pxResult == errQUEUE_YIELD ) \
- { \
- crSET_STATE1( xHandle ); \
- *pxResult = pdPASS; \
- } \
-}
-
-/**
- * croutine. h
- *
- crQUEUE_SEND_FROM_ISR(
- xQueueHandle pxQueue,
- void *pvItemToQueue,
- portBASE_TYPE xCoRoutinePreviouslyWoken
- )
- *
- * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
- * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
- * functions used by tasks.
- *
- * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to
- * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and
- * xQueueReceiveFromISR() can only be used to pass data between a task and and
- * ISR.
- *
- * crQUEUE_SEND_FROM_ISR can only be called from an ISR to send data to a queue
- * that is being used from within a co-routine.
- *
- * See the co-routine section of the WEB documentation for information on
- * passing data between tasks and co-routines and between ISR's and
- * co-routines.
- *
- * @param xQueue The handle to the queue on which the item is to be posted.
- *
- * @param pvItemToQueue A pointer to the item that is to be placed on the
- * queue. The size of the items the queue will hold was defined when the
- * queue was created, so this many bytes will be copied from pvItemToQueue
- * into the queue storage area.
- *
- * @param xCoRoutinePreviouslyWoken This is included so an ISR can post onto
- * the same queue multiple times from a single interrupt. The first call
- * should always pass in pdFALSE. Subsequent calls should pass in
- * the value returned from the previous call.
- *
- * @return pdTRUE if a co-routine was woken by posting onto the queue. This is
- * used by the ISR to determine if a context switch may be required following
- * the ISR.
- *
- * Example usage:
-
- // A co-routine that blocks on a queue waiting for characters to be received.
- static void vReceivingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- portCHAR cRxedChar;
- portBASE_TYPE xResult;
-
- // All co-routines must start with a call to crSTART().
- crSTART( xHandle );
-
- for( ;; )
- {
- // Wait for data to become available on the queue. This assumes the
- // queue xCommsRxQueue has already been created!
- crQUEUE_RECEIVE( xHandle, xCommsRxQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );
-
- // Was a character received?
- if( xResult == pdPASS )
- {
- // Process the character here.
- }
- }
-
- // All co-routines must end with a call to crEND().
- crEND();
- }
-
- // An ISR that uses a queue to send characters received on a serial port to
- // a co-routine.
- void vUART_ISR( void )
- {
- portCHAR cRxedChar;
- portBASE_TYPE xCRWokenByPost = pdFALSE;
-
- // We loop around reading characters until there are none left in the UART.
- while( UART_RX_REG_NOT_EMPTY() )
- {
- // Obtain the character from the UART.
- cRxedChar = UART_RX_REG;
-
- // Post the character onto a queue. xCRWokenByPost will be pdFALSE
- // the first time around the loop. If the post causes a co-routine
- // to be woken (unblocked) then xCRWokenByPost will be set to pdTRUE.
- // In this manner we can ensure that if more than one co-routine is
- // blocked on the queue only one is woken by this ISR no matter how
- // many characters are posted to the queue.
- xCRWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsRxQueue, &cRxedChar, xCRWokenByPost );
- }
- }
- * \defgroup crQUEUE_SEND_FROM_ISR crQUEUE_SEND_FROM_ISR
- * \ingroup Tasks
- */
-#define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) xQueueCRSendFromISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken )
-
-
-/**
- * croutine. h
- *
- crQUEUE_SEND_FROM_ISR(
- xQueueHandle pxQueue,
- void *pvBuffer,
- portBASE_TYPE * pxCoRoutineWoken
- )
- *
- * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
- * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
- * functions used by tasks.
- *
- * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to
- * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and
- * xQueueReceiveFromISR() can only be used to pass data between a task and and
- * ISR.
- *
- * crQUEUE_RECEIVE_FROM_ISR can only be called from an ISR to receive data
- * from a queue that is being used from within a co-routine (a co-routine
- * posted to the queue).
- *
- * See the co-routine section of the WEB documentation for information on
- * passing data between tasks and co-routines and between ISR's and
- * co-routines.
- *
- * @param xQueue The handle to the queue on which the item is to be posted.
- *
- * @param pvBuffer A pointer to a buffer into which the received item will be
- * placed. The size of the items the queue will hold was defined when the
- * queue was created, so this many bytes will be copied from the queue into
- * pvBuffer.
- *
- * @param pxCoRoutineWoken A co-routine may be blocked waiting for space to become
- * available on the queue. If crQUEUE_RECEIVE_FROM_ISR causes such a
- * co-routine to unblock *pxCoRoutineWoken will get set to pdTRUE, otherwise
- * *pxCoRoutineWoken will remain unchanged.
- *
- * @return pdTRUE an item was successfully received from the queue, otherwise
- * pdFALSE.
- *
- * Example usage:
-
- // A co-routine that posts a character to a queue then blocks for a fixed
- // period. The character is incremented each time.
- static void vSendingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
- {
- // cChar holds its value while this co-routine is blocked and must therefore
- // be declared static.
- static portCHAR cCharToTx = 'a';
- portBASE_TYPE xResult;
-
- // All co-routines must start with a call to crSTART().
- crSTART( xHandle );
-
- for( ;; )
- {
- // Send the next character to the queue.
- crQUEUE_SEND( xHandle, xCoRoutineQueue, &cCharToTx, NO_DELAY, &xResult );
-
- if( xResult == pdPASS )
- {
- // The character was successfully posted to the queue.
- }
- else
- {
- // Could not post the character to the queue.
- }
-
- // Enable the UART Tx interrupt to cause an interrupt in this
- // hypothetical UART. The interrupt will obtain the character
- // from the queue and send it.
- ENABLE_RX_INTERRUPT();
-
- // Increment to the next character then block for a fixed period.
- // cCharToTx will maintain its value across the delay as it is
- // declared static.
- cCharToTx++;
- if( cCharToTx > 'x' )
- {
- cCharToTx = 'a';
- }
- crDELAY( 100 );
- }
-
- // All co-routines must end with a call to crEND().
- crEND();
- }
-
- // An ISR that uses a queue to receive characters to send on a UART.
- void vUART_ISR( void )
- {
- portCHAR cCharToTx;
- portBASE_TYPE xCRWokenByPost = pdFALSE;
-
- while( UART_TX_REG_EMPTY() )
- {
- // Are there any characters in the queue waiting to be sent?
- // xCRWokenByPost will automatically be set to pdTRUE if a co-routine
- // is woken by the post - ensuring that only a single co-routine is
- // woken no matter how many times we go around this loop.
- if( crQUEUE_RECEIVE_FROM_ISR( pxQueue, &cCharToTx, &xCRWokenByPost ) )
- {
- SEND_CHARACTER( cCharToTx );
- }
- }
- }
- * \defgroup crQUEUE_RECEIVE_FROM_ISR crQUEUE_RECEIVE_FROM_ISR
- * \ingroup Tasks
- */
-#define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) xQueueCRReceiveFromISR( pxQueue, pvBuffer, pxCoRoutineWoken )
-
-/*
- * This function is intended for internal use by the co-routine macros only.
- * The macro nature of the co-routine implementation requires that the
- * prototype appears here. The function should not be used by application
- * writers.
- *
- * Removes the current co-routine from its ready list and places it in the
- * appropriate delayed list.
- */
-void vCoRoutineAddToDelayedList( portTickType xTicksToDelay, xList *pxEventList );
-
-/*
- * This function is intended for internal use by the queue implementation only.
- * The function should not be used by application writers.
- *
- * Removes the highest priority co-routine from the event list and places it in
- * the pending ready list.
- */
-signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList );
-
-
-#endif /* CO_ROUTINE_H */
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/list.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/list.h
deleted file mode 100644
index f3702c143..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/list.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-/*
- * This is the list implementation used by the scheduler. While it is tailored
- * heavily for the schedulers needs, it is also available for use by
- * application code.
- *
- * xLists can only store pointers to xListItems. Each xListItem contains a
- * numeric value (xItemValue). Most of the time the lists are sorted in
- * descending item value order.
- *
- * Lists are created already containing one list item. The value of this
- * item is the maximum possible that can be stored, it is therefore always at
- * the end of the list and acts as a marker. The list member pxHead always
- * points to this marker - even though it is at the tail of the list. This
- * is because the tail contains a wrap back pointer to the true head of
- * the list.
- *
- * In addition to it's value, each list item contains a pointer to the next
- * item in the list (pxNext), a pointer to the list it is in (pxContainer)
- * and a pointer to back to the object that contains it. These later two
- * pointers are included for efficiency of list manipulation. There is
- * effectively a two way link between the object containing the list item and
- * the list item itself.
- *
- *
- * \page ListIntroduction List Implementation
- * \ingroup FreeRTOSIntro
- */
-
-/*
- Changes from V4.3.1
-
- + Included local const within listGET_OWNER_OF_NEXT_ENTRY() to assist
- compiler with optimisation. Thanks B.R.
-*/
-
-#ifndef LIST_H
-#define LIST_H
-
-/*
- * Definition of the only type of object that a list can contain.
- */
-struct xLIST_ITEM
-{
- portTickType xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */
- volatile struct xLIST_ITEM * pxNext; /*< Pointer to the next xListItem in the list. */
- volatile struct xLIST_ITEM * pxPrevious;/*< Pointer to the previous xListItem in the list. */
- void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
- void * pvContainer; /*< Pointer to the list in which this list item is placed (if any). */
-};
-typedef struct xLIST_ITEM xListItem; /* For some reason lint wants this as two separate definitions. */
-
-struct xMINI_LIST_ITEM
-{
- portTickType xItemValue;
- volatile struct xLIST_ITEM *pxNext;
- volatile struct xLIST_ITEM *pxPrevious;
-};
-typedef struct xMINI_LIST_ITEM xMiniListItem;
-
-/*
- * Definition of the type of queue used by the scheduler.
- */
-typedef struct xLIST
-{
- volatile unsigned portBASE_TYPE uxNumberOfItems;
- volatile xListItem * pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to pvListGetOwnerOfNextEntry (). */
- volatile xMiniListItem xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
-} xList;
-
-/*
- * Access macro to set the owner of a list item. The owner of a list item
- * is the object (usually a TCB) that contains the list item.
- *
- * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
- * \ingroup LinkedList
- */
-#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( pxListItem )->pvOwner = ( void * ) pxOwner
-
-/*
- * Access macro to set the value of the list item. In most cases the value is
- * used to sort the list in descending order.
- *
- * \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
- * \ingroup LinkedList
- */
-#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( pxListItem )->xItemValue = xValue
-
-/*
- * Access macro the retrieve the value of the list item. The value can
- * represent anything - for example a the priority of a task, or the time at
- * which a task should be unblocked.
- *
- * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
- * \ingroup LinkedList
- */
-#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
-
-/*
- * Access macro to determine if a list contains any items. The macro will
- * only have the value true if the list is empty.
- *
- * \page listLIST_IS_EMPTY listLIST_IS_EMPTY
- * \ingroup LinkedList
- */
-#define listLIST_IS_EMPTY( pxList ) ( ( pxList )->uxNumberOfItems == ( unsigned portBASE_TYPE ) 0 )
-
-/*
- * Access macro to return the number of items in the list.
- */
-#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
-
-/*
- * Access function to obtain the owner of the next entry in a list.
- *
- * The list member pxIndex is used to walk through a list. Calling
- * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list
- * and returns that entries pxOwner parameter. Using multiple calls to this
- * function it is therefore possible to move through every item contained in
- * a list.
- *
- * The pxOwner parameter of a list item is a pointer to the object that owns
- * the list item. In the scheduler this is normally a task control block.
- * The pxOwner parameter effectively creates a two way link between the list
- * item and its owner.
- *
- * @param pxList The list from which the next item owner is to be returned.
- *
- * \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
- * \ingroup LinkedList
- */
-#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
-{ \
-xList * const pxConstList = pxList; \
- /* Increment the index to the next item and return the item, ensuring */ \
- /* we don't return the marker used at the end of the list. */ \
- ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
- if( ( pxConstList )->pxIndex == ( xListItem * ) &( ( pxConstList )->xListEnd ) ) \
- { \
- ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
- } \
- pxTCB = ( pxConstList )->pxIndex->pvOwner; \
-}
-
-
-/*
- * Access function to obtain the owner of the first entry in a list. Lists
- * are normally sorted in ascending item value order.
- *
- * This function returns the pxOwner member of the first item in the list.
- * The pxOwner parameter of a list item is a pointer to the object that owns
- * the list item. In the scheduler this is normally a task control block.
- * The pxOwner parameter effectively creates a two way link between the list
- * item and its owner.
- *
- * @param pxList The list from which the owner of the head item is to be
- * returned.
- *
- * \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
- * \ingroup LinkedList
- */
-#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( pxList->uxNumberOfItems != ( unsigned portBASE_TYPE ) 0 ) ? ( (&( pxList->xListEnd ))->pxNext->pvOwner ) : ( NULL ) )
-
-/*
- * Check to see if a list item is within a list. The list item maintains a
- * "container" pointer that points to the list it is in. All this macro does
- * is check to see if the container and the list match.
- *
- * @param pxList The list we want to know if the list item is within.
- * @param pxListItem The list item we want to know if is in the list.
- * @return pdTRUE is the list item is in the list, otherwise pdFALSE.
- * pointer against
- */
-#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( pxListItem )->pvContainer == ( void * ) pxList )
-
-/*
- * Must be called before a list is used! This initialises all the members
- * of the list structure and inserts the xListEnd item into the list as a
- * marker to the back of the list.
- *
- * @param pxList Pointer to the list being initialised.
- *
- * \page vListInitialise vListInitialise
- * \ingroup LinkedList
- */
-void vListInitialise( xList *pxList );
-
-/*
- * Must be called before a list item is used. This sets the list container to
- * null so the item does not think that it is already contained in a list.
- *
- * @param pxItem Pointer to the list item being initialised.
- *
- * \page vListInitialiseItem vListInitialiseItem
- * \ingroup LinkedList
- */
-void vListInitialiseItem( xListItem *pxItem );
-
-/*
- * Insert a list item into a list. The item will be inserted into the list in
- * a position determined by its item value (descending item value order).
- *
- * @param pxList The list into which the item is to be inserted.
- *
- * @param pxNewListItem The item to that is to be placed in the list.
- *
- * \page vListInsert vListInsert
- * \ingroup LinkedList
- */
-void vListInsert( xList *pxList, xListItem *pxNewListItem );
-
-/*
- * Insert a list item into a list. The item will be inserted in a position
- * such that it will be the last item within the list returned by multiple
- * calls to listGET_OWNER_OF_NEXT_ENTRY.
- *
- * The list member pvIndex is used to walk through a list. Calling
- * listGET_OWNER_OF_NEXT_ENTRY increments pvIndex to the next item in the list.
- * Placing an item in a list using vListInsertEnd effectively places the item
- * in the list position pointed to by pvIndex. This means that every other
- * item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before
- * the pvIndex parameter again points to the item being inserted.
- *
- * @param pxList The list into which the item is to be inserted.
- *
- * @param pxNewListItem The list item to be inserted into the list.
- *
- * \page vListInsertEnd vListInsertEnd
- * \ingroup LinkedList
- */
-void vListInsertEnd( xList *pxList, xListItem *pxNewListItem );
-
-/*
- * Remove an item from a list. The list item has a pointer to the list that
- * it is in, so only the list item need be passed into the function.
- *
- * @param vListRemove The item to be removed. The item will remove itself from
- * the list pointed to by it's pxContainer parameter.
- *
- * \page vListRemove vListRemove
- * \ingroup LinkedList
- */
-void vListRemove( xListItem *pxItemToRemove );
-
-
-
-#endif
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/portable.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/portable.h
deleted file mode 100644
index 80bac44a0..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/portable.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http:www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http:www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-/*-----------------------------------------------------------
- * Portable layer API. Each function must be defined for each port.
- *----------------------------------------------------------*/
-
-#ifndef PORTABLE_H
-#define PORTABLE_H
-
-/* Include the macro file relevant to the port being used. */
-
-#ifdef SAM7_GCC
- #include "FreeRTOS/portable/GCC/ARM7_AT91SAM7S/portmacro.h"
-#endif
-
-/*
- * Setup the stack of a new task so it is ready to be placed under the
- * scheduler control. The registers have to be placed on the stack in
- * the order that the port expects to find them.
- */
-portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );
-
-/*
- * Map to the memory management routines required for the port.
- */
-void *pvPortMalloc( size_t xSize );
-void vPortFree( void *pv );
-void vPortInitialiseBlocks( void );
-
-/*
- * Setup the hardware ready for the scheduler to take control. This generally
- * sets up a tick interrupt and sets timers for the correct tick frequency.
- */
-portBASE_TYPE xPortStartScheduler( void );
-
-/*
- * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
- * the hardware is left in its original condition after the scheduler stops
- * executing.
- */
-void vPortEndScheduler( void );
-
-#endif /* PORTABLE_H */
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/projdefs.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/projdefs.h
deleted file mode 100644
index 37a662229..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/projdefs.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-#ifndef PROJDEFS_H
-#define PROJDEFS_H
-
-/* Defines to prototype to which task functions must conform. */
-typedef void (*pdTASK_CODE)( void * );
-
-#define pdTRUE ( 1 )
-#define pdFALSE ( 0 )
-
-#define pdPASS ( 1 )
-#define pdFAIL ( 0 )
-#define errQUEUE_EMPTY ( 0 )
-#define errQUEUE_FULL ( 0 )
-
-/* Error definitions. */
-#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
-#define errNO_TASK_TO_RUN ( -2 )
-#define errQUEUE_BLOCKED ( -4 )
-#define errQUEUE_YIELD ( -5 )
-
-#endif /* PROJDEFS_H */
-
-
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/queue.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/queue.h
deleted file mode 100644
index 4a6c9a660..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/queue.h
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-#ifndef QUEUE_H
-#define QUEUE_H
-
-typedef void * xQueueHandle;
-
-/**
- * queue. h
- *
- xQueueHandle xQueueCreate(
- unsigned portBASE_TYPE uxQueueLength,
- unsigned portBASE_TYPE uxItemSize
- );
- *
- *
- * Creates a new queue instance. This allocates the storage required by the
- * new queue and returns a handle for the queue.
- *
- * @param uxQueueLength The maximum number of items that the queue can contain.
- *
- * @param uxItemSize The number of bytes each item in the queue will require.
- * Items are queued by copy, not by reference, so this is the number of bytes
- * that will be copied for each posted item. Each item on the queue must be
- * the same size.
- *
- * @return If the queue is successfully create then a handle to the newly
- * created queue is returned. If the queue cannot be created then 0 is
- * returned.
- *
- * Example usage:
-
- struct AMessage
- {
- portCHAR ucMessageID;
- portCHAR ucData[ 20 ];
- };
-
- void vATask( void *pvParameters )
- {
- xQueueHandle xQueue1, xQueue2;
-
- // Create a queue capable of containing 10 unsigned long values.
- xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );
- if( xQueue1 == 0 )
- {
- // Queue was not created and must not be used.
- }
-
- // Create a queue capable of containing 10 pointers to AMessage structures.
- // These should be passed by pointer as they contain a lot of data.
- xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
- if( xQueue2 == 0 )
- {
- // Queue was not created and must not be used.
- }
-
- // ... Rest of task code.
- }
-
- * \defgroup xQueueCreate xQueueCreate
- * \ingroup QueueManagement
- */
-xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBASE_TYPE uxItemSize );
-
-/**
- * queue. h
- *
- portBASE_TYPE xQueueSend(
- xQueueHandle xQueue,
- const void * pvItemToQueue,
- portTickType xTicksToWait
- );
- *
- *
- * Post an item on a queue. The item is queued by copy, not by reference.
- * This function must not be called from an interrupt service routine.
- * See xQueueSendFromISR () for an alternative which may be used in an ISR.
- *
- * @param xQueue The handle to the queue on which the item is to be posted.
- *
- * @param pvItemToQueue A pointer to the item that is to be placed on the
- * queue. The size of the items the queue will hold was defined when the
- * queue was created, so this many bytes will be copied from pvItemToQueue
- * into the queue storage area.
- *
- * @param xTicksToWait The maximum amount of time the task should block
- * waiting for space to become available on the queue, should it already
- * be full. The call will return immediately if this is set to 0. The
- * time is defined in tick periods so the constant portTICK_RATE_MS
- * should be used to convert to real time if this is required.
- *
- * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
- *
- * Example usage:
-
- struct AMessage
- {
- portCHAR ucMessageID;
- portCHAR ucData[ 20 ];
- } xMessage;
-
- unsigned portLONG ulVar = 10UL;
-
- void vATask( void *pvParameters )
- {
- xQueueHandle xQueue1, xQueue2;
- struct AMessage *pxMessage;
-
- // Create a queue capable of containing 10 unsigned long values.
- xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );
-
- // Create a queue capable of containing 10 pointers to AMessage structures.
- // These should be passed by pointer as they contain a lot of data.
- xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
-
- // ...
-
- if( xQueue1 != 0 )
- {
- // Send an unsigned long. Wait for 10 ticks for space to become
- // available if necessary.
- if( xQueueSend( xQueue1, ( void * ) &ulVar, ( portTickType ) 10 ) != pdPASS )
- {
- // Failed to post the message, even after 10 ticks.
- }
- }
-
- if( xQueue2 != 0 )
- {
- // Send a pointer to a struct AMessage object. Don't block if the
- // queue is already full.
- pxMessage = & xMessage;
- xQueueSend( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0 );
- }
-
- // ... Rest of task code.
- }
-
- * \defgroup xQueueSend xQueueSend
- * \ingroup QueueManagement
- */
-signed portBASE_TYPE xQueueSend( xQueueHandle xQueue, const void * pvItemToQueue, portTickType xTicksToWait );
-
-/**
- * queue. h
- *
- portBASE_TYPE xQueueReceive(
- xQueueHandle xQueue,
- void *pvBuffer,
- portTickType xTicksToWait
- );
- *
- * Receive an item from a queue. The item is received by copy so a buffer of
- * adequate size must be provided. The number of bytes copied into the buffer
- * was defined when the queue was created.
- *
- * This function must not be used in an interrupt service routine. See
- * xQueueReceiveFromISR for an alternative that can.
- *
- * @param pxQueue The handle to the queue from which the item is to be
- * received.
- *
- * @param pvBuffer Pointer to the buffer into which the received item will
- * be copied.
- *
- * @param xTicksToWait The maximum amount of time the task should block
- * waiting for an item to receive should the queue be empty at the time
- * of the call. The time is defined in tick periods so the constant
- * portTICK_RATE_MS should be used to convert to real time if this is required.
- *
- * @return pdTRUE if an item was successfully received from the queue,
- * otherwise pdFALSE.
- *
- * Example usage:
-
- struct AMessage
- {
- portCHAR ucMessageID;
- portCHAR ucData[ 20 ];
- } xMessage;
-
- xQueueHandle xQueue;
-
- // Task to create a queue and post a value.
- void vATask( void *pvParameters )
- {
- struct AMessage *pxMessage;
-
- // Create a queue capable of containing 10 pointers to AMessage structures.
- // These should be passed by pointer as they contain a lot of data.
- xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
- if( xQueue == 0 )
- {
- // Failed to create the queue.
- }
-
- // ...
-
- // Send a pointer to a struct AMessage object. Don't block if the
- // queue is already full.
- pxMessage = & xMessage;
- xQueueSend( xQueue, ( void * ) &pxMessage, ( portTickType ) 0 );
-
- // ... Rest of task code.
- }
-
- // Task to receive from the queue.
- void vADifferentTask( void *pvParameters )
- {
- struct AMessage *pxRxedMessage;
-
- if( xQueue != 0 )
- {
- // Receive a message on the created queue. Block for 10 ticks if a
- // message is not immediately available.
- if( xQueueReceive( xQueue, &( pxRxedMessage ), ( portTickType ) 10 ) )
- {
- // pcRxedMessage now points to the struct AMessage variable posted
- // by vATask.
- }
- }
-
- // ... Rest of task code.
- }
-
- * \defgroup xQueueReceive xQueueReceive
- * \ingroup QueueManagement
- */
-signed portBASE_TYPE xQueueReceive( xQueueHandle xQueue, void *pvBuffer, portTickType xTicksToWait );
-
-/**
- * queue. h
- * unsigned portBASE_TYPE uxQueueMessagesWaiting( xQueueHandle xQueue );
- *
- * Return the number of messages stored in a queue.
- *
- * @param xQueue A handle to the queue being queried.
- *
- * @return The number of messages available in the queue.
- *
- * \page uxQueueMessagesWaiting uxQueueMessagesWaiting
- * \ingroup QueueManagement
- */
-unsigned portBASE_TYPE uxQueueMessagesWaiting( xQueueHandle xQueue );
-
-/**
- * queue. h
- * void vQueueDelete( xQueueHandle xQueue );
- *
- * Delete a queue - freeing all the memory allocated for storing of items
- * placed on the queue.
- *
- * @param xQueue A handle to the queue to be deleted.
- *
- * \page vQueueDelete vQueueDelete
- * \ingroup QueueManagement
- */
-void vQueueDelete( xQueueHandle xQueue );
-
-/**
- * queue. h
- *
- portBASE_TYPE xQueueSendFromISR(
- xQueueHandle pxQueue,
- const void *pvItemToQueue,
- portBASE_TYPE xTaskPreviouslyWoken
- );
-
- *
- * Post an item on a queue. It is safe to use this function from within an
- * interrupt service routine.
- *
- * Items are queued by copy not reference so it is preferable to only
- * queue small items, especially when called from an ISR. In most cases
- * it would be preferable to store a pointer to the item being queued.
- *
- * @param xQueue The handle to the queue on which the item is to be posted.
- *
- * @param pvItemToQueue A pointer to the item that is to be placed on the
- * queue. The size of the items the queue will hold was defined when the
- * queue was created, so this many bytes will be copied from pvItemToQueue
- * into the queue storage area.
- *
- * @param cTaskPreviouslyWoken This is included so an ISR can post onto
- * the same queue multiple times from a single interrupt. The first call
- * should always pass in pdFALSE. Subsequent calls should pass in
- * the value returned from the previous call. See the file serial .c in the
- * PC port for a good example of this mechanism.
- *
- * @return pdTRUE if a task was woken by posting onto the queue. This is
- * used by the ISR to determine if a context switch may be required following
- * the ISR.
- *
- * Example usage for buffered IO (where the ISR can obtain more than one value
- * per call):
-
- void vBufferISR( void )
- {
- portCHAR cIn;
- portBASE_TYPE xTaskWokenByPost;
-
- // We have not woken a task at the start of the ISR.
- cTaskWokenByPost = pdFALSE;
-
- // Loop until the buffer is empty.
- do
- {
- // Obtain a byte from the buffer.
- cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
-
- // Post the byte. The first time round the loop cTaskWokenByPost
- // will be pdFALSE. If the queue send causes a task to wake we do
- // not want the task to run until we have finished the ISR, so
- // xQueueSendFromISR does not cause a context switch. Also we
- // don't want subsequent posts to wake any other tasks, so we store
- // the return value back into cTaskWokenByPost so xQueueSendFromISR
- // knows not to wake any task the next iteration of the loop.
- xTaskWokenByPost = xQueueSendFromISR( xRxQueue, &cIn, cTaskWokenByPost );
-
- } while( portINPUT_BYTE( BUFFER_COUNT ) );
-
- // Now the buffer is empty we can switch context if necessary.
- if( cTaskWokenByPost )
- {
- taskYIELD ();
- }
- }
-
- *
- * \defgroup xQueueSendFromISR xQueueSendFromISR
- * \ingroup QueueManagement
- */
-signed portBASE_TYPE xQueueSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken );
-
-/**
- * queue. h
- *
- portBASE_TYPE xQueueReceiveFromISR(
- xQueueHandle pxQueue,
- void *pvBuffer,
- portBASE_TYPE *pxTaskWoken
- );
- *
- *
- * Receive an item from a queue. It is safe to use this function from within an
- * interrupt service routine.
- *
- * @param pxQueue The handle to the queue from which the item is to be
- * received.
- *
- * @param pvBuffer Pointer to the buffer into which the received item will
- * be copied.
- *
- * @param pxTaskWoken A task may be blocked waiting for space to become
- * available on the queue. If xQueueReceiveFromISR causes such a task to
- * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
- * remain unchanged.
- *
- * @return pdTRUE if an item was successfully received from the queue,
- * otherwise pdFALSE.
- *
- * Example usage:
-
-
- xQueueHandle xQueue;
-
- // Function to create a queue and post some values.
- void vAFunction( void *pvParameters )
- {
- portCHAR cValueToPost;
- const portTickType xBlockTime = ( portTickType )0xff;
-
- // Create a queue capable of containing 10 characters.
- xQueue = xQueueCreate( 10, sizeof( portCHAR ) );
- if( xQueue == 0 )
- {
- // Failed to create the queue.
- }
-
- // ...
-
- // Post some characters that will be used within an ISR. If the queue
- // is full then this task will block for xBlockTime ticks.
- cValueToPost = 'a';
- xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );
- cValueToPost = 'b';
- xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );
-
- // ... keep posting characters ... this task may block when the queue
- // becomes full.
-
- cValueToPost = 'c';
- xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );
- }
-
- // ISR that outputs all the characters received on the queue.
- void vISR_Routine( void )
- {
- portBASE_TYPE xTaskWokenByReceive = pdFALSE;
- portCHAR cRxedChar;
-
- while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
- {
- // A character was received. Output the character now.
- vOutputCharacter( cRxedChar );
-
- // If removing the character from the queue woke the task that was
- // posting onto the queue cTaskWokenByReceive will have been set to
- // pdTRUE. No matter how many times this loop iterates only one
- // task will be woken.
- }
-
- if( cTaskWokenByPost != ( portCHAR ) pdFALSE;
- {
- taskYIELD ();
- }
- }
-
- * \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
- * \ingroup QueueManagement
- */
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, void *pvBuffer, signed portBASE_TYPE *pxTaskWoken );
-
-
-/*
- * The functions defined above are for passing data to and from tasks. The
- * functions below are the equivalents for passing data to and from
- * co-rtoutines.
- *
- * These functions are called from the co-routine macro implementation and
- * should not be called directly from application code. Instead use the macro
- * wrappers defined within croutine.h.
- */
-signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken );
-signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle pxQueue, void *pvBuffer, signed portBASE_TYPE *pxTaskWoken );
-signed portBASE_TYPE xQueueCRSend( xQueueHandle pxQueue, const void *pvItemToQueue, portTickType xTicksToWait );
-signed portBASE_TYPE xQueueCRReceive( xQueueHandle pxQueue, void *pvBuffer, portTickType xTicksToWait );
-
-#endif
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/semphr.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/semphr.h
deleted file mode 100644
index bae09c746..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/semphr.h
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-#include "queue.h"
-
-#ifndef SEMAPHORE_H
-#define SEMAPHORE_H
-
-typedef xQueueHandle xSemaphoreHandle;
-
-#define semBINARY_SEMAPHORE_QUEUE_LENGTH ( ( unsigned portCHAR ) 1 )
-#define semSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned portCHAR ) 0 )
-#define semGIVE_BLOCK_TIME ( ( portTickType ) 0 )
-
-
-/**
- * semphr. h
- * vSemaphoreCreateBinary( xSemaphoreHandle xSemaphore )
- *
- * Macro that implements a semaphore by using the existing queue mechanism.
- * The queue length is 1 as this is a binary semaphore. The data size is 0
- * as we don't want to actually store any data - we just want to know if the
- * queue is empty or full.
- *
- * @param xSemaphore Handle to the created semaphore. Should be of type xSemaphoreHandle.
- *
- * Example usage:
-
- xSemaphoreHandle xSemaphore;
-
- void vATask( void * pvParameters )
- {
- // Semaphore cannot be used before a call to vSemaphoreCreateBinary ().
- // This is a macro so pass the variable in directly.
- vSemaphoreCreateBinary( xSemaphore );
-
- if( xSemaphore != NULL )
- {
- // The semaphore was created successfully.
- // The semaphore can now be used.
- }
- }
-
- * \defgroup vSemaphoreCreateBinary vSemaphoreCreateBinary
- * \ingroup Semaphores
- */
-#define vSemaphoreCreateBinary( xSemaphore ) { \
- xSemaphore = xQueueCreate( ( unsigned portCHAR ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH ); \
- if( xSemaphore != NULL ) \
- { \
- xSemaphoreGive( xSemaphore ); \
- } \
- }
-
-/**
- * semphr. h
- * xSemaphoreTake(
- * xSemaphoreHandle xSemaphore,
- * portTickType xBlockTime
- * )
- *
- * Macro to obtain a semaphore. The semaphore must of been created using
- * vSemaphoreCreateBinary ().
- *
- * @param xSemaphore A handle to the semaphore being obtained. This is the
- * handle returned by vSemaphoreCreateBinary ();
- *
- * @param xBlockTime The time in ticks to wait for the semaphore to become
- * available. The macro portTICK_RATE_MS can be used to convert this to a
- * real time. A block time of zero can be used to poll the semaphore.
- *
- * @return pdTRUE if the semaphore was obtained. pdFALSE if xBlockTime
- * expired without the semaphore becoming available.
- *
- * Example usage:
-
- xSemaphoreHandle xSemaphore = NULL;
-
- // A task that creates a semaphore.
- void vATask( void * pvParameters )
- {
- // Create the semaphore to guard a shared resource.
- vSemaphoreCreateBinary( xSemaphore );
- }
-
- // A task that uses the semaphore.
- void vAnotherTask( void * pvParameters )
- {
- // ... Do other things.
-
- if( xSemaphore != NULL )
- {
- // See if we can obtain the semaphore. If the semaphore is not available
- // wait 10 ticks to see if it becomes free.
- if( xSemaphoreTake( xSemaphore, ( portTickType ) 10 ) == pdTRUE )
- {
- // We were able to obtain the semaphore and can now access the
- // shared resource.
-
- // ...
-
- // We have finished accessing the shared resource. Release the
- // semaphore.
- xSemaphoreGive( xSemaphore );
- }
- else
- {
- // We could not obtain the semaphore and can therefore not access
- // the shared resource safely.
- }
- }
- }
-
- * \defgroup xSemaphoreTake xSemaphoreTake
- * \ingroup Semaphores
- */
-#define xSemaphoreTake( xSemaphore, xBlockTime ) xQueueReceive( ( xQueueHandle ) xSemaphore, NULL, xBlockTime )
-
-/**
- * semphr. h
- * xSemaphoreGive( xSemaphoreHandle xSemaphore )
- *
- * Macro to release a semaphore. The semaphore must of been created using
- * vSemaphoreCreateBinary (), and obtained using sSemaphoreTake ().
- *
- * This must not be used from an ISR. See xSemaphoreGiveFromISR () for
- * an alternative which can be used from an ISR.
- *
- * @param xSemaphore A handle to the semaphore being released. This is the
- * handle returned by vSemaphoreCreateBinary ();
- *
- * @return pdTRUE if the semaphore was released. pdFALSE if an error occurred.
- * Semaphores are implemented using queues. An error can occur if there is
- * no space on the queue to post a message - indicating that the
- * semaphore was not first obtained correctly.
- *
- * Example usage:
-
- xSemaphoreHandle xSemaphore = NULL;
-
- void vATask( void * pvParameters )
- {
- // Create the semaphore to guard a shared resource.
- vSemaphoreCreateBinary( xSemaphore );
-
- if( xSemaphore != NULL )
- {
- if( xSemaphoreGive( xSemaphore ) != pdTRUE )
- {
- // We would expect this call to fail because we cannot give
- // a semaphore without first "taking" it!
- }
-
- // Obtain the semaphore - don't block if the semaphore is not
- // immediately available.
- if( xSemaphoreTake( xSemaphore, ( portTickType ) 0 ) )
- {
- // We now have the semaphore and can access the shared resource.
-
- // ...
-
- // We have finished accessing the shared resource so can free the
- // semaphore.
- if( xSemaphoreGive( xSemaphore ) != pdTRUE )
- {
- // We would not expect this call to fail because we must have
- // obtained the semaphore to get here.
- }
- }
- }
- }
-
- * \defgroup xSemaphoreGive xSemaphoreGive
- * \ingroup Semaphores
- */
-#define xSemaphoreGive( xSemaphore ) xQueueSend( ( xQueueHandle ) xSemaphore, NULL, semGIVE_BLOCK_TIME )
-
-/**
- * semphr. h
- *
- xSemaphoreGiveFromISR(
- xSemaphoreHandle xSemaphore,
- portSHORT sTaskPreviouslyWoken
- )
- *
- * Macro to release a semaphore. The semaphore must of been created using
- * vSemaphoreCreateBinary (), and obtained using xSemaphoreTake ().
- *
- * This macro can be used from an ISR.
- *
- * @param xSemaphore A handle to the semaphore being released. This is the
- * handle returned by vSemaphoreCreateBinary ();
- *
- * @param sTaskPreviouslyWoken This is included so an ISR can make multiple calls
- * to xSemaphoreGiveFromISR () from a single interrupt. The first call
- * should always pass in pdFALSE. Subsequent calls should pass in
- * the value returned from the previous call. See the file serial .c in the
- * PC port for a good example of using xSemaphoreGiveFromISR ().
- *
- * @return pdTRUE if a task was woken by releasing the semaphore. This is
- * used by the ISR to determine if a context switch may be required following
- * the ISR.
- *
- * Example usage:
-
- #define LONG_TIME 0xffff
- #define TICKS_TO_WAIT 10
- xSemaphoreHandle xSemaphore = NULL;
-
- // Repetitive task.
- void vATask( void * pvParameters )
- {
- for( ;; )
- {
- // We want this task to run every 10 ticks or a timer. The semaphore
- // was created before this task was started
-
- // Block waiting for the semaphore to become available.
- if( xSemaphoreTake( xSemaphore, LONG_TIME ) == pdTRUE )
- {
- // It is time to execute.
-
- // ...
-
- // We have finished our task. Return to the top of the loop where
- // we will block on the semaphore until it is time to execute
- // again.
- }
- }
- }
-
- // Timer ISR
- void vTimerISR( void * pvParameters )
- {
- static unsigned portCHAR ucLocalTickCount = 0;
-
- // A timer tick has occurred.
-
- // ... Do other time functions.
-
- // Is it time for vATask () to run?
- ucLocalTickCount++;
- if( ucLocalTickCount >= TICKS_TO_WAIT )
- {
- // Unblock the task by releasing the semaphore.
- xSemaphoreGive( xSemaphore );
-
- // Reset the count so we release the semaphore again in 10 ticks time.
- ucLocalTickCount = 0;
- }
- }
-
- * \defgroup xSemaphoreGiveFromISR xSemaphoreGiveFromISR
- * \ingroup Semaphores
- */
-#define xSemaphoreGiveFromISR( xSemaphore, xTaskPreviouslyWoken ) xQueueSendFromISR( ( xQueueHandle ) xSemaphore, NULL, xTaskPreviouslyWoken )
-
-
-#endif
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/task.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/task.h
deleted file mode 100644
index 5103f3c2b..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/include/task.h
+++ /dev/null
@@ -1,970 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-/*
-Changes since V4.3.1:
-
- + Added xTaskGetSchedulerState() function.
-*/
-
-#ifndef TASK_H
-#define TASK_H
-
-#include "portable.h"
-#include "list.h"
-
-/*-----------------------------------------------------------
- * MACROS AND DEFINITIONS
- *----------------------------------------------------------*/
-
-#define tskKERNEL_VERSION_NUMBER "V4.4.0"
-
-/**
- * task. h
- *
- * Type by which tasks are referenced. For example, a call to xTaskCreate
- * returns (via a pointer parameter) an xTaskHandle variable that can then
- * be used as a parameter to vTaskDelete to delete the task.
- *
- * \page xTaskHandle xTaskHandle
- * \ingroup Tasks
- */
-typedef void * xTaskHandle;
-
-/*
- * Used internally only.
- */
-typedef struct xTIME_OUT
-{
- portBASE_TYPE xOverflowCount;
- portTickType xTimeOnEntering;
-} xTimeOutType;
-
-/*
- * Defines the priority used by the idle task. This must not be modified.
- *
- * \ingroup TaskUtils
- */
-#define tskIDLE_PRIORITY ( ( unsigned portBASE_TYPE ) 0 )
-
-/**
- * task. h
- *
- * Macro for forcing a context switch.
- *
- * \page taskYIELD taskYIELD
- * \ingroup SchedulerControl
- */
-#define taskYIELD() portYIELD()
-
-/**
- * task. h
- *
- * Macro to mark the start of a critical code region. Preemptive context
- * switches cannot occur when in a critical region.
- *
- * NOTE: This may alter the stack (depending on the portable implementation)
- * so must be used with care!
- *
- * \page taskENTER_CRITICAL taskENTER_CRITICAL
- * \ingroup SchedulerControl
- */
-#define taskENTER_CRITICAL() portENTER_CRITICAL()
-
-/**
- * task. h
- *
- * Macro to mark the end of a critical code region. Preemptive context
- * switches cannot occur when in a critical region.
- *
- * NOTE: This may alter the stack (depending on the portable implementation)
- * so must be used with care!
- *
- * \page taskEXIT_CRITICAL taskEXIT_CRITICAL
- * \ingroup SchedulerControl
- */
-#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
-
-/**
- * task. h
- *
- * Macro to disable all maskable interrupts.
- *
- * \page taskDISABLE_INTERRUPTS taskDISABLE_INTERRUPTS
- * \ingroup SchedulerControl
- */
-#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
-
-/**
- * task. h
- *
- * Macro to enable microcontroller interrupts.
- *
- * \page taskENABLE_INTERRUPTS taskENABLE_INTERRUPTS
- * \ingroup SchedulerControl
- */
-#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
-
-/* Definitions returned by xTaskGetSchedulerState(). */
-#define taskSCHEDULER_NOT_STARTED 0
-#define taskSCHEDULER_RUNNING 1
-#define taskSCHEDULER_SUSPENDED 2
-
-/*-----------------------------------------------------------
- * TASK CREATION API
- *----------------------------------------------------------*/
-
-/**
- * task. h
- *
- portBASE_TYPE xTaskCreate(
- pdTASK_CODE pvTaskCode,
- const portCHAR * const pcName,
- unsigned portSHORT usStackDepth,
- void *pvParameters,
- unsigned portBASE_TYPE uxPriority,
- xTaskHandle *pvCreatedTask
- );
- *
- * Create a new task and add it to the list of tasks that are ready to run.
- *
- * @param pvTaskCode Pointer to the task entry function. Tasks
- * must be implemented to never return (i.e. continuous loop).
- *
- * @param pcName A descriptive name for the task. This is mainly used to
- * facilitate debugging. Max length defined by tskMAX_TASK_NAME_LEN - default
- * is 16.
- *
- * @param usStackDepth The size of the task stack specified as the number of
- * variables the stack can hold - not the number of bytes. For example, if
- * the stack is 16 bits wide and usStackDepth is defined as 100, 200 bytes
- * will be allocated for stack storage.
- *
- * @param pvParameters Pointer that will be used as the parameter for the task
- * being created.
- *
- * @param uxPriority The priority at which the task should run.
- *
- * @param pvCreatedTask Used to pass back a handle by which the created task
- * can be referenced.
- *
- * @return pdPASS if the task was successfully created and added to a ready
- * list, otherwise an error code defined in the file errors. h
- *
- * Example usage:
-
- // Task to be created.
- void vTaskCode( void * pvParameters )
- {
- for( ;; )
- {
- // Task code goes here.
- }
- }
-
- // Function that creates a task.
- void vOtherFunction( void )
- {
- unsigned char ucParameterToPass;
- xTaskHandle xHandle;
-
- // Create the task, storing the handle.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, &ucParameterToPass, tskIDLE_PRIORITY, &xHandle );
-
- // Use the handle to delete the task.
- vTaskDelete( xHandle );
- }
-
- * \defgroup xTaskCreate xTaskCreate
- * \ingroup Tasks
- */
-signed portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pvCreatedTask );
-
-/**
- * task. h
- * void vTaskDelete( xTaskHandle pxTask );
- *
- * INCLUDE_vTaskDelete must be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * Remove a task from the RTOS real time kernels management. The task being
- * deleted will be removed from all ready, blocked, suspended and event lists.
- *
- * NOTE: The idle task is responsible for freeing the kernel allocated
- * memory from tasks that have been deleted. It is therefore important that
- * the idle task is not starved of microcontroller processing time if your
- * application makes any calls to vTaskDelete (). Memory allocated by the
- * task code is not automatically freed, and should be freed before the task
- * is deleted.
- *
- * See the demo application file death.c for sample code that utilises
- * vTaskDelete ().
- *
- * @param pxTask The handle of the task to be deleted. Passing NULL will
- * cause the calling task to be deleted.
- *
- * Example usage:
-
- void vOtherFunction( void )
- {
- xTaskHandle xHandle;
-
- // Create the task, storing the handle.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
-
- // Use the handle to delete the task.
- vTaskDelete( xHandle );
- }
-
- * \defgroup vTaskDelete vTaskDelete
- * \ingroup Tasks
- */
-void vTaskDelete( xTaskHandle pxTask );
-
-
-/*-----------------------------------------------------------
- * TASK CONTROL API
- *----------------------------------------------------------*/
-
-/**
- * task. h
- * void vTaskDelay( portTickType xTicksToDelay );
- *
- * Delay a task for a given number of ticks. The actual time that the
- * task remains blocked depends on the tick rate. The constant
- * portTICK_RATE_MS can be used to calculate real time from the tick
- * rate - with the resolution of one tick period.
- *
- * INCLUDE_vTaskDelay must be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * @param xTicksToDelay The amount of time, in tick periods, that
- * the calling task should block.
- *
- * Example usage:
-
- // Wait 10 ticks before performing an action.
- // NOTE:
- // This is for demonstration only and would be better achieved
- // using vTaskDelayUntil ().
- void vTaskFunction( void * pvParameters )
- {
- portTickType xDelay, xNextTime;
-
- // Calc the time at which we want to perform the action
- // next.
- xNextTime = xTaskGetTickCount () + ( portTickType ) 10;
-
- for( ;; )
- {
- xDelay = xNextTime - xTaskGetTickCount ();
- xNextTime += ( portTickType ) 10;
-
- // Guard against overflow
- if( xDelay <= ( portTickType ) 10 )
- {
- vTaskDelay( xDelay );
- }
-
- // Perform action here.
- }
- }
-
- * \defgroup vTaskDelay vTaskDelay
- * \ingroup TaskCtrl
- */
-void vTaskDelay( portTickType xTicksToDelay );
-
-/**
- * task. h
- * void vTaskDelayUntil( portTickType *pxPreviousWakeTime, portTickType xTimeIncrement );
- *
- * INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * Delay a task until a specified time. This function can be used by cyclical
- * tasks to ensure a constant execution frequency.
- *
- * This function differs from vTaskDelay () in one important aspect: vTaskDelay () will
- * cause a task to block for the specified number of ticks from the time vTaskDelay () is
- * called. It is therefore difficult to use vTaskDelay () by itself to generate a fixed
- * execution frequency as the time between a task starting to execute and that task
- * calling vTaskDelay () may not be fixed [the task may take a different path though the
- * code between calls, or may get interrupted or preempted a different number of times
- * each time it executes].
- *
- * Whereas vTaskDelay () specifies a wake time relative to the time at which the function
- * is called, vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to
- * unblock.
- *
- * The constant portTICK_RATE_MS can be used to calculate real time from the tick
- * rate - with the resolution of one tick period.
- *
- * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the
- * task was last unblocked. The variable must be initialised with the current time
- * prior to its first use (see the example below). Following this the variable is
- * automatically updated within vTaskDelayUntil ().
- *
- * @param xTimeIncrement The cycle time period. The task will be unblocked at
- * time *pxPreviousWakeTime + xTimeIncrement. Calling vTaskDelayUntil with the
- * same xTimeIncrement parameter value will cause the task to execute with
- * a fixed interface period.
- *
- * Example usage:
-
- // Perform an action every 10 ticks.
- void vTaskFunction( void * pvParameters )
- {
- portTickType xLastWakeTime;
- const portTickType xFrequency = 10;
-
- // Initialise the xLastWakeTime variable with the current time.
- xLastWakeTime = xTaskGetTickCount ();
- for( ;; )
- {
- // Wait for the next cycle.
- vTaskDelayUntil( &xLastWakeTime, xFrequency );
-
- // Perform action here.
- }
- }
-
- * \defgroup vTaskDelayUntil vTaskDelayUntil
- * \ingroup TaskCtrl
- */
-void vTaskDelayUntil( portTickType *pxPreviousWakeTime, portTickType xTimeIncrement );
-
-/**
- * task. h
- * unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask );
- *
- * INCLUDE_xTaskPriorityGet must be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * Obtain the priority of any task.
- *
- * @param pxTask Handle of the task to be queried. Passing a NULL
- * handle results in the priority of the calling task being returned.
- *
- * @return The priority of pxTask.
- *
- * Example usage:
-
- void vAFunction( void )
- {
- xTaskHandle xHandle;
-
- // Create a task, storing the handle.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
-
- // ...
-
- // Use the handle to obtain the priority of the created task.
- // It was created with tskIDLE_PRIORITY, but may have changed
- // it itself.
- if( uxTaskPriorityGet( xHandle ) != tskIDLE_PRIORITY )
- {
- // The task has changed it's priority.
- }
-
- // ...
-
- // Is our priority higher than the created task?
- if( uxTaskPriorityGet( xHandle ) < uxTaskPriorityGet( NULL ) )
- {
- // Our priority (obtained using NULL handle) is higher.
- }
- }
-
- * \defgroup uxTaskPriorityGet uxTaskPriorityGet
- * \ingroup TaskCtrl
- */
-unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask );
-
-/**
- * task. h
- * void vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority );
- *
- * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * Set the priority of any task.
- *
- * A context switch will occur before the function returns if the priority
- * being set is higher than the currently executing task.
- *
- * @param pxTask Handle to the task for which the priority is being set.
- * Passing a NULL handle results in the priority of the calling task being set.
- *
- * @param uxNewPriority The priority to which the task will be set.
- *
- * Example usage:
-
- void vAFunction( void )
- {
- xTaskHandle xHandle;
-
- // Create a task, storing the handle.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
-
- // ...
-
- // Use the handle to raise the priority of the created task.
- vTaskPrioritySet( xHandle, tskIDLE_PRIORITY + 1 );
-
- // ...
-
- // Use a NULL handle to raise our priority to the same value.
- vTaskPrioritySet( NULL, tskIDLE_PRIORITY + 1 );
- }
-
- * \defgroup vTaskPrioritySet vTaskPrioritySet
- * \ingroup TaskCtrl
- */
-void vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority );
-
-/**
- * task. h
- * void vTaskSuspend( xTaskHandle pxTaskToSuspend );
- *
- * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * Suspend any task. When suspended a task will never get any microcontroller
- * processing time, no matter what its priority.
- *
- * Calls to vTaskSuspend are not accumulative -
- * i.e. calling vTaskSuspend () twice on the same task still only requires one
- * call to vTaskResume () to ready the suspended task.
- *
- * @param pxTaskToSuspend Handle to the task being suspended. Passing a NULL
- * handle will cause the calling task to be suspended.
- *
- * Example usage:
-
- void vAFunction( void )
- {
- xTaskHandle xHandle;
-
- // Create a task, storing the handle.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
-
- // ...
-
- // Use the handle to suspend the created task.
- vTaskSuspend( xHandle );
-
- // ...
-
- // The created task will not run during this period, unless
- // another task calls vTaskResume( xHandle ).
-
- //...
-
-
- // Suspend ourselves.
- vTaskSuspend( NULL );
-
- // We cannot get here unless another task calls vTaskResume
- // with our handle as the parameter.
- }
-
- * \defgroup vTaskSuspend vTaskSuspend
- * \ingroup TaskCtrl
- */
-void vTaskSuspend( xTaskHandle pxTaskToSuspend );
-
-/**
- * task. h
- * void vTaskResume( xTaskHandle pxTaskToResume );
- *
- * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * Resumes a suspended task.
- *
- * A task that has been suspended by one of more calls to vTaskSuspend ()
- * will be made available for running again by a single call to
- * vTaskResume ().
- *
- * @param pxTaskToResume Handle to the task being readied.
- *
- * Example usage:
-
- void vAFunction( void )
- {
- xTaskHandle xHandle;
-
- // Create a task, storing the handle.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
-
- // ...
-
- // Use the handle to suspend the created task.
- vTaskSuspend( xHandle );
-
- // ...
-
- // The created task will not run during this period, unless
- // another task calls vTaskResume( xHandle ).
-
- //...
-
-
- // Resume the suspended task ourselves.
- vTaskResume( xHandle );
-
- // The created task will once again get microcontroller processing
- // time in accordance with it priority within the system.
- }
-
- * \defgroup vTaskResume vTaskResume
- * \ingroup TaskCtrl
- */
-void vTaskResume( xTaskHandle pxTaskToResume );
-
-/**
- * task. h
- * void xTaskResumeFromISR( xTaskHandle pxTaskToResume );
- *
- * INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be
- * available. See the configuration section for more information.
- *
- * An implementation of vTaskResume() that can be called from within an ISR.
- *
- * A task that has been suspended by one of more calls to vTaskSuspend ()
- * will be made available for running again by a single call to
- * xTaskResumeFromISR ().
- *
- * @param pxTaskToResume Handle to the task being readied.
- *
- * \defgroup vTaskResumeFromISR vTaskResumeFromISR
- * \ingroup TaskCtrl
- */
-portBASE_TYPE xTaskResumeFromISR( xTaskHandle pxTaskToResume );
-
-/*-----------------------------------------------------------
- * SCHEDULER CONTROL
- *----------------------------------------------------------*/
-
-/**
- * task. h
- * void vTaskStartScheduler( void );
- *
- * Starts the real time kernel tick processing. After calling the kernel
- * has control over which tasks are executed and when. This function
- * does not return until an executing task calls vTaskEndScheduler ().
- *
- * At least one task should be created via a call to xTaskCreate ()
- * before calling vTaskStartScheduler (). The idle task is created
- * automatically when the first application task is created.
- *
- * See the demo application file main.c for an example of creating
- * tasks and starting the kernel.
- *
- * Example usage:
-
- void vAFunction( void )
- {
- // Create at least one task before starting the kernel.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
-
- // Start the real time kernel with preemption.
- vTaskStartScheduler ();
-
- // Will not get here unless a task calls vTaskEndScheduler ()
- }
-
- *
- * \defgroup vTaskStartScheduler vTaskStartScheduler
- * \ingroup SchedulerControl
- */
-void vTaskStartScheduler( void );
-
-/**
- * task. h
- * void vTaskEndScheduler( void );
- *
- * Stops the real time kernel tick. All created tasks will be automatically
- * deleted and multitasking (either preemptive or cooperative) will
- * stop. Execution then resumes from the point where vTaskStartScheduler ()
- * was called, as if vTaskStartScheduler () had just returned.
- *
- * See the demo application file main. c in the demo/PC directory for an
- * example that uses vTaskEndScheduler ().
- *
- * vTaskEndScheduler () requires an exit function to be defined within the
- * portable layer (see vPortEndScheduler () in port. c for the PC port). This
- * performs hardware specific operations such as stopping the kernel tick.
- *
- * vTaskEndScheduler () will cause all of the resources allocated by the
- * kernel to be freed - but will not free resources allocated by application
- * tasks.
- *
- * Example usage:
-
- void vTaskCode( void * pvParameters )
- {
- for( ;; )
- {
- // Task code goes here.
-
- // At some point we want to end the real time kernel processing
- // so call ...
- vTaskEndScheduler ();
- }
- }
-
- void vAFunction( void )
- {
- // Create at least one task before starting the kernel.
- xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
-
- // Start the real time kernel with preemption.
- vTaskStartScheduler ();
-
- // Will only get here when the vTaskCode () task has called
- // vTaskEndScheduler (). When we get here we are back to single task
- // execution.
- }
-
- *
- * \defgroup vTaskEndScheduler vTaskEndScheduler
- * \ingroup SchedulerControl
- */
-void vTaskEndScheduler( void );
-
-/**
- * task. h
- * void vTaskSuspendAll( void );
- *
- * Suspends all real time kernel activity while keeping interrupts (including the
- * kernel tick) enabled.
- *
- * After calling vTaskSuspendAll () the calling task will continue to execute
- * without risk of being swapped out until a call to xTaskResumeAll () has been
- * made.
- *
- * Example usage:
-
- void vTask1( void * pvParameters )
- {
- for( ;; )
- {
- // Task code goes here.
-
- // ...
-
- // At some point the task wants to perform a long operation during
- // which it does not want to get swapped out. It cannot use
- // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
- // operation may cause interrupts to be missed - including the
- // ticks.
-
- // Prevent the real time kernel swapping out the task.
- vTaskSuspendAll ();
-
- // Perform the operation here. There is no need to use critical
- // sections as we have all the microcontroller processing time.
- // During this time interrupts will still operate and the kernel
- // tick count will be maintained.
-
- // ...
-
- // The operation is complete. Restart the kernel.
- xTaskResumeAll ();
- }
- }
-
- * \defgroup vTaskSuspendAll vTaskSuspendAll
- * \ingroup SchedulerControl
- */
-void vTaskSuspendAll( void );
-
-/**
- * task. h
- * portCHAR xTaskResumeAll( void );
- *
- * Resumes real time kernel activity following a call to vTaskSuspendAll ().
- * After a call to vTaskSuspendAll () the kernel will take control of which
- * task is executing at any time.
- *
- * @return If resuming the scheduler caused a context switch then pdTRUE is
- * returned, otherwise pdFALSE is returned.
- *
- * Example usage:
-
- void vTask1( void * pvParameters )
- {
- for( ;; )
- {
- // Task code goes here.
-
- // ...
-
- // At some point the task wants to perform a long operation during
- // which it does not want to get swapped out. It cannot use
- // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
- // operation may cause interrupts to be missed - including the
- // ticks.
-
- // Prevent the real time kernel swapping out the task.
- vTaskSuspendAll ();
-
- // Perform the operation here. There is no need to use critical
- // sections as we have all the microcontroller processing time.
- // During this time interrupts will still operate and the real
- // time kernel tick count will be maintained.
-
- // ...
-
- // The operation is complete. Restart the kernel. We want to force
- // a context switch - but there is no point if resuming the scheduler
- // caused a context switch already.
- if( !xTaskResumeAll () )
- {
- taskYIELD ();
- }
- }
- }
-
- * \defgroup xTaskResumeAll xTaskResumeAll
- * \ingroup SchedulerControl
- */
-signed portBASE_TYPE xTaskResumeAll( void );
-
-
-/*-----------------------------------------------------------
- * TASK UTILITIES
- *----------------------------------------------------------*/
-
-/**
- * task. h
- * volatile portTickType xTaskGetTickCount( void );
- *
- * @return The count of ticks since vTaskStartScheduler was called.
- *
- * \page xTaskGetTickCount xTaskGetTickCount
- * \ingroup TaskUtils
- */
-portTickType xTaskGetTickCount( void );
-
-/**
- * task. h
- * unsigned portSHORT uxTaskGetNumberOfTasks( void );
- *
- * @return The number of tasks that the real time kernel is currently managing.
- * This includes all ready, blocked and suspended tasks. A task that
- * has been deleted but not yet freed by the idle task will also be
- * included in the count.
- *
- * \page uxTaskGetNumberOfTasks uxTaskGetNumberOfTasks
- * \ingroup TaskUtils
- */
-unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void );
-
-/**
- * task. h
- * void vTaskList( portCHAR *pcWriteBuffer );
- *
- * configUSE_TRACE_FACILITY, INCLUDE_vTaskDelete and INCLUDE_vTaskSuspend
- * must all be defined as 1 for this function to be available.
- * See the configuration section for more information.
- *
- * NOTE: This function will disable interrupts for its duration. It is
- * not intended for normal application runtime use but as a debug aid.
- *
- * Lists all the current tasks, along with their current state and stack
- * usage high water mark.
- *
- * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or
- * suspended ('S').
- *
- * @param pcWriteBuffer A buffer into which the above mentioned details
- * will be written, in ascii form. This buffer is assumed to be large
- * enough to contain the generated report. Approximately 40 bytes per
- * task should be sufficient.
- *
- * \page vTaskList vTaskList
- * \ingroup TaskUtils
- */
-void vTaskList( signed portCHAR *pcWriteBuffer );
-
-/**
- * task. h
- * void vTaskStartTrace( portCHAR * pcBuffer, unsigned portBASE_TYPE uxBufferSize );
- *
- * Starts a real time kernel activity trace. The trace logs the identity of
- * which task is running when.
- *
- * The trace file is stored in binary format. A separate DOS utility called
- * convtrce.exe is used to convert this into a tab delimited text file which
- * can be viewed and plotted in a spread sheet.
- *
- * @param pcBuffer The buffer into which the trace will be written.
- *
- * @param ulBufferSize The size of pcBuffer in bytes. The trace will continue
- * until either the buffer in full, or ulTaskEndTrace () is called.
- *
- * \page vTaskStartTrace vTaskStartTrace
- * \ingroup TaskUtils
- */
-void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize );
-
-/**
- * task. h
- * unsigned portLONG ulTaskEndTrace( void );
- *
- * Stops a kernel activity trace. See vTaskStartTrace ().
- *
- * @return The number of bytes that have been written into the trace buffer.
- *
- * \page usTaskEndTrace usTaskEndTrace
- * \ingroup TaskUtils
- */
-unsigned portLONG ulTaskEndTrace( void );
-
-
-/*-----------------------------------------------------------
- * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
- *----------------------------------------------------------*/
-
-/*
- * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
- * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
- * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
- *
- * Called from the real time kernel tick (either preemptive or cooperative),
- * this increments the tick count and checks if any tasks that are blocked
- * for a finite period required removing from a blocked list and placing on
- * a ready list.
- */
-inline void vTaskIncrementTick( void );
-
-/*
- * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
- * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
- *
- * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
- *
- * Removes the calling task from the ready list and places it both
- * on the list of tasks waiting for a particular event, and the
- * list of delayed tasks. The task will be removed from both lists
- * and replaced on the ready list should either the event occur (and
- * there be no higher priority tasks waiting on the same event) or
- * the delay period expires.
- *
- * @param pxEventList The list containing tasks that are blocked waiting
- * for the event to occur.
- *
- * @param xTicksToWait The maximum amount of time that the task should wait
- * for the event to occur. This is specified in kernel ticks,the constant
- * portTICK_RATE_MS can be used to convert kernel ticks into a real time
- * period.
- */
-void vTaskPlaceOnEventList( xList *pxEventList, portTickType xTicksToWait );
-
-/*
- * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
- * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
- *
- * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
- *
- * Removes a task from both the specified event list and the list of blocked
- * tasks, and places it on a ready queue.
- *
- * xTaskRemoveFromEventList () will be called if either an event occurs to
- * unblock a task, or the block timeout period expires.
- *
- * @return pdTRUE if the task being removed has a higher priority than the task
- * making the call, otherwise pdFALSE.
- */
-signed portBASE_TYPE xTaskRemoveFromEventList( const xList *pxEventList );
-
-/*
- * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
- * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
- *
- * INCLUDE_vTaskCleanUpResources and INCLUDE_vTaskSuspend must be defined as 1
- * for this function to be available.
- * See the configuration section for more information.
- *
- * Empties the ready and delayed queues of task control blocks, freeing the
- * memory allocated for the task control block and task stacks as it goes.
- */
-void vTaskCleanUpResources( void );
-
-/*
- * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
- * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
- * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
- *
- * Sets the pointer to the current TCB to the TCB of the highest priority task
- * that is ready to run.
- */
-inline void vTaskSwitchContext( void );
-
-/*
- * Return the handle of the calling task.
- */
-xTaskHandle xTaskGetCurrentTaskHandle( void );
-
-/*
- * Capture the current time status for future reference.
- */
-void vTaskSetTimeOutState( xTimeOutType *pxTimeOut );
-
-/*
- * Compare the time status now with that previously captured to see if the
- * timeout has expired.
- */
-portBASE_TYPE xTaskCheckForTimeOut( xTimeOutType *pxTimeOut, portTickType * const pxTicksToWait );
-
-/*
- * Shortcut used by the queue implementation to prevent unnecessary call to
- * taskYIELD();
- */
-void vTaskMissedYield( void );
-
-/*
- * Returns the scheduler state as taskSCHEDULER_RUNNING,
- * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED.
- */
-portBASE_TYPE xTaskGetSchedulerState( void );
-
-#endif /* TASK_H */
-
-
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/list.c b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/list.c
deleted file mode 100644
index 3faa8b4e4..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/list.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-/*
-Changes from V1.2.0
-
- + Removed the volatile modifier from the function parameters. This was
- only ever included to prevent compiler warnings. Now warnings are
- removed by casting parameters where the calls are made.
-
- + prvListGetOwnerOfNextEntry() and prvListGetOwnerOfHeadEntry() have been
- removed from the c file and added as macros to the h file.
-
- + uxNumberOfItems has been added to the list structure. This removes the
- need for a pointer comparison when checking if a list is empty, and so
- is slightly faster.
-
- + Removed the NULL check in vListRemove(). This makes the call faster but
- necessitates any application code utilising the list implementation to
- ensure NULL pointers are not passed.
-
-Changes from V2.0.0
-
- + Double linked the lists to allow faster removal item removal.
-
-Changes from V2.6.1
-
- + Make use of the new portBASE_TYPE definition where ever appropriate.
-
-Changes from V3.0.0
-
- + API changes as described on the FreeRTOS.org WEB site.
-
-Changes from V3.2.4
-
- + Removed the pxHead member of the xList structure. This always pointed
- to the same place so has been removed to free a few bytes of RAM.
-
- + Introduced the xMiniListItem structure that does not include the
- xListItem members that are not required by the xListEnd member of a list.
- Again this was done to reduce RAM usage.
-
- + Changed the volatile definitions of some structure members to clean up
- the code where the list structures are used.
-
-Changes from V4.0.4
-
- + Optimised vListInsert() in the case when the wake time is the maximum
- tick count value.
-*/
-
-#include
-#include "FreeRTOS.h"
-#include "list.h"
-
-/*-----------------------------------------------------------
- * PUBLIC LIST API documented in list.h
- *----------------------------------------------------------*/
-
-void vListInitialise( xList *pxList )
-{
- /* The list structure contains a list item which is used to mark the
- end of the list. To initialise the list the list end is inserted
- as the only list entry. */
- pxList->pxIndex = ( xListItem * ) &( pxList->xListEnd );
-
- /* The list end value is the highest possible value in the list to
- ensure it remains at the end of the list. */
- pxList->xListEnd.xItemValue = portMAX_DELAY;
-
- /* The list end next and previous pointers point to itself so we know
- when the list is empty. */
- pxList->xListEnd.pxNext = ( xListItem * ) &( pxList->xListEnd );
- pxList->xListEnd.pxPrevious = ( xListItem * ) &( pxList->xListEnd );
-
- pxList->uxNumberOfItems = 0;
-}
-/*-----------------------------------------------------------*/
-
-void vListInitialiseItem( xListItem *pxItem )
-{
- /* Make sure the list item is not recorded as being on a list. */
- pxItem->pvContainer = NULL;
-}
-/*-----------------------------------------------------------*/
-
-void vListInsertEnd( xList *pxList, xListItem *pxNewListItem )
-{
-volatile xListItem * pxIndex;
-
- /* Insert a new list item into pxList, but rather than sort the list,
- makes the new list item the last item to be removed by a call to
- pvListGetOwnerOfNextEntry. This means it has to be the item pointed to by
- the pxIndex member. */
- pxIndex = pxList->pxIndex;
-
- pxNewListItem->pxNext = pxIndex->pxNext;
- pxNewListItem->pxPrevious = pxList->pxIndex;
- pxIndex->pxNext->pxPrevious = ( volatile xListItem * ) pxNewListItem;
- pxIndex->pxNext = ( volatile xListItem * ) pxNewListItem;
- pxList->pxIndex = ( volatile xListItem * ) pxNewListItem;
-
- /* Remember which list the item is in. */
- pxNewListItem->pvContainer = ( void * ) pxList;
-
- ( pxList->uxNumberOfItems )++;
-}
-/*-----------------------------------------------------------*/
-
-void vListInsert( xList *pxList, xListItem *pxNewListItem )
-{
-volatile xListItem *pxIterator;
-portTickType xValueOfInsertion;
-
- /* Insert the new list item into the list, sorted in ulListItem order. */
- xValueOfInsertion = pxNewListItem->xItemValue;
-
- /* If the list already contains a list item with the same item value then
- the new list item should be placed after it. This ensures that TCB's which
- are stored in ready lists (all of which have the same ulListItem value)
- get an equal share of the CPU. However, if the xItemValue is the same as
- the back marker the iteration loop below will not end. This means we need
- to guard against this by checking the value first and modifying the
- algorithm slightly if necessary. */
- if( xValueOfInsertion == portMAX_DELAY )
- {
- pxIterator = pxList->xListEnd.pxPrevious;
- }
- else
- {
- for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
- {
- /* There is nothing to do here, we are just iterating to the
- wanted insertion position. */
- }
- }
-
- pxNewListItem->pxNext = pxIterator->pxNext;
- pxNewListItem->pxNext->pxPrevious = ( volatile xListItem * ) pxNewListItem;
- pxNewListItem->pxPrevious = pxIterator;
- pxIterator->pxNext = ( volatile xListItem * ) pxNewListItem;
-
- /* Remember which list the item is in. This allows fast removal of the
- item later. */
- pxNewListItem->pvContainer = ( void * ) pxList;
-
- ( pxList->uxNumberOfItems )++;
-}
-/*-----------------------------------------------------------*/
-
-void vListRemove( xListItem *pxItemToRemove )
-{
-xList * pxList;
-
- pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
- pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
-
- /* The list item knows which list it is in. Obtain the list from the list
- item. */
- pxList = ( xList * ) pxItemToRemove->pvContainer;
-
- /* Make sure the index is left pointing to a valid item. */
- if( pxList->pxIndex == pxItemToRemove )
- {
- pxList->pxIndex = pxItemToRemove->pxPrevious;
- }
-
- pxItemToRemove->pvContainer = NULL;
- ( pxList->uxNumberOfItems )--;
-}
-/*-----------------------------------------------------------*/
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/port.c b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/port.c
deleted file mode 100644
index 797cb5078..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/port.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * MODBUS Library: SAM7X Port
- * Copyright (c) 2007 Christian Walter
- * All rights reserved.
- *
- * $Id$
- */
-/*
- * FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
- *
- * This file is part of the FreeRTOS.org distribution.
- *
- * FreeRTOS.org is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * FreeRTOS.org 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. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FreeRTOS.org; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * A special exception to the GPL can be applied should you wish to distribute
- * a combined work that includes FreeRTOS.org, without being obliged to provide
- * the source code for any proprietary components. See the licensing section
- * of http://www.FreeRTOS.org for full details of how and when the exception
- * can be applied.
- *
- ****************************************************************************
- * See http://www.FreeRTOS.org for documentation, latest information, license
- * and contact details. Please ensure to read the configuration and relevant
- * port sections of the online documentation.
- *
- * Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- * with commercial development and support options.
- ***************************************************************************
- */
-
-/* ----------------------- System includes ----------------------------------*/
-#include
-
-/* ----------------------- FreeRTOS includes --------------------------------*/
-#include "FreeRTOS.h"
-#include "task.h"
-
-/* ----------------------- Platform includes --------------------------------*/
-#include "AT91SAM7X256.h"
-#include "lib_AT91SAM7X256.h"
-
-/* ----------------------- Defines ------------------------------------------*/
-#define portINITIAL_SPSR ( ( portSTACK_TYPE ) 0x1f )
-#define portTHUMB_MODE_BIT ( ( portSTACK_TYPE ) 0x20 )
-#define portINSTRUCTION_SIZE ( ( portSTACK_TYPE ) 4 )
-#define portNO_CRITICAL_SECTION_NESTING ( ( portSTACK_TYPE ) 0 )
-
-/*
-#define portPRESCALE_VALUE 0x00
-#define portINTERRUPT_ON_MATCH ( ( unsigned portLONG ) 0x01 )
-#define portRESET_COUNT_ON_MATCH ( ( unsigned portLONG ) 0x02 )
-
-#define portPIT_CLOCK_DIVISOR ( ( unsigned portLONG ) 16 )
-#define portPIT_COUNTER_VALUE ( ( ( configCPU_CLOCK_HZ / portPIT_CLOCK_DIVISOR ) / 1000UL ) * portTICK_RATE_MS )
-
-#define portINT_LEVEL_SENSITIVE 0
-#define portPIT_ENABLE ( ( unsigned portSHORT ) 0x1 << 24 )
-#define portPIT_INT_ENABLE ( ( unsigned portSHORT ) 0x1 << 25 )
-*/
-
-/* ----------------------- Type definitions ---------------------------------*/
-
-/* ----------------------- Static variables ---------------------------------*/
-
-/* ----------------------- Function prototypes ------------------------------*/
-extern void vPortISRStartFirstTask( void );
-extern void vNonPreemptiveTick ( void );
-extern void vPreemptiveTick( void );
-
-/* ----------------------- Static functions ---------------------------------*/
-static void prvSetupTimerInterrupt( void );
-
-/* ----------------------- Start implementation -----------------------------*/
-
-portSTACK_TYPE *
-pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
-{
- portSTACK_TYPE *pxOriginalTOS;
-
- pxOriginalTOS = pxTopOfStack;
- /* Setup the initial stack of the task. The stack is set exactly as
- * expected by the portRESTORE_CONTEXT() macro.
- */
-
- /* First on the stack is the return address - which in this case is the
- * start of the task. The offset is added to make the return address appear
- * as it would within an IRQ ISR.
- */
- *pxTopOfStack = ( portSTACK_TYPE ) pxCode + portINSTRUCTION_SIZE;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xaaaaaaaa; /* R14 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) pxOriginalTOS; /* Stack used when task starts goes in R13. */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x12121212; /* R12 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x11111111; /* R11 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x10101010; /* R10 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x09090909; /* R9 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x08080808; /* R8 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x07070707; /* R7 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x06060606; /* R6 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x05050505; /* R5 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x04040404; /* R4 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x03030303; /* R3 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x02020202; /* R2 */
- pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) 0x01010101; /* R1 */
- pxTopOfStack--;
-
- /* When the task starts is will expect to find the function parameter in
- * R0.
- */
- *pxTopOfStack = ( portSTACK_TYPE ) pvParameters; /* R0 */
- pxTopOfStack--;
-
- /* The last thing onto the stack is the status register, which is set for
- * system mode, with interrupts enabled.
- */
- *pxTopOfStack = ( portSTACK_TYPE ) portINITIAL_SPSR;
-
-#ifdef THUMB_INTERWORK
- {
- /* We want the task to start in thumb mode. */
- *pxTopOfStack |= portTHUMB_MODE_BIT;
- }
-#endif
-
- pxTopOfStack--;
-
- /* Some optimisation levels use the stack differently to others. This
- * means the interrupt flags cannot always be stored on the stack and will
- * instead be stored in a variable, which is then saved as part of the
- * tasks context.
- */
- *pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
-
- return pxTopOfStack;
-}
-
-portBASE_TYPE
-xPortStartScheduler( void )
-{
- /* Start the timer that generates the tick ISR. Interrupts are disabled
- * here already.
- */
- prvSetupTimerInterrupt( );
-
- /* Start the first task. */
- vPortISRStartFirstTask( );
-
- /* Should not get here! */
- return 0;
-}
-
-void
-vPortEndScheduler( void )
-{
-}
-
-/*
- * Setup the timer 0 to generate the tick interrupts at the required frequency.
- */
-static void
-prvSetupTimerInterrupt( void )
-{
- /* Setup the AIC for PIT interrupts. The interrupt routine chosen depends
- * on whether the preemptive or cooperative scheduler is being used.
- */
-#if configUSE_PREEMPTION == 0
- AT91F_AIC_ConfigureIt( AT91C_BASE_AIC, AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST,
- AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
- ( void ( * )( void ) )vNonPreemptiveTick );
-#else
- AT91F_AIC_ConfigureIt( AT91C_BASE_AIC, AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST,
- AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
- ( void ( * )( void ) )vPreemptiveTick );
-
-#endif
-
- /* Configure the PIT period. */
- AT91F_PITInit( AT91C_BASE_PITC, portTICK_RATE_MS * 1000U, configCPU_CLOCK_HZ / 1000000U );
- AT91F_PITEnableInt( AT91C_BASE_PITC );
- AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_SYS );
-}
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/portISR.c b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/portISR.c
deleted file mode 100644
index a9649127a..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/portISR.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * MODBUS Library: SAM7X Port
- * Copyright (c) 2007 Christian Walter
- * All rights reserved.
- *
- * $Id$
- */
-/*
- * FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
- *
- * This file is part of the FreeRTOS.org distribution.
- *
- * FreeRTOS.org is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * FreeRTOS.org 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. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FreeRTOS.org; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * A special exception to the GPL can be applied should you wish to distribute
- * a combined work that includes FreeRTOS.org, without being obliged to provide
- * the source code for any proprietary components. See the licensing section
- * of http://www.FreeRTOS.org for full details of how and when the exception
- * can be applied.
- *
- ****************************************************************************
- * See http://www.FreeRTOS.org for documentation, latest information, license
- * and contact details. Please ensure to read the configuration and relevant
- * port sections of the online documentation.
- *
- * Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- * with commercial development and support options.
- ***************************************************************************
- */
-
-/* ----------------------- System includes ----------------------------------*/
-#include
-
-/* ----------------------- FreeRTOS includes --------------------------------*/
-#include "FreeRTOS.h"
-#include "task.h"
-
-/* ----------------------- Platform includes --------------------------------*/
-#include "AT91SAM7X256.h"
-#include "lib_AT91SAM7X256.h"
-
-/* ----------------------- Defines ------------------------------------------*/
-#define portTIMER_MATCH_ISR_BIT ( ( unsigned portCHAR ) 0x01 )
-#define portCLEAR_VIC_INTERRUPT ( ( unsigned portLONG ) 0 )
-#define portNO_CRITICAL_NESTING ( ( unsigned portLONG ) 0 )
-volatile unsigned portLONG ulCriticalNesting = 9999UL;
-
-/* ----------------------- Type definitions ---------------------------------*/
-
-/* ----------------------- Static variables ---------------------------------*/
-
-/* ----------------------- Function prototypes ------------------------------*/
-void vPortDisableInterruptsFromThumb( void ) __attribute__ ( ( naked ) );
-void vPortEnableInterruptsFromThumb( void ) __attribute__ ( ( naked ) );
-void vNonPreemptiveTick( void ) __attribute__ ( ( interrupt( "IRQ" ) ) );
-void vPreemptiveTick( void ) __attribute__ ( ( naked ) );
-void vPortYieldProcessor( void ) __attribute__ ( ( interrupt( "SWI" ), naked ) );
-
-void vPortISRStartFirstTask( void );
-
-/* ----------------------- Static functions ---------------------------------*/
-
-/* ----------------------- Start implementation -----------------------------*/
-
-void
-vPortISRStartFirstTask( void )
-{
- /* Simply start the scheduler. This is included here as it can only be
- * called from ARM mode.
- */
- portRESTORE_CONTEXT( );
-}
-
-/*
- * Called by portYIELD() or taskYIELD() to manually force a context switch.
- *
- * When a context switch is performed from the task level the saved task
- * context is made to look as if it occurred from within the tick ISR. This
- * way the same restore context function can be used when restoring the context
- * saved from the ISR or that saved from a call to vPortYieldProcessor.
- */
-void
-vPortYieldProcessor( void )
-{
- /* Within an IRQ ISR the link register has an offset from the true return
- * address, but an SWI ISR does not. Add the offset manually so the same
- * ISR return code can be used in both cases.
- */
- asm volatile ( "ADD LR, LR, #4" );
-
- /* Perform the context switch. First save the context of the current task. */
- portSAVE_CONTEXT( );
-
- /* Find the highest priority task that is ready to run. */
- vTaskSwitchContext( );
-
- /* Restore the context of the new task. */
- portRESTORE_CONTEXT( );
-}
-
-/*
- * The ISR used for the scheduler tick depends on whether the cooperative or
- * the preemptive scheduler is being used.
- */
-#if configUSE_PREEMPTION == 0
-
-
-
-void
-vNonPreemptiveTick( void )
-{
- unsigned portLONG ulDummy;
-
- /* Increment the tick count - which may wake some tasks but as the
- * preemptive scheduler is not being used any woken task is not given
- * processor time no matter what its priority.
- */
- vTaskIncrementTick( );
-
- /* Clear the PIT interrupt. */
- AT91C_BASE_AIC->AIC_EOICR = AT91C_BASE_PITC->PITC_PIVR;
-}
-#else
-void
-vPreemptiveTick( void )
-{
- /* Save the context of the current task. */
- portSAVE_CONTEXT( );
-
- /* Increment the tick count - this may wake a task. */
- vTaskIncrementTick( );
-
- /* Find the highest priority task that is ready to run. */
- vTaskSwitchContext( );
-
- /* End the interrupt in the AIC. */
- AT91C_BASE_AIC->AIC_EOICR = AT91C_BASE_PITC->PITC_PIVR;;
-
- portRESTORE_CONTEXT( );
-}
-#endif
-
-/*
- * The interrupt management utilities can only be called from ARM mode. When
- * THUMB_INTERWORK is defined the utilities are defined as functions here to
- * ensure a switch to ARM mode. When THUMB_INTERWORK is not defined then
- * the utilities are defined as macros in portmacro.h - as per other ports.
- */
-void
-vPortDisableInterruptsFromThumb( void )
-{
- asm volatile ( "STMDB SP!, {R0}\n\t" /* Push R0. */
- "MRS R0, CPSR\n\t" /* Get CPSR. */
- "ORR R0, R0, #0xC0 \n\t" /* Disable IRQ, FIQ. */
- "MSR CPSR, R0\n\t" /* Write back modified value. */
- "LDMIA SP!, {R0}\n\t" /* Pop R0. */
- "BX R14" ); /* Return back to thumb. */
-}
-
-void
-vPortEnableInterruptsFromThumb( void )
-{
- asm volatile ( "STMDB SP!, {R0}\n\t" /* Push R0. */
- "MRS R0, CPSR\n\t" /* Get CPSR. */
- "BIC R0, R0, #0xC0\n\t" /* Enable IRQ, FIQ. */
- "MSR CPSR, R0\n\t" /* Write back modified value. */
- "LDMIA SP!, {R0}\n\t" /* Pop R0. */
- "BX R14" ); /* Return back to thumb. */
-}
-
-/* The code generated by the GCC compiler uses the stack in different ways at
- * different optimisation levels. The interrupt flags can therefore not always
- * be saved to the stack. Instead the critical section nesting level is stored
- * in a variable, which is then saved as part of the stack context.
- */
-void
-vPortEnterCritical( void )
-{
- /* Disable interrupts as per portDISABLE_INTERRUPTS(); */
- asm volatile ( "STMDB SP!, {R0}\n\t" /* Push R0. */
- "MRS R0, CPSR\n\t" /* Get CPSR. */
- "ORR R0, R0, #0xC0\n\t" /* Disable IRQ, FIQ. */
- "MSR CPSR, R0\n\t" /* Write back modified value. */
- "LDMIA SP!, {R0}" ); /* Pop R0. */
-
- /* Now interrupts are disabled ulCriticalNesting can be accessed
- * directly. Increment ulCriticalNesting to keep a count of how many times
- * portENTER_CRITICAL() has been called.
- */
- ulCriticalNesting++;
-}
-
-void
-vPortExitCritical( void )
-{
- if( ulCriticalNesting > portNO_CRITICAL_NESTING )
- {
- /* Decrement the nesting count as we are leaving a critical section. */
- ulCriticalNesting--;
-
- /* If the nesting level has reached zero then interrupts should be
- re-enabled. */
- if( ulCriticalNesting == portNO_CRITICAL_NESTING )
- {
- /* Enable interrupts as per portEXIT_CRITICAL(). */
- asm volatile ( "STMDB SP!, {R0}\n\t" /* Push R0. */
- "MRS R0, CPSR\n\t" /* Get CPSR. */
- "BIC R0, R0, #0xC0\n\t" /* Enable IRQ, FIQ. */
- "MSR CPSR, R0\n\t" /* Write back modified value. */
- "LDMIA SP!, {R0}" ); /* Pop R0. */
- }
- }
-}
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/portmacro.h b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/portmacro.h
deleted file mode 100644
index 43593c56e..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/GCC/ARM7_AT91SAM7S/portmacro.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * MODBUS Library: SAM7X Port
- * Copyright (c) 2007 Christian Walter
- * All rights reserved.
- *
- * $Id$
- */
-/*
- * FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
- *
- * This file is part of the FreeRTOS.org distribution.
- *
- * FreeRTOS.org is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * FreeRTOS.org 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. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FreeRTOS.org; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * A special exception to the GPL can be applied should you wish to distribute
- * a combined work that includes FreeRTOS.org, without being obliged to provide
- * the source code for any proprietary components. See the licensing section
- * of http://www.FreeRTOS.org for full details of how and when the exception
- * can be applied.
- *
- ****************************************************************************
- * See http://www.FreeRTOS.org for documentation, latest information, license
- * and contact details. Please ensure to read the configuration and relevant
- * port sections of the online documentation.
- *
- * Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- * with commercial development and support options.
- ***************************************************************************
- */
-
-#ifndef PORTMACRO_H
-#define PORTMACRO_H
-
-/* ----------------------- Defines (Type definitions) -----------------------*/
-#define portCHAR char
-#define portFLOAT float
-#define portDOUBLE double
-#define portLONG long
-#define portSHORT short
-#define portSTACK_TYPE unsigned portLONG
-#define portBASE_TYPE portLONG
-
-#if( configUSE_16_BIT_TICKS == 1 )
-typedef unsigned portSHORT portTickType;
-#define portMAX_DELAY ( portTickType ) 0xffff
-#else
-typedef unsigned portLONG portTickType;
-#define portMAX_DELAY ( portTickType ) 0xffffffff
-#endif
-
-/* ----------------------- Defines (Architecture specific) ------------------*/
-
-#define portSTACK_GROWTH ( -1 )
-#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
-#define portBYTE_ALIGNMENT 4
-#define portNOP() asm volatile ( "NOP" );
-
-/*
- * portRESTORE_CONTEXT, portRESTORE_CONTEXT, portENTER_SWITCHING_ISR
- * and portEXIT_SWITCHING_ISR can only be called from ARM mode, but
- * are included here for efficiency. An attempt to call one from
- * THUMB mode code will result in a compile time error.
- */
-#define portRESTORE_CONTEXT() do { \
- extern volatile void * volatile pxCurrentTCB; \
- extern volatile unsigned portLONG ulCriticalNesting; \
- \
- /* Set the LR to the task stack. */ \
- asm volatile ( \
- "LDR R0, =pxCurrentTCB\n\t" \
- "LDR R0, [R0]\n\t" \
- "LDR LR, [R0]\n\t" \
- \
- /* The critical nesting depth is the first item on the stack. */ \
- /* Load it into the ulCriticalNesting variable. */ \
- "LDR R0, =ulCriticalNesting\n\t" \
- "LDMFD LR!, {R1}\n\t" \
- "STR R1, [R0]\n\t" \
- \
- /* Get the SPSR from the stack. */ \
- "LDMFD LR!, {R0}\n\t" \
- "MSR SPSR, R0\n\t" \
- \
- /* Restore all system mode registers for the task. */ \
- "LDMFD LR, {R0-R14}^\n\t" \
- "NOP\n\t" \
- \
- /* Restore the return address. */ \
- "LDR LR, [LR, #+60]\n\t" \
- \
- /* And return - correcting the offset in the LR to obtain the */ \
- /* correct address. */ \
- "SUBS PC, LR, #4\n\t" \
- ); \
- ( void ) ulCriticalNesting; \
- ( void ) pxCurrentTCB; \
-} while( 0 )
-
-#define portSAVE_CONTEXT() do { \
- extern volatile void * volatile pxCurrentTCB; \
- extern volatile unsigned portLONG ulCriticalNesting; \
- \
- /* Push R0 as we are going to use the register. */ \
- asm volatile ( \
- "STMDB SP!, {R0}\n\t" \
- \
- /* Set R0 to point to the task stack pointer. */ \
- "STMDB SP,{SP}^\n\t" \
- "NOP\n\t" \
- "SUB SP, SP, #4\n\t" \
- "LDMIA SP!,{R0}\n\t" \
- \
- /* Push the return address onto the stack. */ \
- "STMDB R0!, {LR}\n\t" \
- \
- /* Now we have saved LR we can use it instead of R0. */ \
- "MOV LR, R0\n\t" \
- \
- /* Pop R0 so we can save it onto the system mode stack. */ \
- "LDMIA SP!, {R0}\n\t" \
- \
- /* Push all the system mode registers onto the task stack. */ \
- "STMDB LR,{R0-LR}^\n\t" \
- "NOP\n\t" \
- "SUB LR, LR, #60\n\t" \
- \
- /* Push the SPSR onto the task stack. */ \
- "MRS R0, SPSR\n\t" \
- "STMDB LR!, {R0}\n\t" \
- \
- "LDR R0, =ulCriticalNesting\n\t" \
- "LDR R0, [R0]\n\t" \
- "STMDB LR!, {R0}\n\t" \
- \
- /* Store the new top of stack for the task. */ \
- "LDR R0, =pxCurrentTCB\n\t" \
- "LDR R0, [R0]\n\t" \
- "STR LR, [R0]\n\t" \
- ); \
- ( void ) ulCriticalNesting; \
- ( void ) pxCurrentTCB; \
-} while( 0 )
-
-#define portENTER_SWITCHING_ISR() do { \
- /* Save the context of the interrupted task. */ \
- portSAVE_CONTEXT(); \
- \
- /* We don't know the stack requirements for the ISR, so the frame */ \
- /* pointer will be set to the top of the task stack, and the stack*/ \
- /* pointer left where it is. The IRQ stack will get used for any */ \
- /* functions calls made by this ISR. */ \
- asm volatile ( "SUB R11, LR, #4" ); \
- {
-
-#define portEXIT_SWITCHING_ISR( SwitchRequired ) \
- /* If a switch is required then we just need to call */ \
- /* vTaskSwitchContext() as the context has already been */ \
- /* saved. */ \
- if( SwitchRequired ) \
- { \
- vTaskSwitchContext(); \
- } \
- } \
- /* Restore the context of which ever task is now the highest */ \
- /* priority that is ready to run. */ \
- portRESTORE_CONTEXT(); \
-} while( 0 )
-
-#define portYIELD() asm volatile ( "SWI" );
-
-/*
- * The interrupt management utilities can only be called from ARM mode. When
- * THUMB_INTERWORK is defined the utilities are defined as functions in
- * portISR.c to ensure a switch to ARM mode. When THUMB_INTERWORK is not
- * defined then the utilities are defined as macros here - as per other ports.
- */
-#ifdef THUMB_INTERWORK
-
-extern void vPortDisableInterruptsFromThumb( void ) __attribute__ ( ( naked ) );
-extern void vPortEnableInterruptsFromThumb( void ) __attribute__ ( ( naked ) );
-
-#define portDISABLE_INTERRUPTS() vPortDisableInterruptsFromThumb()
-#define portENABLE_INTERRUPTS() vPortEnableInterruptsFromThumb()
-
-#else
-
-#define portDISABLE_INTERRUPTS() do { \
- asm volatile ( \
- "STMDB SP!, {R0}\n\t" /* Push R0. */ \
- "MRS R0, CPSR\n\t" /* Get CPSR. */ \
- "ORR R0, R0, #0xC0\n\t" /* Disable IRQ, FIQ. */ \
- "MSR CPSR, R0\n\t" /* Write back modified value. */ \
- "LDMIA SP!, {R0}" ); /* Pop R0. */ \
-} while( 0 )
-
-#define portENABLE_INTERRUPTS() do { \
- asm volatile ( \
- "STMDB SP!, {R0}\n\t" /* Push R0. */ \
- "MRS R0, CPSR\n\t" /* Get CPSR. */ \
- "BIC R0, R0, #0xC0 \n\t" /* Enable IRQ, FIQ. */ \
- "MSR CPSR, R0\n\t" /* Write back modified value. */ \
- "LDMIA SP!, {R0}" ); /* Pop R0. */ \
-} while( 0 )
-#endif
-
-extern void vPortEnterCritical( void );
-extern void vPortExitCritical( void );
-
-#define portENTER_CRITICAL() vPortEnterCritical();
-#define portEXIT_CRITICAL() vPortExitCritical();
-
-/* ----------------------- Defines (Other) ----------------------------------*/
-
-/* Task function macros as described on the FreeRTOS.org WEB site. */
-#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
-#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
-
-#endif
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_1.c b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_1.c
deleted file mode 100644
index 57a7e4e0b..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_1.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-/*
-
-Changes between V2.5.1 and V2.5.1
-
- + The memory pool has been defined within a struct to ensure correct memory
- alignment on 32bit systems.
-
-Changes between V2.6.1 and V3.0.0
-
- + An overflow check has been added to ensure the next free byte variable
- does not wrap around.
-*/
-
-
-/*
- * The simplest possible implementation of pvPortMalloc(). Note that this
- * implementation does NOT allow allocated memory to be freed again.
- *
- * See heap_2.c and heap_3.c for alternative implementations, and the memory
- * management pages of http://www.FreeRTOS.org for more information.
- */
-#include
-#include "FreeRTOS.h"
-#include "task.h"
-
-/* Setup the correct byte alignment mask for the defined byte alignment. */
-
-#if portBYTE_ALIGNMENT == 8
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0007 )
-#endif
-
-#if portBYTE_ALIGNMENT == 4
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0003 )
-#endif
-
-#if portBYTE_ALIGNMENT == 2
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0001 )
-#endif
-
-#if portBYTE_ALIGNMENT == 1
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0000 )
-#endif
-
-#ifndef heapBYTE_ALIGNMENT_MASK
- #error "Invalid portBYTE_ALIGNMENT definition"
-#endif
-
-/* Allocate the memory for the heap. The struct is used to force byte
-alignment without using any non-portable code. */
-static struct xRTOS_HEAP
-{
- unsigned portLONG ulDummy;
- unsigned portCHAR ucHeap[ configTOTAL_HEAP_SIZE ];
-} xHeap;
-
-static size_t xNextFreeByte = ( size_t ) 0;
-/*-----------------------------------------------------------*/
-
-void *pvPortMalloc( size_t xWantedSize )
-{
-void *pvReturn = NULL;
-
- /* Ensure that blocks are always aligned to the required number of bytes. */
- #if portBYTE_ALIGNMENT != 1
- if( xWantedSize & heapBYTE_ALIGNMENT_MASK )
- {
- /* Byte alignment required. */
- xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & heapBYTE_ALIGNMENT_MASK ) );
- }
- #endif
-
- vTaskSuspendAll();
- {
- /* Check there is enough room left for the allocation. */
- if( ( ( xNextFreeByte + xWantedSize ) < configTOTAL_HEAP_SIZE ) &&
- ( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) )/* Check for overflow. */
- {
- /* Return the next free byte then increment the index past this
- block. */
- pvReturn = &( xHeap.ucHeap[ xNextFreeByte ] );
- xNextFreeByte += xWantedSize;
- }
- }
- xTaskResumeAll();
-
- return pvReturn;
-}
-/*-----------------------------------------------------------*/
-
-void vPortFree( void *pv )
-{
- /* Memory cannot be freed using this scheme. See heap_2.c and heap_3.c
- for alternative implementations, and the memory management pages of
- http://www.FreeRTOS.org for more information. */
- ( void ) pv;
-}
-/*-----------------------------------------------------------*/
-
-void vPortInitialiseBlocks( void )
-{
- /* Only required when static memory is not cleared. */
- xNextFreeByte = ( size_t ) 0;
-}
-
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_2.c b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_2.c
deleted file mode 100644
index f733e7dd3..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_2.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-/*
- * A sample implementation of pvPortMalloc() and vPortFree() that permits
- * allocated blocks to be freed, but does not combine adjacent free blocks
- * into a single larger block.
- *
- * See heap_1.c and heap_3.c for alternative implementations, and the memory
- * management pages of http://www.FreeRTOS.org for more information.
- */
-#include
-
-#include "FreeRTOS.h"
-#include "task.h"
-
-/* Setup the correct byte alignment mask for the defined byte alignment. */
-
-#if portBYTE_ALIGNMENT == 8
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0007 )
-#endif
-
-#if portBYTE_ALIGNMENT == 4
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0003 )
-#endif
-
-#if portBYTE_ALIGNMENT == 2
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0001 )
-#endif
-
-#if portBYTE_ALIGNMENT == 1
- #define heapBYTE_ALIGNMENT_MASK ( ( size_t ) 0x0000 )
-#endif
-
-#ifndef heapBYTE_ALIGNMENT_MASK
- #error "Invalid portBYTE_ALIGNMENT definition"
-#endif
-
-/* Allocate the memory for the heap. The struct is used to force byte
-alignment without using any non-portable code. */
-static struct xRTOS_HEAP
-{
- unsigned portLONG ulDummy;
- unsigned portCHAR ucHeap[ configTOTAL_HEAP_SIZE ];
-} xHeap;
-
-/* Define the linked list structure. This is used to link free blocks in order
-of their size. */
-typedef struct A_BLOCK_LINK
-{
- struct A_BLOCK_LINK *pxNextFreeBlock; /*<< The next free block in the list. */
- size_t xBlockSize; /*<< The size of the free block. */
-} xBlockLink;
-
-
-static const unsigned portSHORT heapSTRUCT_SIZE = ( sizeof( xBlockLink ) + ( sizeof( xBlockLink ) % portBYTE_ALIGNMENT ) );
-#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) )
-
-/* Create a couple of list links to mark the start and end of the list. */
-static xBlockLink xStart, xEnd;
-
-/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */
-
-/*
- * Insert a block into the list of free blocks - which is ordered by size of
- * the block. Small blocks at the start of the list and large blocks at the end
- * of the list.
- */
-#define prvInsertBlockIntoFreeList( pxBlockToInsert ) \
-{ \
-xBlockLink *pxIterator; \
-size_t xBlockSize; \
- \
- xBlockSize = pxBlockToInsert->xBlockSize; \
- \
- /* Iterate through the list until a block is found that has a larger size */ \
- /* than the block we are inserting. */ \
- for( pxIterator = &xStart; pxIterator->pxNextFreeBlock->xBlockSize < xBlockSize; pxIterator = pxIterator->pxNextFreeBlock ) \
- { \
- /* There is nothing to do here - just iterate to the correct position. */ \
- } \
- \
- /* Update the list to include the block being inserted in the correct */ \
- /* position. */ \
- pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock; \
- pxIterator->pxNextFreeBlock = pxBlockToInsert; \
-}
-/*-----------------------------------------------------------*/
-
-#define prvHeapInit() \
-{ \
-xBlockLink *pxFirstFreeBlock; \
- \
- /* xStart is used to hold a pointer to the first item in the list of free */ \
- /* blocks. The void cast is used to prevent compiler warnings. */ \
- xStart.pxNextFreeBlock = ( void * ) xHeap.ucHeap; \
- xStart.xBlockSize = ( size_t ) 0; \
- \
- /* xEnd is used to mark the end of the list of free blocks. */ \
- xEnd.xBlockSize = configTOTAL_HEAP_SIZE; \
- xEnd.pxNextFreeBlock = NULL; \
- \
- /* To start with there is a single free block that is sized to take up the \
- entire heap space. */ \
- pxFirstFreeBlock = ( void * ) xHeap.ucHeap; \
- pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE; \
- pxFirstFreeBlock->pxNextFreeBlock = &xEnd; \
-}
-/*-----------------------------------------------------------*/
-
-void *pvPortMalloc( size_t xWantedSize )
-{
-xBlockLink *pxBlock, *pxPreviousBlock, *pxNewBlockLink;
-static portBASE_TYPE xHeapHasBeenInitialised = pdFALSE;
-void *pvReturn = NULL;
-
- vTaskSuspendAll();
- {
- /* If this is the first call to malloc then the heap will require
- initialisation to setup the list of free blocks. */
- if( xHeapHasBeenInitialised == pdFALSE )
- {
- prvHeapInit();
- xHeapHasBeenInitialised = pdTRUE;
- }
-
- /* The wanted size is increased so it can contain a xBlockLink
- structure in addition to the requested amount of bytes. */
- if( xWantedSize > 0 )
- {
- xWantedSize += heapSTRUCT_SIZE;
-
- /* Ensure that blocks are always aligned to the required number of bytes. */
- if( xWantedSize & heapBYTE_ALIGNMENT_MASK )
- {
- /* Byte alignment required. */
- xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & heapBYTE_ALIGNMENT_MASK ) );
- }
- }
-
- if( ( xWantedSize > 0 ) && ( xWantedSize < configTOTAL_HEAP_SIZE ) )
- {
- /* Blocks are stored in byte order - traverse the list from the start
- (smallest) block until one of adequate size is found. */
- pxPreviousBlock = &xStart;
- pxBlock = xStart.pxNextFreeBlock;
- while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock ) )
- {
- pxPreviousBlock = pxBlock;
- pxBlock = pxBlock->pxNextFreeBlock;
- }
-
- /* If we found the end marker then a block of adequate size was not found. */
- if( pxBlock != &xEnd )
- {
- /* Return the memory space - jumping over the xBlockLink structure
- at its start. */
- pvReturn = ( void * ) ( ( ( unsigned portCHAR * ) pxPreviousBlock->pxNextFreeBlock ) + heapSTRUCT_SIZE );
-
- /* This block is being returned for use so must be taken our of the
- list of free blocks. */
- pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;
-
- /* If the block is larger than required it can be split into two. */
- if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )
- {
- /* This block is to be split into two. Create a new block
- following the number of bytes requested. The void cast is
- used to prevent byte alignment warnings from the compiler. */
- pxNewBlockLink = ( void * ) ( ( ( unsigned portCHAR * ) pxBlock ) + xWantedSize );
-
- /* Calculate the sizes of two blocks split from the single
- block. */
- pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
- pxBlock->xBlockSize = xWantedSize;
-
- /* Insert the new block into the list of free blocks. */
- prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
- }
- }
- }
- }
- xTaskResumeAll();
-
- return pvReturn;
-}
-/*-----------------------------------------------------------*/
-
-void vPortFree( void *pv )
-{
-unsigned portCHAR *puc = ( unsigned portCHAR * ) pv;
-xBlockLink *pxLink;
-
- if( pv )
- {
- /* The memory being freed will have an xBlockLink structure immediately
- before it. */
- puc -= heapSTRUCT_SIZE;
-
- /* This casting is to keep the compiler from issuing warnings. */
- pxLink = ( void * ) puc;
-
- vTaskSuspendAll();
- {
- /* Add this block to the list of free blocks. */
- prvInsertBlockIntoFreeList( ( ( xBlockLink * ) pxLink ) );
- }
- xTaskResumeAll();
- }
-}
-/*-----------------------------------------------------------*/
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_3.c b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_3.c
deleted file mode 100644
index c32f883bf..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/portable/MemMang/heap_3.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-
-/*
- * Implementation of pvPortMalloc() and vPortFree() that relies on the
- * compilers own malloc() and free() implementations.
- *
- * This file can only be used if the linker is configured to to generate
- * a heap memory area.
- *
- * See heap_2.c and heap_1.c for alternative implementations, and the memory
- * management pages of http://www.FreeRTOS.org for more information.
- */
-
-#include
-
-#include "FreeRTOS.h"
-#include "task.h"
-
-/*-----------------------------------------------------------*/
-
-void *pvPortMalloc( size_t xWantedSize )
-{
-void *pvReturn;
-
- vTaskSuspendAll();
- {
- pvReturn = malloc( xWantedSize );
- }
- xTaskResumeAll();
-
- return pvReturn;
-}
-/*-----------------------------------------------------------*/
-
-void vPortFree( void *pv )
-{
- if( pv )
- {
- vTaskSuspendAll();
- {
- free( pv );
- }
- xTaskResumeAll();
- }
-}
-
-
-
diff --git a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/queue.c b/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/queue.c
deleted file mode 100644
index ab0c13ae2..000000000
--- a/components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/AT91SAM7X_ROWLEY/FreeRTOS/queue.c
+++ /dev/null
@@ -1,930 +0,0 @@
-/*
- FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.
-
- This file is part of the FreeRTOS.org distribution.
-
- FreeRTOS.org is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- FreeRTOS.org 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with FreeRTOS.org; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- A special exception to the GPL can be applied should you wish to distribute
- a combined work that includes FreeRTOS.org, without being obliged to provide
- the source code for any proprietary components. See the licensing section
- of http://www.FreeRTOS.org for full details of how and when the exception
- can be applied.
-
- ***************************************************************************
- See http://www.FreeRTOS.org for documentation, latest information, license
- and contact details. Please ensure to read the configuration and relevant
- port sections of the online documentation.
-
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
- with commercial development and support options.
- ***************************************************************************
-*/
-
-/*
-Changes from V1.01
-
- + More use of 8bit data types.
- + Function name prefixes changed where the data type returned has changed.
-
-Changed from V2.0.0
-
- + Added the queue locking mechanism and make more use of the scheduler
- suspension feature to minimise the time interrupts have to be disabled
- when accessing a queue.
-
-Changed from V2.2.0
-
- + Explicit use of 'signed' qualifier on portCHAR types added.
-
-Changes from V3.0.0
-
- + API changes as described on the FreeRTOS.org WEB site.
-
-Changes from V3.2.3
-
- + Added the queue functions that can be used from co-routines.
-
-Changes from V4.0.5
-
- + Added a loop within xQueueSend() and xQueueReceive() to prevent the
- functions exiting when a block time remains and the function has
- not completed.
-
-Changes from V4.1.2:
-
- + BUG FIX: Removed the call to prvIsQueueEmpty from within xQueueCRReceive
- as it exited with interrupts enabled. Thanks Paul Katz.
-
-Changes from V4.1.3:
-
- + Modified xQueueSend() and xQueueReceive() to handle the (very unlikely)
- case whereby a task unblocking due to a temporal event can remove/send an
- item from/to a queue when a higher priority task is still blocked on the
- queue. This modification is a result of the SafeRTOS testing.
-*/
-
-#include