FreeRTOS queue usage
来源:互联网 发布:sql查询多表相同列名 编辑:程序博客网 时间:2024/06/05 20:38
#include "freertos/queue.h"
typedef struct fg_data {
unsigned short v;unsigned short i;
unsigned short p;
unsigned short kwh;
} fg_data_t;
static xQueueHandle UartMsgQueue;
Initialization:
UartMsgQueue = xQueueCreate( 5 /*depth*/, 8/*element size*/);
TX:
fg_data_t fgdata_tx;
fgdata_tx.v = 1;
…
xQueueSend( UartMsgQueue, ( void* )&fgdata, 1000/portTICK_RATE_MS);
ARG3: if queue has no room, the function will wait for maximum time, when timeout happens and still has no room, the function returns failure, otherwise returns success.
RX:
fg_data_t fgdata_rx;
xQueueReceive( UartMsgQueue, &fgdata_rx, 1000/portTICK_RATE_MS )
ARG3: if queue has been empty, the function will wait for maximum time, when timeout happens and no data available, the function returns failure, otherwise returns the data.
阅读全文
0 0
- FreeRTOS queue usage
- FreeRTOS内核详解----Queue
- queue.h usage
- queue.h usage
- FreeRTOS内核详解—-Queue
- queue.h usage (二)
- usage of stack and queue
- FreeRTOS内核详解—-Queue 1
- 【DataStructure】Description and usage of queue
- 【DataStructure】One of queue usage: Simulation System
- FreeRTOS
- FreeRTOS
- usage
- 队列的构造以及使用方法(the usage and construction of queue)
- FreeRTOS----创建FreeRTOS项目
- Queue
- queue
- Queue
- 金典——最接近的数__
- websocket的日常问题
- Hadoop日记——安装、配置、启动HDFS
- 葵花宝典第二天
- 3 Hibernate:本地 API 单元测试优化
- FreeRTOS queue usage
- where条件
- WebRTC音频模块
- CRC校验
- 基于Vue2.0+Vue-router构建一个简单的单页应用
- 使用ListView时的注意事项有哪些
- 爬虫技巧
- vue中的js类表达式
- linux命令下导入和导出mysql 数据