8 Channels print
This commit is contained in:
parent
d701062b3b
commit
09fa75aa90
@ -1,11 +1,11 @@
|
|||||||
#include "can_radio_ctrl/candev.h"
|
#include "can_radio_ctrl/candev.h"
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <thread> // 异步接收线程
|
|
||||||
#include <atomic> // 线程退出标志
|
#include <atomic> // 线程退出标志
|
||||||
#include <chrono> // 睡眠所需头文件
|
#include <chrono> // 睡眠所需头文件
|
||||||
|
#include <cstring>
|
||||||
#include <iostream> // 日志输出
|
#include <iostream> // 日志输出
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <thread> // 异步接收线程
|
||||||
|
|
||||||
// 全局变量定义
|
// 全局变量定义
|
||||||
RadioData radio_data = {0, 0, 0, 0, false};
|
RadioData radio_data = {0, 0, 0, 0, false};
|
||||||
@ -118,6 +118,14 @@ void can_recv_loop()
|
|||||||
{
|
{
|
||||||
radio_data.gear = frame.data[0];
|
radio_data.gear = frame.data[0];
|
||||||
radio_data.sweep = frame.data[1];
|
radio_data.sweep = frame.data[1];
|
||||||
|
uint8_t ch3 = frame.data[2];
|
||||||
|
uint8_t ch4 = frame.data[3];
|
||||||
|
uint8_t ch5 = frame.data[4];
|
||||||
|
uint8_t ch6 = frame.data[5];
|
||||||
|
uint8_t ch7 = frame.data[6];
|
||||||
|
uint8_t ch8 = frame.data[7];
|
||||||
|
printf("ch1 : %d ,ch2 : %d ,ch3 : %d ,ch4 : %d\n", radio_data.gear, radio_data.sweep, ch3, ch4);
|
||||||
|
printf("ch5 : %d ,ch6 : %d ,ch7 : %d ,ch8 : %d\n", ch5, ch6, ch7, ch8);
|
||||||
radio_data.data_valid = true;
|
radio_data.data_valid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user