From bec1e40c55fdd2182347a9f08d926ef3b8d304bc Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 9 Aug 2018 20:51:46 +0100 Subject: [PATCH] Merge remote-tracking branch 'origin/development' # Conflicts: # include/etl/version.h # support/Release notes.txt --- .../ArmTimerCallbacks.uvprojx | 2 +- .../ArmTimerCallbacks - C++/etl_profile.h | 5 +++-- examples/ArmTimerCallbacks - C++/main.cpp | 19 +++++++++++++++++-- include/etl/atomic/atomic_gcc_sync.h | 2 +- include/etl/debug_count.h | 18 ++++-------------- include/etl/stl/iterator.h | 2 +- include/etl/version.h | 8 ++++---- support/Release notes.txt | 5 +++++ test/test_io_port.cpp | 11 +++++++++-- 9 files changed, 45 insertions(+), 27 deletions(-) diff --git a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx index ed494f20..b7fa094b 100644 --- a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx +++ b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx @@ -336,7 +336,7 @@ - ..\..\src;..\ArmTimerCallbacks - C++ + ..\..\include;..\ArmTimerCallbacks - C++ diff --git a/examples/ArmTimerCallbacks - C++/etl_profile.h b/examples/ArmTimerCallbacks - C++/etl_profile.h index 4560ba1e..a2e2f33f 100644 --- a/examples/ArmTimerCallbacks - C++/etl_profile.h +++ b/examples/ArmTimerCallbacks - C++/etl_profile.h @@ -9,13 +9,14 @@ #define ETL_IVECTOR_REPAIR_ENABLE #define ETL_IDEQUE_REPAIR_ENABLE #define ETL_IN_UNIT_TEST +#define ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK #if (__CC_ARM == 1) // ARM5 compiler - #include "profiles/armv5.h" + #include "etl/profiles/armv5.h" #else // ARM6 compiler - #include "profiles/armv6.h" + #include "etl/profiles/armv6.h" #endif #endif diff --git a/examples/ArmTimerCallbacks - C++/main.cpp b/examples/ArmTimerCallbacks - C++/main.cpp index 05f19b17..d2d0e5a3 100644 --- a/examples/ArmTimerCallbacks - C++/main.cpp +++ b/examples/ArmTimerCallbacks - C++/main.cpp @@ -9,8 +9,23 @@ extern "C" #include "stm32f4xx.h" // Device header } -#include "function.h" -#include "callback_timer.h" +#include "etl/function.h" +#include "etl/callback_timer.h" +#include "etl/vector.h" + +struct FP +{ + void (*function)(); +}; + +static etl::vector power_callbacks; + +void register_poweroff_callback(void (*function)()) +{ + FP fp = { function }; + power_callbacks.push_back(fp); +} + const int N_TIMERS = 4; diff --git a/include/etl/atomic/atomic_gcc_sync.h b/include/etl/atomic/atomic_gcc_sync.h index d26005b2..725c44ac 100644 --- a/include/etl/atomic/atomic_gcc_sync.h +++ b/include/etl/atomic/atomic_gcc_sync.h @@ -34,7 +34,7 @@ SOFTWARE. #include "../static_assert.h" #include "../nullptr.h" -#include +//#include #include #pragma GCC diagnostic push diff --git a/include/etl/debug_count.h b/include/etl/debug_count.h index b603b00c..66b40530 100644 --- a/include/etl/debug_count.h +++ b/include/etl/debug_count.h @@ -84,25 +84,15 @@ namespace etl return *this; } - inline debug_count& operator +=(int32_t n) - { - count += n; - return *this; - } - - inline debug_count& operator -=(int32_t n) - { - count -= n; - return *this; - } - - inline debug_count& operator +=(size_t n) + template + inline debug_count& operator +=(T n) { count += int32_t(n); return *this; } - inline debug_count& operator -=(size_t n) + template + inline debug_count& operator -=(T n) { count -= int32_t(n); return *this; diff --git a/include/etl/stl/iterator.h b/include/etl/stl/iterator.h index 91299a26..56f2e5d6 100644 --- a/include/etl/stl/iterator.h +++ b/include/etl/stl/iterator.h @@ -40,4 +40,4 @@ SOFTWARE. #include #endif -#endif \ No newline at end of file +#endif diff --git a/include/etl/version.h b/include/etl/version.h index 531de754..a89a8969 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -37,10 +37,10 @@ SOFTWARE. /// Definitions of the ETL version ///\ingroup utilities -#define ETL_VERSION "11.15.0" -#define ETL_VERSION_W L"11.15.0" -#define ETL_VERSION_U16 u"11.15.0" -#define ETL_VERSION_U32 U"11.15.0" +#define ETL_VERSION "11.15.1" +#define ETL_VERSION_W L"11.15.1" +#define ETL_VERSION_U16 u"11.15.1" +#define ETL_VERSION_U32 U"11.15.1" #define ETL_VERSION_MAJOR 11 #define ETL_VERSION_MINOR 15 #define ETL_VERSION_PATCH 0 diff --git a/support/Release notes.txt b/support/Release notes.txt index fde6c598..f977f9d7 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,8 @@ +=============================================================================== +11.15.1 +io_port_test Fixed unaligned access error. +debug_count Removed typed += & -= operators and replaced with templates. + =============================================================================== 11.15.0 Added 'memory model' selection for queues to allow more efficient implementations. diff --git a/test/test_io_port.cpp b/test/test_io_port.cpp index 88223339..4634e8da 100644 --- a/test/test_io_port.cpp +++ b/test/test_io_port.cpp @@ -95,7 +95,14 @@ namespace //************************************************************************* TEST(test_dynamic_io_port) { - uint8_t memory[7]; + union U + { + uint16_t dummy; + uint8_t memory[7]; + } u; + + uint8_t* memory = &u.memory[0]; + memory[0] = 0x12; memory[1] = 0x00; memory[2] = 0x00; @@ -104,7 +111,7 @@ namespace memory[5] = 0x9A; memory[6] = 0x00; - dynamic_serial_port port(memory); + dynamic_serial_port port(&u.memory[0]); uint8_t rxdata = port.rxdata; CHECK_EQUAL(memory[0], rxdata);