mirror of https://github.com/ARMmbed/mbed-os.git
Fix for Issue #7308 (Deep_sleep_lock Ticker.h Issue)
parent
af52c30234
commit
af02b23bf7
|
@ -53,4 +53,16 @@ void Ticker::handler()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ticker::attach_us(Callback<void()> func, us_timestamp_t t)
|
||||||
|
{
|
||||||
|
core_util_critical_section_enter();
|
||||||
|
// lock only for the initial callback setup and this is not low power ticker
|
||||||
|
if (!_function && _lock_deepsleep) {
|
||||||
|
sleep_manager_lock_deep_sleep();
|
||||||
|
}
|
||||||
|
_function = func;
|
||||||
|
setup(t);
|
||||||
|
core_util_critical_section_exit();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace mbed
|
} // namespace mbed
|
||||||
|
|
|
@ -117,17 +117,7 @@ public:
|
||||||
* for threads scheduling.
|
* for threads scheduling.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void attach_us(Callback<void()> func, us_timestamp_t t)
|
void attach_us(Callback<void()> func, us_timestamp_t t);
|
||||||
{
|
|
||||||
core_util_critical_section_enter();
|
|
||||||
// lock only for the initial callback setup and this is not low power ticker
|
|
||||||
if (!_function && _lock_deepsleep) {
|
|
||||||
sleep_manager_lock_deep_sleep();
|
|
||||||
}
|
|
||||||
_function = func;
|
|
||||||
setup(t);
|
|
||||||
core_util_critical_section_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Attach a member function to be called by the Ticker, specifying the interval in microseconds
|
/** Attach a member function to be called by the Ticker, specifying the interval in microseconds
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue