Commit graph

985 commits

Author SHA1 Message Date
Matheus Afonso Martins Moreira a715265af6 Merge PR #437 - debouncing logic
Mechanical switches exhibit temporary voltage fluctuations
when electrical contact is made, which manifest as "bouncing"
between the logical high and low states. Sampling the switch's
state during this period of stability produces invalid results.

The switch must be debounced by ignoring the generated interrupts
until the switch's state has stabilized. This is implemented by delaying
the input events until an empirically determined time has elapsed.
As such this pull request introduces customizable high resolution timers
for debouncing button down and up events.

This software debouncing unfortunately increases the sensor watch's
input latency. This is an acceptable tradeoff due to better usability:
watch faces which require holding down buttons such as the pulsometer
should work much more reliably after this patch.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Tested-on-hardware-by: Krzysztof Gałka <@kshysztof@Discord>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/437
References: https://en.wikipedia.org/wiki/Switch#Contact_bounce
2024-08-30 16:44:38 -03:00
Matheus Moreira 9c093f9540 Merge PR #387 - configurable default birthdate/location
Adds the ability to configure at compilation time
the movement's default birth date and location.

Tested-by: madhogs <madhogs@protonmail.com>
Tested-by: Niehztog <niehztog@gmail.com>
Tested-on-hardware-by: madhogs <madhogs@protonmail.com>
Tested-on-hardware-by: Niehztog <niehztog@gmail.com>
Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/387
2024-08-30 16:44:38 -03:00
Matheus Moreira c7413322a5 Merge PR #439 - fix scheduled task misses
The movement was checking for scheduled tasks
by comparing for equality their scheduled times to
the current time. However, it is possible that the time
has moved past the scheduled time by the time the
function executes, leading to scheduled tasks not
being executed and therefore to missed deadlines.

Changing it to `<=` fixes the problem by taking that
possibility into account.

Helped-by: Wesley Ellis <tahnok@gmail.com>
Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/439
2024-08-30 16:44:38 -03:00
Matheus Moreira c8a87d3b7c Merge PR #441 - update documentation
The TOTP watch face has gained a new declarative API
for defining secrets directly in the source code but the
documentation still describes the old interfaces.
This pull request brings the documentation up to date
with currect practice.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/441
2024-08-30 16:44:38 -03:00
Matheus Moreira dd04443413 Merge PR #443 - improved t and y character display
The t and y characters were not being displayed optimally
in certain positions. This commit improves it substantially
by internally remapping those characters to better looking
characters when displaying on those positions.

