Commit graph

1202 commits

Author SHA1 Message Date
Matheus Afonso Martins Moreira fa0cdef45b Merge PR #450 - sync after enabling RTC
According to the data sheet, writing to a Control A register's ENABLE
bit will trigger write synchronization and set SYNCBUSY's ENABLE bit
which will be automatically cleared by the hardware once the write
operation is complete.

It is necessary to wait until SYNCBUSY's ENABLE bit is clear.
Reading synchronized registers before that returns previous values.
Writing synchronized registers before that drops the write and generates
an error value in another register.

The data sheet recommends polling the ENABLE bit in this situation.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/450
References: SAM L22 Family Data Sheet §§ 14.3.2, 14.3.3, 14.3.4, 14.3.5
2024-08-30 16:47:47 -03:00
Matheus Afonso Martins Moreira 879c48ce4d Merge PR #417 - improve 24h only mode
Enhances 24 hour only mode by setting defaults properly
and skipping past the 12/24 hour settings page in the
preferences watch face.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/417
2024-08-30 16:47:47 -03:00
Matheus Afonso Martins Moreira db4097bf84 Merge PR #426 - add temperature input to simulator
This patch enhances the Sensor Watch simulator with a temperature input
allowing users to simulate and test the temperature sensor.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/426
2024-08-30 16:47:47 -03:00
Matheus Afonso Martins Moreira dea05663b0 Merge PR #428 - fix issues in sunrise/sunset
Takes zero into account, allowing the sunrise/sunset watch face
to work with no presets defined.

Also resolves a warning during compilation of the sunrise/sunset face.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/428
2024-08-30 16:47:47 -03:00
Matheus Afonso Martins Moreira 663cd725f8 Merge PR #434 - fix leap years
Improves handling of months in the Sensor Watch
by computing whether the given year is a leap year.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/434
2024-08-30 16:47:38 -03:00
Matheus Afonso Martins Moreira c8ca0d3619 Merge PR #431 - fix wrong number of days in month
July has 31 days and but was set to 30 days in the Sensor Watch.
This patch fixes the discrepancy.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/431
2024-08-30 16:46:22 -03:00
Matheus Afonso Martins Moreira 95ca374c98 Merge PR #433 - fix clock face indicators
I misinterpreted the documentation and swapped the alarm and time signal
indicators in the clock face. This patch brings it back in sync with
the original watch's behavior as described in the manual.

Reported-by: 814d3 (GitHub)
Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/433
References: https://github.com/joeycastillo/Sensor-Watch/pull/380
References: https://github.com/joeycastillo/Sensor-Watch/issues/132
2024-08-30 16:46:22 -03:00
Matheus Afonso Martins Moreira 657ff724d0 Merge PR #440 - fix countdown face issues
Avoid potential underflow when evaluating x - y with y > x.
Evaluate it only when y <= x instead.

Avoid clearing indicators in background task
since another watch face is likely active.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/440
2024-08-30 16:46:22 -03:00
Matheus Afonso Martins Moreira 42dc15117e Merge PR #447 - improve kim possible chime
The current one is slightly off compared to the original tune.

Original: https://www.youtube.com/watch?v=_3nfrGdVcv0
Before: https://onlinesequencer.net/4159215
After: https://onlinesequencer.net/4160385

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/447
2024-08-30 16:46:22 -03:00
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
Joseph Bryant cae5d8a33f wait for RTC SYNCBUSY in watch_register_extwake_callback 2024-08-30 16:20:32 -03:00
metehan-arslan 2a194dfa69
style: remove extra whitespace 2024-08-28 20:40:32 +00:00
metehan-arslan 77fb6202c9
Update SIGNAL_TUNE_KIM_POSSIBLE notes 2024-08-27 13:56:36 +03:00
David Volovskiy fe259ee526 Comment change 2024-08-26 21:40:56 -04:00
Matheus Moreira 01940449b6
Merge PR #442 - update devcontainer image
The devcontainer image stopped working
because the requested Ubuntu image
was too outdated. This pull request
brings it up to date and it should remain
functional until 2029. It also enables
use of the emulator by installing the
needed dependencies.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/442
2024-08-26 09:41:08 -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 f02e73c1c4
Update Devcontainer Dockerfile
This PR updates the .devcontainer Dockerfile which was no longer
working. Attempting to build an image from the Dockerfile would result
in an error:

```
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic Release' does not have a Release file.
```

AFAIU, this is because the 22.04 release is no longer supported. I
changed the base image to the current LTS release, which should remain
supported until 2029.

In addition, the Dockerfile is also modified to install `emscripten` APT
package. While this is not the recommented installation method from the
Emscripten docs, it is much more convenient and works enough to build
the simulator using the resulting Docker image.
2024-08-22 14:54:41 +02: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 e2c5babb2c don't change the bell indicator from within background task 2024-08-18 22:09:37 +01:00
Joseph Bryant dcd4d12c0a avoid delta overflow in countdown draw 2024-08-18 22:09:17 +01: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
David Volovskiy 09576807eb Made the days_in_month its own function 2024-08-10 07:40:52 -04:00
David Volovskiy f85a7f2c78 Swapped the bell and alarm icon on the clock face to match Casio's doc 2024-08-10 06:38:46 -04:00
Struan 1da9d0aefe
fix: july has 31 days 2024-08-07 22:24:57 -06: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
David Volovskiy 598e876186 check_and_act_on_daylight_savings now only occurs in one spot 2024-08-04 10:11:33 -04:00
David Volovskiy 2824a62908 Bugfix on not registering the top of an hour 2024-08-04 09:53:04 -04:00
Christian Buschau 7a15ed3591
faces/alarm_thermometer: new watch face 2024-08-03 18:59:41 +02:00
David Volovskiy 51176344dc Made it so the code works with a completely empty preset list 2024-08-03 11:42:42 -04:00
David Volovskiy 84f0db0654 Fix to remove compiler complaint 2024-08-03 11:38:45 -04:00
David Volovskiy 6ae5dfef70 Leap Years Now Handled Dynamically 2024-08-03 11:20:25 -04:00
David Volovskiy aebea960c0 Cleanup to the default branch 2024-08-03 10:08:24 -04:00
David Volovskiy e50390b673 DST roll is now a global variable in watch_rtc 2024-08-03 10:07:57 -04:00
David Volovskiy 74421c7e65 Day roll back repeat fix 2024-08-03 09:39:02 -04:00
David Volovskiy fa2907e098 Some more cleanup 2024-08-03 09:38:00 -04:00
Christian Buschau db165bec30
Fix all days in a month 2024-08-03 12:22:15 +02:00
Robert Masen ccf99a9727 add temp input to simulator 2024-08-02 18:20:44 -05:00
David Volovskiy bae8c65825 Made the faces I care about not need to continuously re-find the timezone 2024-08-02 07:37:30 -04:00