Skip to content

Commit ed657a5

Browse files
committed
add tx fail isr
1 parent 80e3f44 commit ed657a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bsp/stm32/libraries/HAL_Drivers/drivers/drv_fdcan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,11 @@ void HAL_FDCAN_ErrorCallback(FDCAN_HandleTypeDef *hfdcan)
615615
{
616616
tmp_u32Errcount = st_DrvCan1.fdcanHandle.Instance->ECR;
617617
tmp_u32status = st_DrvCan1.fdcanHandle.Instance->PSR;
618-
619618
st_DrvCan1.device.status.rcverrcnt = (tmp_u32Errcount>>8)&0x000000ff;
620619
st_DrvCan1.device.status.snderrcnt = (tmp_u32Errcount)&0x000000ff;
621620
st_DrvCan1.device.status.lasterrtype = tmp_u32status&0x000000007;
621+
rt_hw_can_isr(&st_DrvCan1.device, RT_CAN_EVENT_TX_FAIL);
622+
622623
}
623624
#endif /*BSP_USING_FDCAN1*/
624625
}
@@ -640,6 +641,7 @@ void HAL_FDCAN_ErrorCallback(FDCAN_HandleTypeDef *hfdcan)
640641
st_DrvCan2.device.status.rcverrcnt = (tmp_u32Errcount>>8)&0x000000ff;
641642
st_DrvCan2.device.status.snderrcnt = (tmp_u32Errcount)&0x000000ff;
642643
st_DrvCan2.device.status.lasterrtype = tmp_u32status&0x000000007;
644+
rt_hw_can_isr(&st_DrvCan2.device, RT_CAN_EVENT_TX_FAIL);
643645
}
644646
#endif /*BSP_USING_FDCAN2*/
645647
}

0 commit comments

Comments
 (0)