mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-20 01:58:32 -04:00
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:
parent
ad451e8b70
commit
7ce7d21ca8
2 changed files with 35 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue