@@ -2669,6 +2669,77 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
2669
2669
#endif /* INCLUDE_uxTaskPriorityGet */
2670
2670
/*-----------------------------------------------------------*/
2671
2671
2672
+ #if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) )
2673
+
2674
+ UBaseType_t uxTaskBasePriorityGet ( const TaskHandle_t xTask )
2675
+ {
2676
+ TCB_t const * pxTCB ;
2677
+ UBaseType_t uxReturn ;
2678
+
2679
+ traceENTER_uxTaskBasePriorityGet ( xTask );
2680
+
2681
+ taskENTER_CRITICAL ();
2682
+ {
2683
+ /* If null is passed in here then it is the base priority of the task
2684
+ * that called uxTaskBasePriorityGet() that is being queried. */
2685
+ pxTCB = prvGetTCBFromHandle ( xTask );
2686
+ uxReturn = pxTCB -> uxBasePriority ;
2687
+ }
2688
+ taskEXIT_CRITICAL ();
2689
+
2690
+ traceRETURN_uxTaskBasePriorityGet ( uxReturn );
2691
+
2692
+ return uxReturn ;
2693
+ }
2694
+
2695
+ #endif /* #if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) ) */
2696
+ /*-----------------------------------------------------------*/
2697
+
2698
+ #if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) )
2699
+
2700
+ UBaseType_t uxTaskBasePriorityGetFromISR ( const TaskHandle_t xTask )
2701
+ {
2702
+ TCB_t const * pxTCB ;
2703
+ UBaseType_t uxReturn ;
2704
+ UBaseType_t uxSavedInterruptStatus ;
2705
+
2706
+ traceENTER_uxTaskBasePriorityGetFromISR ( xTask );
2707
+
2708
+ /* RTOS ports that support interrupt nesting have the concept of a
2709
+ * maximum system call (or maximum API call) interrupt priority.
2710
+ * Interrupts that are above the maximum system call priority are keep
2711
+ * permanently enabled, even when the RTOS kernel is in a critical section,
2712
+ * but cannot make any calls to FreeRTOS API functions. If configASSERT()
2713
+ * is defined in FreeRTOSConfig.h then
2714
+ * portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion
2715
+ * failure if a FreeRTOS API function is called from an interrupt that has
2716
+ * been assigned a priority above the configured maximum system call
2717
+ * priority. Only FreeRTOS functions that end in FromISR can be called
2718
+ * from interrupts that have been assigned a priority at or (logically)
2719
+ * below the maximum system call interrupt priority. FreeRTOS maintains a
2720
+ * separate interrupt safe API to ensure interrupt entry is as fast and as
2721
+ * simple as possible. More information (albeit Cortex-M specific) is
2722
+ * provided on the following link:
2723
+ * https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
2724
+ portASSERT_IF_INTERRUPT_PRIORITY_INVALID ();
2725
+
2726
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR ();
2727
+ {
2728
+ /* If null is passed in here then it is the base priority of the calling
2729
+ * task that is being queried. */
2730
+ pxTCB = prvGetTCBFromHandle ( xTask );
2731
+ uxReturn = pxTCB -> uxBasePriority ;
2732
+ }
2733
+ taskEXIT_CRITICAL_FROM_ISR ( uxSavedInterruptStatus );
2734
+
2735
+ traceRETURN_uxTaskBasePriorityGetFromISR ( uxReturn );
2736
+
2737
+ return uxReturn ;
2738
+ }
2739
+
2740
+ #endif /* #if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) ) */
2741
+ /*-----------------------------------------------------------*/
2742
+
2672
2743
#if ( INCLUDE_vTaskPrioritySet == 1 )
2673
2744
2674
2745
void vTaskPrioritySet ( TaskHandle_t xTask ,
0 commit comments