/* Called by vApplicationTickHook(), which is defined in main.c. */ void vFullDemoTickHookFunction( void ) { TaskHandle_t xTimerTask; /* Call the periodic timer test, which tests the timer API functions that can be called from an ISR. */ #if( configUSE_PREEMPTION != 0 ) { /* Only created when preemption is used. */ vTimerPeriodicISRTests(); } #endif /* Call the periodic queue overwrite from ISR demo. */ vQueueOverwritePeriodicISRDemo(); /* Write to a queue that is in use as part of the queue set demo to demonstrate using queue sets from an ISR. */ vQueueSetAccessQueueSetFromISR(); vQueueSetPollingInterruptAccess(); /* Exercise event groups from interrupts. */ vPeriodicEventGroupsProcessing(); /* Exercise giving mutexes from an interrupt. */ vInterruptSemaphorePeriodicTest(); /* Exercise using task notifications from an interrupt. */ xNotifyTaskFromISR(); /* For code coverage purposes. */ xTimerTask = xTimerGetTimerDaemonTaskHandle(); configASSERT( uxTaskPriorityGetFromISR( xTimerTask ) == configTIMER_TASK_PRIORITY ); }
/** * @brief Get current priority of an active thread. * @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId. * @retval current priority value of the thread function. * @note MUST REMAIN UNCHANGED: \b osThreadGetPriority shall be consistent in every CMSIS-RTOS. */ osPriority osThreadGetPriority (osThreadId thread_id) { #if (INCLUDE_uxTaskPriorityGet == 1) if (inHandlerMode()) { return makeCmsisPriority(uxTaskPriorityGetFromISR(thread_id)); } else { return makeCmsisPriority(uxTaskPriorityGet(thread_id)); } #else return osPriorityError; #endif }