跳转至

超炫桌面节奏大师

USB 音频播放优化说明

  • 动态缓冲清理:在 AUDIO_PeriodicTC_FS 中统计每个 USB OUT 包的长度与到达时间,一旦发现包间隔超过 AUDIO_STREAM_GAP_FLUSH_MS 或者主机发送短包,就立即停止 I2S DMA、清空循环缓冲,并等待新的数据填满后再重新启动,避免大缓冲导致的尾段重播。
  • 延迟启动 DMAAudio_StartPlayback 不再在 rd_enable 为 0 时强行启动 DMA,而是设置 start_pending,在 USB 缓冲准备好后由 Audio_TryStartPending 触发,完全消除首包空数据造成的 0.5 s 静音。
  • 智能欠供修复:保持原有的欠供检测,用静音填补不足的样本,同时记录事件计数,既防止“滋滋”噪声又方便调试。
  • PLL 频率校准:将 I2S PLLI2S 重新配置为 128/5,确保 I2S LRCK 精确为 16 kHz,与主机采样率一致,避免缓慢漂移导致定期欠供。

每次更新cubemx之后,将usbd_audio.h 宏定义配置更改,不然切换歌曲会重复声音

#defineAUDIO_OUT_PACKET_NUM                          800U

驱动以及测试代码

Core/Src/main.c
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.c
  * @brief          : Main program body
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2025 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "dma.h"
#include "i2s.h"
#include "spi.h"
#include "tim.h"
#include "usart.h"
#include "usb_device.h"
#include "gpio.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "st7789.h"
#include "spectrum.h"
#include "usbd_audio.h"
#include "driver_ws2812b.h"
/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */

/* USER CODE END PTD */

/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
#define WS2812_LED_COUNT           30U
#define WS2812_UPDATE_INTERVAL_MS  20U

#define WS2812_VIS_MODE_SPECTRUM_BAR      0U
#define WS2812_VIS_MODE_ENERGY_SWEEP      1U
#define WS2812_VIS_MODE_RAINBOW_GLOW      2U

#ifndef WS2812_VISUAL_MODE
#define WS2812_VISUAL_MODE WS2812_VIS_MODE_SPECTRUM_BAR
#endif
/* USER CODE END PD */

/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */

/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/

/* USER CODE BEGIN PV */
static uint8_t ws2812_ready = 0U;
static uint32_t ws2812_last_update_ms = 0U;
/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP */
static void Visualizer_UpdateStrip(void);
static void Visualizer_ModeSpectrumBar(uint32_t leds, uint32_t bins, uint16_t max_height);
static void Visualizer_ModeEnergySweep(uint32_t leds, uint32_t bins, uint16_t max_height);
static void Visualizer_ModeRainbowGlow(uint32_t leds, uint32_t bins, uint16_t max_height);
static void Visualizer_Color565ToRGB(uint16_t color565, uint8_t *r, uint8_t *g, uint8_t *b);
static void Visualizer_ColorWheel(uint32_t pos, uint32_t total, uint8_t *r, uint8_t *g, uint8_t *b);
/* USER CODE END PFP */

/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */

/* USER CODE END 0 */

/**
  * @brief  The application entry point.
  * @retval int
  */
int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_I2S2_Init();
  MX_USB_DEVICE_Init();
  MX_SPI1_Init();
  MX_USART2_UART_Init();
  MX_TIM3_Init();
  /* USER CODE BEGIN 2 */
  ST7789_Init();
  Spectrum_Init(USBD_AUDIO_FREQ);
  if (ws2812b_init(WS2812_LED_COUNT))
  {
    ws2812_ready = 1U;
    ws2812b_fill(0U, 0U, 0U);
    (void)ws2812b_refresh();
  }
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
    Spectrum_DrawIfDue();
    Visualizer_UpdateStrip();
  }
  /* USER CODE END 3 */
}

/**
  * @brief System Clock Configuration
  * @retval None
  */
void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  /** Configure the main internal regulator output voltage
  */
  __HAL_RCC_PWR_CLK_ENABLE();
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);

  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = 4;
  RCC_OscInitStruct.PLL.PLLN = 168;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
  RCC_OscInitStruct.PLL.PLLQ = 7;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  /** Initializes the CPU, AHB and APB buses clocks
  */
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
  {
    Error_Handler();
  }
}

