Use USB VCP as a normal serial driver as well

This commit is contained in:
Raphael Coeffic
2022-03-20 16:22:14 +01:00
parent 530d395204
commit b39baa2360
37 changed files with 357 additions and 248 deletions
+4 -18
View File
@@ -24,8 +24,6 @@
#include <stdint.h>
#define MAX_AUX_SERIAL 2
void initSerialPorts();
uint8_t serialGetMode(int port_nr);
uint8_t serialTracesEnabled(int port_nr);
@@ -33,22 +31,6 @@ void serialInit(int port_nr, int mode);
void serialStop(int port_nr);
void serialPutc(int port_nr, uint8_t c);
#if defined(AUX_SERIAL)
#define auxSerialSbusInit() serialInit(0, UART_MODE_SBUS_TRAINER)
#define auxSerialGetMode() serialGetMode(0)
#define auxSerialTracesEnabled() serialTracesEnabled(0)
#define auxSerialStop() serialStop(0)
#define auxSerialPutc(c) serialPutc(0, (c))
#endif
#if defined(AUX2_SERIAL)
#define aux2SerialSbusInit() serialInit(1, UART_MODE_SBUS_TRAINER)
#define aux2SerialGetMode() serialGetMode(1)
#define aux2SerialTracesEnabled() serialTracesEnabled(1)
#define aux2SerialStop() serialStop(1)
#define aux2SerialPutc(c) serialPutc(1, (c))
#endif
//
// Functions used by debug.h
//
@@ -69,5 +51,9 @@ void dbgSerialCrlf();
// Debug serial callback
void dbgSerialSetSendCb(void* ctx, void (*cb)(void*, uint8_t));
// Query debug callback
void (*dbgSerialGetSendCb())(void*, uint8_t);
void* dbgSerialGetSendCbCtx();
#endif // _SERIAL_H_