开启串口3接收中断

This commit is contained in:
bmy
2024-04-14 22:33:26 +08:00
parent 2200c58e43
commit 750f6dc50f
2 changed files with 659 additions and 656 deletions

View File

@@ -261,7 +261,10 @@ void USART2_IRQHandler(void)
void USART3_IRQHandler(void)
{
/* add user code begin USART3_IRQ 0 */
if (SET == usart_flag_get(USART3, USART_RDBF_FLAG)) {
// usart_data_transmit(USART1, usart_data_receive(USART3));
usart_flag_clear(USART3, USART_RDBF_FLAG);
}
/* add user code end USART3_IRQ 0 */
/* add user code begin USART3_IRQ 1 */
@@ -298,7 +301,7 @@ void CAN2_RX0_IRQHandler(void)
can_message_receive(CAN2, CAN_RX_FIFO0, &rx_message_struct);
lwprintf("CAN2 RECV: ID = 0x%X\r\n", rx_message_struct.standard_id);
lwprintf("---------------------\r\n| ");
for (uint8_t i = 0; i < 8; i++) {
for (uint8_t i = 0; i < rx_message_struct.dlc; i++) {
lwprintf("0x%02X |", rx_message_struct.data[i]);
}
lwprintf("\r\n---------------------\r\n");

View File

@@ -542,7 +542,7 @@ void wk_usart3_init(void)
usart_enable(USART3, TRUE);
/* add user code begin usart3_init 2 */
usart_interrupt_enable(USART3, USART_RDBF_INT, TRUE);
/* add user code end usart3_init 2 */
}