From: richardbarry Date: Sat, 12 Apr 2008 09:50:30 +0000 (+0000) Subject: Add in the configUSE_APPLICATION_TASK_HOOK macro. X-Git-Tag: V5.0.0~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=070cf75af50ccfd4ae83fb9eb5dec5cb74b0d5f8;p=freertos Add in the configUSE_APPLICATION_TASK_HOOK macro. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@303 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/PC/FreeRTOSConfig.h b/Demo/PC/FreeRTOSConfig.h index 9c5eb8432..e150a3ba6 100644 --- a/Demo/PC/FreeRTOSConfig.h +++ b/Demo/PC/FreeRTOSConfig.h @@ -79,6 +79,7 @@ #define configUSE_ALTERNATIVE_API 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 0 /* Do not use this option on the PC port. */ +#define configUSE_APPLICATION_TASK_HOOK 1 #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 10 ) #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) diff --git a/Demo/PC/rtosdemo.tgt b/Demo/PC/rtosdemo.tgt index e6a005d93..0cbfabb01 100644 --- a/Demo/PC/rtosdemo.tgt +++ b/Demo/PC/rtosdemo.tgt @@ -75,7 +75,7 @@ WVList 0 19 WPickList -64 +65 20 MItem 3 @@ -1012,8 +1012,8 @@ WVList 0 236 MItem -27 -..\..\source\include\list.h +31 +..\..\SOURCE\INCLUDE\FreeRTOS.h 237 WString 3 @@ -1030,8 +1030,8 @@ WVList 0 240 MItem -31 -..\..\source\include\portable.h +27 +..\..\source\include\list.h 241 WString 3 @@ -1049,7 +1049,7 @@ WVList 244 MItem 31 -..\..\source\include\projdefs.h +..\..\source\include\portable.h 245 WString 3 @@ -1066,8 +1066,8 @@ WVList 0 248 MItem -28 -..\..\source\include\queue.h +31 +..\..\source\include\projdefs.h 249 WString 3 @@ -1084,8 +1084,8 @@ WVList 0 252 MItem -29 -..\..\source\include\semphr.h +28 +..\..\source\include\queue.h 253 WString 3 @@ -1102,8 +1102,8 @@ WVList 0 256 MItem -27 -..\..\source\include\task.h +29 +..\..\source\include\semphr.h 257 WString 3 @@ -1120,8 +1120,8 @@ WVList 0 260 MItem -55 -..\..\source\portable\owatcom\16bitdos\common\portasm.h +27 +..\..\source\include\task.h 261 WString 3 @@ -1138,8 +1138,8 @@ WVList 0 264 MItem -53 -..\..\source\portable\owatcom\16bitdos\pc\portmacro.h +55 +..\..\source\portable\owatcom\16bitdos\common\portasm.h 265 WString 3 @@ -1156,8 +1156,8 @@ WVList 0 268 MItem -28 -..\COMMON\INCLUDE\AltBlckQ.h +53 +..\..\source\portable\owatcom\16bitdos\pc\portmacro.h 269 WString 3 @@ -1175,7 +1175,7 @@ WVList 272 MItem 28 -..\COMMON\INCLUDE\AltBlock.h +..\COMMON\INCLUDE\AltBlckQ.h 273 WString 3 @@ -1193,7 +1193,7 @@ WVList 276 MItem 28 -..\COMMON\INCLUDE\AltPollQ.h +..\COMMON\INCLUDE\AltBlock.h 277 WString 3 @@ -1211,7 +1211,7 @@ WVList 280 MItem 28 -..\COMMON\INCLUDE\AltQTest.h +..\COMMON\INCLUDE\AltPollQ.h 281 WString 3 @@ -1228,8 +1228,8 @@ WVList 0 284 MItem -26 -..\common\include\blockq.h +28 +..\COMMON\INCLUDE\AltQTest.h 285 WString 3 @@ -1246,8 +1246,8 @@ WVList 0 288 MItem -28 -..\COMMON\INCLUDE\blocktim.h +26 +..\common\include\blockq.h 289 WString 3 @@ -1264,8 +1264,8 @@ WVList 0 292 MItem -27 -..\common\include\comtest.h +28 +..\COMMON\INCLUDE\blocktim.h 293 WString 3 @@ -1282,8 +1282,8 @@ WVList 0 296 MItem -28 -..\COMMON\INCLUDE\countsem.h +27 +..\common\include\comtest.h 297 WString 3 @@ -1300,8 +1300,8 @@ WVList 0 300 MItem -26 -..\COMMON\INCLUDE\crhook.h +28 +..\COMMON\INCLUDE\countsem.h 301 WString 3 @@ -1318,8 +1318,8 @@ WVList 0 304 MItem -25 -..\common\include\death.h +26 +..\COMMON\INCLUDE\crhook.h 305 WString 3 @@ -1336,8 +1336,8 @@ WVList 0 308 MItem -27 -..\COMMON\INCLUDE\dynamic.h +25 +..\common\include\death.h 309 WString 3 @@ -1354,8 +1354,8 @@ WVList 0 312 MItem -26 -..\common\include\fileio.h +27 +..\COMMON\INCLUDE\dynamic.h 313 WString 3 @@ -1372,8 +1372,8 @@ WVList 0 316 MItem -25 -..\common\include\flash.h +26 +..\common\include\fileio.h 317 WString 3 @@ -1390,8 +1390,8 @@ WVList 0 320 MItem -24 -..\common\include\flop.h +25 +..\common\include\flash.h 321 WString 3 @@ -1408,8 +1408,8 @@ WVList 0 324 MItem -28 -..\COMMON\INCLUDE\GenQTest.h +24 +..\common\include\flop.h 325 WString 3 @@ -1426,8 +1426,8 @@ WVList 0 328 MItem -27 -..\common\include\partest.h +28 +..\COMMON\INCLUDE\GenQTest.h 329 WString 3 @@ -1444,8 +1444,8 @@ WVList 0 332 MItem -25 -..\common\include\pollq.h +27 +..\common\include\partest.h 333 WString 3 @@ -1463,7 +1463,7 @@ WVList 336 MItem 25 -..\common\include\print.h +..\common\include\pollq.h 337 WString 3 @@ -1480,8 +1480,8 @@ WVList 0 340 MItem -27 -..\common\include\semtest.h +25 +..\common\include\print.h 341 WString 3 @@ -1498,8 +1498,8 @@ WVList 0 344 MItem -26 -..\common\include\serial.h +27 +..\common\include\semtest.h 345 WString 3 @@ -1516,8 +1516,8 @@ WVList 0 348 MItem -16 -FreeRTOSConfig.h +26 +..\common\include\serial.h 349 WString 3 @@ -1532,3 +1532,21 @@ WVList 1 1 0 +352 +MItem +16 +FreeRTOSConfig.h +353 +WString +3 +NIL +354 +WVList +0 +355 +WVList +0 +228 +1 +1 +0 diff --git a/Demo/PC/rtosdemo.wpj b/Demo/PC/rtosdemo.wpj index 34b752148..78b602ce8 100644 --- a/Demo/PC/rtosdemo.wpj +++ b/Demo/PC/rtosdemo.wpj @@ -6,7 +6,7 @@ VpeMain WRect 0 0 -6202 +6195 7168 2 MProject @@ -38,6 +38,6 @@ WRect WFileName 12 rtosdemo.tgt -6 -63 +0 +7 7 diff --git a/Demo/PC/serial/serial.c b/Demo/PC/serial/serial.c index fdcf254c6..f4b8afb8e 100644 --- a/Demo/PC/serial/serial.c +++ b/Demo/PC/serial/serial.c @@ -513,7 +513,7 @@ static portSHORT sComPortISR( const xComPort * const pxPort ) { portSHORT sInterruptID; portCHAR cIn, cOut; -portBASE_TYPE xTaskWokenByPost = pdFALSE, xAnotherTaskWokenByPost = pdFALSE, xTaskWokenByTx = pdFALSE; +portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; extern void vComTestUnsuspendTask( void ); portOUTPUT_BYTE( pxPort->us8259InterruptMaskReg, ( portINPUT_BYTE( pxPort->us8259InterruptMaskReg) | ~pxPort->ucInterruptEnableMast ) ); @@ -536,13 +536,13 @@ extern void vComTestUnsuspendTask( void ); do { cIn = ( portCHAR ) portINPUT_BYTE( pxPort->usReceiveDataRegister ); - xTaskWokenByPost = xQueueSendFromISR( pxPort->xRxedChars, &cIn, xTaskWokenByPost ); + xQueueSendFromISR( pxPort->xRxedChars, &cIn, &xHigherPriorityTaskWoken ); /* Also release the semaphore - this does nothing interesting and is just a test. We first attempt to unsuspend the task to check the scheduler correctely detects this as an invalid call, then give the semaphore for real. */ vComTestUnsuspendTask(); - xAnotherTaskWokenByPost = xSemaphoreGiveFromISR( pxPort->xTestSem, xAnotherTaskWokenByPost ); + xSemaphoreGiveFromISR( pxPort->xTestSem, &xHigherPriorityTaskWoken ); } while( portINPUT_BYTE( pxPort->usLineStatusReg ) & 0x01 ); break; @@ -559,19 +559,19 @@ extern void vComTestUnsuspendTask( void ); do { cIn = ( portCHAR ) portINPUT_BYTE( pxPort->usReceiveDataRegister ); - xTaskWokenByPost = xQueueSendFromISR( pxPort->xRxedChars, &cIn, xTaskWokenByPost ); + xQueueSendFromISR( pxPort->xRxedChars, &cIn, &xHigherPriorityTaskWoken ); /* Also release the semaphore - this does nothing interesting and is just a test. We first attempt to unsuspend the task to check the scheduler correctely detects this as an invalid call, then give the semaphore for real. */ vComTestUnsuspendTask(); - xAnotherTaskWokenByPost = xSemaphoreGiveFromISR( pxPort->xTestSem, xAnotherTaskWokenByPost ); + xSemaphoreGiveFromISR( pxPort->xTestSem, &xHigherPriorityTaskWoken ); } while( portINPUT_BYTE( pxPort->usLineStatusReg ) & 0x01 ); break; case 0x02: /* serTRANSMIT_HOLD_EMPTY_INT */ - if( xQueueReceiveFromISR( pxPort->xCharsForTx, &cOut, &xTaskWokenByTx ) != pdTRUE ) + if( xQueueReceiveFromISR( pxPort->xCharsForTx, &cOut, &xHigherPriorityTaskWoken ) != pdTRUE ) { /* Queue empty, nothing to send */ vInterruptOff( pxPort, serTRANSMIT_HOLD_EMPTY_INT); @@ -607,14 +607,7 @@ extern void vComTestUnsuspendTask( void ); /* If posting any of the characters to a queue woke a task that was blocked on the queue we may want to return to the task just woken (depending on its priority relative to the task this ISR interrupted. */ - if( xTaskWokenByPost || xAnotherTaskWokenByPost || xTaskWokenByTx ) - { - return pdTRUE; - } - else - { - return pdFALSE; - } + return xHigherPriorityTaskWoken; } /*-----------------------------------------------------------*/