Merge pull request #3238 from qiyongzhong0/stm32_HAL_Drivers
修改stm32驱动库
This commit is contained in:
commit
cd50a40fa8
|
@ -270,7 +270,7 @@ static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size);
|
||||||
static int fal_flash_write(long offset, const rt_uint8_t *buf, size_t size);
|
static int fal_flash_write(long offset, const rt_uint8_t *buf, size_t size);
|
||||||
static int fal_flash_erase(long offset, size_t size);
|
static int fal_flash_erase(long offset, size_t size);
|
||||||
|
|
||||||
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} };
|
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} };
|
||||||
|
|
||||||
static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size)
|
static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -239,11 +239,27 @@ const static struct udcd_ops _udc_ops =
|
||||||
_wakeup,
|
_wakeup,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef RT_USING_DEVICE_OPS
|
||||||
|
const static struct rt_device_ops _ops =
|
||||||
|
{
|
||||||
|
_init,
|
||||||
|
RT_NULL,
|
||||||
|
RT_NULL,
|
||||||
|
RT_NULL,
|
||||||
|
RT_NULL,
|
||||||
|
RT_NULL,
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
int stm_usbd_register(void)
|
int stm_usbd_register(void)
|
||||||
{
|
{
|
||||||
rt_memset((void *)&_stm_udc, 0, sizeof(struct udcd));
|
rt_memset((void *)&_stm_udc, 0, sizeof(struct udcd));
|
||||||
_stm_udc.parent.type = RT_Device_Class_USBDevice;
|
_stm_udc.parent.type = RT_Device_Class_USBDevice;
|
||||||
|
#ifdef RT_USING_DEVICE_OPS
|
||||||
|
_stm_udc.parent.ops = &_ops;
|
||||||
|
#else
|
||||||
_stm_udc.parent.init = _init;
|
_stm_udc.parent.init = _init;
|
||||||
|
#endif
|
||||||
_stm_udc.parent.user_data = &_stm_pcd;
|
_stm_udc.parent.user_data = &_stm_pcd;
|
||||||
_stm_udc.ops = &_udc_ops;
|
_stm_udc.ops = &_udc_ops;
|
||||||
/* Register endpoint infomation */
|
/* Register endpoint infomation */
|
||||||
|
|
Loading…
Reference in New Issue