0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

FreeRTOS任務(wù)通知簡介及實現(xiàn)

CHANBAEK ? 來源:南山府嵌入式 ? 作者:南山府嵌入式 ? 2022-12-06 16:24 ? 次閱讀

1- 簡介

每個系統(tǒng)任務(wù)都會有一個任務(wù)通知。然后每個任務(wù)通知都具有掛起或者未掛起的狀態(tài),以及32位的通知。常量configTASK_NOTIFICATION_ARRAY_ENTRIES()是用來設(shè)置任務(wù)通知索引的數(shù)組。

任務(wù)通知是直接發(fā)送給任務(wù)事件,不是通過中間對象(隊列、事件組、信號量)間接發(fā)送給任務(wù)的。

當(dāng)任務(wù)發(fā)送任務(wù)通知時,會將目標(biāo)任務(wù)通知的狀態(tài)設(shè)定位掛起狀態(tài)。就像任務(wù)阻塞中間對象一樣,例如,信號在等待信號量的可用情況,任務(wù)組織這個等待通知的狀態(tài)變?yōu)閽炱鸬臓顟B(tài)。

任務(wù)通知也可以是以下幾種方式:

  • 值覆蓋,不管接受任務(wù)是否已經(jīng)讀取被覆蓋的值。
  • 值覆蓋,僅當(dāng)接收任務(wù)已讀取被覆蓋的值時。
  • 在設(shè)置值中設(shè)置一個或多個位。
  • 遞增值(加1)

注意:

每個數(shù)組中的通知都是獨立的,一個任務(wù)一次只能阻塞數(shù)組中的一個通知,而且不會通過發(fā)送到任何其他數(shù)組索引的直通解除阻塞狀態(tài)。

1.1 優(yōu)勢和使用限制

任務(wù)通知的靈活性允許它們在需要創(chuàng)建單獨隊列、二進(jìn)制信號量、計數(shù)信號量或事件組的情況下使用。使用直接通知解除RTOS任務(wù)的阻塞速度比使用中間對象(如二進(jìn)制信號量)解除阻塞的速度快45% *,并且使用的RAM更少。正如所料,這些性能優(yōu)勢需要一些用例限制。

1-當(dāng)只有一個任務(wù)可以接收事件時,才可以使用RTOS任務(wù)通知。然而,實際應(yīng)用中的大多數(shù)用例都滿足這個條件,例如中斷解除阻塞,任務(wù)將處理由中斷接收到的數(shù)據(jù)。

2-只有在使用RTOS任務(wù)通知代替隊列的情況下:接收任務(wù)可以在阻塞狀態(tài)下等待通知(這樣不會消耗任何CPU時間),如果發(fā)送任務(wù)不能立即完成,則發(fā)送任務(wù)不能在阻塞狀態(tài)下等待發(fā)送完成。

1.2 用例

通知使用xTaskNotifyIndexed()和xTaskNotifyGiveIndexed() API函數(shù)(和它們的中斷安全等效)發(fā)送,并保持等待,直到接收RTOS任務(wù)調(diào)用xTaskNotifyWaitIndexed()或ulTaskNotifyTakeIndexed() API函數(shù)。這些API函數(shù)都有一個不帶“I索引”前綴的等價函數(shù)。非“索引”版本總是在數(shù)組索引0處的任務(wù)通知上操作。例如,xTaskNotifyGive(TargetTask)等價于xTaskNotifyGiveIndexed(TargetTask, 0) -兩者都在索引0處增加任務(wù)通知由任務(wù)處理的TargetTask引用的任務(wù)。

2-將 RTOS 任務(wù)通知用作輕量級二進(jìn)制信號量

與使用二進(jìn)制信號量解鎖任務(wù)相比,使用直接通知解鎖 RTOS 任務(wù)的速度快 45%,并且使用的 RAM 更少。

二進(jìn)制信號量是最大計數(shù)為 1 的信號量,因此稱為“二進(jìn)制”。任務(wù)只有在信號量可用時才可以“獲取”信號量,并且信號量僅 如果計數(shù)為 1,則可用。

