Skip to content

Commit

Permalink
调整USB初始化流程
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-kirisame committed Sep 19, 2021
1 parent d82ce42 commit f04e5cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion usb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,14 @@ static void main()
IE_TKEY = 1; // 运行Timer

USBDeviceInit(); //USB设备模式初始化
DelayMs(10);
EA = 1; //允许单片机中断
DelayMs(10);
EnableWatchDog();
#ifdef ONBOARD_CMSIS_DAP
Dap_Init();
#endif
EA = 1; //允许单片机中断
DelayMs(10);
UEP1_T_LEN = 0; //预使用发送长度一定要清空
UEP2_T_LEN = 0; //预使用发送长度一定要清空
UEP3_T_LEN = 0;
Expand Down

0 comments on commit f04e5cb

Please sign in to comment.