Tested-by: David Volovskiy <devolov@gmail.com>
Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/443
References: https://hchargois.github.io/sensor-watch-playground/
2024-08-30 16:44:00 -03:00
David Volovskiy d5a8c57c82 Additional code review change 2024-08-23 22:25:02 -04:00
David Volovskiy c6f2bff75e Code review edits 2024-08-23 17:35:16 -04:00
David Volovskiy 9640f452cd Made the T and Y characters look more unique on the 4 and 6 position 2024-08-22 20:46:47 -04:00
Nicholas Rodrigues Lordello a4fc048f94
Update TOTP Face Documentation
The TOTP face header file documentation contained outdated instructions
for configuring the complication with TOTP credentials. This PR updates
the documentation to match what is expected in `totp_face.c`.
2024-08-22 14:53:17 +02:00
Joseph Bryant 20b4a32835 make sure we don't miss our scheduled tasks 2024-08-18 20:09:06 +01:00
David Volovskiy e9837ff0cb Stops Running cb_fast_tick when the watch debounce timer is defined as 0 2024-08-17 02:52:30 -04:00
David Volovskiy 2cdfa2d3b3 Set the debounce tick variables to 0 to make the face work the same as stock. 2024-08-17 02:45:22 -04:00
David Volovskiy 9861da84c3 Changed debounce to ignore button presses after a press down or up rathe rthan dact after a set amount of time due to an issue of delay_ms allowing a shoft-bricking 2024-08-11 11:00:08 -04:00
atax1a 0ad5fa4733
Merge pull request #429 from theAlexes/theAlexes/format-command
add a format command
2024-08-07 04:51:12 +00:00
Alex Maestas 44bdc8503e explain usage in format command when arg isn't YES 2024-08-05 23:11:54 +00:00
Alex Maestas ca1da33b82 in filesystem_init, handle the error code correctly 2024-08-05 23:09:24 +00:00
Alex Maestas 7000d08ba5 add a format command 2024-08-05 23:06:18 +00:00
atax1a e732afbec6
Merge pull request #424 from edwardspeyer/bug-fix-july-31
Allow setting July 31st as today's date
2024-07-31 18:13:40 +00:00
EGS 278520bfaf Allow setting July 31st as today's date
To allow a valid date to be set the `set_time_face` cycles through the
valid days for a given month.  July was incorrectly encoded as having 30
days (it has 31!)
2024-07-31 18:17:04 +01:00
David Volovskiy 7bbac4cd80 Brought debounce time to 8ms rather than 15 2024-07-31 07:33:25 -04:00
David Volovskiy 027e42dc58 Moved a few lines around to match main 2024-07-31 07:25:09 -04:00
David Volovskiy e297b3013e Using debounce that triggers when there's no change for Xms rather than just ignoring new presses after Xms 2024-07-31 07:22:33 -04:00
David Volovskiy 607946ed2e A little bit of clean-up 2024-07-30 07:27:47 -04:00
David Volovskiy f7d1b8f9f3 Delay for starting the debounce no loonger happens 2024-07-29 23:53:25 -04:00
David Volovskiy 7f2ac61375 Fixed stuck fast_tick 2024-07-29 21:43:32 -04:00
David Volovskiy 73c3ba3ae7 Cleaned up code 2024-07-29 21:05:19 -04:00
David Volovskiy 36117ca207 using cb_fast_tick again 2024-07-29 20:48:17 -04:00
David Volovskiy 9727dac3c3 Revert "Leaving sleep with alarm button up doesn't trigger alarm button"
This reverts commit 7d5aaf60ca.
2024-07-29 20:28:10 -04:00
David Volovskiy 947e299494 Made the debounce register rising edges rather than falling edges 2024-07-29 20:13:54 -04:00
David Volovskiy 4a4fce428e Removed some dead code 2024-07-29 18:24:58 -04:00
David Volovskiy df2dac5a07 debouince now uses cb_fast_tick and holding the button now also gets debounced 2024-07-29 18:12:46 -04:00
David Volovskiy 7d5aaf60ca Leaving sleep with alarm button up doesn't trigger alarm button 2024-07-29 07:44:31 -04:00
David Volovskiy 4375ca37e0 Added debouncing 2024-07-29 07:39:51 -04:00
atax1a 42c14c2e5b
Merge pull request #420 from voloved/sunrise_sunset_presets
Added ability to add presets to the sunrise and sunset face
2024-07-24 04:49:03 +00:00
Wesley Ellis 8aa1a3f8fa
Merge pull request #422 from wryun/fix-totp-lfs-error-params
Fix TOTP LFS printf string
2024-07-21 08:43:05 -04:00
James Haggerty 222c60b072 Fix TOTP LFS printf string 2024-07-21 09:10:28 +10:00
David Volovskiy a13c8c35b8 Code review commit 2024-07-20 15:59:42 -04:00
David Volovskiy 9ee319c888 Typo in comment 2024-07-20 14:48:32 -04:00
David Volovskiy a3d23ab45e Long press of Alarm goes back to default 2024-07-20 14:46:42 -04:00
David Volovskiy a7c0fb7dfd Added ability to add presets to the sunrise and sunset face 2024-07-20 14:35:37 -04:00
joeycastillo 5ec3dca9e4 documentation fix 2024-07-10 06:56:49 -04:00
joeycastillo ac5fb40730 remove dead code 2024-07-10 06:49:56 -04:00
atax1a 5f5d86353f
Merge pull request #397 from madhogs/wyrun-totp-lfs-fix
Reduce totp_face_lfs memory usage
2024-07-08 21:10:46 +00:00
Jose Castillo d98d14d236
Add support for Sensor Watch Pro (#412)
* Sensor Watch Pro board definition

* Disable hot-plugging on SWCLK

* Add rainbow test

* Move interrupt mapping to board config

* New color definition for Pro boards in makefile
2024-07-06 11:07:02 -04:00
joeycastillo 89a2af92ef silence warnings 2024-07-06 08:52:41 -04:00
Wesley Ellis 226cda748c
Merge pull request #408 from tahnok/sanity-check-color
Check that color is valid
2024-06-26 11:40:28 -04:00
Wesley Ellis 96fdf64c4c Check that color is valid
Instead of merely checking that COLOR is set, check that it is one of
RED, BLUE or GREEN
2024-06-26 11:30:31 -04:00
James Haggerty 77ea1b8965 Reduce totp_face_lfs memory usage 2024-04-26 16:05:35 +01:00
atax1a 439843f56b
Merge pull request #388 from TheOnePerson/fix-compile-errors
Fix compile errors and warnings in movement.c and shell.c
2024-04-09 22:24:19 +00:00
atax1a 45beca19e8
Merge pull request #389 from joeycastillo/theAlexes/add-openocd
add an openocd.cfg for openocd 0.12.0
2024-04-09 22:23:21 +00:00