From: Keith Packard Date: Wed, 4 Jul 2018 18:58:40 +0000 (-0700) Subject: altos: Make LCO search directly drive pad/box displays X-Git-Tag: 1.8.6~1^2~9 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=38fb80e5e6af87f8c734448e4aa69b2c39854903 altos: Make LCO search directly drive pad/box displays Don't use ao_lco_show as that has other logic too. Signed-off-by: Keith Packard --- diff --git a/src/drivers/ao_lco.c b/src/drivers/ao_lco.c index 2c8c729f..47752f1f 100644 --- a/src/drivers/ao_lco.c +++ b/src/drivers/ao_lco.c @@ -82,7 +82,7 @@ ao_lco_show_box(uint16_t box) ao_mutex_put(&ao_lco_display_mutex); } -void +static void ao_lco_show_voltage(uint16_t decivolts) { uint8_t tens, ones, tenths; @@ -98,7 +98,7 @@ ao_lco_show_voltage(uint16_t decivolts) } void -ao_lco_show_display(void) +ao_lco_show(void) { if (ao_lco_pad == AO_LCO_PAD_VOLTAGE && ao_lco_box != AO_LCO_BOX_DRAG) { ao_lco_show_voltage(ao_pad_query.battery); diff --git a/src/drivers/ao_lco.h b/src/drivers/ao_lco.h index c1b101d2..e528c2ad 100644 --- a/src/drivers/ao_lco.h +++ b/src/drivers/ao_lco.h @@ -141,10 +141,7 @@ void ao_lco_show_box(uint16_t box); void -ao_lco_show_voltage(uint16_t decivolts); - -void -ao_lco_show_display(void); +ao_lco_show(void); void ao_lco_init(void); diff --git a/src/drivers/ao_lco_bits.c b/src/drivers/ao_lco_bits.c index 6c5182f2..197bf8aa 100644 --- a/src/drivers/ao_lco_bits.c +++ b/src/drivers/ao_lco_bits.c @@ -173,7 +173,7 @@ ao_lco_update(void) ao_lco_set_pad(ao_lco_pad_first(ao_lco_box)); } if (ao_lco_pad == AO_LCO_PAD_VOLTAGE) - ao_lco_show_display(); + ao_lco_show(); } } @@ -203,7 +203,7 @@ void ao_lco_set_pad(uint8_t new_pad) { ao_lco_pad = new_pad; - ao_lco_show_display(); + ao_lco_show(); } void @@ -215,7 +215,7 @@ ao_lco_set_box(uint16_t new_box) #endif ao_lco_channels[ao_lco_box] = 0; ao_lco_pad = 1; - ao_lco_show_display(); + ao_lco_show(); } void @@ -278,12 +278,11 @@ ao_lco_search(void) uint8_t boxes = 0; ao_lco_box_reset_present(); - ao_lco_set_pad(0); + ao_lco_show_box(0); + ao_lco_show_pad(0); for (box = 0; box < AO_PAD_MAX_BOXES; box++) { - if ((box % 10) == 0) { - ao_lco_box = box; - ao_lco_show_display(); - } + if ((box % 10) == 0) + ao_lco_show_box(box); for (try = 0; try < 3; try++) { ao_lco_tick_offset[box] = 0; r = ao_lco_query(box, &ao_pad_query, &ao_lco_tick_offset[box]); @@ -291,7 +290,7 @@ ao_lco_search(void) if (r == AO_RADIO_CMAC_OK) { ++boxes; ao_lco_box_set_present(box); - ao_lco_set_pad(boxes % 10); + ao_lco_show_pad(boxes % 10); ao_delay(AO_MS_TO_TICKS(30)); break; } @@ -427,7 +426,7 @@ ao_lco_drag_enable(void) ao_led_on(AO_LED_DRAG); #endif ao_lco_drag_add_beeps(5); - ao_lco_show_display(); + ao_lco_show(); } } @@ -442,7 +441,7 @@ ao_lco_drag_disable(void) #endif memset(ao_lco_selected, 0, sizeof (ao_lco_selected)); ao_lco_drag_add_beeps(2); - ao_lco_show_display(); + ao_lco_show(); } } diff --git a/src/drivers/ao_lco_two.c b/src/drivers/ao_lco_two.c index 2fa0a21f..6f2d81ff 100644 --- a/src/drivers/ao_lco_two.c +++ b/src/drivers/ao_lco_two.c @@ -46,7 +46,19 @@ ao_lco_wakeup(void) } void -ao_lco_show_display(void) +ao_lco_show_pad(uint8_t pad) +{ + (void) pad; +} + +void +ao_lco_show_box(uint16_t box) +{ + (void) box; +} + +void +ao_lco_show(void) { } diff --git a/src/telelco-v2.0/ao_lco_v2.c b/src/telelco-v2.0/ao_lco_v2.c index f64a7745..a9933d59 100644 --- a/src/telelco-v2.0/ao_lco_v2.c +++ b/src/telelco-v2.0/ao_lco_v2.c @@ -72,7 +72,7 @@ ao_lco_show_box(uint16_t box) ao_mutex_put(&ao_lco_display_mutex); } -void +static void ao_lco_show_voltage(uint16_t decivolts) { uint8_t tens, ones, tenths; @@ -89,7 +89,7 @@ ao_lco_show_voltage(uint16_t decivolts) } void -ao_lco_show_display(void) +ao_lco_show(void) { if (ao_lco_pad == AO_LCO_PAD_VOLTAGE) { ao_lco_show_voltage(ao_pad_query.battery);