调通串口与上位机双向通信
- UART2 TX: 硬件FIFO+DMA+块传输模式,非阻塞发送 - UART2 RX: 硬件FIFO+中断+软件FIFO,状态机解析协议帧 - 协议: [SOF:0xA7][cmd:1][checksum:1],支持自动/手动/调试模式切换 - 更新.gitignore忽略*.log文件
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "Beep.h"
|
||||
#include "GrayscaleSensor.h"
|
||||
#include "MotorEncoder.h"
|
||||
#include "Command.h"
|
||||
|
||||
/*
|
||||
定时器资源分配:
|
||||
@@ -60,7 +61,7 @@ G6 20Hz任务
|
||||
0 GPIOA_INT_IRQn 外部中断模拟四倍频正交编码器
|
||||
1 TIMA0_INT_IRQn 100Hz任务
|
||||
1 TIMA1_INT_IRQn 50Hz任务
|
||||
1 UART2_INT_IRQn Command串口接收中断
|
||||
2 UART2_INT_IRQn Command串口接收中断
|
||||
7 TIMG6_INT_IRQn 20Hz任务
|
||||
*/
|
||||
int main (void)
|
||||
@@ -75,6 +76,7 @@ int main (void)
|
||||
imu_calibrate_gyro(); // IMU 陀螺仪零偏校准 需要在静止状态下调用
|
||||
grayscale_sensor_init();//灰度传感器初始化
|
||||
motor_encoder_init();//电机编码器初始化
|
||||
command_init();
|
||||
|
||||
task_init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user