From f33681815491184edca121e8005de0281aa611ac Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Mon, 30 Dec 2019 11:39:26 +0100 Subject: [PATCH] application: Extract time and position from GPS NMEA messages. --- src/application/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/application/main.rs b/src/application/main.rs index edb234e..dbd748c 100644 --- a/src/application/main.rs +++ b/src/application/main.rs @@ -39,6 +39,7 @@ use common::i2c; use common::uart; use common::usb_serial; use common::display; +use common::gps; extern { fn enable_interrupts(); @@ -99,11 +100,13 @@ pub unsafe extern "C" fn _start() -> ! { nvic::enable_irq(12); // UART0 + let mut gps = gps::Gps::new(); + loop { - systick::delay_ms(1000); + let mut tap = gps::TimeAndPos::new(); - cdc_tx_buf.write(b".\n"); - cdc_tx_buf.flush(); + while gps.update(&mut tap) { + } if (gpio::get(gpio::GPIOA) & (1 << 12)) == 0 { nvic::system_reset(); -- 2.30.2