Release:5.20灰测

This commit is contained in:
2026-05-21 10:01:28 +08:00
parent 8a5a32b139
commit fd65e9c6a2
68 changed files with 4329 additions and 1489 deletions

View File

@@ -22,6 +22,7 @@
#include "usbd_cdc_if.h"
/* USER CODE BEGIN INCLUDE */
#include <stdarg.h>
/* USER CODE END INCLUDE */
@@ -317,6 +318,21 @@ static int8_t CDC_TransmitCplt_FS(uint8_t *Buf, uint32_t *Len, uint8_t epnum)
}
/* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */
void USB_Printf(const char *format, ...)
{
char tx_buffer[256];
va_list args;
va_start(args, format);
int len = vsnprintf(tx_buffer, sizeof(tx_buffer), format, args);
va_end(args);
if (len > 0 && len < sizeof(tx_buffer))
{
CDC_Transmit_FS((uint8_t*)tx_buffer, len);
}
}
/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */

View File

@@ -31,6 +31,8 @@
/* USER CODE BEGIN INCLUDE */
/* USER CODE END INCLUDE */
/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
@@ -109,6 +111,9 @@ uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len);
/* USER CODE BEGIN EXPORTED_FUNCTIONS */
void USB_Printf(const char *format, ...);
/* USER CODE END EXPORTED_FUNCTIONS */
/**

View File

@@ -62,11 +62,11 @@
* @{
*/
#define USBD_VID 1156
#define USBD_VID 1155
#define USBD_LANGID_STRING 1033
#define USBD_MANUFACTURER_STRING "JSBR"
#define USBD_PID_FS 22337
#define USBD_PRODUCT_STRING_FS "YKC Virtual ComPort"
#define USBD_MANUFACTURER_STRING "STMicroelectronics"
#define USBD_PID_FS 22336
#define USBD_PRODUCT_STRING_FS "STM32 Virtual ComPort"
#define USBD_CONFIGURATION_STRING_FS "CDC Config"
#define USBD_INTERFACE_STRING_FS "CDC Interface"