Make consoleInit() Reentrant, and initialize it earlier on native (#10156)
This commit is contained in:
@@ -30,6 +30,9 @@ SerialConsole *console;
|
|||||||
|
|
||||||
void consoleInit()
|
void consoleInit()
|
||||||
{
|
{
|
||||||
|
if (console) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto sc = new SerialConsole(); // Must be dynamically allocated because we are now inheriting from thread
|
auto sc = new SerialConsole(); // Must be dynamically allocated because we are now inheriting from thread
|
||||||
|
|
||||||
#if defined(SERIAL_HAS_ON_RECEIVE)
|
#if defined(SERIAL_HAS_ON_RECEIVE)
|
||||||
|
|||||||
@@ -182,6 +182,10 @@ void portduinoSetup()
|
|||||||
// Force stdout to be line buffered
|
// Force stdout to be line buffered
|
||||||
setvbuf(stdout, stdoutBuffer, _IOLBF, sizeof(stdoutBuffer));
|
setvbuf(stdout, stdoutBuffer, _IOLBF, sizeof(stdoutBuffer));
|
||||||
|
|
||||||
|
// We do this super early so that we can log from the rest of the init code
|
||||||
|
concurrency::hasBeenSetup = true;
|
||||||
|
consoleInit();
|
||||||
|
|
||||||
if (portduino_config.force_simradio == true) {
|
if (portduino_config.force_simradio == true) {
|
||||||
portduino_config.lora_module = use_simradio;
|
portduino_config.lora_module = use_simradio;
|
||||||
} else if (configPath != nullptr) {
|
} else if (configPath != nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user