Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/Ticker/src/Ticker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ void Ticker::_attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t
}
esp_timer_create(&_timerConfig, &_timer);
if (repeat) {
esp_timer_start_periodic(_timer, milliseconds * 1000);
esp_timer_start_periodic(_timer, ((uint64_t)milliseconds) * 1000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "ULL" to the 1000 as well to also force cast there. This is also done in the millis() function as seen here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 1000ULL added. Prior change (the uint64_t cast) reverted as redundant. Tested: Ticker used to fire after 900+ seconds, now it hasn't fired for 1342s, and counting.

} else {
esp_timer_start_once(_timer, milliseconds * 1000);
esp_timer_start_once(_timer, ((uint64_t)milliseconds) * 1000);
}
}

Expand Down