fix: Correctly reflect state of AUX1 when DEBUG build (#3814)

This commit is contained in:
Michael
2023-10-09 20:07:51 +10:00
committed by GitHub
parent 4485df77bb
commit c51c91401e
5 changed files with 24 additions and 6 deletions
+11 -3
View File
@@ -90,7 +90,7 @@ extern "C" void dbgSerialPrintf(const char * format, ...)
const char *t = tmp;
while (*t) {
SEGGER_RTT_Write(0, (const void *)t++, 1);
SEGGER_RTT_Write(0, (const void*)t++, 1);
}
}
#else
@@ -449,12 +449,20 @@ void serialInit(uint8_t port_nr, int mode)
void initSerialPorts()
{
memset(serialPortStates, 0, sizeof(serialPortStates));
#if defined(DEBUG)
// AUX1 and serialPortStates was already initialized early in DEBUG config
for (uint8_t port_nr = 0; port_nr < MAX_AUX_SERIAL; port_nr++) {
if (port_nr != SP_AUX1) {
auto mode = getSerialPortMode(port_nr);
serialInit(port_nr, mode);
}
}
#else
for (uint8_t port_nr = 0; port_nr < MAX_AUX_SERIAL; port_nr++) {
auto mode = getSerialPortMode(port_nr);
serialInit(port_nr, mode);
}
#endif
}
int serialGetMode(uint8_t port_nr)