FreeRTOS 原创代码示例

时间:2021-07-29 21:18:36
【文件属性】:

文件名称:FreeRTOS 原创代码示例

文件大小:3KB

文件格式:C

更新时间:2021-07-29 21:18:36

FreeRTOS

Write a program using FreeRTOS that performs the following:  The program has three tasks: TxTask1, TxTask2, RxTask  The program has one global counter (an unsigned integer): globalCount  The program has one queue that is shared by all of the tasks: numberQueue  numberQueue should be sized so that it can hold up to 10 unsigned integers at a time  TxTask1 and TxTask 2 perform the same function: they place the current value of globalCount in the numberQueue queue, print out the current value of globalCount, and increment globalCount by 1 each time, then wait 500 ms before doing the same operation again.  RxTask should retrieve numbers from numberQueue, and print the value of the number retrieved from the queue  When the printf() function in C is used on an embedded system, it is usually connected to a UART or other communications interface. This hardware interface is a shared among all of the tasks, and must be protected appropriately.


网友评论