當(dāng)使用任務(wù)通知代替二進(jìn)制信號量時,接收任務(wù)的通知值會代替二進(jìn)制信號量的count值,并且會使用ulTaskNotifyTake()(或ulTaskNotifyTakeIndexed()) API函數(shù)代替信號量的xSemaphoreTake() API函數(shù)。

ulTaskNotifyTake()函數(shù)的xClearOnExit參數(shù)被設(shè)置為pdTRUE,因此每次收到通知時count值都返回0——模擬二進(jìn)制信號量。

同樣,xTaskNotifyGive()(或xTaskNotifyGiveIndexed())或vTaskNotifyGiveFromISR()(或vTaskNotifyGiveIndexedFromISR())函數(shù)被用來代替信號量的xSemaphoreGive()和xSemaphoreGiveFromISR()函數(shù)。

2.1 使用范例

1/*這是通用外設(shè)驅(qū)動程序中的傳輸函數(shù)的一個例子。
 2RTOS任務(wù)調(diào)用傳輸函數(shù),然后處于阻塞狀態(tài)(因此不占用CPU時間),
 3直到收到傳輸完成的通知。傳輸由DMA執(zhí)行,DMA端中斷用于通知任務(wù)。 */
 4
 5/* 存儲傳輸完成時將收到通知的任務(wù)句柄。 */
 6static TaskHandle_t xTaskToNotify = NULL;
 7
 8/* 目標(biāo)任務(wù)要使用的任務(wù)通知數(shù)組中的索引。 */
 9const UBaseType_t xArrayIndex = 1;
10
11/* 外設(shè)驅(qū)動的傳輸功能 */
12void StartTransmission( uint8_t *pcData, size_t xDataLength )
13{
14/*此時xTaskToNotify應(yīng)該為NULL,因為沒有正在進(jìn)行傳輸。
15如果有必要,可以使用互斥量來保護(hù)對外設(shè)的訪問。*/
16configASSERT( xTaskToNotify == NULL );
17
18/* 存儲調(diào)用任務(wù)的句柄。 */
19xTaskToNotify = xTaskGetCurrentTaskHandle();
20
21/* 開始傳輸:在傳輸完成時產(chǎn)生一個中斷。 */
22vStartTransmit( pcData, xDatalength );
23}
24/*-----------------------------------------------------------*/
25
26/* 結(jié)束中斷傳輸 */
27void vTransmitEndISR( void )
28{
29BaseType_t xHigherPriorityTaskWoken = pdFALSE;
30
31/* 此時,xTaskToNotify不應(yīng)該為NULL,因為傳輸正在進(jìn)行中。 */
32configASSERT( xTaskToNotify != NULL );
33
34/* Notify the task that the transmission is complete. */
35vTaskNotifyGiveIndexedFromISR( xTaskToNotify,
36xArrayIndex,
37&xHigherPriorityTaskWoken );
38
39/*此時,xTaskToNotify不應(yīng)該為NULL,因為傳輸正在進(jìn)行中。 */
40xTaskToNotify = NULL;
41
42/*如果xHigherPriorityTaskWoken現(xiàn)在設(shè)置為pdTRUE,
43那么應(yīng)該執(zhí)行切換,以確保中斷直接返回到最高優(yōu)先級的任務(wù)。
44用于該目的的宏取決于所使用的端口,可以稱為portEND_SWITCHING_ISR()。 */
45portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
46}
47/*-----------------------------------------------------------*/
48
49/* 發(fā)起傳輸?shù)娜蝿?wù),然后進(jìn)入阻塞狀態(tài)(因此不消耗任何CPU時間),以等待傳輸完成。 */
50void vAFunctionCalledFromATask( uint8_t ucDataToTransmit,
51size_t xDataLength )
52{
53uint32_t ulNotificationValue;
54const TickType_t xMaxBlockTime = pdMS_TO_TICKS( 200 );
55
56/* 通過調(diào)用上面顯示的函數(shù)開始傳輸。 */
57StartTransmission( ucDataToTransmit, xDataLength );
58
59/* 等待傳輸完成的通知。注意,第一個參數(shù)是pdTRUE,
60它的作用是將任務(wù)的通知值清除回0,
61使通知值類似于二進(jìn)制(而不是計數(shù))信號量。 */
62ulNotificationValue = ulTaskNotifyTakeIndexed( xArrayIndex,
63pdTRUE,
64xMaxBlockTime );
65
66if( ulNotificationValue == 1 )
67{
68/* The transmission ended as expected. */
69}
70else
71{
72/* The call to ulTaskNotifyTake() timed out. */
73}
74}

