X-Git-Url: http://git.code-monkey.de/?p=gps-watch.git;a=blobdiff_plain;f=src%2Fapplication%2Fmain.rs;h=dc955ce7af46fb39fc5b37721e4b12c5b7cbcbd3;hp=4fa0c96513e974bab1d0f31e29b414dd524213cd;hb=70fb2fadd8688fdc11ba1d398661ac99aaa1b02a;hpb=0d8584ea930c590c6034d465844e74dc94b25309 diff --git a/src/application/main.rs b/src/application/main.rs index 4fa0c96..dc955ce 100644 --- a/src/application/main.rs +++ b/src/application/main.rs @@ -225,8 +225,6 @@ pub unsafe extern "C" fn _start() -> ! { let mut prev_tap = gps::TimeAndPos::new(); - let mut total_distance_cm = 0; - loop { let mut tap = gps::TimeAndPos::new(); let mut show_time = false; @@ -237,8 +235,6 @@ pub unsafe extern "C" fn _start() -> ! { if is_recording { logger.log(&prev_tap, &tap); - total_distance_cm += tap.distance_cm(&prev_tap) as u32; - show_distance = true; } @@ -282,7 +278,8 @@ pub unsafe extern "C" fn _start() -> ! { if show_distance { let mut distance_m_s = [b' '; 8]; - common::fmt::fmt_u32(&mut distance_m_s, total_distance_cm / 100); + common::fmt::fmt_u32(&mut distance_m_s, + logger.total_distance_cm / 100); screen.clear(); screen.draw_text(&distance_m_s); @@ -320,8 +317,6 @@ pub unsafe extern "C" fn _start() -> ! { } else { logger.stop_recording(&prev_tap); } - - total_distance_cm = 0; } if reset_requested() {