This commit is contained in:
Raphael Coeffic
2022-03-20 16:22:14 +01:00
parent da59fca1bc
commit 530d395204
66 changed files with 1267 additions and 1081 deletions
+20
View File
@@ -26,6 +26,10 @@
#include "libopenui.h"
#endif
#if defined(CLI)
#include "cli.h"
#endif
uint8_t currentSpeakerVolume = 255;
uint8_t requiredSpeakerVolume = 255;
uint8_t currentBacklightBright = 0;
@@ -153,6 +157,22 @@ void handleUsbConnection()
opentxClose(false);
usbPluggedIn();
}
#if defined(USB_SERIAL)
else if (getSelectedUsbMode() == USB_SERIAL_MODE) {
// TODO: query USB serial mode
// -> for now, only CLI / DEBUG / LUA
#if defined(CLI)
cliSetSendCb(nullptr, usbSerialPutc);
usbSerialSetReceiveDataCb(cliReceiveData);
#elif defined(DEBUG)
dbgSerialSetSendCb(nullptr, usbSerialPutc);
usbSerialSetReceiveDataCb(nullptr);
#elif defined(LUA)
luaSetSendCb(nullptr, usbSerialPutc);
usbSerialSetReceiveDataCb(luaReceiveData);
#endif
}
#endif
usbStart();
TRACE("USB started");