mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 11:37:45 +08:00
添加了大量调试log,新增了dwt计时宏,增加了USB软件复位防止主控复位后上位机无法连接usb
This commit is contained in:
@@ -123,9 +123,9 @@ void MX_FREERTOS_Init(void)
|
||||
void StartDefaultTask(void const *argument)
|
||||
{
|
||||
/* init code for USB_DEVICE */
|
||||
MX_USB_DEVICE_Init(); // USB???
|
||||
MX_USB_DEVICE_Init(); // 默认usb启动任务的位置
|
||||
/* USER CODE BEGIN StartDefaultTask */
|
||||
vTaskDelete(NULL); // ??????,????CPU
|
||||
vTaskDelete(NULL); // 避免空置和切换占用cpu
|
||||
/* USER CODE END StartDefaultTask */
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,11 @@ void HAL_MspInit(void)
|
||||
/* PendSV_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);
|
||||
|
||||
/* Peripheral interrupt init */
|
||||
/* FLASH_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(FLASH_IRQn, 6, 0);
|
||||
HAL_NVIC_EnableIRQ(FLASH_IRQn);
|
||||
|
||||
/* USER CODE BEGIN MspInit 1 */
|
||||
|
||||
/* USER CODE END MspInit 1 */
|
||||
|
||||
@@ -183,6 +183,20 @@ void DebugMon_Handler(void)
|
||||
/* please refer to the startup file (startup_stm32f4xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles Flash global interrupt.
|
||||
*/
|
||||
void FLASH_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN FLASH_IRQn 0 */
|
||||
|
||||
/* USER CODE END FLASH_IRQn 0 */
|
||||
HAL_FLASH_IRQHandler();
|
||||
/* USER CODE BEGIN FLASH_IRQn 1 */
|
||||
|
||||
/* USER CODE END FLASH_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line3 interrupt.
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "usbd_cdc.h"
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "bsp_dwt.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -95,7 +95,11 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
|
||||
HAL_NVIC_SetPriority(OTG_FS_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
|
||||
/* USER CODE BEGIN USB_OTG_FS_MspInit 1 */
|
||||
|
||||
// 上电后重新枚举usb设备
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET);
|
||||
DWT_Delay(100);
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET);
|
||||
DWT_Delay(100);
|
||||
/* USER CODE END USB_OTG_FS_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user