3-使用 RTOS 任務(wù)通知作為輕量級計數(shù)信號量

與使用信號量解鎖任務(wù)相比,使用直接通知解鎖 RTOS 任務(wù)的速度快 45%,并且使用的 RAM 更少。

計數(shù)信號量是這樣一種信號量,其計數(shù)值可以為0,直到創(chuàng)建信號量時設(shè)置的最大值。只有當(dāng)信號量可用時,任務(wù)才能獲取信號量,并且只有當(dāng)信號量的計數(shù)大于0時,信號量才可用。

當(dāng)使用任務(wù)通知來代替計數(shù)信號量時,接收任務(wù)的通知值會代替計數(shù)信號量的計數(shù)值,并且使用ulTaskNotifyTake()(或ulTaskNotifyTakeIndexed()) API函數(shù)來代替信號量的xSemaphoreTake() API函數(shù)。ulTaskNotifyTake()函數(shù)的xClearOnExit參數(shù)被設(shè)置為pdFALSE,因此每次收到通知時,計數(shù)值只減少(而不是清除)——模擬計數(shù)信號量。

同樣,xTaskNotifyGive()(或xTaskNotifyGiveIndexed())或vTaskNotifyGiveFromISR()(或vTaskNotifyGiveIndexedFromISR())函數(shù)被用來代替信號量的xSemaphoreGive()和xSemaphoreGiveFromISR()函數(shù)。

下面通過兩個例子來看。

下面的第一個例子使用接收任務(wù)的通知值作為計數(shù)信號量。第二個示例提供了高效的實現(xiàn)方式。

3.1 Example 1:

1/* An interrupt handler that does not process interrupts directly,
 2but instead defers processing to a high priority RTOS task. The
 3ISR uses RTOS task notifications to both unblock the RTOS task
 4and increment the RTOS task's notification value. */
 5void vANInterruptHandler( void )
 6{
 7BaseType_t xHigherPriorityTaskWoken;
 8
 9/* Clear the interrupt. */
10prvClearInterruptSource();
11
12/* xHigherPriorityTaskWoken must be initialised to pdFALSE.
13If calling vTaskNotifyGiveFromISR() unblocks the handling
14task, and the priority of the handling task is higher than
15the priority of the currently running task, then
16xHigherPriorityTaskWoken will be automatically set to pdTRUE. */
17xHigherPriorityTaskWoken = pdFALSE;
18
19/* Unblock the handling task so the task can perform
20any processing necessitated by the interrupt. xHandlingTask
21is the task's handle, which was obtained when the task was
22created. vTaskNotifyGiveFromISR() also increments
23the receiving task's notification value. */
24vTaskNotifyGiveFromISR( xHandlingTask, &xHigherPriorityTaskWoken );
25
26/* Force a context switch if xHigherPriorityTaskWoken is now
27set to pdTRUE. The macro used to do this is dependent on
28the port and may be called portEND_SWITCHING_ISR. */
29portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
30}
31/*-----------------------------------------------------------*/
32
33/* A task that blocks waiting to be notified that the peripheral
34needs servicing. */
35void vHandlingTask( void *pvParameters )
36{
37BaseType_t xEvent;
38const TickType_t xBlockTime = pdMS_TO_TICS( 500 );
39uint32_t ulNotifiedValue;
40
41for( ;; )
42{
43/* Block to wait for a notification. Here the RTOS
44task notification is being used as a counting semaphore.
45The task's notification value is incremented each time
46the ISR calls vTaskNotifyGiveFromISR(), and decremented
47each time the RTOS task calls ulTaskNotifyTake() - so in
48effect holds a count of the number of outstanding interrupts.
49The first parameter is set to pdFALSE, so the notification
50value is only decremented and not cleared to zero, and one
51deferred interrupt event is processed at a time. See
52example 2 below for a more pragmatic approach. */
53ulNotifiedValue = ulTaskNotifyTake( pdFALSE,
54xBlockTime );
55
56if( ulNotifiedValue > 0 )
57{
58/* Perform any processing necessitated by the interrupt. */
59xEvent = xQueryPeripheral();
60
61if( xEvent != NO_MORE_EVENTS )
62{
63vProcessPeripheralEvent( xEvent );
64}
65}
66else
67{
68/* Did not receive a notification within the expected
69time. */
70vCheckForErrorConditions();
71}
72}
73}

