From acfab8fac80b50000bda01bd4547cf244e6d292d Mon Sep 17 00:00:00 2001 From: Gibby Date: Wed, 25 Dec 2024 03:55:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:[CAN][STM32]=E4=BF=AE=E5=A4=8Dgcc=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=94=99=E8=AF=AF=20error:=20a=20label=20can=20only?= =?UTF-8?q?=20be=20part=20of=20a=20statement=20and=20a=20declaration=20is?= =?UTF-8?q?=20not=20a=20statement=20459=20|=20rt=5Fuint32=5Ft=20errtype;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c b/bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c index c366f94c17f..1716616c400 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c +++ b/bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c @@ -174,7 +174,7 @@ static rt_err_t _can_config(struct rt_can_device *can, struct can_configure *cfg /* default filter config */ HAL_CAN_ConfigFilter(&drv_can->CanHandle, &drv_can->FilterConfig); - + return RT_EOK; } @@ -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)