File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1216,13 +1216,13 @@ static void can_irq(CANName name, int id)
1216
1216
tmp1 = __HAL_CAN_MSG_PENDING (& CanHandle , CAN_FIFO0 );
1217
1217
tmp2 = __HAL_CAN_GET_IT_SOURCE (& CanHandle , CAN_IT_FMP0 );
1218
1218
1219
- // In legacy can (bxCAN and earlier), reading is the only way to clear rx interrupt. But can_read has mutex locks
1220
- // since mutexes cannot be used in ISR context, rx interrupt is masked here to temporary disable it
1221
- // rx interrupts will be unamsked in read operation. reads must be deffered to thread context.
1222
- // refer to the CAN receive interrupt problem due to mutex and resolution section of README doc.
1223
- __HAL_CAN_DISABLE_IT (& CanHandle , CAN_IT_FMP0 );
1224
-
1225
1219
if ((tmp1 != 0 ) && tmp2 ) {
1220
+ // In legacy can (bxCAN and earlier), reading is the only way to clear rx interrupt. But can_read has mutex locks
1221
+ // since mutexes cannot be used in ISR context, rx interrupt is masked here to temporary disable it
1222
+ // rx interrupts will be unamsked in read operation. reads must be deffered to thread context.
1223
+ // refer to the CAN receive interrupt problem due to mutex and resolution section of README doc.
1224
+ __HAL_CAN_DISABLE_IT (& CanHandle , CAN_IT_FMP0 );
1225
+
1226
1226
irq_handler (can_irq_contexts [id ], IRQ_RX );
1227
1227
}
1228
1228
You can’t perform that action at this time.
0 commit comments