/* USER CODE BEGIN 4 */
static void Visualizer_UpdateStrip(void)
{
  if ((ws2812_ready == 0U) || ws2812b_is_busy())
  {
    return;
  }

  uint32_t now = HAL_GetTick();
  if ((now - ws2812_last_update_ms) < WS2812_UPDATE_INTERVAL_MS)
  {
    return;
  }
  ws2812_last_update_ms = now;

  uint32_t leds = ws2812b_get_led_count();
  uint32_t bins = Spectrum_GetBinCount();
  if ((leds == 0U) || (bins == 0U))
  {
    return;
  }

  uint16_t max_height = Spectrum_GetMaxHeight();
  if (max_height == 0U)
  {
    max_height = 1U;
  }

  switch (WS2812_VISUAL_MODE)
  {
    case WS2812_VIS_MODE_SPECTRUM_BAR:
      Visualizer_ModeSpectrumBar(leds, bins, max_height);
      break;
    case WS2812_VIS_MODE_ENERGY_SWEEP:
      Visualizer_ModeEnergySweep(leds, bins, max_height);
      break;
    case WS2812_VIS_MODE_RAINBOW_GLOW:
      Visualizer_ModeRainbowGlow(leds, bins, max_height);
      break;
    default:
      Visualizer_ModeSpectrumBar(leds, bins, max_height);
      break;
  }

  (void)ws2812b_refresh();
}

static void Visualizer_ModeSpectrumBar(uint32_t leds, uint32_t bins, uint16_t max_height)
{
  for (uint32_t led = 0U; led < leds; ++led)
  {
    uint32_t bin = (led * bins) / leds;
    uint16_t level = Spectrum_GetLevel(bin);
    uint16_t color565 = Spectrum_GetBinColor(bin);

    uint8_t r, g, b;
    Visualizer_Color565ToRGB(color565, &r, &g, &b);

    uint32_t scale = ((uint32_t)level * 255U) / max_height;
    r = (uint8_t)((r * scale) / 255U);
    g = (uint8_t)((g * scale) / 255U);
    b = (uint8_t)((b * scale) / 255U);

    (void)ws2812b_set_pixel((uint16_t)led, r, g, b);
  }
}

static void Visualizer_ModeEnergySweep(uint32_t leds, uint32_t bins, uint16_t max_height)
{
  uint32_t sum = 0U;
  for (uint32_t bin = 0U; bin < bins; ++bin)
  {
    sum += Spectrum_GetLevel(bin);
  }
  uint32_t avg = (bins > 0U) ? (sum / bins) : 0U;
  uint32_t active_leds = (avg * leds) / max_height;
  if (active_leds > leds)
  {
    active_leds = leds;
  }

  for (uint32_t led = 0U; led < leds; ++led)
  {
    if (led < active_leds)
    {
      uint32_t bin = (led * bins) / leds;
      uint16_t color565 = Spectrum_GetBinColor(bin);
      uint8_t r, g, b;
      Visualizer_Color565ToRGB(color565, &r, &g, &b);
      (void)ws2812b_set_pixel((uint16_t)led, r, g, b);
    }
    else
    {
      (void)ws2812b_set_pixel((uint16_t)led, 0U, 0U, 0U);
    }
  }
}

static void Visualizer_ModeRainbowGlow(uint32_t leds, uint32_t bins, uint16_t max_height)
{
  if (leds == 0U)
  {
    return;
  }

  for (uint32_t led = 0U; led < leds; ++led)
  {
    uint8_t r, g, b;
    Visualizer_ColorWheel(led, leds, &r, &g, &b);

    uint32_t bin = (led * bins) / leds;
    uint16_t level = Spectrum_GetLevel(bin);
    uint32_t scale = ((uint32_t)level * 255U) / max_height;
    r = (uint8_t)((r * scale) / 255U);
    g = (uint8_t)((g * scale) / 255U);
    b = (uint8_t)((b * scale) / 255U);

    (void)ws2812b_set_pixel((uint16_t)led, r, g, b);
  }
}

static void Visualizer_Color565ToRGB(uint16_t color565, uint8_t *r, uint8_t *g, uint8_t *b)
{
  if (r != NULL)
  {
    *r = (uint8_t)(((color565 >> 11) & 0x1FU) << 3);
  }
  if (g != NULL)
  {
    *g = (uint8_t)(((color565 >> 5) & 0x3FU) << 2);
  }
  if (b != NULL)
  {
    *b = (uint8_t)((color565 & 0x1FU) << 3);
  }
}

