mirror of
https://github.com/Derisis13/memdump-fw.git
synced 2025-12-06 19:52:47 +01:00
feature: USB serial port middleware
feautre: Blink the debug LED refarctor: rename the openocd script
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "usb_device.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@@ -44,8 +45,6 @@ I2C_HandleTypeDef hi2c1;
|
||||
|
||||
SPI_HandleTypeDef hspi1;
|
||||
|
||||
PCD_HandleTypeDef hpcd_USB_FS;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
@@ -55,7 +54,6 @@ void SystemClock_Config(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_I2C1_Init(void);
|
||||
static void MX_SPI1_Init(void);
|
||||
static void MX_USB_PCD_Init(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
@@ -95,7 +93,7 @@ int main(void)
|
||||
MX_GPIO_Init();
|
||||
MX_I2C1_Init();
|
||||
MX_SPI1_Init();
|
||||
MX_USB_PCD_Init();
|
||||
MX_USB_DEVICE_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* USER CODE END 2 */
|
||||
@@ -104,7 +102,8 @@ int main(void)
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1)
|
||||
{
|
||||
|
||||
HAL_Delay(1000);
|
||||
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
@@ -230,37 +229,6 @@ static void MX_SPI1_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief USB Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_USB_PCD_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN USB_Init 0 */
|
||||
|
||||
/* USER CODE END USB_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN USB_Init 1 */
|
||||
|
||||
/* USER CODE END USB_Init 1 */
|
||||
hpcd_USB_FS.Instance = USB;
|
||||
hpcd_USB_FS.Init.dev_endpoints = 8;
|
||||
hpcd_USB_FS.Init.speed = PCD_SPEED_FULL;
|
||||
hpcd_USB_FS.Init.low_power_enable = DISABLE;
|
||||
hpcd_USB_FS.Init.lpm_enable = DISABLE;
|
||||
hpcd_USB_FS.Init.battery_charging_enable = DISABLE;
|
||||
if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN USB_Init 2 */
|
||||
|
||||
/* USER CODE END USB_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GPIO Initialization Function
|
||||
* @param None
|
||||
|
||||
Reference in New Issue
Block a user