Allow tasks to be suspended immediately after creation - provided the scheduler is not running.

Add API function that allows the tick count to be queried from an interrupt.
This commit is contained in:
Richard Barry 2010-09-23 13:54:37 +00:00
parent ad451e8b70
commit 7ce7d21ca8
2 changed files with 35 additions and 13 deletions

View file

@ -33,9 +33,9 @@
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
@ -894,7 +894,7 @@ tskTCB * pxNewTCB;
portEXIT_CRITICAL();
/* We may have just suspended the current task. */
if( ( void * ) pxTaskToSuspend == NULL )
if( ( ( void * ) pxTaskToSuspend == NULL ) && ( xSchedulerRunning != pdFALSE ) )
{
portYIELD_WITHIN_API();
}
@ -1175,6 +1175,12 @@ portTickType xTicks;
}
/*-----------------------------------------------------------*/
portTickType xTaskGetTickCountFromISR( void )
{
return xTickCount;
}
/*-----------------------------------------------------------*/
unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
{
/* A critical section is not required because the variables are of type