3.2 Example 2:

1這個例子展示了一個更實用和高效的RTOS任務(wù)的實現(xiàn)。在這個實現(xiàn)中,ulTaskNotifyTake()的返回值用于知道有多少未處理的ISR事件必須被處理,允許RTOS任務(wù)的通知計數(shù)在每次ulTaskNotifyTake()被調(diào)用時被清除回零。中斷服務(wù)例程(ISR)假定如上例1所示。
 2/* The index within the target task's array of task notifications
 3to use. */
 4const UBaseType_t xArrayIndex = 0;
 5
 6/* A task that blocks waiting to be notified that the peripheral
 7needs servicing. */
 8void vHandlingTask( void *pvParameters )
 9{
10BaseType_t xEvent;
11const TickType_t xBlockTime = pdMS_TO_TICS( 500 );
12uint32_t ulNotifiedValue;
13
14for( ;; )
15{
16/* As before, block to wait for a notification form the ISR.
17This time however the first parameter is set to pdTRUE,
18clearing the task's notification value to 0, meaning each
19outstanding outstanding deferred interrupt event must be
20processed before ulTaskNotifyTake() is called again. */
21ulNotifiedValue = ulTaskNotifyTakeIndexed( xArrayIndex,
22pdTRUE,
23xBlockTime );
24
25if( ulNotifiedValue == 0 )
26{
27/* Did not receive a notification within the expected
28time. */
29vCheckForErrorConditions();
30}
31else
32{
33/* ulNotifiedValue holds a count of the number of
34outstanding interrupts. Process each in turn. */
35while( ulNotifiedValue > 0 )
36{
37xEvent = xQueryPeripheral();
38
39if( xEvent != NO_MORE_EVENTS )
40{
41vProcessPeripheralEvent( xEvent );
42ulNotifiedValue--;
43}
44else
45{
46break;
47}
48}
49}
50}
51}

4-將 RTOS 任務(wù)通知用作輕量級事件組

事件組是一組二進(jìn)制標(biāo)志(或位),應(yīng)用程序編寫人員可以為每個標(biāo)志指定含義。RTOS進(jìn)程可以進(jìn)入阻塞狀態(tài),等待組內(nèi)的一個或多個標(biāo)志變?yōu)榛顒訝顟B(tài)。當(dāng)RTOS任務(wù)處于阻塞狀態(tài)時,不會消耗任何CPU時間。

當(dāng)使用任務(wù)通知代替事件組時,使用接收任務(wù)的通知值代替事件組,接收任務(wù)的通知值中的比特位用作事件標(biāo)志,并且使用xTaskNotifyWait() API函數(shù)代替事件組的xEventGroupWaitBits() API函數(shù)。

同樣,使用xTaskNotify()和xTaskNotifyFromISR() API函數(shù)(其eAction參數(shù)設(shè)置為eSetBits)來代替xEventGroupSetBits()和xEventGroupSetBitsFromISR()函數(shù)。

與xEventGroupSetBitsFromISR()相比,xTaskNotifyFromISR()具有顯著的性能優(yōu)勢,因為xTaskNotifyFromISR()完全在ISR中執(zhí)行,而xEventGroupSetBitsFromISR()必須推遲一些處理到RTOS進(jìn)程任務(wù)。

與使用事件組時不同,接收任務(wù)不能指定只在同時有多個比特位處于活動狀態(tài)時才離開阻塞狀態(tài)。相反,在任何比特位處于活動狀態(tài)時,進(jìn)程將解除阻塞,并且必須自己測試比特位的組合。

