Merge PR #293 - add instant LED duration

Adds an instant LED duration preference that only keeps the LED lit
while the LIGHT button remains held down.

Matches the behavior of the original watch.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Tested-on-hardware-by: Wesley Aptekar-Cassels <me@wesleyac.com>
Tested-on-hardware-by: 814d3 (GitHub)
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/293
This commit is contained in:
Matheus Afonso Martins Moreira
2024-09-03 19:02:21 -03:00
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;
@@ -171,11 +174,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: