diff --git a/firmware/bootloader/src/rusefi_stubs.cpp b/firmware/bootloader/src/rusefi_stubs.cpp index df286465bc..d5e1f85103 100644 --- a/firmware/bootloader/src/rusefi_stubs.cpp +++ b/firmware/bootloader/src/rusefi_stubs.cpp @@ -12,9 +12,6 @@ void chDbgPanic3(const char* /*msg*/, const char* /*file*/, int /*line*/) { } -void print(const char* /*format*/, ...) { -} - void scheduleMsg(Logging* /*logging*/, const char* /*fmt*/, ...) { } diff --git a/firmware/config/boards/kinetis/efifeatures.h b/firmware/config/boards/kinetis/efifeatures.h index f1844dc99c..95b4a80ed1 100644 --- a/firmware/config/boards/kinetis/efifeatures.h +++ b/firmware/config/boards/kinetis/efifeatures.h @@ -358,7 +358,7 @@ #define CCM_UNUSED_SIZE 1 #define EFI_PRINT_ERRORS_AS_WARNINGS TRUE -#define EFI_PRINT_MESSAGES_TO_TERMINAL TRUE +// #define EFI_PRINT_MESSAGES_TO_TERMINAL TRUE #undef EFI_ACTIVE_CONFIGURATION_IN_FLASH #define EFI_ACTIVE_CONFIGURATION_IN_FLASH TRUE diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 53747297de..e7ecac8838 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -368,7 +368,7 @@ static void handleWriteValueCommand(TsChannelBase* tsChannel, ts_response_format tunerStudioDebug("got W (Write)"); // we can get a lot of these #if EFI_TUNER_STUDIO_VERBOSE -// scheduleMsg(logger, "Page number %d\r\n", pageId); // we can get a lot of these +// scheduleMsg(logger, "Page number %d", pageId); // we can get a lot of these #endif if (validateOffsetCount(offset, 1, tsChannel)) { @@ -569,8 +569,10 @@ static void tsProcessOne(TsChannelBase* tsChannel) { } int success = tsInstance.handleCrcCommand(tsChannel, tsChannel->scratchBuffer, incomingPacketSize); - if (!success) - print("got unexpected TunerStudio command %x:%c\r\n", command, command); + + if (!success) { + scheduleMsg(&tsLogger, "got unexpected TunerStudio command %x:%c", command, command); + } } void runBinaryProtocolLoop(TsChannelBase* tsChannel) { diff --git a/firmware/console/binary/tunerstudio_io.cpp b/firmware/console/binary/tunerstudio_io.cpp index 2e1d36a09c..25c7cd3316 100644 --- a/firmware/console/binary/tunerstudio_io.cpp +++ b/firmware/console/binary/tunerstudio_io.cpp @@ -50,7 +50,7 @@ void startTsPort(ts_channel_s *tsChannel) { #if defined(TS_UART_DEVICE) || defined(TS_SERIAL_DEVICE) if (CONFIG(useSerialPort)) { - print("TunerStudio over USART"); + scheduleMsg(&tsLogger, "TunerStudio over USART"); /** * We have hard-coded USB serial console so that it would be clear how to connect to each specific board, * but for UART serial we allow users to change settings. @@ -59,15 +59,16 @@ void startTsPort(ts_channel_s *tsChannel) { efiSetPadMode("tunerstudio tx", engineConfiguration->binarySerialTxPin, PAL_MODE_ALTERNATE(TS_SERIAL_AF)); #if TS_UART_DMA_MODE + scheduleMsg(&tsLogger, "Using UART-DMA mode"); tsChannel->uartp = TS_UART_DEVICE; startUartDmaConnector(tsChannel->uartp PASS_CONFIG_PARAMETER_SUFFIX); #elif TS_UART_MODE - print("Using UART mode"); + scheduleMsg(&tsLogger, "Using UART mode"); // start DMA driver tsUartConfig.speed = CONFIG(tunerStudioSerialSpeed); uartStart(TS_UART_DEVICE, &tsUartConfig); #elif defined(TS_SERIAL_DEVICE) - print("Using Serial mode"); + scheduleMsg(&tsLogger, "Using Serial mode"); tsSerialConfig.speed = CONFIG(tunerStudioSerialSpeed); sdStart(TS_SERIAL_DEVICE, &tsSerialConfig); diff --git a/firmware/console/connector_uart_dma.cpp b/firmware/console/connector_uart_dma.cpp index 84e8f3c0f9..6d70ab3dd5 100644 --- a/firmware/console/connector_uart_dma.cpp +++ b/firmware/console/connector_uart_dma.cpp @@ -68,7 +68,6 @@ static UARTConfig tsDmaUartConfig = { }; void startUartDmaConnector(UARTDriver *uartp DECLARE_CONFIG_PARAMETER_SUFFIX) { - print("Using UART-DMA mode"); // init FIFO queue iqObjectInit(&tsUartDma.fifoRxQueue, tsUartDma.buffer, sizeof(tsUartDma.buffer), NULL, NULL); diff --git a/firmware/console/console_io.cpp b/firmware/console/console_io.cpp index 867c7a8db9..ad45584a6e 100644 --- a/firmware/console/console_io.cpp +++ b/firmware/console/console_io.cpp @@ -117,7 +117,7 @@ static msg_t _put(void *ip, uint8_t b) { } _putt(ip, b, CONSOLE_WRITE_TIMEOUT); - + // Relock if we were locked before if (wasLocked) { if (isIsrContext()) { @@ -202,15 +202,6 @@ static THD_FUNCTION(consoleThreadEntryPoint, arg) { #endif /* EFI_CONSOLE_NO_THREAD */ -void consoleOutputBuffer(const uint8_t *buf, int size) { -#if !EFI_UART_ECHO_TEST_MODE - BaseChannel * channel = getConsoleChannel(); - if (channel != nullptr) { - chnWriteTimeout(channel, buf, size, CONSOLE_WRITE_TIMEOUT); - } -#endif /* EFI_UART_ECHO_TEST_MODE */ -} - static Logging *logger; void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p) { diff --git a/firmware/console/eficonsole.cpp b/firmware/console/eficonsole.cpp index 9ade38c6d8..524c90c3a0 100644 --- a/firmware/console/eficonsole.cpp +++ b/firmware/console/eficonsole.cpp @@ -170,27 +170,6 @@ static void cmd_threads(void) { #endif } -/** - * This methods prints the message to whatever is configured as our primary console - */ -void print(const char *format, ...) { -#if !EFI_UART_ECHO_TEST_MODE - if (!isCommandLineConsoleReady()) { - return; - } - BaseSequentialStream * channel = (BaseSequentialStream*) getConsoleChannel(); - if (channel == nullptr) { - return; - } - va_list ap; - va_start(ap, format); - chvprintf(channel, format, ap); - va_end(ap); -#else - UNUSED(format); -#endif /* EFI_UART_ECHO_TEST_MODE */ -} - void initializeConsole(Logging *sharedLogger) { initConsoleLogic(sharedLogger); diff --git a/firmware/console/eficonsole.h b/firmware/console/eficonsole.h index 1257f6ad2e..b73888401f 100644 --- a/firmware/console/eficonsole.h +++ b/firmware/console/eficonsole.h @@ -10,5 +10,4 @@ #include "datalogging.h" void initializeConsole(Logging *sharedLogger); -void print(const char *fmt, ...); void startUsbConsole(); diff --git a/firmware/controllers/core/error_handling.cpp b/firmware/controllers/core/error_handling.cpp index 2f248aa011..d4373b596d 100644 --- a/firmware/controllers/core/error_handling.cpp +++ b/firmware/controllers/core/error_handling.cpp @@ -75,8 +75,6 @@ void chDbgPanic3(const char *msg, const char * file, int line) { #endif /* EFI_HD44780_LCD */ if (!main_loop_started) { - print("%s %s %s:%d\r\n", CRITICAL_PREFIX, msg, file, line); -// chThdSleepSeconds(1); chSysHalt("Main loop did not start"); } } diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index f5e1b619af..c77ddbf127 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -550,7 +550,7 @@ void initMainEventListener(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX #if EFI_PROD_CODE addConsoleActionP("maininfo", (VoidPtr) showMainInfo, engine); - printMsg(logger, "initMainLoop: %d", currentTimeMillis()); + scheduleMsg(logger, "initMainLoop: %d", currentTimeMillis()); #endif diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index 69cd11053e..11320a93e2 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -140,7 +140,7 @@ typedef enum { } persisted_configuration_state_e; static persisted_configuration_state_e doReadConfiguration(flashaddr_t address, Logging * logger) { - printMsg(logger, "readFromFlash %x", address); + scheduleMsg(logger, "readFromFlash %x", address); intFlashRead(address, (char *) &persistentState, sizeof(persistentState)); if (!isValidCrc(&persistentState)) { @@ -160,7 +160,7 @@ static persisted_configuration_state_e readConfiguration(Logging* logger) { efiAssert(CUSTOM_ERR_ASSERT, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "read f", PC_ERROR); persisted_configuration_state_e result = doReadConfiguration(getFlashAddrFirstCopy(), logger); if (result != PC_OK) { - printMsg(logger, "Reading second configuration copy"); + scheduleMsg(logger, "Reading second configuration copy"); result = doReadConfiguration(getFlashAddrSecondCopy(), logger); } @@ -187,11 +187,11 @@ void readFromFlash() { persisted_configuration_state_e result = readConfiguration(logger); if (result == CRC_FAILED) { - printMsg(logger, "Need to reset flash to default due to CRC"); + scheduleMsg(logger, "Need to reset flash to default due to CRC"); } else if (result == INCOMPATIBLE_VERSION) { - printMsg(logger, "Resetting due to version mismatch but preserving engine type [%d]", engineConfiguration->engineType); + scheduleMsg(logger, "Resetting due to version mismatch but preserving engine type [%d]", engineConfiguration->engineType); } else { - printMsg(logger, "Read valid configuration from flash!"); + scheduleMsg(logger, "Read valid configuration from flash!"); } } diff --git a/firmware/development/hw_layer/poten.cpp b/firmware/development/hw_layer/poten.cpp index 71b59f8d43..a1b05ffc29 100644 --- a/firmware/development/hw_layer/poten.cpp +++ b/firmware/development/hw_layer/poten.cpp @@ -124,8 +124,6 @@ void initPotentiometers(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { setPotResistance(&potConfig[0], 0, 3000); setPotResistance(&potConfig[0], 1, 7000); -#else - print("digiPot logic disabled\r\n"); #endif } diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 6453a7c3e3..348a93f35f 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -470,7 +470,7 @@ void initHardwareNoConfig(Logging *l) { efiAssertVoid(CUSTOM_EC_NULL, engineConfiguration!=NULL, "engineConfiguration"); - printMsg(sharedLogger, "initHardware()"); + scheduleMsg(sharedLogger, "initHardware()"); initPinRepository(); @@ -605,7 +605,7 @@ void initHardware() { calcFastAdcIndexes(); - printMsg(sharedLogger, "initHardware() OK!"); + scheduleMsg(sharedLogger, "initHardware() OK!"); } #endif /* EFI_PROD_CODE */ diff --git a/firmware/hw_layer/lcd/lcd_HD44780.cpp b/firmware/hw_layer/lcd/lcd_HD44780.cpp index 2062ea08d8..a001a2fe79 100644 --- a/firmware/hw_layer/lcd/lcd_HD44780.cpp +++ b/firmware/hw_layer/lcd/lcd_HD44780.cpp @@ -237,7 +237,7 @@ void lcd_HD44780_init(Logging *sharedLogger) { return; } - printMsg(logger, "lcd_HD44780_init %d", engineConfiguration->displayMode); + scheduleMsg(logger, "lcd_HD44780_init %d", engineConfiguration->displayMode); if (!lcd_HD44780_is_enabled()) return; @@ -267,7 +267,7 @@ void lcd_HD44780_init(Logging *sharedLogger) { lcd_HD44780_write_command(LCD_HD44780_DISPLAY_ON); lcd_HD44780_set_position(0, 0); - printMsg(logger, "lcd_HD44780_init() done"); + scheduleMsg(logger, "lcd_HD44780_init() done"); } void lcdShowPanicMessage(char *message) { diff --git a/firmware/hw_layer/neo6m.cpp b/firmware/hw_layer/neo6m.cpp index 7306ff039a..b251d41878 100644 --- a/firmware/hw_layer/neo6m.cpp +++ b/firmware/hw_layer/neo6m.cpp @@ -49,7 +49,7 @@ static void printGpsInfo(DECLARE_ENGINE_PARAMETER_SIGNATURE) { scheduleMsg(&logging, "GPS RX %s", hwPortname(CONFIG(gps_rx_pin))); scheduleMsg(&logging, "GPS TX %s", hwPortname(CONFIG(gps_tx_pin))); - scheduleMsg(&logging, "m=%d,e=%d: vehicle speed = %.2f\r\n", gpsMesagesCount, uartErrors, getCurrentSpeed()); + scheduleMsg(&logging, "m=%d,e=%d: vehicle speed = %.2f", gpsMesagesCount, uartErrors, getCurrentSpeed()); float sec = currentTimeMillis() / 1000.0; scheduleMsg(&logging, "communication speed: %.2f", gpsMesagesCount / sec); diff --git a/firmware/hw_layer/rtc_helper.cpp b/firmware/hw_layer/rtc_helper.cpp index f225b2b0fd..fa62cd37d6 100644 --- a/firmware/hw_layer/rtc_helper.cpp +++ b/firmware/hw_layer/rtc_helper.cpp @@ -158,13 +158,13 @@ void setDateTime(const char *strDate) { return; } } - scheduleMsg(&logger, "date_set Date parameter %s is wrong\r\n", strDate); + scheduleMsg(&logger, "date_set Date parameter %s is wrong", strDate); } #endif /* EFI_RTC */ void initRtc(void) { #if EFI_RTC GetTimeUnixSec(); // this would test RTC, see 'rtcWorks' variable, see #311 - printMsg(&logger, "initRtc()"); + scheduleMsg(&logger, "initRtc()"); #endif /* EFI_RTC */ } diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 5f9129d180..afcbda8749 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -246,7 +246,7 @@ void runRusEfi(void) { runSchedulingPrecisionTestIfNeeded(); } - print("Running main loop\r\n"); + scheduleMsg(&sharedLogger, "Running main loop"); main_loop_started = true; /** * This loop is the closes we have to 'main loop' - but here we only publish the status. The main logic of engine diff --git a/firmware/util/cli_registry.cpp b/firmware/util/cli_registry.cpp index 0ab3f72e21..b0b4ac679d 100644 --- a/firmware/util/cli_registry.cpp +++ b/firmware/util/cli_registry.cpp @@ -183,7 +183,7 @@ void helpCommand(void) { * @brief This is just a test function */ static void echo(int value) { - print("got value: %d\r\n", value); + scheduleMsg(logging, "got value: %d", value); } char *unquote(char *line) { @@ -371,7 +371,7 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) { if (current->parameterType == FLOAT_PARAMETER) { float value = atoff(parameter); if (cisnan(value)) { - print("invalid float [%s]\r\n", parameter); + scheduleMsg(logging, "invalid float [%s]", parameter); return; } VoidFloat callbackF = (VoidFloat) current->callback; @@ -388,7 +388,7 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) { REPLACE_SPACES_WITH_ZERO; float value1 = atoff(parameter); if (cisnan(value1)) { - print("invalid float [%s]\r\n", parameter); + scheduleMsg(logging, "invalid float [%s]", parameter); return; } @@ -396,7 +396,7 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) { float value2 = atoff(parameter); if (cisnan(value2)) { - print("invalid float [%s]\r\n", parameter); + scheduleMsg(logging, "invalid float [%s]", parameter); return; } if (current->parameterType == FLOAT_FLOAT_PARAMETER) { @@ -425,7 +425,7 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) { float value2 = atoff(parameter); if (cisnan(value2)) { - print("invalid float [%s]\r\n", parameter); + scheduleMsg(logging, "invalid float [%s]", parameter); return; } @@ -437,7 +437,7 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) { int value = atoi(parameter); if (absI(value) == ERROR_CODE) { - print("invalid integer [%s]\r\n", parameter); + scheduleMsg(logging, "invalid integer [%s]", parameter); return; } @@ -493,7 +493,7 @@ char *validateSecureLine(char *line) { char *divider = line; while (*divider != '!') { if (*divider == '\0') { - print("Divider not found [%s]\r\n", line); + scheduleMsg(logging, "Divider not found [%s]", line); return NULL; } divider++; @@ -503,7 +503,7 @@ char *validateSecureLine(char *line) { line = divider; int actualLength = strlen(line); if (expectedLength != actualLength) { - print("Error detected: expected %d but got %d in [%s]\r\n", expectedLength, actualLength, line); + scheduleMsg(logging, "Error detected: expected %d but got %d in [%s]", expectedLength, actualLength, line); return NULL; } } @@ -562,7 +562,7 @@ void handleConsoleLine(char *line) { if (lineLength > 100) { // todo: better max size logic // todo: better reaction to excessive line - print("Long line?\r\n"); + scheduleMsg(logging, "Long line?"); return; } diff --git a/firmware/util/datalogging.cpp b/firmware/util/datalogging.cpp index ce1b27399e..b673702998 100644 --- a/firmware/util/datalogging.cpp +++ b/firmware/util/datalogging.cpp @@ -173,46 +173,6 @@ void Logging::appendFloat(float value, int precision) { static char header[16]; -/** - * this method should invoked on the main thread only - */ -static void printWithLength(char *line) { -#if ! EFI_UNIT_TEST - int len; - char *p; - - if (!isCommandLineConsoleReady()) - return; - - /** - * this is my way to detect serial port transmission errors - * following code is functionally identical to - * print("line:%d:%s\r\n", len, line); - * but it is faster because it outputs the whole buffer, not single characters - * We need this optimization because when we output larger chunks of data like the wave_chart: - * When we work with actual hardware, it is faster to invoke 'chSequentialStreamWrite' for the - * whole buffer then to invoke 'chSequentialStreamPut' once per character. - */ - // todo: if needed we can probably know line length without calculating it, but seems like this is done not - // under a lock so not a problem? - - len = efiStrlen(line); - strcpy(header, "line:"); - p = header + efiStrlen(header); - p = itoa10(p, len); - *p++ = ':'; - *p++ = '\0'; - - p = line; - p += len; - *p++ = '\r'; - *p++ = '\n'; - - consoleOutputBuffer((const uint8_t *) header, strlen(header)); - consoleOutputBuffer((const uint8_t *) line, p - line); -#endif // EFI_UNIT_TEST -} - void appendMsgPrefix(Logging *logging) { logging->append(PROTOCOL_MSG DELIMETER); } @@ -226,25 +186,6 @@ void Logging::reset() { *linePointer = 0; } -/** - * This method would output a simple console message immediately. - * 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(CUSTOM_ERR_6605, getCurrentRemainingStack() > 128, "lowstck#5o"); -// resetLogging(logging); // I guess 'reset' is not needed here? - appendMsgPrefix(logger); - - va_list ap; - va_start(ap, fmt); - logger->vappendPrintf(fmt, ap); - va_end(ap); - - logger->append(DELIMETER); - printWithLength(logger->buffer); - logger->reset(); -} - Logging::Logging(char const *name, char *buffer, int bufferSize) : name(name) , buffer(buffer) diff --git a/firmware/util/datalogging.h b/firmware/util/datalogging.h index 4266482d96..f61427472a 100644 --- a/firmware/util/datalogging.h +++ b/firmware/util/datalogging.h @@ -85,9 +85,6 @@ void appendMsgPostfix(Logging *logging); extern "C" { #endif /* __cplusplus */ - -void printMsg(Logging *logging, const char *fmt, ...); - /** * this method copies the line into the intermediate buffer for later output by * the main thread diff --git a/firmware/util/efilib.cpp b/firmware/util/efilib.cpp index 91fd4b1cf2..27224ae630 100644 --- a/firmware/util/efilib.cpp +++ b/firmware/util/efilib.cpp @@ -237,7 +237,7 @@ float atoff(const char *param) { char *string = todofixthismesswithcopy; if (indexOf(string, 'n') != -1 || indexOf(string, 'N') != -1) { #if ! EFI_SIMULATOR - print("NAN from [%s]\r\n", string); + scheduleMsg(nullptr, "NAN from [%s]", string); #endif return (float) NAN; } diff --git a/unit_tests/global.h b/unit_tests/global.h index c3d888402b..36e4e8a880 100644 --- a/unit_tests/global.h +++ b/unit_tests/global.h @@ -43,8 +43,6 @@ typedef uint32_t systime_t; void chDbgAssert(int c, char *msg, void *arg); -void print(const char *fmt, ...); - #define TICKS_IN_MS 100 #define chDbgCheck(x, y) chDbgAssert(x, y, NULL) diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index c7a2c15325..e074f279d9 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -45,12 +45,5 @@ GTEST_API_ int main(int argc, char **argv) { return result == 0 ? 0 : -1; } -void print(const char *format, ...) { - va_list ap; - va_start(ap, format); - vprintf(format, ap); - va_end(ap); -} - void initLogging(LoggingWithStorage *logging, const char *name) { } diff --git a/unit_tests/tests/test_logic_expression.cpp b/unit_tests/tests/test_logic_expression.cpp index acd4ffaae4..695033ecaa 100644 --- a/unit_tests/tests/test_logic_expression.cpp +++ b/unit_tests/tests/test_logic_expression.cpp @@ -111,7 +111,7 @@ static void testExpression2(float selfValue, const char *line, float expected, E LEElement thepool[TEST_POOL_SIZE]; LEElementPool pool(thepool, TEST_POOL_SIZE); LEElement * element = pool.parseExpression(line); - print("Parsing [%s]\n", line); + printf("Parsing [%s]\n", line); ASSERT_TRUE(element != NULL) << "Not NULL expected"; LECalculator c; diff --git a/unit_tests/tests/test_pid.cpp b/unit_tests/tests/test_pid.cpp index 2c350e175b..68c51d6560 100644 --- a/unit_tests/tests/test_pid.cpp +++ b/unit_tests/tests/test_pid.cpp @@ -11,7 +11,6 @@ #include "pid.h" TEST(util, pid) { - print("******************************************* testPidController\r\n"); pid_s pidS; pidS.pFactor = 50; pidS.iFactor = 0.5; diff --git a/unit_tests/tests/test_pwm_generator.cpp b/unit_tests/tests/test_pwm_generator.cpp index 7d48e4aac1..886d015eb9 100644 --- a/unit_tests/tests/test_pwm_generator.cpp +++ b/unit_tests/tests/test_pwm_generator.cpp @@ -40,7 +40,7 @@ static void assertNextEvent(const char *msg, int expectedPinState, TestExecutor } static void test100dutyCycle() { - print("*************************************** test100dutyCycle\r\n"); + printf("*************************************** test100dutyCycle\r\n"); expectedTimeOfNextEvent = timeNowUs = 0; TestExecutor executor; @@ -67,7 +67,7 @@ static void test100dutyCycle() { } static void testSwitchToNanPeriod() { - print("*************************************** testSwitchToNanPeriod\r\n"); + printf("*************************************** testSwitchToNanPeriod\r\n"); expectedTimeOfNextEvent = timeNowUs = 0; TestExecutor executor; @@ -105,8 +105,6 @@ TEST(misc, testPwmGenerator) { test100dutyCycle(); testSwitchToNanPeriod(); - print("*************************************** testPwmGenerator\r\n"); - expectedTimeOfNextEvent = timeNowUs = 0; TestExecutor executor; SimplePwm pwm("test PWM3"); diff --git a/unit_tests/tests/test_signal_executor.cpp b/unit_tests/tests/test_signal_executor.cpp index 565c2abb85..b2b38cb450 100644 --- a/unit_tests/tests/test_signal_executor.cpp +++ b/unit_tests/tests/test_signal_executor.cpp @@ -87,8 +87,6 @@ TEST(misc, testSignalExecutor3) { } TEST(misc, testSignalExecutor) { - print("*************************************** testSignalExecutor\r\n"); - EventQueue eq; ASSERT_EQ(eq.getNextEventTime(0), unexpected); scheduling_s s1; diff --git a/unit_tests/tests/test_util.cpp b/unit_tests/tests/test_util.cpp index 968406bb81..6203eab8fb 100644 --- a/unit_tests/tests/test_util.cpp +++ b/unit_tests/tests/test_util.cpp @@ -46,8 +46,6 @@ TEST(util, crc) { ASSERT_EQ(4, efiRound(4.4, 1)); ASSERT_FLOAT_EQ(1.2, efiRound(1.2345, 0.1)); - print("*************************************** testCrc\r\n"); - const char * A = "A"; ASSERT_EQ( 168, calc_crc((const crc_t *) A, 1)) << "crc8"; @@ -75,8 +73,6 @@ TEST(util, cyclicBufferContains) { TEST(util, cyclicBuffer) { cyclic_buffer sb; - print("*************************************** testCyclicBuffer\r\n"); - { sb.add(10); @@ -102,8 +98,6 @@ TEST(util, cyclicBuffer) { } TEST(util, histogram) { - print("******************************************* testHistogram\r\n"); - initHistogramsModule(); ASSERT_EQ(80, histogramGetIndex(239)); @@ -145,7 +139,6 @@ TEST(util, histogram) { } static void testMalfunctionCentralRemoveNonExistent() { - print("******************************************* testMalfunctionCentralRemoveNonExistent\r\n"); clearWarnings(); // this should not crash @@ -154,7 +147,6 @@ static void testMalfunctionCentralRemoveNonExistent() { static void testMalfunctionCentralSameElementAgain() { clearWarnings(); - print("******************************************* testMalfunctionCentralSameElementAgain\r\n"); error_codes_set_s localCopy; addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction); @@ -165,7 +157,6 @@ static void testMalfunctionCentralSameElementAgain() { static void testMalfunctionCentralRemoveFirstElement() { clearWarnings(); - print("******************************************* testMalfunctionCentralRemoveFirstElement\r\n"); error_codes_set_s localCopy; obd_code_e firstElement = OBD_Engine_Coolant_Temperature_Circuit_Malfunction; @@ -189,7 +180,6 @@ TEST(misc, testMalfunctionCentral) { testMalfunctionCentralSameElementAgain(); testMalfunctionCentralRemoveFirstElement(); - print("******************************************* testMalfunctionCentral\r\n"); clearWarnings(); error_codes_set_s localCopy; @@ -256,8 +246,6 @@ static loc_t GPSdata; static char nmeaMessage[1000]; TEST(misc, testGpsParser) { - print("******************************************* testGpsParser\r\n"); - strcpy(nmeaMessage, ""); gps_location(&GPSdata, nmeaMessage); @@ -310,7 +298,6 @@ TEST(misc, testGpsParser) { static char buffer[300]; TEST(misc, testConsoleLogic) { - print("******************************************* testConsoleLogic\r\n"); resetConsoleActions(); helpCommand(); @@ -338,32 +325,32 @@ TEST(misc, testConsoleLogic) { strcpy(buffer, "sdasdafasd asd"); handleConsoleLine(buffer); - print("\r\naddConsoleActionI\r\n"); + printf("\r\naddConsoleActionI\r\n"); addConsoleActionI("echoi", testEchoI); strcpy(buffer, "echoi 239"); handleConsoleLine(buffer); ASSERT_EQ(239, lastInteger); - print("\r\naddConsoleActionI 240 with two spaces\r\n"); + printf("\r\naddConsoleActionI 240 with two spaces\r\n"); strcpy(buffer, "echoi 240"); handleConsoleLine(buffer); ASSERT_EQ(240, lastInteger); - print("\r\naddConsoleActionII\r\n"); + printf("\r\naddConsoleActionII\r\n"); addConsoleActionII("echoii", testEchoII); strcpy(buffer, "echoii 22 239"); handleConsoleLine(buffer); ASSERT_EQ(22, lastInteger); ASSERT_EQ(239, lastInteger2); - print("\r\naddConsoleActionII three spaces\r\n"); + printf("\r\naddConsoleActionII three spaces\r\n"); strcpy(buffer, "echoii 21 220"); handleConsoleLine(buffer); ASSERT_EQ(21, lastInteger); ASSERT_EQ(220, lastInteger2); - print("\r\addConsoleActionSSS\r\n"); + printf("\r\addConsoleActionSSS\r\n"); addConsoleActionSSS("echosss", testEchoSSS); strcpy(buffer, "echosss 111 222 333"); handleConsoleLine(buffer); @@ -378,8 +365,6 @@ TEST(misc, testConsoleLogic) { } TEST(misc, testFLStack) { - print("******************************************* testFLStack\r\n"); - FLStack stack; ASSERT_EQ(0, stack.size()); @@ -410,7 +395,6 @@ TEST(misc, testFLStack) { static char buff[32]; TEST(misc, testMisc) { - print("******************************************* testMisc\r\n"); strcpy(buff, " ab "); // we need a mutable array here ASSERT_TRUE(strEqual("ab", efiTrim(buff))); @@ -434,8 +418,6 @@ TEST(misc, testMisc) { } TEST(misc, testMenuTree) { - print("******************************************* testMenuTree\r\n"); - MenuItem ROOT(NULL, NULL); MenuTree tree(&ROOT);