From: Tilman Sauerbeck Date: Mon, 30 Dec 2019 10:39:26 +0000 (+0100) Subject: application: Extract time and position from GPS NMEA messages. X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=f33681815491184edca121e8005de0281aa611ac;p=gps-watch.git application: Extract time and position from GPS NMEA messages. --- 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();