| 1851 | #if ( INCLUDE_vTaskDelay == 1 ) |
| 1852 | |
| 1853 | void vTaskDelay( const TickType_t xTicksToDelay ) |
| 1854 | { |
| 1855 | BaseType_t xAlreadyYielded = pdFALSE; |
| 1856 | |
| 1857 | /* A delay time of zero just forces a reschedule. */ |
| 1858 | if( xTicksToDelay > ( TickType_t ) 0U ) |
| 1859 | { |
| 1860 | vTaskSuspendAll(); |
| 1861 | { |
| 1862 | configASSERT( uxSchedulerSuspended == 1 ); |
| 1863 | traceTASK_DELAY(); |
| 1864 | |
| 1865 | /* A task that is removed from the event list while the |
| 1866 | * scheduler is suspended will not get placed in the ready |
| 1867 | * list or removed from the blocked list until the scheduler |
| 1868 | * is resumed. |
| 1869 | * |
| 1870 | * This task cannot be in an event list as it is the currently |
| 1871 | * executing task. */ |
| 1872 | prvAddCurrentTaskToDelayedList( xTicksToDelay, pdFALSE ); |
| 1873 | } |
| 1874 | xAlreadyYielded = xTaskResumeAll(); |
| 1875 | } |
| 1876 | else |
| 1877 | { |
| 1878 | mtCOVERAGE_TEST_MARKER(); |
| 1879 | } |
| 1880 | |
| 1881 | /* Force a reschedule if xTaskResumeAll has not already done so, we may |
| 1882 | * have put ourselves to sleep. */ |
| 1883 | if( xAlreadyYielded == pdFALSE ) |
| 1884 | { |
| 1885 | vTaskYieldWithinAPI(); |
| 1886 | } |
| 1887 | else |
| 1888 | { |
| 1889 | mtCOVERAGE_TEST_MARKER(); |
| 1890 | } |
| 1891 | } |
| 1892 | |
| 1893 | #endif /* INCLUDE_vTaskDelay */ |
| 1894 | /*-----------------------------------------------------------*/ |
no test coverage detected