Commit Graph

18 Commits

Author SHA1 Message Date
David Volovskiy 51ca839f3b Removed all of the compiler warnings 2026-01-02 20:07:56 -05:00
Alessandro Genova 996d5d6679 Convert from timestamp to date_time once per second at most 2026-01-02 20:07:56 -05:00
Alessandro Genova 42fdad78d5 Add more theoretical checks to ensure we don't miss out on any comp timers
Even without this "fix" the watch seems to be extremely stable and haven't seen
any missed timers over several days test. So this might not actually be needed,
but it should make things even safer.
2026-01-02 20:02:36 -05:00
Alessandro Genova 96682a513b Undo some workarounds implemented to fix race conditions that are no longer needed 2026-01-02 20:02:36 -05:00
Alessandro Genova a71967a015 Perform as little work as possible in the interrupt callbacks 2026-01-02 20:02:36 -05:00
Alessandro Genova 9770ad4fe9 Fix more corner case that could cause the top of minute alarm to stop firing 2026-01-02 20:02:36 -05:00
Alessandro Genova a616ac6cc4 Fix corner case that could cause the top of minute alarm to stop firing 2026-01-02 20:02:36 -05:00
Alessandro Genova 7acc9cc414 Align the top of the second with the 1Hz periodic interrupt 2026-01-02 20:02:36 -05:00
Alessandro Genova eb9ec8659c Initial seemingly stable version of movement using the RTC COUNTER32 mode 2026-01-02 20:02:36 -05:00
voloved 154bd54510 Set time on make (#35)
* Time can get set from makefile

* Added setting make time into simulator

* Added  Hash in settings

* Added default location

* Cuts the Githash to 6 characters in the settings in case the makefile didn't do that already

* bump gossamer commit

* remove automatic timezone setting

* automatic time set: rename MAKEFILE_ to BUILD_ to match gossamer

* Revert "Added default location"

This reverts commit c24f69450fd40472c4f6cebb790a56c3f0d69cb6.

* silence warning

* watch_get_init_date_time: explicitly initialize all fields to 0

---------

Co-authored-by: Joey Castillo <joeycastillo@utexas.edu>
2025-07-06 10:56:27 -04:00
Joey Castillo 60914647b1 watch_rtc clarification: 128 Hz is 0x80, not 0xF0 2025-05-15 22:12:12 -04:00
joeycastillo 997f091c16 use updated gossamer typedefs 2024-10-05 10:36:58 -04:00
joeycastillo 29d6ce42f1 bring in RTC functionality 2024-09-18 15:06:38 -04:00
Alex Maestas 8206f37fcf fix undefined behavior found by clang's sanitize 2023-12-07 02:24:26 +00:00
Mikhail Svarichevsky 6b71711079 Precision watch update (#152)
* Intermediate changes

* Databank working

* Main commit for precision timing

First version where all functions are supposed to be working

* Fix math error in nanosec. File storage for location.

* Remove obsolete comments

* Missing page name on pages rotation - thanks to jeremy

* Delete file.diff

* Cleanup+tempchart

1) finetune must always reset last calibration time when doing non-0 time correction, even when you are not applying ppm correction.
2) Dithers over 31 periods not 10, more resolution with still no risk of overflow
3) Minute-boundery finetune fix. I also just got this 1-minute error after finetune...
4) Write frequency calibration value in 1 operation rather than 2. All RTC writes must be single operations to avoid partially correct data.
5) Some code cleanup
6) Tempchart face is added for temperature statistics

* Update set_time_hackwatch_face.c

* Math error in display code of finetune, allow to update correction time even without correction - by long alarm press

* Increase reliability of stopping & starting RTC timer

As it's quite dangerous operation

* hackwatch - days adjust down fix by long alarm

* unify style

* More comments & last style change

* Simulator support

RTC operations (watch_rtc_enable and watch_rtc_freqcorr_write) are in common libs.

* Unicode fix

* Crystal aging is now adjustable (AA page in nanosec - annual aging, ppm/year)

Aging is baked into fixed offset every time finetune is performed, as it relies on last adjustment time.

* Blink on non-0 page every minute in finetune to measure clock error

* Rolling back private changes

* Cleanup

* Cleanup

* Quality of life changes in nanosec

1. Does not calculate & apply ppm correction if less than 6 hours passed since previous adjustment (as it gives very high correction values which are unrealistic and unhelpful)
2. Idle timeout resets to face 0 only if no correction was made

* unify style

* Fix low-power errors in nanosec infrastructure, faster display in finetune

* Merge fix

* unify style

Co-authored-by: Jeremy O'Brien <neutral@fastmail.com>
Co-authored-by: joeycastillo <joeycastillo@utexas.edu>
2023-01-10 16:56:26 -05:00
Joey Castillo 6bdaff5d2a remove all deprecated functions 2022-04-10 15:56:45 -04:00
Alexsander Akers a559d089f1 Add new function to disable certain RTC periodic callbacks 2022-01-27 12:06:06 -05:00
Alexsander Akers b8de35658f Sensor Watch Simulator (#35)
* Put something on screen

* Use the 32bit watch_date_time repr to pass from JS

* Implement periodic callbacks

* Clear display on enabling

* Hook up watch_set_led_color() to SVG (green-only)

* Make debug output full-width

* Remove default Emscripten canvas

* Implement sleep and button clicks

* Fix time zone conversion bug in beats-time app

* Clean up warnings

* Fix pin levels

* Set time zone to browser value (if available)

* Add basic backup data saving

* Silence format specifier warnings in both targets

* Remove unnecessary, copied files

* Use RTC pointer to clear callbacks (if available)

* Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES

* Change each face to const preprocessor definition

* Remove Intl.DateTimeFormat usage

* Update shell.html title, header

* Add touch start/end event handlers on SVG buttons

* Update shell.html

* Update folder structure (shared, simulator, hardware under watch-library)

* Tease out shared components from watch_slcd

* Clean up simulator watch_slcd.c inline JS calls

* Fix missing newlines at end of file

* Add simulator warnings (except format, unused-paremter)

* Implement remaining watch_rtc functions

* Fix button bug on mouse down then drag out

* Implement remaining watch_slcd functions

* Link keyboard events to buttons (for keys A, L, M)

* Rewrite event handling (mouse, touch, keyboard) in C

* Set explicit text UTF-8 charset in shell.html

* Address PR comments

* Remove unused directories from include paths
2022-01-25 15:03:22 -05:00