4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-21 15:45:22 +08:00

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;
This commit is contained in:
Gibby 2025-01-05 00:17:36 +08:00 committed by GitHub
parent b3b99082f9
commit ebe05a91df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -456,6 +456,7 @@ static rt_err_t _can_control(struct rt_can_device *can, int cmd, void *arg)
}
break;
case RT_CAN_CMD_GET_STATUS:
{
rt_uint32_t errtype;
errtype = drv_can->CanHandle.Instance->ESR;
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)
rt_memcpy(arg, &drv_can->device.status, sizeof(drv_can->device.status));
break;
}
case RT_CAN_CMD_START:
argval = (rt_uint32_t) arg;
if (argval == 0)