diff --git a/firmware/util/datalogging.cpp b/firmware/util/datalogging.cpp index 08e856daa7..ecc2a84ced 100644 --- a/firmware/util/datalogging.cpp +++ b/firmware/util/datalogging.cpp @@ -105,7 +105,7 @@ void appendFast(Logging *logging, const char *text) { // todo: look into chsnprintf once on Chibios 3 static void vappendPrintfI(Logging *logging, const char *fmt, va_list arg) { intermediateLoggingBuffer.eos = 0; // reset - efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#1b"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#1b"); chvprintf((BaseSequentialStream *) &intermediateLoggingBuffer, fmt, arg); intermediateLoggingBuffer.buffer[intermediateLoggingBuffer.eos] = 0; // need to terminate explicitly append(logging, (char *) intermediateLoggingBufferData); @@ -115,7 +115,7 @@ static void vappendPrintfI(Logging *logging, const char *fmt, va_list arg) { * this method acquires system lock to guard the shared intermediateLoggingBuffer memory stream */ void vappendPrintf(Logging *logging, const char *fmt, va_list arg) { - efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#5b"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#5b"); if (!intermediateLoggingBufferInited) { firmwareError(CUSTOM_ERR_6532, "intermediateLoggingBufferInited not inited!"); return; @@ -128,7 +128,7 @@ void vappendPrintf(Logging *logging, const char *fmt, va_list arg) { } void appendPrintf(Logging *logging, const char *fmt, ...) { - efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#4"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#4"); va_list ap; va_start(ap, fmt); vappendPrintf(logging, fmt, ap); @@ -253,7 +253,7 @@ void resetLogging(Logging *logging) { * This method should only be invoked on main thread because only the main thread can write to the console */ void printMsg(Logging *logger, const char *fmt, ...) { - efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#5o"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#5o"); // resetLogging(logging); // I guess 'reset' is not needed here? appendMsgPrefix(logger);