Skip to content
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

Countdown Timer: Some small fixes and improvements #106

Merged
merged 3 commits into from
May 24, 2024

Conversation

puppable
Copy link
Contributor

In order of commit:

  • fc77cfe Replaces the alarm-like timeup alert with one faithfully modeled after a typical digital kitchen timer (which now follows volume/vibration settings)
  • 25fcd73 Fixes a divide-by-zero error when setting the time to zero seconds. Has since been made somewhat superfluous by 1bd63df no longer allowing that in the first place, but the additional hardening doesn't hurt.
  • b967b6b Fixes the math for wrapping the hour/minute/second selection, allowing it to wrap in both directions.

Further details can be found in the description for each commit

For timer expiry, replaces use of the builtin `sequence_audiovisual_alert`
notification sequence wiith a custom alarm modeled after that of a typical
electronic kitchen timer. (A repeating one second sequence of four short beeps)

Note this currently omits the sound and vibration setting overrides that
feature in the builtin sequence, so the alarm will now follow the user's
sound and vibration settings.
`expected_count` is set to be a minimum of 1 to avoid dividing by zero
at the bottom of the affected function.
The progress bar at the top now renders as empty when the time is set
to zero.
When pressing right, adds the modulo number to the `selection` variable
before subtracting and modulo'ing it. This prevents it from being
assigned a negative value (which cannot be relied upon for an enum),
as well as making the variable properly wrap around below "zero".

While not strictly necessary, the code for handling left button presses
is also changed for consistency.
@0w0mewo
Copy link

0w0mewo commented May 23, 2024

Hey there. The improved codes have applied to my repo. Thank you.
(I was writing the app as a practice on learning C two years ago and I had never thought that there were others interested in the project.)

@xMasterX
Copy link
Owner

Thanks!

@xMasterX xMasterX merged commit ccff085 into xMasterX:dev May 24, 2024
@puppable
Copy link
Contributor Author

@0w0mewo Coincidentally, this was one of the apps I was using to familiarize myself with Flipper's API for writing a somewhat related app of my own. I've personally found the Flipper to be a great device for mundane little utility apps without having all the complexity of a phone, so having a timer app available has been a great addition for my purposes. Thank you as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants