summaryrefslogtreecommitdiffstats
path: root/movement/watch_faces/clock
diff options
context:
space:
mode:
authorMikhail Svarichevsky <3@14.by>2023-01-11 00:56:26 +0300
committerGitHub <noreply@github.com>2023-01-10 16:56:26 -0500
commit6b71711079bd35cab61356e7b47c27445fd5eee5 (patch)
treea090a8d78d2e08db52e2b7640babfea448665fd6 /movement/watch_faces/clock
parentfee6145e4d79a0d67d7e390692152bfdf94676a3 (diff)
downloadSensor-Watch-6b71711079bd35cab61356e7b47c27445fd5eee5.tar.gz
Sensor-Watch-6b71711079bd35cab61356e7b47c27445fd5eee5.tar.bz2
Sensor-Watch-6b71711079bd35cab61356e7b47c27445fd5eee5.zip
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>
Diffstat (limited to 'movement/watch_faces/clock')
-rw-r--r--movement/watch_faces/clock/simple_clock_face.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/movement/watch_faces/clock/simple_clock_face.c b/movement/watch_faces/clock/simple_clock_face.c
index fd1d167c..76055998 100644
--- a/movement/watch_faces/clock/simple_clock_face.c
+++ b/movement/watch_faces/clock/simple_clock_face.c
@@ -26,6 +26,7 @@
#include "simple_clock_face.h"
#include "watch.h"
#include "watch_utility.h"
+#include "watch_private_display.h"
static void _update_alarm_indicator(bool settings_alarm_enabled, simple_clock_state_t *state) {
state->alarm_enabled = settings_alarm_enabled;
@@ -96,8 +97,9 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
// everything before seconds is the same, don't waste cycles setting those segments.
- pos = 8;
- sprintf(buf, "%02d", date_time.unit.second);
+ watch_display_character_lp_seconds('0' + date_time.unit.second / 10, 8);
+ watch_display_character_lp_seconds('0' + date_time.unit.second % 10, 9);
+ break;
} else if ((date_time.reg >> 12) == (previous_date_time >> 12) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
// everything before minutes is the same.
pos = 6;