From f4c812bef76a2cd95f675cb27ea89059561ceec7 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 13 Feb 2015 23:51:10 -0800 Subject: altos: Replace ao_alarm/ao_clear_alarm with ao_sleep_for Having arbitrary alarms firing in the middle of complicated device logic makes no sense at all. Therefore only correct use of ao_alarm and ao_clear_alarm was around a specific ao_sleep call, with correct recovery in case the alarm fires. This patch replaces all uses of ao_alarm/ao_sleep/ao_clear_alarm with ao_sleep_for, a new function which takes the alarm timeout directly. A few cases which weren't simply calling ao_sleep have been reworked to pass the timeout value down to the place where sleep *is* being called, and having that code deal with the return correctly. Signed-off-by: Keith Packard --- src/telebt-v3.0/ao_pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/telebt-v3.0') diff --git a/src/telebt-v3.0/ao_pins.h b/src/telebt-v3.0/ao_pins.h index 838f0dfc..6e90afcc 100644 --- a/src/telebt-v3.0/ao_pins.h +++ b/src/telebt-v3.0/ao_pins.h @@ -168,7 +168,7 @@ struct ao_adc { #define ao_serial_btm_getchar ao_serial2_getchar #define ao_serial_btm_putchar ao_serial2_putchar #define _ao_serial_btm_pollchar _ao_serial2_pollchar -#define _ao_serial_btm_sleep _ao_serial2_sleep +#define _ao_serial_btm_sleep_for _ao_serial2_sleep_for #define ao_serial_btm_set_speed ao_serial2_set_speed #define ao_serial_btm_drain ao_serial2_drain #define ao_serial_btm_rx_fifo (ao_stm_usart2.rx_fifo) -- cgit v1.2.3 From ee1b0bd05bedb8a5a631cc79c77fde8fd920ac38 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 Jun 2015 18:42:29 -0700 Subject: altos/telebt-v3.0: Report battery voltage correctly There was an extra %d, and an extra ':' in the output, making the UI not parse the voltage correctly Signed-off-by: Keith Packard --- src/telebt-v3.0/ao_pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/telebt-v3.0') diff --git a/src/telebt-v3.0/ao_pins.h b/src/telebt-v3.0/ao_pins.h index 6e90afcc..a6a01662 100644 --- a/src/telebt-v3.0/ao_pins.h +++ b/src/telebt-v3.0/ao_pins.h @@ -130,7 +130,7 @@ struct ao_adc { }; #define AO_ADC_DUMP(p) \ - printf("tick: %5u %5d batt: %5d\n", \ + printf("tick: %5u batt %5d\n", \ (p)->tick, \ (p)->adc.v_batt); -- cgit v1.2.3