From e6125581fd3535ddac6562b457df896479fc2123 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 14 Mar 2019 22:07:26 +0100 Subject: [PATCH] main: repurpose led activity, obtain fresh time --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index a66260b..63375e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,20 +105,22 @@ fn main() -> ! { let mut last_output = 0_u32; loop { - led_red.on(); + led_green.on(); let now = timer::now().0; let instant = Instant::from_millis(now as i64); server.poll(instant); + led_green.off(); + led_blue.on(); + let now = timer::now().0; if now - last_output >= OUTPUT_INTERVAL { - led_blue.on(); let adc_value = adc_input::read(); adc_value.map(|adc_value| { write!(server, "t={},pa3={}\r\n", now, adc_value).unwrap(); }); last_output = now; - led_blue.off(); } + led_blue.off(); // Update watchdog wd.feed();