Ver Fonte

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;
Gibby há 9 meses atrás
pai
commit
ebe05a91df
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c

+ 2 - 0
bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c

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