485扩展板轮询帧日志降为debug级(2s例行流量不再刷屏,LOGDEBUG命令可开启查看)

This commit is contained in:
helei 2026-09-08 13:19:44 +08:00
parent f9c4b3f4cc
commit fa8942aca1
1 changed files with 4 additions and 2 deletions

View File

@ -393,7 +393,8 @@ uint16_t USART2_PollFrame(uint8_t *out, uint16_t out_size)
char hex[3 * 24 + 1] = {0}; char hex[3 * 24 + 1] = {0};
uint16_t n0 = uart2_frame_len < 24 ? uart2_frame_len : 24; uint16_t n0 = uart2_frame_len < 24 ? uart2_frame_len : 24;
for (uint16_t k = 0; k < n0; k++) snprintf(hex + k * 3, 4, "%02X ", uart2_frame_buf[k]); for (uint16_t k = 0; k < n0; k++) snprintf(hex + k * 3, 4, "%02X ", uart2_frame_buf[k]);
log_info("> UART2: Ö¡Ìá½» %d ×Ö½Ú: %s", (int)uart2_frame_len, hex); if (uart2_frame_buf[0] == 0x10) log_debug("> UART2: 帧提交 %d 字节: %s", (int)uart2_frame_len, hex); /* 扩展板轮询帧降为 debug */
else log_info("> UART2: 帧提交 %d 字节: %s", (int)uart2_frame_len, hex);
uint16_t len = uart2_frame_len < out_size ? uart2_frame_len : out_size - 1; uint16_t len = uart2_frame_len < out_size ? uart2_frame_len : out_size - 1;
memcpy(out, uart2_frame_buf, len); memcpy(out, uart2_frame_buf, len);
out[len] = 0; out[len] = 0;
@ -412,7 +413,8 @@ void USART2_Tick(void)
char hex[3 * 24 + 1] = {0}; char hex[3 * 24 + 1] = {0};
uint16_t n = uart2_cmd_index < 24 ? uart2_cmd_index : 24; uint16_t n = uart2_cmd_index < 24 ? uart2_cmd_index : 24;
for (uint16_t i = 0; i < n; i++) snprintf(hex + i * 3, 4, "%02X ", uart2_cmd_buf[i]); for (uint16_t i = 0; i < n; i++) snprintf(hex + i * 3, 4, "%02X ", uart2_cmd_buf[i]);
log_info("> UART2: Ö¡Ìá½» %d ×Ö½Ú: %s", (int)uart2_cmd_index, hex); if (uart2_cmd_buf[0] == 0x10) log_debug("> UART2: 帧提交 %d 字节: %s", (int)uart2_cmd_index, hex);
else log_info("> UART2: 帧提交 %d 字节: %s", (int)uart2_cmd_index, hex);
uart2_rx_ready = 1; uart2_rx_ready = 1;
} }
} }