Merge pull request #2933 from murphyzhao/fix-pwm-usagefault

[bsp][stm32] fix drv_pwm.c device register usagefault
This commit is contained in:
Bernard Xiong 2019-08-08 11:17:54 +08:00 committed by GitHub
commit 532ad16b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -542,7 +542,7 @@ static int stm32_pwm_init(void)
LOG_D("%s init success", stm32_pwm_obj[i].name);
/* register pwm device */
if (rt_device_pwm_register(rt_calloc(1, sizeof(struct rt_device_pwm)), stm32_pwm_obj[i].name, &drv_ops, &stm32_pwm_obj[i].tim_handle) == RT_EOK)
if (rt_device_pwm_register(&stm32_pwm_obj[i].pwm_device, stm32_pwm_obj[i].name, &drv_ops, &stm32_pwm_obj[i].tim_handle) == RT_EOK)
{
LOG_D("%s register success", stm32_pwm_obj[i].name);