1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Serial refactor fix (#14007)

* VCP - zero-init USB port in usbVcpOpen

* Serial - serialPortIdentifier_e is signed

* UART - remove unused serialPortCount

* UART - allow compiling spectrum without UART

* UART - minor improvements

closeSerialPort tests for NULL,
no other functional changes
This commit is contained in:
Petr Ledvina 2024-11-06 22:58:10 +01:00 committed by GitHub
parent 6e79712906
commit 4d697c2ce1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 30 additions and 58 deletions

View file

@ -50,7 +50,7 @@
#define USB_TIMEOUT 50
static vcpPort_t vcpPort;
static vcpPort_t vcpPort = {0};
otg_core_type otg_core_struct;
@ -483,8 +483,6 @@ static const struct serialPortVTable usbVTable[] = {
serialPort_t *usbVcpOpen(void)
{
vcpPort_t *s;
IOInit(IOGetByTag(IO_TAG(PA11)), OWNER_USB, 0);
IOInit(IOGetByTag(IO_TAG(PA12)), OWNER_USB, 0);
usb_gpio_config();
@ -504,12 +502,12 @@ serialPort_t *usbVcpOpen(void)
USB_ID,
&cdc_class_handler,
&cdc_desc_handler);
s = &vcpPort;
s->port.vTable = usbVTable;
TxTimerConfig();
return (serialPort_t *)s;
vcpPort_t *s = &vcpPort;
s->port.vTable = usbVTable;
return &s->port;
}
uint32_t usbVcpGetBaudRate(serialPort_t *instance)