Fixed incorrect ETL_ALWAYS_ASSERT in etl::callback_timer

This commit is contained in:
John Wellbelove 2020-01-29 17:38:02 +00:00
parent 238244e1a1
commit b80763e644
5 changed files with 13 additions and 12 deletions

View File

@ -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<void()>& callback_,
uint32_t period_,
bool repeating_)
uint32_t period_,
bool repeating_)
: p_callback(reinterpret_cast<void*>(&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<etl::delegate<void()>*>(timer.p_callback))();
}
#endif
else
{
ETL_ALWAYS_ASSERT("Callback timer has incorrect callback type stored");
}
}
has_active = !active_list.empty();

View File

@ -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)

View File

@ -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"

View File

@ -1,5 +1,5 @@
name=Embedded Template Library
version=16.3.0
version=16.3.1
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT

View File

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