static void Visualizer_ColorWheel(uint32_t pos, uint32_t total, uint8_t *r, uint8_t *g, uint8_t *b)
{
  if ((total == 0U) || (r == NULL) || (g == NULL) || (b == NULL))
  {
    return;
  }

  uint32_t angle = (pos * 1536U) / total;
  angle %= 1536U;
  uint32_t region = angle / 256U;
  uint32_t offset = angle % 256U;

  switch (region)
  {
    case 0:
      *r = 255U;
      *g = (uint8_t)offset;
      *b = 0U;
      break;
    case 1:
      *r = (uint8_t)(255U - offset);
      *g = 255U;
      *b = 0U;
      break;
    case 2:
      *r = 0U;
      *g = 255U;
      *b = (uint8_t)offset;
      break;
    case 3:
      *r = 0U;
      *g = (uint8_t)(255U - offset);
      *b = 255U;
      break;
    case 4:
      *r = (uint8_t)offset;
      *g = 0U;
      *b = 255U;
      break;
    default:
      *r = 255U;
      *g = 0U;
      *b = (uint8_t)(255U - offset);
      break;
  }
}
/* USER CODE END 4 */

/**
  * @brief  This function is executed in case of error occurrence.
  * @retval None
  */
void Error_Handler(void)
{
  /* USER CODE BEGIN Error_Handler_Debug */
  /* User can add his own implementation to report the HAL error return state */
  __disable_irq();
  while (1)
  {
  }
  /* USER CODE END Error_Handler_Debug */
}

