新手入门
- 积分
- 1
- 金钱
- 1
- 注册时间
- 2019-9-18
- 在线时间
- 0 小时
|

楼主 |
发表于 2019-9-18 11:14:31
|
显示全部楼层
int main(void)
{
__IO uint32_t i = 0;
/*!< At this stage the microcontroller clock setting is already configured,
this is done through SystemInit() function which is called from startup
file (startup_stm32fxxx_xx.s) before to branch to application main.
To reconfigure the default setting of SystemInit() function, refer to
system_stm32fxxx.c file
*/
USBD_Init(&USB_OTG_dev,
#ifdef USE_USB_OTG_HS
USB_OTG_HS_CORE_ID,
#else
USB_OTG_FS_CORE_ID,
#endif
&USR_desc,
&USBD_MSC_cb,
&USR_cb);
//??Task1
xTaskCreate((pdTASK_CODE)task1_task,
(char* ) "task1_task",
(uint16_t ) TASK1_STK_SIZE,
(void * ) NULL,
(unsigned portBASE_TYPE) TASK1_TASK_PRIO,
(xTaskHandle* ) &Task1Task_Handler);
//??Task2
xTaskCreate((pdTASK_CODE) task2_task,
(char* ) "task2_task",
(uint16_t ) TASK1_STK_SIZE,
(void * ) NULL,
(unsigned portBASE_TYPE) TASK2_TASK_PRIO,
(xTaskHandle* ) &Task2Task_Handler);
vTaskStartScheduler();
while (1)
{
if (i++ == 0x100000)
{
i = 0;
}
}
}
但是两个任务都不能被调度。但是去掉USBD_Init()里面的USB_OTG_BSP_EnableInterrupt()就可以调度了,但是这不是办法啊。到底什么地方出问题了。 |
|