Files
ManGoWalk_STM32/fun/imu948.c

31 lines
525 B
C

#include "imu948.h"
extern _GPSData gps_data;
extern TX_QUEUE ble_tx_queue;
/***
此文件 以IMU.c作为底层代码 Base
现在编写应用层程序
***/
void imu_angle_ble_task_entry(ULONG thread_input)
{
BleMessage msg;
UINT sta; // 状态
while(1)
{
// 只要有新数据,就触发
tx_thread_sleep(500); // 每20ms采样一次
//读取最新角度
msg.angle = 96.7;
// 发送到消息队列
sta = tx_queue_send(&ble_tx_queue,&msg,TX_NO_WAIT);
if(sta != TX_SUCCESS)
{
HCBle_SendData("Queue is full,IMU's Data was abandon");
}
}
}