#ifdef  USE_FULL_ASSERT
/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t *file, uint32_t line)
{
  /* USER CODE BEGIN 6 */
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  /* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */
Core/Src/stm32f4xx_it.c
/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    stm32f4xx_it.c
  * @brief   Interrupt Service Routines.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2025 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f4xx_it.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */

/* USER CODE END TD */

/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */

/* USER CODE END PD */

/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */

/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN PV */

/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN PFP */

/* USER CODE END PFP */

/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */

/* USER CODE END 0 */

/* External variables --------------------------------------------------------*/
extern PCD_HandleTypeDef hpcd_USB_OTG_FS;
extern DMA_HandleTypeDef hdma_spi2_tx;
extern I2S_HandleTypeDef hi2s2;
extern DMA_HandleTypeDef hdma_spi1_tx;
extern SPI_HandleTypeDef hspi1;
extern DMA_HandleTypeDef hdma_tim3_ch4_up;
/* USER CODE BEGIN EV */

/* USER CODE END EV */

/******************************************************************************/
/*           Cortex-M4 Processor Interruption and Exception Handlers          */
/******************************************************************************/
/**
  * @brief This function handles Non maskable interrupt.
  */
void NMI_Handler(void)
{
  /* USER CODE BEGIN NonMaskableInt_IRQn 0 */

  /* USER CODE END NonMaskableInt_IRQn 0 */
  /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
   while (1)
  {
  }
  /* USER CODE END NonMaskableInt_IRQn 1 */
}

/**
  * @brief This function handles Hard fault interrupt.
  */
void HardFault_Handler(void)
{
  /* USER CODE BEGIN HardFault_IRQn 0 */

  /* USER CODE END HardFault_IRQn 0 */
  while (1)
  {
    /* USER CODE BEGIN W1_HardFault_IRQn 0 */
    /* USER CODE END W1_HardFault_IRQn 0 */
  }
}

/**
  * @brief This function handles Memory management fault.
  */
void MemManage_Handler(void)
{
  /* USER CODE BEGIN MemoryManagement_IRQn 0 */

  /* USER CODE END MemoryManagement_IRQn 0 */
  while (1)
  {
    /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
    /* USER CODE END W1_MemoryManagement_IRQn 0 */
  }
}

/**
  * @brief This function handles Pre-fetch fault, memory access fault.
  */
void BusFault_Handler(void)
{
  /* USER CODE BEGIN BusFault_IRQn 0 */

  /* USER CODE END BusFault_IRQn 0 */
  while (1)
  {
    /* USER CODE BEGIN W1_BusFault_IRQn 0 */
    /* USER CODE END W1_BusFault_IRQn 0 */
  }
}

/**
  * @brief This function handles Undefined instruction or illegal state.
  */
void UsageFault_Handler(void)
{
  /* USER CODE BEGIN UsageFault_IRQn 0 */

  /* USER CODE END UsageFault_IRQn 0 */
  while (1)
  {
    /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
    /* USER CODE END W1_UsageFault_IRQn 0 */
  }
}

/**
  * @brief This function handles System service call via SWI instruction.
  */
void SVC_Handler(void)
{
  /* USER CODE BEGIN SVCall_IRQn 0 */

  /* USER CODE END SVCall_IRQn 0 */
  /* USER CODE BEGIN SVCall_IRQn 1 */

  /* USER CODE END SVCall_IRQn 1 */
}

/**
  * @brief This function handles Debug monitor.
  */
void DebugMon_Handler(void)
{
  /* USER CODE BEGIN DebugMonitor_IRQn 0 */

  /* USER CODE END DebugMonitor_IRQn 0 */
  /* USER CODE BEGIN DebugMonitor_IRQn 1 */

  /* USER CODE END DebugMonitor_IRQn 1 */
}

/**
  * @brief This function handles Pendable request for system service.
  */
void PendSV_Handler(void)
{
  /* USER CODE BEGIN PendSV_IRQn 0 */

  /* USER CODE END PendSV_IRQn 0 */
  /* USER CODE BEGIN PendSV_IRQn 1 */

  /* USER CODE END PendSV_IRQn 1 */
}

/**
  * @brief This function handles System tick timer.
  */
void SysTick_Handler(void)
{
  /* USER CODE BEGIN SysTick_IRQn 0 */

  /* USER CODE END SysTick_IRQn 0 */
  HAL_IncTick();
  /* USER CODE BEGIN SysTick_IRQn 1 */

  /* USER CODE END SysTick_IRQn 1 */
}

/******************************************************************************/
/* STM32F4xx Peripheral Interrupt Handlers                                    */
/* Add here the Interrupt Handlers for the used peripherals.                  */
/* For the available peripheral interrupt handler names,                      */
/* please refer to the startup file (startup_stm32f4xx.s).                    */
/******************************************************************************/

/**
  * @brief This function handles DMA1 stream2 global interrupt.
  */
void DMA1_Stream2_IRQHandler(void)
{
  /* USER CODE BEGIN DMA1_Stream2_IRQn 0 */

  /* USER CODE END DMA1_Stream2_IRQn 0 */
  HAL_DMA_IRQHandler(&hdma_tim3_ch4_up);
  /* USER CODE BEGIN DMA1_Stream2_IRQn 1 */

  /* USER CODE END DMA1_Stream2_IRQn 1 */
}

/**
  * @brief This function handles DMA1 stream4 global interrupt.
  */
void DMA1_Stream4_IRQHandler(void)
{
  /* USER CODE BEGIN DMA1_Stream4_IRQn 0 */

  /* USER CODE END DMA1_Stream4_IRQn 0 */
  HAL_DMA_IRQHandler(&hdma_spi2_tx);
  /* USER CODE BEGIN DMA1_Stream4_IRQn 1 */

  /* USER CODE END DMA1_Stream4_IRQn 1 */
}

/**
  * @brief This function handles SPI1 global interrupt.
  */
void SPI1_IRQHandler(void)
{
  /* USER CODE BEGIN SPI1_IRQn 0 */

  /* USER CODE END SPI1_IRQn 0 */
  HAL_SPI_IRQHandler(&hspi1);
  /* USER CODE BEGIN SPI1_IRQn 1 */

  /* USER CODE END SPI1_IRQn 1 */
}

/**
  * @brief This function handles SPI2 global interrupt.
  */
void SPI2_IRQHandler(void)
{
  /* USER CODE BEGIN SPI2_IRQn 0 */

  /* USER CODE END SPI2_IRQn 0 */
  HAL_I2S_IRQHandler(&hi2s2);
  /* USER CODE BEGIN SPI2_IRQn 1 */

  /* USER CODE END SPI2_IRQn 1 */
}

/**
  * @brief This function handles DMA2 stream3 global interrupt.
  */
void DMA2_Stream3_IRQHandler(void)
{
  /* USER CODE BEGIN DMA2_Stream3_IRQn 0 */

  /* USER CODE END DMA2_Stream3_IRQn 0 */
  HAL_DMA_IRQHandler(&hdma_spi1_tx);
  /* USER CODE BEGIN DMA2_Stream3_IRQn 1 */

  /* USER CODE END DMA2_Stream3_IRQn 1 */
}

/**
  * @brief This function handles USB On The Go FS global interrupt.
  */
void OTG_FS_IRQHandler(void)
{
  /* USER CODE BEGIN OTG_FS_IRQn 0 */

  /* USER CODE END OTG_FS_IRQn 0 */
  HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
  /* USER CODE BEGIN OTG_FS_IRQn 1 */

  /* USER CODE END OTG_FS_IRQn 1 */
}

/* USER CODE BEGIN 1 */

/* USER CODE END 1 */