-
-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to freertos timers #1095
Switch to freertos timers #1095
Conversation
681c700
to
aca605d
Compare
It's great! Because alarm reliability is a very important thing... A unreliable alarm is may be even worse than absense of any alarm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the "new time" and "adjust time" a bit confusing. I feel like there may be a way to simplify it. I'll have to think about it.
TimerController was recently updated to use FreeRTOS timers. Please fix the conflicts.
aca605d
to
34b0717
Compare
Thank you @Riksu9000 for reviewing the code! I have now rebased and updated the commits for the latest develop branch, and applied few cosmetical changes. |
…tainabilty. Firmware size seems unchanged.
34b0717
to
201d09a
Compare
I have rebased the code again and excluded the commit about resilience to time adjustments, so that it's possible to focus better on the switch to FreeRTOS timers (per code review). A new commit was added that may address code clarity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the remaining APP_TIMER_TICKS()
as discussed.
…g timers (removes ScheduleAlarm message)
Co-authored-by: NeroBurner <[email protected]>
Addresses observations and issues reported in #1086 and possibly others.
This switches alarm, timer and motor controller to use FreeRTOS timers instead of the app_timer component.
The logic was changed slightly for MotorController, to avoid two timers being started simultaneosily but being executed in an unintended order.
An event is introduced to differentiate between time settings and time adjustments, this is to make alarms resilient to time zone or daylight saving changes, and to prevent companion apps from postponing alarms by periodically adjusting the time in the watch (this could happen if the time is adjusted by the companion app to the exact hour and minute an alarm was set to, which would result in the alarm being set forward 24h by ScheduleAlarm).
I have positively tested the changes, though testing was done in my personal branch mainly so far, and it's still preliminary. I only own one PineTime at the moment, and testing alarms and recurring alarms can take days.
Edit: per discussion with Riksu9000 below, this PR currently focuses on the switch to FreeRTOS timers