From 56c01c79511a59f57c996403f4f85c316769132e Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 8 Nov 2014 20:06:49 -0600 Subject: [PATCH] auto-sync --- firmware/chibios/os/various/chprintf.c | 5 +++++ firmware/console_util/datalogging.c | 1 + 2 files changed, 6 insertions(+) diff --git a/firmware/chibios/os/various/chprintf.c b/firmware/chibios/os/various/chprintf.c index de11a0f7df..7b82e0f21d 100644 --- a/firmware/chibios/os/various/chprintf.c +++ b/firmware/chibios/os/various/chprintf.c @@ -95,6 +95,8 @@ char *ftoa(char *p, double num, unsigned long precision) { } #endif +#include "error_handling.h" + /** * @brief System formatted output function. * @details This function implements a minimal @p vprintf()-like functionality @@ -131,6 +133,9 @@ void chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap) { char tmpbuf[MAX_FILLER + 1]; #endif + efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#1c"); + + while (TRUE) { c = *fmt++; if (c == 0) diff --git a/firmware/console_util/datalogging.c b/firmware/console_util/datalogging.c index 96eb478b28..c5ce7a10c1 100644 --- a/firmware/console_util/datalogging.c +++ b/firmware/console_util/datalogging.c @@ -108,6 +108,7 @@ void appendFast(Logging *logging, const char *text) { static void vappendPrintfI(Logging *logging, const char *fmt, va_list arg) { intermediateLoggingBuffer.eos = 0; // reset + efiAssertVoid(getRemainingStack(chThdSelf()) > 196, "lowstck#1b"); chvprintf((BaseSequentialStream *) &intermediateLoggingBuffer, fmt, arg); intermediateLoggingBuffer.buffer[intermediateLoggingBuffer.eos] = 0; // need to terminate explicitly append(logging, (char *) intermediateLoggingBufferData);