1/* This example demonstrates a single RTOS task being used to process
  2events that originate from two separate interrupt service routines -
  3a transmit interrupt and a receive interrupt. Many peripherals will
  4use the same handler for both, in which case the peripheral's
  5interrupt status register can simply be bitwise ORed with the
  6receiving task's notification value.
  7
  8First bits are defined to represent each interrupt source. */
  9#define TX_BIT 0x01
 10#define RX_BIT 0x02
 11
 12/* The handle of the task that will receive notifications from the
 13interrupts. The handle was obtained when the task
 14was created. */
 15static TaskHandle_t xHandlingTask;
 16
 17/*-----------------------------------------------------------*/
 18
 19/* The implementation of the transmit interrupt service routine. */
 20void vTxISR( void )
 21{
 22BaseType_t xHigherPriorityTaskWoken = pdFALSE;
 23
 24/* Clear the interrupt source. */
 25prvClearInterrupt();
 26
 27/* Notify the task that the transmission is complete by setting the TX_BIT
 28in the task's notification value. */
 29xTaskNotifyFromISR( xHandlingTask,
 30TX_BIT,
 31eSetBits,
 32&xHigherPriorityTaskWoken );
 33
 34/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
 35should be performed to ensure the interrupt returns directly to the highest
 36priority task. The macro used for this purpose is dependent on the port in
 37use and may be called portEND_SWITCHING_ISR(). */
 38portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
 39}
 40/*-----------------------------------------------------------*/
 41
 42/* The implementation of the receive interrupt service routine is identical
 43except for the bit that gets set in the receiving task's notification value. */
 44void vRxISR( void )
 45{
 46BaseType_t xHigherPriorityTaskWoken = pdFALSE;
 47
 48/* Clear the interrupt source. */
 49prvClearInterrupt();
 50
 51/* Notify the task that the reception is complete by setting the RX_BIT
 52in the task's notification value. */
 53xTaskNotifyFromISR( xHandlingTask,
 54RX_BIT,
 55eSetBits,
 56&xHigherPriorityTaskWoken );
 57
 58/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
 59should be performed to ensure the interrupt returns directly to the highest
 60priority task. The macro used for this purpose is dependent on the port in
 61use and may be called portEND_SWITCHING_ISR(). */
 62portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
 63}
 64/*-----------------------------------------------------------*/
 65
 66/* The implementation of the task that is notified by the interrupt service
 67routines. */
 68static void prvHandlingTask( void *pvParameter )
 69{
 70const TickType_t xMaxBlockTime = pdMS_TO_TICKS( 500 );
 71BaseType_t xResult;
 72
 73for( ;; )
 74{
 75/* Wait to be notified of an interrupt. */
 76xResult = xTaskNotifyWait( pdFALSE, /* Don't clear bits on entry. */
 77ULONG_MAX, /* Clear all bits on exit. */
 78&ulNotifiedValue, /* Stores the notified value. */
 79xMaxBlockTime );
 80
 81if( xResult == pdPASS )
 82{
 83/* A notification was received. See which bits were set. */
 84if( ( ulNotifiedValue & TX_BIT ) != 0 )
 85{
 86/* The TX ISR has set a bit. */
 87prvProcessTx();
 88}
 89
 90if( ( ulNotifiedValue & RX_BIT ) != 0 )
 91{
 92/* The RX ISR has set a bit. */
 93prvProcessRx();
 94}
 95}
 96else
 97{
 98/* Did not receive a notification within the expected time. */
 99prvCheckForErrors();
100}
101}
102}

5-將 RTOS 任務(wù)通知用作輕量級郵箱

