generated from hulk/gd32f4xx_template_cmake_vscode
Add M1 single-shot temp query command; NTC trimmed-mean filter
This commit is contained in:
+3
-3
@@ -81,10 +81,10 @@ void rs485_send(const uint8_t *data, uint16_t len) {
|
||||
/* 回到接收态 */
|
||||
gpio_bit_reset(RS485_DE_PORT, RS485_DE_PIN);
|
||||
|
||||
/* 丢弃发送期间挤入/回环进接收通道的残留字节(读 DATA 清 RBNE/ORE),
|
||||
并清空接收环形缓冲,避免垃圾字节污染后续协议帧 */
|
||||
/* 读一次 DATA 丢弃发送窗口内挤入接收通道的残留字节(清 RBNE/ORE)。
|
||||
注意:不能清接收环形缓冲——缓冲里可能有"已收到待处理"的用户帧字节。
|
||||
发送期间的回环/杂散字节由协议状态机按非包头丢弃。 */
|
||||
(void)usart_data_receive(RS485_PHY);
|
||||
rs485_rx_clear();
|
||||
|
||||
/* 恢复接收 */
|
||||
usart_interrupt_enable(RS485_PHY, USART_INT_RBNE);
|
||||
|
||||
Reference in New Issue
Block a user