Working variant of esp_iot_rtos_sdk (files from commit ec75c85f9ef53)

This commit is contained in:
Angus Gratton 2015-04-30 14:00:03 +10:00
parent 101c8648ea
commit 1ffbc303ff
124 changed files with 19424 additions and 592 deletions

View file

@ -194,7 +194,8 @@ static void prvProcessTimerOrBlockTask( portTickType xNextExpireTime, portBASE_T
/*-----------------------------------------------------------*/
portBASE_TYPE xTimerCreateTimerTask( void )
portBASE_TYPE ICACHE_FLASH_ATTR
xTimerCreateTimerTask( void )
{
portBASE_TYPE xReturn = pdFAIL;
@ -211,6 +212,7 @@ portBASE_TYPE xReturn = pdFAIL;
/* Create the timer task, storing its handle in xTimerTaskHandle so
it can be returned by the xTimerGetTimerDaemonTaskHandle() function. */
xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle );
printf("tim_task_hdl : %x\n", xTimerTaskHandle);
}
#else
{
@ -225,7 +227,8 @@ portBASE_TYPE xReturn = pdFAIL;
}
/*-----------------------------------------------------------*/
xTimerHandle xTimerCreate( const signed char * const pcTimerName, portTickType xTimerPeriodInTicks, unsigned portBASE_TYPE uxAutoReload, void *pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction )
xTimerHandle ICACHE_FLASH_ATTR
xTimerCreate( const signed char * const pcTimerName, portTickType xTimerPeriodInTicks, unsigned portBASE_TYPE uxAutoReload, void *pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction )
{
xTIMER *pxNewTimer;
@ -264,7 +267,8 @@ xTIMER *pxNewTimer;
}
/*-----------------------------------------------------------*/
portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime )
portBASE_TYPE ICACHE_FLASH_ATTR
xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime )
{
portBASE_TYPE xReturn = pdFAIL;
xTIMER_MESSAGE xMessage;
@ -303,7 +307,8 @@ xTIMER_MESSAGE xMessage;
#if ( INCLUDE_xTimerGetTimerDaemonTaskHandle == 1 )
xTaskHandle xTimerGetTimerDaemonTaskHandle( void )
xTaskHandle ICACHE_FLASH_ATTR
xTimerGetTimerDaemonTaskHandle( void )
{
/* If xTimerGetTimerDaemonTaskHandle() is called before the scheduler has been
started, then xTimerTaskHandle will be NULL. */
@ -314,7 +319,8 @@ xTIMER_MESSAGE xMessage;
#endif
/*-----------------------------------------------------------*/
static void prvProcessExpiredTimer( portTickType xNextExpireTime, portTickType xTimeNow )
static void ICACHE_FLASH_ATTR
prvProcessExpiredTimer( portTickType xNextExpireTime, portTickType xTimeNow )
{
xTIMER *pxTimer;
portBASE_TYPE xResult;
@ -346,11 +352,14 @@ portBASE_TYPE xResult;
}
/* Call the timer callback. */
pxTimer->pxCallbackFunction( ( xTimerHandle ) pxTimer );
//pxTimer->pxCallbackFunction( ( xTimerHandle ) pxTimer );
pxTimer->pxCallbackFunction( ( void * ) (pxTimer->pvTimerID) );
}
/*-----------------------------------------------------------*/
static void prvTimerTask( void *pvParameters )
static void ICACHE_FLASH_ATTR
prvTimerTask( void *pvParameters )
{
portTickType xNextExpireTime;
portBASE_TYPE xListWasEmpty;
@ -374,7 +383,8 @@ portBASE_TYPE xListWasEmpty;
}
/*-----------------------------------------------------------*/
static void prvProcessTimerOrBlockTask( portTickType xNextExpireTime, portBASE_TYPE xListWasEmpty )
static void ICACHE_FLASH_ATTR
prvProcessTimerOrBlockTask( portTickType xNextExpireTime, portBASE_TYPE xListWasEmpty )
{
portTickType xTimeNow;
portBASE_TYPE xTimerListsWereSwitched;
@ -423,7 +433,8 @@ portBASE_TYPE xTimerListsWereSwitched;
}
/*-----------------------------------------------------------*/
static portTickType prvGetNextExpireTime( portBASE_TYPE *pxListWasEmpty )
static portTickType ICACHE_FLASH_ATTR
prvGetNextExpireTime( portBASE_TYPE *pxListWasEmpty )
{
portTickType xNextExpireTime;
@ -449,7 +460,8 @@ portTickType xNextExpireTime;
}
/*-----------------------------------------------------------*/
static portTickType prvSampleTimeNow( portBASE_TYPE *pxTimerListsWereSwitched )
static portTickType ICACHE_FLASH_ATTR
prvSampleTimeNow( portBASE_TYPE *pxTimerListsWereSwitched )
{
portTickType xTimeNow;
PRIVILEGED_DATA static portTickType xLastTime = ( portTickType ) 0U; /*lint !e956 Variable is only accessible to one task. */
@ -472,7 +484,8 @@ PRIVILEGED_DATA static portTickType xLastTime = ( portTickType ) 0U; /*lint !e95
}
/*-----------------------------------------------------------*/
static portBASE_TYPE prvInsertTimerInActiveList( xTIMER *pxTimer, portTickType xNextExpiryTime, portTickType xTimeNow, portTickType xCommandTime )
static portBASE_TYPE ICACHE_FLASH_ATTR
prvInsertTimerInActiveList( xTIMER *pxTimer, portTickType xNextExpiryTime, portTickType xTimeNow, portTickType xCommandTime )
{
portBASE_TYPE xProcessTimerNow = pdFALSE;
@ -513,7 +526,8 @@ portBASE_TYPE xProcessTimerNow = pdFALSE;
}
/*-----------------------------------------------------------*/
static void prvProcessReceivedCommands( void )
static void ICACHE_FLASH_ATTR
prvProcessReceivedCommands( void )
{
xTIMER_MESSAGE xMessage;
xTIMER *pxTimer;
@ -548,7 +562,8 @@ portTickType xTimeNow;
{
/* The timer expired before it was added to the active timer
list. Process it now. */
pxTimer->pxCallbackFunction( ( xTimerHandle ) pxTimer );
//pxTimer->pxCallbackFunction( ( xTimerHandle ) pxTimer );
pxTimer->pxCallbackFunction( ( void * ) (pxTimer->pvTimerID) );
if( pxTimer->uxAutoReload == ( unsigned portBASE_TYPE ) pdTRUE )
{
@ -584,7 +599,8 @@ portTickType xTimeNow;
}
/*-----------------------------------------------------------*/
static void prvSwitchTimerLists( portTickType xLastTime )
static void ICACHE_FLASH_ATTR
prvSwitchTimerLists( portTickType xLastTime )
{
portTickType xNextExpireTime, xReloadTime;
xList *pxTemp;
@ -609,7 +625,8 @@ portBASE_TYPE xResult;
/* Execute its callback, then send a command to restart the timer if
it is an auto-reload timer. It cannot be restarted here as the lists
have not yet been switched. */
pxTimer->pxCallbackFunction( ( xTimerHandle ) pxTimer );
//pxTimer->pxCallbackFunction( ( xTimerHandle ) pxTimer );
pxTimer->pxCallbackFunction( ( void * ) (pxTimer->pvTimerID) );
if( pxTimer->uxAutoReload == ( unsigned portBASE_TYPE ) pdTRUE )
{
@ -641,7 +658,8 @@ portBASE_TYPE xResult;
}
/*-----------------------------------------------------------*/
static void prvCheckForValidListAndQueue( void )
static void ICACHE_FLASH_ATTR
prvCheckForValidListAndQueue( void )
{
/* Check that the list from which active timers are referenced, and the
queue used to communicate with the timer service, have been
@ -661,7 +679,8 @@ static void prvCheckForValidListAndQueue( void )
}
/*-----------------------------------------------------------*/
portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer )
portBASE_TYPE ICACHE_FLASH_ATTR
xTimerIsTimerActive( xTimerHandle xTimer )
{
portBASE_TYPE xTimerIsInActiveList;
xTIMER *pxTimer = ( xTIMER * ) xTimer;
@ -680,7 +699,8 @@ xTIMER *pxTimer = ( xTIMER * ) xTimer;
}
/*-----------------------------------------------------------*/
void *pvTimerGetTimerID( xTimerHandle xTimer )
void * ICACHE_FLASH_ATTR
pvTimerGetTimerID( xTimerHandle xTimer )
{
xTIMER *pxTimer = ( xTIMER * ) xTimer;
@ -691,7 +711,5 @@ xTIMER *pxTimer = ( xTIMER * ) xTimer;
/* This entire source file will be skipped if the application is not configured
to include software timer functionality. If you want to include software timer
functionality then ensure configUSE_TIMERS is set to 1 in FreeRTOSConfig.h. */
#endif /* configUSE_TIMERS == 1 */