movement: Add "instant" led_duration option.

This illuminates the LED only for the time that the button is pressed,
and turns it off as soon as it's released, which is the behaviour of the
original watch.

I chose a led_duration of zero to represent "instant" and all bits set
to represent "no LED", which is arbitrary but seemed more sensible to
me.
This commit is contained in:
Wesley Aptekar-Cassels
2023-09-29 22:10:14 -04:00
parent 5c94111ea2
commit 30195a2619
3 changed files with 28 additions and 10 deletions

View File

@@ -84,6 +84,9 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
break;
case 4:
settings->bit.led_duration = settings->bit.led_duration + 1;
if (settings->bit.led_duration > 3) {
settings->bit.led_duration = 0b111;
}
break;
case 5:
settings->bit.led_green_color = settings->bit.led_green_color + 1;
@@ -159,11 +162,13 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
}
break;
case 4:
if (settings->bit.led_duration) {
if (settings->bit.led_duration == 0) {
watch_display_string("instnt", 4);
} else if (settings->bit.led_duration == 0b111) {
watch_display_string("no LEd", 4);
} else {
sprintf(buf, " %1d SeC", settings->bit.led_duration * 2 - 1);
watch_display_string(buf, 4);
} else {
watch_display_string("no LEd", 4);
}
break;
case 5: