projects
/
gps-watch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: Store distance travelled in Logger instance.
[gps-watch.git]
/
src
/
application
/
main.rs
diff --git
a/src/application/main.rs
b/src/application/main.rs
index 4fa0c96513e974bab1d0f31e29b414dd524213cd..dc955ce7af46fb39fc5b37721e4b12c5b7cbcbd3 100644
(file)
--- 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 prev_tap = gps::TimeAndPos::new();
- let mut total_distance_cm = 0;
-
loop {
let mut tap = gps::TimeAndPos::new();
let mut show_time = false;
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);
if is_recording {
logger.log(&prev_tap, &tap);
- total_distance_cm += tap.distance_cm(&prev_tap) as u32;
-
show_distance = true;
}
show_distance = true;
}
@@
-282,7
+278,8
@@
pub unsafe extern "C" fn _start() -> ! {
if show_distance {
let mut distance_m_s = [b' '; 8];
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);
screen.clear();
screen.draw_text(&distance_m_s);
@@
-320,8
+317,6
@@
pub unsafe extern "C" fn _start() -> ! {
} else {
logger.stop_recording(&prev_tap);
}
} else {
logger.stop_recording(&prev_tap);
}
-
- total_distance_cm = 0;
}
if reset_requested() {
}
if reset_requested() {