Skip to content

Commit ebe05a9

Browse files
authoredJan 4, 2025··
Fix: [CAN][STM32] GCC compile errors
error: a label can only be part of a statement and a declaration is not a statement 459 | rt_uint32_t errtype;
1 parent b3b9908 commit ebe05a9

File tree

1 file changed

+2
-0
lines changed
  • bsp/stm32/libraries/HAL_Drivers/drivers

1 file changed

+2
-0
lines changed
 

Diff for: ‎bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c

+2
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ static rt_err_t _can_control(struct rt_can_device *can, int cmd, void *arg)
456456
}
457457
break;
458458
case RT_CAN_CMD_GET_STATUS:
459+
{
459460
rt_uint32_t errtype;
460461
errtype = drv_can->CanHandle.Instance->ESR;
461462
drv_can->device.status.rcverrcnt = errtype >> 24;
@@ -465,6 +466,7 @@ static rt_err_t _can_control(struct rt_can_device *can, int cmd, void *arg)
465466

466467
rt_memcpy(arg, &drv_can->device.status, sizeof(drv_can->device.status));
467468
break;
469+
}
468470
case RT_CAN_CMD_START:
469471
argval = (rt_uint32_t) arg;
470472
if (argval == 0)

0 commit comments

Comments
 (0)
Please sign in to comment.