Ticker: invoke _function only if attached

pull/5063/head
Martin Kojtal 2017-09-09 18:41:01 +02:00 committed by Russ Butler
parent deb1febb8b
commit 78718910d3
1 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,9 @@ void Ticker::setup(us_timestamp_t t) {
void Ticker::handler() {
insert_absolute(event.timestamp + _delay);
_function();
if (_function) {
_function();
}
}
} // namespace mbed