From bfab275a8813cf7bcb699f3b57a7ad68a15563e6 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Fri, 17 Mar 2017 15:08:06 +0100 Subject: [PATCH] [ion] Get rid of log Change-Id: Icf37d4cedb1cc3ffbc9e020cdb7b4a89d543aa23 --- escher/src/run_loop.cpp | 7 ++----- ion/Makefile | 1 - ion/include/ion.h | 1 - ion/include/ion/log.h | 28 ---------------------------- ion/src/blackbox/Makefile | 1 - ion/src/device/Makefile | 1 - ion/src/shared/log_printf.cpp | 7 ------- ion/src/shared/log_uint32.cpp | 16 ---------------- ion/src/simulator/Makefile | 1 - 9 files changed, 2 insertions(+), 61 deletions(-) delete mode 100644 ion/include/ion/log.h delete mode 100644 ion/src/shared/log_printf.cpp delete mode 100644 ion/src/shared/log_uint32.cpp diff --git a/escher/src/run_loop.cpp b/escher/src/run_loop.cpp index 6a1f4d7e9..870f3d3ae 100644 --- a/escher/src/run_loop.cpp +++ b/escher/src/run_loop.cpp @@ -53,17 +53,14 @@ void RunLoop::step() { } #if ESCHER_LOG_EVENTS_BINARY - char message[2] = { (char)event.id(), 0}; - ion_log_string(message); + Ion::Console::writeChar((char)event.id()); #endif #if ESCHER_LOG_EVENTS_NAME const char * name = event.name(); if (name == nullptr) { name = "UNDEFINED"; } - ion_log_string("Ion::Events::"); - ion_log_string(name); - ion_log_string("\n"); + Ion::Console::writeLine(name); #endif if (event != Ion::Events::None) { diff --git a/ion/Makefile b/ion/Makefile index 459b8cbeb..73e1aa017 100644 --- a/ion/Makefile +++ b/ion/Makefile @@ -3,7 +3,6 @@ include ion/src/$(PLATFORM)/Makefile objs += $(addprefix ion/src/shared/, \ events.o \ - log_uint32.o \ ) tests += $(addprefix ion/test/,\ diff --git a/ion/include/ion.h b/ion/include/ion.h index 5ae833362..309d1f3aa 100644 --- a/ion/include/ion.h +++ b/ion/include/ion.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/ion/include/ion/log.h b/ion/include/ion/log.h deleted file mode 100644 index c6f1ace0e..000000000 --- a/ion/include/ion/log.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ION_LOG_H -#define ION_LOG_H - -// Ion offers a C-compatible logging API - -#include - -#ifdef DEBUG - -#ifdef __cplusplus -extern "C" { -#endif - -void ion_log_string(const char * message); -void ion_log_uint32(uint32_t integer); - -#ifdef __cplusplus -} -#endif - -#else - -#define ion_log_print_string(m) ((void)0) -#define ion_log_print_uint32(i) ((void)0) - -#endif - -#endif diff --git a/ion/src/blackbox/Makefile b/ion/src/blackbox/Makefile index 2a2f48899..3fa226f2d 100644 --- a/ion/src/blackbox/Makefile +++ b/ion/src/blackbox/Makefile @@ -3,7 +3,6 @@ objs += $(addprefix ion/src/shared/, \ crc32.o \ events.o \ events_stdin.o \ - log_printf.o \ power.o \ ) diff --git a/ion/src/device/Makefile b/ion/src/device/Makefile index ab39ab1ad..86dcce250 100644 --- a/ion/src/device/Makefile +++ b/ion/src/device/Makefile @@ -14,7 +14,6 @@ objs += $(addprefix ion/src/device/, \ display.o\ keyboard.o\ led.o\ - log.o\ power.o\ sd_card.o\ swd.o \ diff --git a/ion/src/shared/log_printf.cpp b/ion/src/shared/log_printf.cpp deleted file mode 100644 index 9459269f7..000000000 --- a/ion/src/shared/log_printf.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -void ion_log_string(const char * message) { - printf("%s", message); - fflush(stdout); -} diff --git a/ion/src/shared/log_uint32.cpp b/ion/src/shared/log_uint32.cpp deleted file mode 100644 index c25241d95..000000000 --- a/ion/src/shared/log_uint32.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#ifdef DEBUG - -void ion_log_uint32(uint32_t i) { - char buffer[9]; - for (int j=0; j<8; j++) { - uint8_t v = (i & 0xF); - buffer[8-1-j] = (v>9) ? 'A'+v-10 : '0'+v; - i = i >> 4; - } - buffer[8] = 0; - ion_log_string(buffer); -} - -#endif diff --git a/ion/src/simulator/Makefile b/ion/src/simulator/Makefile index cfaf469ad..1ed4ce757 100644 --- a/ion/src/simulator/Makefile +++ b/ion/src/simulator/Makefile @@ -10,7 +10,6 @@ objs += $(addprefix ion/src/simulator/keyboard/, fltkkbd.o) objs += $(addprefix ion/src/shared/, \ crc32.o \ events_keyboard.o \ - log_printf.o \ power.o \ random.o \ )