feat: 实验性上行数据接收

This commit is contained in:
bmy
2024-07-05 14:50:53 +08:00
parent 296d02ff4a
commit be37b5d206
5 changed files with 40 additions and 26 deletions

View File

@@ -92,15 +92,11 @@ void USART1_IRQHandler(void)
void USART2_IRQHandler(void)
{
if (USART_GetITStatus(USART2, USART_IT_RXNE) != RESET) {
// uint8_t data = (uint8_t)USART_ReceiveData(USART2);
// by_frame_parse_uart_handle(data);
USART_ReceiveData(USART2);
NVIC_SystemReset();
by_frame_parse_uart_handle((uint8_t)USART_ReceiveData(USART2));
USART_ClearITPendingBit(USART2, USART_IT_RXNE);
}
if (USART_GetFlagStatus(USART2, USART_FLAG_ORE) != RESET) {
USART_ClearFlag(USART2, USART_FLAG_ORE); // <20><><EFBFBD><EFBFBD> ORE <20><>־λ
USART_ReceiveData(USART2);
}