开启串口3接收中断
This commit is contained in:
@@ -261,7 +261,10 @@ void USART2_IRQHandler(void)
|
|||||||
void USART3_IRQHandler(void)
|
void USART3_IRQHandler(void)
|
||||||
{
|
{
|
||||||
/* add user code begin USART3_IRQ 0 */
|
/* 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 end USART3_IRQ 0 */
|
||||||
/* add user code begin USART3_IRQ 1 */
|
/* 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);
|
can_message_receive(CAN2, CAN_RX_FIFO0, &rx_message_struct);
|
||||||
lwprintf("CAN2 RECV: ID = 0x%X\r\n", rx_message_struct.standard_id);
|
lwprintf("CAN2 RECV: ID = 0x%X\r\n", rx_message_struct.standard_id);
|
||||||
lwprintf("---------------------\r\n| ");
|
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("0x%02X |", rx_message_struct.data[i]);
|
||||||
}
|
}
|
||||||
lwprintf("\r\n---------------------\r\n");
|
lwprintf("\r\n---------------------\r\n");
|
||||||
|
|||||||
@@ -542,7 +542,7 @@ void wk_usart3_init(void)
|
|||||||
usart_enable(USART3, TRUE);
|
usart_enable(USART3, TRUE);
|
||||||
|
|
||||||
/* add user code begin usart3_init 2 */
|
/* add user code begin usart3_init 2 */
|
||||||
|
usart_interrupt_enable(USART3, USART_RDBF_INT, TRUE);
|
||||||
/* add user code end usart3_init 2 */
|
/* add user code end usart3_init 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user