From b80763e64430dde7a1655fe713f3e3b43b675afe Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Wed, 29 Jan 2020 17:38:02 +0000 Subject: [PATCH] Fixed incorrect ETL_ALWAYS_ASSERT in etl::callback_timer --- include/etl/callback_timer.h | 15 ++++++--------- include/etl/version.h | 2 +- library.json | 2 +- library.properties | 2 +- support/Release notes.txt | 4 ++++ 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/etl/callback_timer.h b/include/etl/callback_timer.h index 487f5789..07c084e6 100644 --- a/include/etl/callback_timer.h +++ b/include/etl/callback_timer.h @@ -93,6 +93,7 @@ namespace etl IFUNCTION, DELEGATE }; + //******************************************* callback_timer_data() : p_callback(nullptr), @@ -146,10 +147,10 @@ namespace etl //******************************************* /// ETL delegate callback //******************************************* - callback_timer_data(etl::timer::id::type id_, + callback_timer_data(etl::timer::id::type id_, etl::delegate& callback_, - uint32_t period_, - bool repeating_) + uint32_t period_, + bool repeating_) : p_callback(reinterpret_cast(&callback_)), period(period_), delta(etl::timer::state::INACTIVE), @@ -538,7 +539,7 @@ namespace etl for (int i = 0; i < MAX_TIMERS; ++i) { - new (&timer_array[i]) callback_timer_data(); + ::new (&timer_array[i]) callback_timer_data(); } registered_timers = 0; @@ -591,14 +592,10 @@ namespace etl #if ETL_CPP11_SUPPORTED else if(timer.cbk_type == callback_timer_data::DELEGATE) { - // Call the function wrapper callback. + // Call the delegate callback. (*reinterpret_cast*>(timer.p_callback))(); } #endif - else - { - ETL_ALWAYS_ASSERT("Callback timer has incorrect callback type stored"); - } } has_active = !active_list.empty(); diff --git a/include/etl/version.h b/include/etl/version.h index 51eac722..93b5e668 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 16 #define ETL_VERSION_MINOR 3 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index f09a46ef..eae020a0 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "16.3.0", + "version": "16.3.1", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index af92bfdc..8dea8fd3 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=16.3.0 +version=16.3.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index b57a14ca..4cc6ae34 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +16.3.1 +Removed incorrect ETL_ALWAYS_ASSERT from etl::callback_timer + =============================================================================== 16.3.0 Added parity checksum to checksum.h.