generated from hulk/gd32f4xx_template_cmake_vscode
RS485 send: disable RX during tx + drain/clear after (anti-loopback); COM_DEBUG on with RX byte trace
This commit is contained in:
@@ -463,6 +463,11 @@ void command_process(void) {
|
||||
int byte = rs485_rx_get();
|
||||
if (byte < 0) break;
|
||||
|
||||
#if COM_DEBUG == CFG_ENABLE
|
||||
/* 调试:打印 RS485 收到的每个原始字节 */
|
||||
printf("[RX] %02X\r\n", (uint8_t)byte);
|
||||
#endif
|
||||
|
||||
if (cmd_len == 0) {
|
||||
if ((uint8_t)byte == PROTOCOL_PACKAGE_HEADER) {
|
||||
cmd_buf[cmd_len++] = (uint8_t)byte;
|
||||
|
||||
Reference in New Issue
Block a user