|
|
|
@ -19,6 +19,7 @@ |
|
|
|
#include "msp_TL720D.pb.h" |
|
|
|
#include "BHBF.h" |
|
|
|
#include "msg_center.h" |
|
|
|
#include "rd_time.h" |
|
|
|
|
|
|
|
/*----------------------------------------------*
|
|
|
|
* 外部变量说明 * |
|
|
|
@ -107,6 +108,8 @@ static int check_TL720D(char *_pBuffer, uint32_t _iSize) |
|
|
|
|
|
|
|
static void decode_TL720D(const char *buf, uint32_t _iSize) |
|
|
|
{ |
|
|
|
static uint32_t uiLastSendTick = 0; |
|
|
|
|
|
|
|
g_stTL720D.RF_Angle_Roll = getDeci((uint8_t *)&buf[4]); |
|
|
|
g_stTL720D.RF_Angle_Pitch = getDeci((uint8_t *)&buf[7]); |
|
|
|
g_stTL720D.RF_Angle_Yaw = getDeci((uint8_t *)&buf[10]); |
|
|
|
@ -117,8 +120,13 @@ static void decode_TL720D(const char *buf, uint32_t _iSize) |
|
|
|
g_stTL720D.RF_Gro_Y = getDeci((uint8_t *)&buf[25]); |
|
|
|
g_stTL720D.RF_Gro_Z = getDeci((uint8_t *)&buf[28]); |
|
|
|
|
|
|
|
uint32_t uiNowTick = Rd_GetTime(); |
|
|
|
if ((int32_t)(uiNowTick - uiLastSendTick) >= 50) |
|
|
|
{ |
|
|
|
uiLastSendTick = uiNowTick; |
|
|
|
MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_GET_TL720D_ROLL, (void *)&g_stTL720D.RF_Angle_Roll, sizeof(int32_t)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void Read_TL720D(void *argument) |
|
|
|
{ |
|
|
|
|