From a3e02531a2bdebe08a1e4f2ec64b0c958cec5417 Mon Sep 17 00:00:00 2001 From: cfif Date: Sun, 21 Jun 2026 18:02:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CanPorts.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/CanPorts.c b/CanPorts.c index 7005ccb..a041ab5 100644 --- a/CanPorts.c +++ b/CanPorts.c @@ -13,6 +13,33 @@ tCanPorts CAN_PORTS; +static void CAN0_ErrorInterrupt_CallBack(uint8_t u8CanIndex, FLEXCAN_ErrorInfoType *pErrorInfo) { + FLEXCAN_ClrErrorInfo(u8CanIndex, pErrorInfo); + PROCESS_UNUSED_VAR(u8CanIndex); + PROCESS_UNUSED_VAR(pErrorInfo); +} + +uint32_t azz0 = 0; + +static void CAN0_TxInterruptCallBackType(uint8_t u8CanIndex, uint8_t u8TxHandler) { + ++azz0; + asm("nop"); +} + +static void CAN1_ErrorInterrupt_CallBack(uint8_t u8CanIndex, FLEXCAN_ErrorInfoType *pErrorInfo) { + FLEXCAN_ClrErrorInfo(u8CanIndex, pErrorInfo); + PROCESS_UNUSED_VAR(u8CanIndex); + PROCESS_UNUSED_VAR(pErrorInfo); +} + +uint32_t azz1 = 0; + +static void CAN1_TxInterruptCallBackType(uint8_t u8CanIndex, uint8_t u8TxHandler) { + ++azz1; + asm("nop"); +} + + #if (CAN_DMA_EN == 1) @@ -33,12 +60,6 @@ static void DMA_TransferCompleteCallbackCan1(void) { } #else -static void CAN0_ErrorInterrupt_CallBack(uint8_t u8CanIndex, FLEXCAN_ErrorInfoType *pErrorInfo) { - FLEXCAN_ClrErrorInfo(u8CanIndex, pErrorInfo); - PROCESS_UNUSED_VAR(u8CanIndex); - PROCESS_UNUSED_VAR(pErrorInfo); -} - static void CAN0_RxInterrupt_CallBack(uint8_t u8CanIndex, FLEXCAN_RxMsgType *pRxCfg) { CanSerialPortFrameIrqRxProcessingNO_DMA(CAN_PORTS.Can0_IO.env, pRxCfg); } @@ -48,11 +69,7 @@ static void CAN0_RxFifoInterrupt_CallBack(uint8_t u8CanIndex, FLEXCAN_RxMsgType } -static void CAN1_ErrorInterrupt_CallBack(uint8_t u8CanIndex, FLEXCAN_ErrorInfoType *pErrorInfo) { - FLEXCAN_ClrErrorInfo(u8CanIndex, pErrorInfo); - PROCESS_UNUSED_VAR(u8CanIndex); - PROCESS_UNUSED_VAR(pErrorInfo); -} + static void CAN1_RxInterrupt_CallBack(uint8_t u8CanIndex, FLEXCAN_RxMsgType *pRxCfg) { CanSerialPortFrameIrqRxProcessingNO_DMA(CAN_PORTS.Can1_IO.env, pRxCfg); @@ -205,7 +222,7 @@ static bool vCanPort_InitCan0() { FLEXCAN_BAUD_500K, FLEXCAN_ID_STD, 0x55, - NULL, + CAN0_ErrorInterrupt_CallBack, NULL, NULL, NULL, @@ -310,7 +327,7 @@ static bool vCanPort_InitCan1() { FLEXCAN_BAUD_500K, FLEXCAN_ID_STD, 0x55, - NULL, + CAN1_ErrorInterrupt_CallBack, NULL, NULL, NULL,