Reduced disable/enable time during function calls.

This commit is contained in:
John Wellbelove 2018-02-06 21:11:07 +00:00
parent 879fb1f626
commit 52fa62585a
4 changed files with 12 additions and 28 deletions

View File

@ -1,5 +1,5 @@
name=Embedded Template Library
version=10.18.0
version=10.18.1
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
sentence=A C++ template library tailored for embedded systems.

View File

@ -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;
}
//*******************************************

View File

@ -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;
}
//*******************************************

View File

@ -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.
===============================================================================