diff --git a/library.properties b/library.properties index bfa833f7..c97b8bf2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=10.18.0 +version=10.18.1 author= John Wellbelove maintainer=John Wellbelove sentence=A C++ template library tailored for embedded systems. diff --git a/src/callback_timer.h b/src/callback_timer.h index 8ed39417..42410566 100644 --- a/src/callback_timer.h +++ b/src/callback_timer.h @@ -350,8 +350,6 @@ namespace etl { etl::timer::id::type id = etl::timer::id::NO_TIMER; - ETL_DISABLE_TIMER_UPDATES; - bool is_space = (registered_timers < MAX_TIMERS); if (is_space) @@ -372,8 +370,6 @@ namespace etl } } - ETL_ENABLE_TIMER_UPDATES; - return id; } @@ -386,8 +382,6 @@ namespace etl { etl::timer::id::type id = etl::timer::id::NO_TIMER; - ETL_DISABLE_TIMER_UPDATES; - bool is_space = (registered_timers < MAX_TIMERS); if (is_space) @@ -408,8 +402,6 @@ namespace etl } } - ETL_ENABLE_TIMER_UPDATES; - return id; } @@ -422,15 +414,15 @@ namespace etl if (id_ != etl::timer::id::NO_TIMER) { - ETL_DISABLE_TIMER_UPDATES; - etl::callback_timer_data& timer = timer_array[id_]; if (timer.id != etl::timer::id::NO_TIMER) { if (timer.is_active()) { + ETL_DISABLE_TIMER_UPDATES; active_list.remove(timer.id, false); + ETL_ENABLE_TIMER_UPDATES; // Reset in-place. new (&timer) callback_timer_data(); @@ -439,8 +431,6 @@ namespace etl result = true; } } - - ETL_ENABLE_TIMER_UPDATES; } return result; @@ -468,8 +458,8 @@ namespace etl void clear() { ETL_DISABLE_TIMER_UPDATES; - active_list.clear(); + ETL_ENABLE_TIMER_UPDATES; for (int i = 0; i < MAX_TIMERS; ++i) { @@ -477,8 +467,6 @@ namespace etl } registered_timers = 0; - - ETL_ENABLE_TIMER_UPDATES; } //******************************************* diff --git a/src/message_timer.h b/src/message_timer.h index d76bb94d..64d41f7d 100644 --- a/src/message_timer.h +++ b/src/message_timer.h @@ -347,8 +347,6 @@ namespace etl { etl::timer::id::type id = etl::timer::id::NO_TIMER; - ETL_DISABLE_TIMER_UPDATES; - bool is_space = (registered_timers < MAX_TIMERS); if (is_space) @@ -373,8 +371,6 @@ namespace etl } } - ETL_ENABLE_TIMER_UPDATES; - return id; } @@ -387,15 +383,15 @@ namespace etl if (id_ != etl::timer::id::NO_TIMER) { - ETL_DISABLE_TIMER_UPDATES; - etl::message_timer_data& timer = timer_array[id_]; if (timer.id != etl::timer::id::NO_TIMER) { if (timer.is_active()) { + ETL_DISABLE_TIMER_UPDATES; active_list.remove(timer.id, true); + ETL_ENABLE_TIMER_UPDATES; // Reset in-place. new (&timer) message_timer_data(); @@ -404,8 +400,6 @@ namespace etl result = true; } } - - ETL_ENABLE_TIMER_UPDATES; } return result; @@ -433,8 +427,8 @@ namespace etl void clear() { ETL_DISABLE_TIMER_UPDATES; - active_list.clear(); + ETL_ENABLE_TIMER_UPDATES; for (int i = 0; i < MAX_TIMERS; ++i) { @@ -442,8 +436,6 @@ namespace etl } registered_timers = 0; - - ETL_ENABLE_TIMER_UPDATES; } //******************************************* diff --git a/support/Release notes.txt b/support/Release notes.txt index 11310d97..00170cfc 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,7 +1,11 @@ +=============================================================================== +10.18.1 +Reduced disable/enable time during function calls. + =============================================================================== 10.18.0 Improvements to message and callback timer frameworks. -Reduced disable/enable time dur function calls. +Reduced disable/enable time during function calls. Added the option to use either atomic semaphores or interrupt enables to control access. ===============================================================================