diff --git a/include/etl/callback_timer.h b/include/etl/callback_timer.h index e5fd754e..265c46da 100644 --- a/include/etl/callback_timer.h +++ b/include/etl/callback_timer.h @@ -132,23 +132,25 @@ namespace etl { } - //******************************************* - /// ETL delegate callback - //******************************************* - callback_timer_data(etl::timer::id::type id_, - etl::delegate& callback_, - uint32_t period_, - bool repeating_) - : p_callback(reinterpret_cast(&callback_)), - period(period_), - delta(etl::timer::state::INACTIVE), - id(id_), - previous(etl::timer::id::NO_TIMER), - next(etl::timer::id::NO_TIMER), - repeating(repeating_), - cbk_type(DELEGATE) - { - } +#if ETL_CPP11_SUPPORTED + //******************************************* + /// ETL delegate callback + //******************************************* + callback_timer_data(etl::timer::id::type id_, + etl::delegate& callback_, + uint32_t period_, + bool repeating_) + : p_callback(reinterpret_cast(&callback_)), + period(period_), + delta(etl::timer::state::INACTIVE), + id(id_), + previous(etl::timer::id::NO_TIMER), + next(etl::timer::id::NO_TIMER), + repeating(repeating_), + cbk_type(DELEGATE) + { + } +#endif //******************************************* /// Returns true if the timer is active. @@ -434,38 +436,38 @@ namespace etl return id; } - //******************************************* - /// Register a timer. - //******************************************* + //******************************************* + /// Register a timer. + //******************************************* #if ETL_CPP11_SUPPORTED - etl::timer::id::type register_timer(etl::delegate& callback_, - uint32_t period_, - bool repeating_) - { - etl::timer::id::type id = etl::timer::id::NO_TIMER; + etl::timer::id::type register_timer(etl::delegate& callback_, + uint32_t period_, + bool repeating_) + { + etl::timer::id::type id = etl::timer::id::NO_TIMER; - bool is_space = (registered_timers < MAX_TIMERS); + bool is_space = (registered_timers < MAX_TIMERS); - if (is_space) - { - // Search for the free space. - for (uint_least8_t i = 0; i < MAX_TIMERS; ++i) - { - etl::callback_timer_data& timer = timer_array[i]; + if (is_space) + { + // Search for the free space. + for (uint_least8_t i = 0; i < MAX_TIMERS; ++i) + { + etl::callback_timer_data& timer = timer_array[i]; - if (timer.id == etl::timer::id::NO_TIMER) - { - // Create in-place. - new (&timer) callback_timer_data(i, callback_, period_, repeating_); - ++registered_timers; - id = i; - break; - } - } - } + if (timer.id == etl::timer::id::NO_TIMER) + { + // Create in-place. + new (&timer) callback_timer_data(i, callback_, period_, repeating_); + ++registered_timers; + id = i; + break; + } + } + } - return id; - } + return id; + } #endif //******************************************* @@ -576,11 +578,13 @@ namespace etl // Call the function wrapper callback. (*reinterpret_cast*>(timer.p_callback))(); } +#if ETL_CPP11_SUPPORTED else if(timer.cbk_type == callback_timer_data::DELEGATE) { // Call the function wrapper callback. (*reinterpret_cast*>(timer.p_callback))(); } +#endif else { ETL_ALWAYS_ASSERT("Callback timer has incorrect callback type stored"); @@ -618,7 +622,7 @@ namespace etl // Registered timer? if (timer.id != etl::timer::id::NO_TIMER) - { + { // Has a valid period. if (timer.period != etl::timer::state::INACTIVE) { @@ -633,7 +637,7 @@ namespace etl ETL_ENABLE_TIMER_UPDATES; result = true; - } + } } } diff --git a/include/etl/version.h b/include/etl/version.h index 789badbb..275995b3 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 14 #define ETL_VERSION_MINOR 38 -#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 4d8a97f2..42539d13 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "14.38.0", + "version": "14.38.1", "authors": { "name": "John Wellbelove", "email": "" diff --git a/library.properties b/library.properties index dc899c5a..fd02f4da 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=14.38.0 +version=14.38.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index d0a46c7e..c7c02064 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +14.38.1 +Added missing C++11 conditional compilation in callback_timer.h + =============================================================================== 14.38.0 Added optional to force string and string_view construction from character