RTOS任務(wù)通知可用于向任務(wù)發(fā)送數(shù)據(jù),但與RTOS隊列相比,發(fā)送數(shù)據(jù)的方式要嚴(yán)格得多,因為:

  • 只能發(fā)送 32 位值

  • 該值被保存為接收任務(wù)的通知值,并且在任何時間只能有一個通知值,因此短語“輕量級郵箱”優(yōu)先于“輕量級隊列”。任務(wù)的通知值是郵箱值。

  • 數(shù)據(jù)使用xTaskNotify()(或xTaskNotifyIndexed())和xTaskNotifyFromISR()(或xTaskNotifyIndexedFromISR()) API函數(shù)發(fā)送到任務(wù),其eAction參數(shù)設(shè)置為eSetValueWithOverwrite或eSetValueWithoutOverwrite。如果eAction設(shè)置為eSetValueWithOverwrite,那么即使接收任務(wù)已經(jīng)有一個待處理的通知,也會更新接收任務(wù)的通知值。如果eAction設(shè)置為esetvaluewithoutooverwrite,則只有在接收任務(wù)沒有待處理通知時才更新接收任務(wù)的通知值——因為更新通知值將覆蓋接收任務(wù)處理之前的值。

    任務(wù)可以使用xTaskNotifyWait()(或xTaskNotifyWaitIndexed())讀取它自己的通知值。

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • 函數(shù)
    +關(guān)注

    關(guān)注

    3

    文章

    4235

    瀏覽量

    61965
  • RTOS
    +關(guān)注

    關(guān)注

    20

    文章

    804

    瀏覽量

    119113
  • FreeRTOS
    +關(guān)注

    關(guān)注

    12

    文章

    483

    瀏覽量

    61721
