]>
git.earman.xyz Git - sensor-watch.git/log
atax1a [Tue, 9 Apr 2024 22:23:21 +0000 (22:23 +0000)]
Merge pull request #389 from joeycastillo/theAlexes/add-openocd
add an openocd.cfg for openocd 0.12.0
atax1a [Sun, 31 Mar 2024 00:40:05 +0000 (00:40 +0000)]
Merge pull request #383 from theAlexes/theAlexes/fix-uf2conv
uf2conv: argument to `re.split` should be a rawstring
atax1a [Sun, 31 Mar 2024 00:39:43 +0000 (00:39 +0000)]
Merge pull request #385 from matheusmoreira/totp-hot-patch
TOTP hotfix: reduce memory usage
Alex Maestas [Sun, 31 Mar 2024 00:37:35 +0000 (00:37 +0000)]
add an openocd.cfg for openocd 0.12.0
Matheus Afonso Martins Moreira [Wed, 20 Mar 2024 14:35:58 +0000 (11:35 -0300)]
faces/totp: avoid displaying when key is invalid
Fixes a division by zero bug caused by calling getCodeFromTimestamp
without having initialized the TOTP library with a secret first.
This was happening because the face calls totp_display on activation,
meaning the validity of the secret was not checked since this is
done in the generate function.
Now the validity of the key is determined solely by the size
of the current decoded key. A general display function checks it
and decides whether to display the code or just the error message.
The size of the current decoded key is initialized to zero
on watch face activation, ensuring fail safe operation.
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: madhogs <59648482+madhogs@users.noreply.github.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/385
Matheus Afonso Martins Moreira [Wed, 20 Mar 2024 14:29:02 +0000 (11:29 -0300)]
faces/totp: fix error message not displayed bug
Forgot to call watch_display_string on the error message.
Of course the message isn't going to be displayed.
Also, increase the buffer size to 10 characters
and output a space to the last position.
This ensures the segments are cleared.
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: madhogs <59648482+madhogs@users.noreply.github.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/385
Matheus Afonso Martins Moreira [Mon, 18 Mar 2024 13:41:06 +0000 (10:41 -0300)]
faces/totp: remove dynamic memory allocation
Allocate an unlimited extent 128 byte buffer once during setup
instead of allocating and deallocating repeatedly. A static buffer
was not used because it fails to be reentrant and prevents multiple
instances of the watch face to be compiled by the user.
The advantage is the complete prevention of memory management errors,
improving the reliability of the watch. It also eliminates the overhead
of the memory allocator itself since malloc is not free.
The disadvantage is a worst case default size of 128 bytes was required,
meaning about 90 bytes will be wasted in the common case since most keys
are not that big. This can be overridden by the user via preprocessor.
The key lengths are checked on TOTP watch face initialization
and if any key is found to be too large to fit the buffer
it is turned off and the label and ERROR is displayed instead.
The base32 encoded secrets are decoded dynamically to the buffer
at the following times:
- Face enters the foreground
- User switches TOTP code
Therefore, there is still some extra runtime overhead
that can still be eliminated by code generation.
This will be addressed in future commits.
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: madhogs <59648482+madhogs@users.noreply.github.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/385
Matheus Afonso Martins Moreira [Sun, 17 Mar 2024 22:32:27 +0000 (19:32 -0300)]
faces/totp: improve memory usage
The TOTP face is working in the simulator but fails on the real hardware
when loaded with lots of codes, just like the LFS version.
This is likely caused by the recent refactoring of the TOTP face
which introduced a declarative credential interface for ease of use.
That's accomplished by decoding the secrets at runtime which increases
the RAM requirements. Users are likely hitting memory limits.
In order to mitigate this, the algorithm is changed from decoding
all of the secrets only once during initialization to on the fly
decoding of the secret for the current TOTP credential only.
This converts this face's dynamic memory usage from O(N) to O(1)
at the cost of memory management when switching faces and credentials
which could impact power consumption. Issue is confirmed fixed by
author of issue who has tested it on real hardware. Fixes #384.
Due to variable key sizes, the memory cannot be statically allocated.
Perhaps there's a maximum key size that can serve as worst case?
Also took this opportunity to restructure the code a bit.
Also added code to check for memory allocation failure.
Reported-by: madhogs <59648482+madhogs@users.noreply.github.com>
Fixed-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: madhogs <59648482+madhogs@users.noreply.github.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/384
Matheus Afonso Martins Moreira [Sat, 16 Mar 2024 22:58:55 +0000 (19:58 -0300)]
faces: restore simple_clock_face
Restore the original simple clock face as requested.
Alex Maestas [Sat, 16 Mar 2024 16:50:55 +0000 (16:50 +0000)]
uf2conv: argument to `re.split` should be a rawstring
Matheus Afonso Martins Moreira [Wed, 6 Mar 2024 01:03:54 +0000 (22:03 -0300)]
Merge branch 'timeout-event-and-sleep-logic'
Currently, movement drops timeout events in case the previous loop
indicates that sleep is not possible. This is due to unintended
short circuiting behavior of && and is fixed with a temporary variable.
The static qualifier of can_sleep is also removed.
Helped-by: Alex Maestas <git@se30.xyz>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/376
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 06:07:43 +0000 (03:07 -0300)]
Merge branch 'structured-totp+maxz' into advanced
Aggregates the TOTP credentials into a data structure,
making it easier to define and use the credentials.
Also incorporate backwards movement code from another branch.
Co-authored-by: Max Zettlmeißl <max@zettlmeissl.de>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/369
GitHub-Related-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/356
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 03:53:12 +0000 (00:53 -0300)]
Merge branch 'advanced-pulsometer' into advanced
Implements an advanced pulsometer that can be calibrated by the user.
Also features a streamlined and responsive user interface,
new documentation and generally improved code.
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/371
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 03:49:57 +0000 (00:49 -0300)]
Merge branch 'advanced-clock+24h' into advanced
Completely refactors the simple clock face
and lays the foundations for new features.
Also adds a compile time 24 hour mode only feature.
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/373
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 04:51:18 +0000 (01:51 -0300)]
Merge branch 'moon-phase-face-long-press-reset'
Makes a long press of the ALARM button reset the face to current day.
Reviewed-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-by: Wesley Aptekar-Cassels <me@wesleyac.com>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/316
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 05:03:26 +0000 (02:03 -0300)]
Merge branch 'compile-time-preferences'
Adds overridable C preprocessor definitions for every user preference.
Enables the user to set defaults and omit the preferences face.
The default behavior of the watch is preserved.
Suggested-by: Wesley Aptekar-Cassels <me@wesleyac.com>
Implemented-by: madhogs <x3dh4vhf@duck.com>
Reviewed-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/295
GitHub-Related-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/291
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 04:05:31 +0000 (01:05 -0300)]
Merge branch 'usb-improvements' into advanced
- Change newline prints to also send carriage return
- Introduce shell module for serial shell with argument parsing
- Introduce shell command list for compile time command registration
- Refactor file system commands for shell subsystem
- Introduce new shell commands:
- 'help' command
- 'flash' command to reset into bootloader
- 'stress' tests CDC serial writes of various lengths
- optional delay parameter
- Harden USB handling
- Hangs less
- Drops fewer inputs
- Circular buffers for both reads and writes
Reported-by: Edward Shin <contact@edwardsh.in>
Tested-by: Edward Shin <contact@edwardsh.in>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Reviewed-by: James Haggerty <james@gruemail.com>
Reviewed-by: Wesley Aptekar-Cassels <me@wesleyac.com>
Reviewed-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/344
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 04:28:12 +0000 (01:28 -0300)]
Merge branch 'silicon-errata' into advanced
Implements the recommended workarounds for numerous silicon errata,
reducing power consumption and preventing freezes and hard faults.
Tested-by: Alex Maestas <git@se30.xyz>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Alex Maestas <git@se30.xyz>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Reviewed-by: Wesley Aptekar-Cassels <me@wesleyac.com>
Reviewed-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/340
GitHub-Related-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/361
GitHub-Related-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/359
Reference: https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/Errata/SAM-L22-Family-Silicon-Errata-and-Data-Sheet-Clarification-DS80000782.pdf
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 04:40:15 +0000 (01:40 -0300)]
Merge 'fix-sunrise-sunset-uninitialized'
Fixes a crash due to use of uninitialized buffer when setting location.
Reported-by: eshrh <esrh@gatech.edu>
Fixed-by: Wesley Aptekar-Cassels <me@wesleyac.com>
Reviewed-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/329
GitHub-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/198
Fixes: https://github.com/joeycastillo/Sensor-Watch/issues/198
Matheus Afonso Martins Moreira [Wed, 6 Mar 2024 00:49:32 +0000 (21:49 -0300)]
movement: fix unintended timeout short circuiting
Currently, movement drops time out events in case the previous loop
indicates that sleep is not possible due to short circuiting behavior
of logical and in C: if the left-hand side is false, the right hand
side is not evaluated at all, which means the loop is not called.
This was not intended to happen.
Fix it by storing the result in a second boolean variable
and working out the logic after the fact.
Matheus Afonso Martins Moreira [Wed, 6 Mar 2024 00:08:10 +0000 (21:08 -0300)]
movement: convert can_sleep an automatic variable
It is a simple boolean value and its scope is limited to the function.
There is no reason that I can think of for it to be a static variable.
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 07:29:52 +0000 (04:29 -0300)]
faces/pulsometer: remember pulsometer measurement
Avoid resetting it to zero when the face is activated.
Initialize the variables once when the face is first set up.
This makes it remember the last measurement taken by the user.
It will no longer be overwritten when the watch face activates.
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 07:10:41 +0000 (04:10 -0300)]
faces/pulsometer: remember pulsometer calibration
Avoid resetting it to default when the face is activated.
Set the default pulsometer calibration once,
only when the face is first set up.
This makes it remember the calibration set by the user.
It will no longer overwrite it.
Matheus Afonso Martins Moreira [Tue, 5 Mar 2024 06:03:25 +0000 (03:03 -0300)]
faces/totp: update copyrights
Update the copyrights to include full name attribution
to Max Zettlmeißl whose code I've incorporated and who
has explicitly licensed it as MIT.
Max Zettlmeißl (@maxz) commented on 2024-01-20:
> I provide all my changes under the MIT license
GitHub-Comment: https://github.com/joeycastillo/Sensor-Watch/pull/356#issuecomment-
1902114306
Max Zettlmeißl [Sat, 20 Jan 2024 23:15:01 +0000 (00:15 +0100)]
faces/totp: allow moving backwards through codes
Adds the ability to cycle back to the previous credential with LIGHT.
Long pressing LIGHT activates the LED.
Co-authored-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 18:18:45 +0000 (15:18 -0300)]
faces/clock: add 24h only feature
The clock watch face can now be configured at build time
to only display the time in 24h mode. Also enabled in forced 24h mode.
This should result in smaller code size due to dead code elimination.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 21:27:40 +0000 (18:27 -0300)]
faces/clock: update copyrights and credits
Update the copyrights to include full name attribution to all
who contributed to the clock watch face, including myself.
Also add an SPDX license identifier header comment to the files.
Matheus Afonso Martins Moreira [Mon, 26 Feb 2024 01:55:55 +0000 (22:55 -0300)]
faces/totp: delete leading underscores
Makes for cleaner symbols.
Matheus Afonso Martins Moreira [Mon, 26 Feb 2024 01:46:45 +0000 (22:46 -0300)]
faces/totp: rename initializer macro to credential
Shorter and far more expressive.
Matheus Afonso Martins Moreira [Mon, 26 Feb 2024 01:40:32 +0000 (22:40 -0300)]
faces/totp: improve TOTP initializer labeling
It now generates the string literal from the preprocessor token.
Even warns the user if the string is too long!
Matheus Afonso Martins Moreira [Mon, 26 Feb 2024 01:23:38 +0000 (22:23 -0300)]
faces/totp: decode secrets when setting up
This allows the user to easily copy the base32 encoded secrets
into the TOTP record initializers. They will be decoded once
at runtime when the face is being set up by the movement framework.
Also rename the array of TOTP records to credentials. Much better.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 17:14:26 +0000 (14:14 -0300)]
faces/clock: indicate low power only when needed
There is no need to set the indicator on every clock tick.
Indicate only when the battery is checked.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 17:11:07 +0000 (14:11 -0300)]
faces/clock: indicate alarm only when necessary
The alarm state is not modified within the clock face.
Therefore, it only needs to be set when the face is activated.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 17:10:04 +0000 (14:10 -0300)]
faces/clock: refactor time signal toggling code
Simplifies the code by defining dedicated functions for this.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 17:06:19 +0000 (14:06 -0300)]
faces/clock: refactor clock display code
Simplifies the code by defining dedicated functions for this.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 16:31:28 +0000 (13:31 -0300)]
faces/clock: reorder periodic battery check
Check the battery after the time has been updated.
Place all the indication code next to each other.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 16:31:17 +0000 (13:31 -0300)]
faces/clock: refactor partial time display code
Simplifies the code by defining dedicated functions for this.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 16:00:50 +0000 (13:00 -0300)]
faces/clock: refactor full time display code
Simplifies the code by defining dedicated functions for this.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 15:40:00 +0000 (12:40 -0300)]
faces/clock: refactor tick tock animation code
Simplifies the code by defining dedicated functions for this.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 15:32:31 +0000 (12:32 -0300)]
faces/clock: refactor low power tick function
Simplifies the code by defining dedicated functions
and separating the case from the main ones.
Also use the snprintf function since the buffer size is known.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 01:38:28 +0000 (22:38 -0300)]
faces/clock: simplify LAP indication function
Simplifies the code by adding a dedicated function for this.
Also documents the meaning of the LAP indicator: Low Available Power.
Matheus Afonso Martins Moreira [Sun, 25 Feb 2024 01:31:12 +0000 (22:31 -0300)]
faces/clock: refactor daily battery check
Move the code in question to a dedicated function. Better organized.
Add overridable preprocessor definition for the low battery threshold.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 23:13:07 +0000 (20:13 -0300)]
faces/clock: simplify PM indication function
Simplifies the code by adding dedicated functions for this.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 22:52:51 +0000 (19:52 -0300)]
faces/clock: simplify 24h indication function
Simplifies the code by adding a dedicated function for this.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 22:44:52 +0000 (19:44 -0300)]
faces/clock: simplify signal indication function
Simplifies the code and makes it use the correct indicator.
For some reason it had been switched with the alarm indicator.
WATCH_INDICATOR_BELL
The small bell indicating that an alarm is set.
WATCH_INDICATOR_SIGNAL
The hourly signal indicator.
Also useful for indicating that sensors are on.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 22:36:34 +0000 (19:36 -0300)]
faces/clock: simplify alarm indication function
Deduplicates state in the clock state and movement settings.
Makes the code simpler.
Also makes it use the correct indicator.
For some reason it had been switched
with the hourly chime indicator.
WATCH_INDICATOR_BELL
The small bell indicating that an alarm is set.
WATCH_INDICATOR_SIGNAL
The hourly signal indicator.
Also useful for indicating that sensors are on.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 22:16:06 +0000 (19:16 -0300)]
faces/clock: define general indication function
Sets or clears the specified indicator based on some boolean value.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 21:40:21 +0000 (18:40 -0300)]
faces/clock: move structure definition
Instances of the clock state structure
are only passed to the clock face itself
and only via the opaque context pointer.
No other code uses it.
Thus there is no need to expose it in a header file.
So make it an implementation detail of the watch face
by localizing it inside the translation unit.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 21:19:12 +0000 (18:19 -0300)]
faces: rename simple_clock_face to clock_face
It's not actually so simple and will only gain features from now on.
Just "clock face" also feels more canonical.
Matheus Afonso Martins Moreira [Sat, 24 Feb 2024 08:17:56 +0000 (05:17 -0300)]
faces/pulsometer: move structure definition
Instances of the pulsometer state structure are only passed
to the pulsometer itself and only via the opaque context pointer.
No other code uses it. There is no need to expose it in a header file
so make it an implementation detail of the watch face.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 09:11:21 +0000 (06:11 -0300)]
faces/pulsometer: update copyrights and credits
Update the copyrights to include full name attribution to all
who contributed to the pulsometer watch face, including myself.
Also add an SPDX license identifier header comment to the files.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 09:05:00 +0000 (06:05 -0300)]
faces/pulsometer: document the advanced pulsometer
Thoroughly document the new advanced pulsometer watch face
by describing what it is and how it works.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 09:00:18 +0000 (06:00 -0300)]
faces/pulsometer: implement advanced pulsometer
Implements an advanced pulsometer that can be recalibrated by the user.
The main clock face now displays the measured pulses per minute.
The day of month digits now display the pulsometer calibration.
The light button now cycles through integer graduations
which now range from 1 to 39 pulses per minute.
Long presses of the light button cycle by 10 instead of 1.
The watch face's responsiveness to input has been carefully optimized.
The code has been reorganized and generally improved.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 04:52:31 +0000 (01:52 -0300)]
faces/totp: update copyright and license data
Update the copyrights to include full name attribution
to all who contributed to this watch face, including myself.
Also add an SPDX license identifier header comment to the files.
https://spdx.org/licenses/MIT.html
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 02:24:01 +0000 (23:24 -0300)]
faces/totp: delete unused structure field
The TOTP watch face now keeps track of each key separately.
There is no need to compute offsets at runtime.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 02:20:21 +0000 (23:20 -0300)]
faces/totp: update watch face logic for new struct
Using the new structured TOTP record data structure
allows the TOTP watch face to statically and implicitly
compute the total number of defined TOTP records.
Users can now simply add new keys and records in the designated area
and the watch face will compile and automatically use them with no need
to maintain a separate array size variable. Less chance of mistakes.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 02:18:00 +0000 (23:18 -0300)]
faces/totp: define current TOTP data function
Selects the appropriate TOTP data structure
given the TOTP watch face state.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 02:16:41 +0000 (23:16 -0300)]
faces/totp: define TOTP data array size function
Computes the size of the array of TOTP records.
The compiler will likely evaluate it at compile time.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 02:15:15 +0000 (23:15 -0300)]
faces/totp: update example data to new structure
The data definitions are much shorter and easier to read now.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 02:12:53 +0000 (23:12 -0300)]
faces/totp: define TOTP struct initializer macro
Generates a compound initializer for the given TOTP parameters.
Lessens repetition and allows functional definitions of TOTP records.
Matheus Afonso Martins Moreira [Wed, 21 Feb 2024 02:10:13 +0000 (23:10 -0300)]
faces/totp: define TOTP data structure
Aggregates all the data necessary for TOTP generation.
madhogs [Wed, 14 Feb 2024 17:17:10 +0000 (17:17 +0000)]
Merge branch 'main' into preferences_in_config
Max Zettlmeißl [Wed, 7 Feb 2024 19:02:41 +0000 (20:02 +0100)]
Change inactivity deadlines: add 10 minutes and remove 2 days. (#365)
I like to use the ten minute timeout on my watch and there are other
people who have similar interests in a lower deadline. The two day
deadline had to go to still accommodate the change within the three
bit index.
The default setting is still the one hour timeout.
Wesley Ellis [Mon, 22 Jan 2024 17:09:05 +0000 (12:09 -0500)]
Merge pull request #362 from Kistelini/fix
Revert "make the watch-face a global in movement.c, actually"
Alex Maestas [Mon, 22 Jan 2024 00:37:25 +0000 (00:37 +0000)]
annotate SLEEPCFG-register detail
Alex Maestas [Mon, 22 Jan 2024 00:31:27 +0000 (00:31 +0000)]
annotate voltage regulation erratum
Alex Maestas [Mon, 22 Jan 2024 00:31:04 +0000 (00:31 +0000)]
annotate SysTick erratum
Alex Maestas [Mon, 22 Jan 2024 00:30:25 +0000 (00:30 +0000)]
annotate TRNG erratum, address review comment
Christian Buschau [Sun, 21 Jan 2024 16:32:36 +0000 (17:32 +0100)]
Revert "make the watch-face a global in movement.c, actually"
This reverts commit
0e801ed505cb0c368bf1eb0473058efb6c275a3e .
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:35:32 +0000 (02:35 -0500)]
Merge pull request #337 from theAlexes/theAlexes/wyoscan-zero
make the zero in wyoscan a little more visually appealing
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:10:16 +0000 (02:10 -0500)]
Merge pull request #322 from WesleyAC/watch-face-save-load
Add save_load_face
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:08:28 +0000 (02:08 -0500)]
Merge branch 'main' into watch-face-save-load
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:06:14 +0000 (02:06 -0500)]
Merge pull request #319 from WesleyAC/watch-face-day-night-percentage
Add day_night_percentage_face.
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:04:20 +0000 (02:04 -0500)]
Merge branch 'main' into watch-face-day-night-percentage
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:03:41 +0000 (02:03 -0500)]
Merge pull request #318 from WesleyAC/watch-face-simple-coin-flip
Add simple_coin_flip_face
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:01:27 +0000 (02:01 -0500)]
Merge branch 'main' into watch-face-simple-coin-flip
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 07:00:51 +0000 (02:00 -0500)]
Merge pull request #315 from WesleyAC/watch-face-solstice
Add solstice_face
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 06:58:20 +0000 (01:58 -0500)]
Merge branch 'main' into watch-face-solstice
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 06:44:19 +0000 (01:44 -0500)]
Merge pull request #339 from theAlexes/theAlexes/cleanup
did a tiny bit of code cleanup, encountered a bug that might fix some sleep-mode issues
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 06:31:58 +0000 (01:31 -0500)]
Merge branch 'main' into theAlexes/cleanup
Wesley Aptekar-Cassels [Sun, 21 Jan 2024 06:21:32 +0000 (01:21 -0500)]
Merge pull request #360 from CarpeNoctem/compiler_warning_watch_face_index
template: fix compiler warning on watch_face_index as mentioned in PR269
CarpeNoctem [Wed, 17 Jan 2024 12:08:54 +0000 (23:08 +1100)]
template: fix compiler warning on watch_face_index as mentioned in PR 269
Wesley Aptekar-Cassels [Fri, 12 Jan 2024 00:53:51 +0000 (19:53 -0500)]
Merge pull request #325 from WesleyAC/fix-le-buzzer-default-tune
Fix buzzer in LE mode.
joeycastillo [Wed, 10 Jan 2024 14:38:33 +0000 (09:38 -0500)]
fix alternate firmware script
Wesley Aptekar-Cassels [Tue, 9 Jan 2024 22:46:48 +0000 (17:46 -0500)]
Merge pull request #342 from theAlexes/theAlexes/nanosec-profile-bug
delete stray line of code that messed with correction profile
Alex Maestas [Tue, 9 Jan 2024 21:24:11 +0000 (16:24 -0500)]
movement: Use LE mode code to keep buzzer awake, instead of sleeping.
Wesley Aptekar-Cassels [Thu, 16 Nov 2023 00:21:43 +0000 (19:21 -0500)]
buzzer: fix simulator build, refactor sequence_length.
Wesley Aptekar-Cassels [Mon, 13 Nov 2023 05:48:57 +0000 (00:48 -0500)]
Enable custom signal tones in LE mode.
This makes movement_play_signal synchronous when in LE mode, despite
using the underlying asynchronous API. It's a bit of a hack, but it
should work well enough for now.
This also moves the enabling/disabling of the buzzer into the
movement_play_signal function, so that watch faces no longer have to do
it.
Wesley Aptekar-Cassels [Mon, 13 Nov 2023 05:16:13 +0000 (00:16 -0500)]
Use legacy buzzer functions when playing default tune.
This allows the default tune to be played in LE mode.
Fixes: #275
Wesley Aptekar-Cassels [Mon, 13 Nov 2023 05:14:41 +0000 (00:14 -0500)]
Revert "Merge pull request #283 from neutralinsomniac/fix_hourly_chime_background"
This reverts commit
5c94111ea20e50cb9dab8f416603403185e933b3 , reversing
changes made to
bc9b4ce700d3f12adc0daceaa880e3d638df0c2b .
Jose Castillo [Tue, 9 Jan 2024 20:54:46 +0000 (15:54 -0500)]
Merge pull request #350 from pfmaggi/main
Handle visibility for tomato watchface
Pietro F. Maggi [Sun, 7 Jan 2024 11:40:42 +0000 (12:40 +0100)]
Handle visibility for tomato watchface
(cherry picked from commit
547e8248ba3538693ee8c587a92ffece7b40d1a2 )
Edward Shin [Sun, 15 Oct 2023 04:36:49 +0000 (00:36 -0400)]
USB Improvements
* Introduce shell module for basic serial shell with argument parsing
* Introduce shell_cmd_list module for basic compile-time command
registration
* Harden USB handling to hang less and drop fewer inputs
- Service tud_task() with periodic TC0 timer interrupt
- Service cdc_task() with periodic TC1 timer interrupt
- Handle shell servicing in main app loop
- Add a circular buffering layer for reads/writes
* Change newline prints to also send carriage return
* Refactor filesystem commands for shell subsystem
* Introduce new shell commands:
- 'help' command
- 'flash' command to reset into bootloader
- 'stress' command to stress CDC writes
Testing:
* Shell validated on Sensor Watch Blue w/ Linux host
* Shell validated in emscripten emulator
* Tuned by spamming inputs during `stress` cmd until stack didn't crash
Alex Maestas [Fri, 22 Dec 2023 22:35:46 +0000 (22:35 +0000)]
delete stray line of code that messed with correction profile while adjusting cadence
Alex Maestas [Mon, 18 Dec 2023 06:41:21 +0000 (06:41 +0000)]
make any unknown interrupts/faults reset the microcontroller
Alex Maestas [Mon, 18 Dec 2023 03:06:10 +0000 (03:06 +0000)]
make the HAL sleep function obey the chip documentation
the sleep mode doesn't get set immediately, and needs to be waited upon.
Alex Maestas [Mon, 18 Dec 2023 01:29:28 +0000 (01:29 +0000)]
address SysTick erratum, which can hard-fault the chip
Alex Maestas [Sun, 17 Dec 2023 22:40:04 +0000 (22:40 +0000)]
fix simulator build by declaring Trng type as a void pointer
Alex Maestas [Sun, 17 Dec 2023 17:40:19 +0000 (17:40 +0000)]
work around silicon erratum in SUPC/VREG
Alex Maestas [Sun, 17 Dec 2023 17:39:59 +0000 (17:39 +0000)]
work around silicon erratum in TRNG