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
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
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
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
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/
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`.
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!)
* 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