From 59e998ddabb4f0652771fe8f13f3226aa776cee2 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Tue, 14 Feb 2017 10:08:53 +0100 Subject: [PATCH 1/2] [ion] Add a Ion::Log::print method Change-Id: Iba069b97c07b9ef6c1f21dd33b83a445c0e3dbda --- ion/include/ion.h | 2 +- ion/include/ion/log.h | 12 ++++++++++++ ion/src/shared/log.cpp | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 ion/include/ion/log.h create mode 100644 ion/src/shared/log.cpp diff --git a/ion/include/ion.h b/ion/include/ion.h index f9daca5ae..3c7b281ad 100644 --- a/ion/include/ion.h +++ b/ion/include/ion.h @@ -8,11 +8,11 @@ #include #include #include +#include #include #include #include - /* ION is not your regular library. It is a library you link against, but it * will take care of configuring the whole environment for you. In POSIX terms, * ION will implement the "main" function. diff --git a/ion/include/ion/log.h b/ion/include/ion/log.h new file mode 100644 index 000000000..0cd94ad5a --- /dev/null +++ b/ion/include/ion/log.h @@ -0,0 +1,12 @@ +#ifndef ION_LOG_H +#define ION_LOG_H + +namespace Ion { +namespace Log { + +void print(const char * message); + +} +} + +#endif diff --git a/ion/src/shared/log.cpp b/ion/src/shared/log.cpp new file mode 100644 index 000000000..867d38088 --- /dev/null +++ b/ion/src/shared/log.cpp @@ -0,0 +1,6 @@ +#include +#include + +void Ion::Log::print(const char * message) { + printf("%s\n", message); +} From 2005a3d8226c86b8176765f19452bed3c4cf1f6a Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Tue, 14 Feb 2017 10:55:30 +0100 Subject: [PATCH 2/2] [ion] Fix a volatile error Change-Id: I8123b26d4b1b830ee4278b7fcc59d0ce552f0864 --- ion/src/device/regs/gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/device/regs/gpio.h b/ion/src/device/regs/gpio.h index 4469e5887..367607300 100644 --- a/ion/src/device/regs/gpio.h +++ b/ion/src/device/regs/gpio.h @@ -46,7 +46,7 @@ public: class ODR : Register32 { public: - bool get(int index) { return (bool)getBitRange(index, index); } + bool get(int index) volatile { return (bool)getBitRange(index, index); } void set(int index, bool state) volatile { setBitRange(index, index, state); } };