mbed library sources. Supersedes mbed-src.
Fork of mbed-dev by
Diff: drivers/Timer.cpp
- Revision:
- 174:b96e65c34a4d
- Parent:
- 167:e84263d55307
- Child:
- 175:af195413fb11
--- a/drivers/Timer.cpp Fri Sep 15 14:59:18 2017 +0100 +++ b/drivers/Timer.cpp Mon Oct 02 15:33:19 2017 +0100 @@ -31,6 +31,7 @@ void Timer::start() { core_util_critical_section_enter(); if (!_running) { + sleep_manager_lock_deep_sleep(); _start = ticker_read_us(_ticker_data); _running = 1; } @@ -40,6 +41,9 @@ void Timer::stop() { core_util_critical_section_enter(); _time += slicetime(); + if (_running) { + sleep_manager_unlock_deep_sleep(); + } _running = 0; core_util_critical_section_exit(); }