修改USB初始化位置,将其放在hardwareinit task中

This commit is contained in:
不吃油炸鸡
2026-03-25 15:59:59 +08:00
parent 3a1d2b7f90
commit 58b3446ef5
2 changed files with 5 additions and 4 deletions

View File

@@ -46,6 +46,9 @@ void HardwareInitTask(void *argument)
Gate_Port_Init();
flow_route_selection(HIGH_CUR);
// usb init
MX_USB_DEVICE_Init();
// ADC sample start
HAL_ADC_Start_DMA(&hadc1, (uint32_t *)adc_raw_buffer, ADC_TIMES*2 * ADC_CHANNELS); /*启动ADC的DMA传输配合定时器触发ADC转换 12位的ADC对应0-4095 */
HAL_TIM_Base_Start(&htim2); /*开启定时器用溢出时间来触发ADC*/