Skip to content

Commit cd50a40

Browse files
authored
Merge pull request #3238 from qiyongzhong0/stm32_HAL_Drivers
修改stm32驱动库
2 parents 8e7be2e + 5c15fd6 commit cd50a40

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size);
270270
static int fal_flash_write(long offset, const rt_uint8_t *buf, size_t size);
271271
static int fal_flash_erase(long offset, size_t size);
272272

273-
const struct fal_flash_dev stm32_onchip_flash = { "onchip_flash", STM32_FLASH_START_ADRESS, STM32_FLASH_SIZE, 2048, {NULL, fal_flash_read, fal_flash_write, fal_flash_erase} };
273+
const struct fal_flash_dev stm32_onchip_flash = { "onchip_flash", STM32_FLASH_START_ADRESS, STM32_FLASH_SIZE, FLASH_PAGE_SIZE, {NULL, fal_flash_read, fal_flash_write, fal_flash_erase} };
274274

275275
static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size)
276276
{

bsp/stm32/libraries/HAL_Drivers/drv_usbd.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,27 @@ const static struct udcd_ops _udc_ops =
239239
_wakeup,
240240
};
241241

242+
#ifdef RT_USING_DEVICE_OPS
243+
const static struct rt_device_ops _ops =
244+
{
245+
_init,
246+
RT_NULL,
247+
RT_NULL,
248+
RT_NULL,
249+
RT_NULL,
250+
RT_NULL,
251+
};
252+
#endif
253+
242254
int stm_usbd_register(void)
243255
{
244256
rt_memset((void *)&_stm_udc, 0, sizeof(struct udcd));
245257
_stm_udc.parent.type = RT_Device_Class_USBDevice;
258+
#ifdef RT_USING_DEVICE_OPS
259+
_stm_udc.parent.ops = &_ops;
260+
#else
246261
_stm_udc.parent.init = _init;
262+
#endif
247263
_stm_udc.parent.user_data = &_stm_pcd;
248264
_stm_udc.ops = &_udc_ops;
249265
/* Register endpoint infomation */

0 commit comments

Comments
 (0)