收藏 人收藏

    評論

    相關(guān)推薦

    FreeRTOS中的任務(wù)管理

    任務(wù)FreeRTOS 中最基本的調(diào)度單元,它是一段可執(zhí)行的代碼,可以獨立運行。FreeRTOS 中的任務(wù)是基于優(yōu)先級的搶占式調(diào)度,優(yōu)先級高的任務(wù)
    的頭像 發(fā)表于 11-27 17:03 ?784次閱讀

    FreeRTOS任務(wù)通知模擬二值信號量怎么都獲取不成功是怎么回事

    如圖,所示,救助論壇的大神,元老? FreeRTOS 21080511 任務(wù)通知模擬二值信號量.rar (4.02 MB )
    發(fā)表于 06-15 04:32

    FreeRTOS任務(wù)通知相關(guān)資料分享

    FreeRTOS--任務(wù)通知Notification今天發(fā)現(xiàn)了一個奇怪的現(xiàn)象,特意把它記錄下來,防止忘記了。先上圖于是找了所有的任務(wù)句柄,真的是沒有操作掛起了這個
    發(fā)表于 01-21 12:07

    使用FreeRTOS通知功能加速應(yīng)用執(zhí)行

    使用FreeRTOS的直接任務(wù)通知實現(xiàn)更高效的交互,與信號量相比,通知機(jī)制內(nèi)存占用更小,速度可提高45%。架構(gòu)良好的
    發(fā)表于 04-14 11:19

    如何輕松幾步實現(xiàn)在STM32上運行FreeRTOS任務(wù)

    輕松幾步實現(xiàn)在STM32上運行FreeRTOS任務(wù)
    的頭像 發(fā)表于 03-01 12:07 ?8305次閱讀
    如何輕松幾步<b class='flag-5'>實現(xiàn)</b>在STM32上運行<b class='flag-5'>FreeRTOS</b><b class='flag-5'>任務(wù)</b>

    FreeRTOS的直接任務(wù)(消息)通知

    ? ? ? ? 之前分享了《FreeRTOS V10.4.0更新了哪些功能?》,今天就來詳細(xì)講述其中的一個知識點:FreeRTOS的直接任務(wù)(消息)通知,這樣做的目的就是減少RAM占用
    的頭像 發(fā)表于 01-07 09:37 ?4383次閱讀

    FreeRTOS —— 9.任務(wù)通知

    9.1本章介紹與范圍已經(jīng)看到,使用FreeRTOS的應(yīng)用程序被構(gòu)造為一組獨立的任務(wù),并且這些任務(wù)很可能必須彼此通信,以便它們可以共同提供有用的系統(tǒng)功能。通過中介對象進(jìn)行通信本書已經(jīng)描述了任務(wù)
    發(fā)表于 12-04 20:21 ?10次下載
    <b class='flag-5'>FreeRTOS</b> —— 9.<b class='flag-5'>任務(wù)</b><b class='flag-5'>通知</b>

    FreeRTOS高級篇8---FreeRTOS任務(wù)通知分析

    FreeRTOS版本V8.2.0中推出了全新的功能:任務(wù)通知。在大多數(shù)情況下,任務(wù)通知可以替代二進(jìn)制信號量、計數(shù)信號量、事件組,可以替代長
    發(fā)表于 01-26 17:36 ?10次下載
    <b class='flag-5'>FreeRTOS</b>高級篇8---<b class='flag-5'>FreeRTOS</b><b class='flag-5'>任務(wù)</b><b class='flag-5'>通知</b>分析

    FreeRTOS系列第15篇---使用任務(wù)通知實現(xiàn)命令行解釋器

    雖然這是介紹FreeRTOS系列的文章,但這篇文章偏重于命令行解釋器的實現(xiàn)。這一方面是因為任務(wù)通知使用起來非常簡單,另一方面也因為對于...
    發(fā)表于 01-26 17:49 ?6次下載
    <b class='flag-5'>FreeRTOS</b>系列第15篇---使用<b class='flag-5'>任務(wù)</b><b class='flag-5'>通知</b><b class='flag-5'>實現(xiàn)</b>命令行解釋器

    FreeRTOS系列第14篇---FreeRTOS任務(wù)通知

    每個RTOS任務(wù)都有一個32位的通知值,任務(wù)創(chuàng)建時,這個值被初始化為0。RTOS任務(wù)通知相當(dāng)于直接向任務(wù)
    發(fā)表于 01-26 17:49 ?5次下載
    <b class='flag-5'>FreeRTOS</b>系列第14篇---<b class='flag-5'>FreeRTOS</b><b class='flag-5'>任務(wù)</b><b class='flag-5'>通知</b>

    FreeRTOS系列第11篇---FreeRTOS任務(wù)控制

    FreeRTOS任務(wù)控制API函數(shù)主要實現(xiàn)任務(wù)延時、任務(wù)掛起、解除任務(wù)掛起、任務(wù)優(yōu)先級獲取和設(shè)置
    發(fā)表于 01-26 17:54 ?12次下載
    <b class='flag-5'>FreeRTOS</b>系列第11篇---<b class='flag-5'>FreeRTOS</b><b class='flag-5'>任務(wù)</b>控制

    FreeRTOS任務(wù)和協(xié)程簡介實現(xiàn)

    簡單來說,FreeRTOS實時系統(tǒng)能夠創(chuàng)建多個獨立的任務(wù),任務(wù)之間互不干擾。任務(wù)創(chuàng)建之后并不是一起運行的,而是通過優(yōu)先級順序進(jìn)行任務(wù)的調(diào)用,
    的頭像 發(fā)表于 12-06 16:33 ?2781次閱讀
    <b class='flag-5'>FreeRTOS</b><b class='flag-5'>任務(wù)</b>和協(xié)程<b class='flag-5'>簡介</b>及<b class='flag-5'>實現(xiàn)</b>

    FreeRTOS任務(wù)間通信,怎么實現(xiàn)?

    FreeRTOS 是一個可裁剪、可剝奪型的多任務(wù)內(nèi)核,十分好用,而且沒有任務(wù)數(shù)限制,在此之前分析過很多了,簡單來說,FreeRTOS實時系統(tǒng)能夠創(chuàng)建多個獨立的
    的頭像 發(fā)表于 02-23 09:21 ?1801次閱讀

    FreeRTOS任務(wù)通知簡介

    任務(wù)通知簡介 任務(wù)通知FreeRTOS 中是一個可選的功能,要使用
    的頭像 發(fā)表于 07-30 11:34 ?644次閱讀

    FreeRTOS任務(wù)通知通用發(fā)送函數(shù)

    發(fā)送任務(wù)通知 任務(wù)通知通用發(fā)送函數(shù) 任務(wù)任務(wù)通知發(fā)
    的頭像 發(fā)表于 07-30 11:43 ?637次閱讀
    <b class='flag-5'>FreeRTOS</b><b class='flag-5'>任務(wù)</b><b class='flag-5'>通知</b>通用發(fā)送函數(shù)