Commit 212d53d1 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

gpscoord: Printing all coordinates in one format on screen

parent 781e8744
......@@ -119,7 +119,10 @@ INCLUDEPATHS += \
-I../common \
-I../common/emlib/inc \
-I../common/emdrv/sleep/inc \
-I../common/drivers/gps/nmealib/include
-I../common/drivers/gps/nmealib/include \
-I../common/drivers/usb/ \
-I../common/drivers/usb/inc \
# TODO remove the USB stuff above
####################################################################
# Files #
......@@ -138,7 +141,7 @@ C_SRC += \
../common/emlib/src/em_rtc.c \
../common/emlib/src/em_system.c \
../common/emlib/src/em_usart.c \
../common/emlib/src/em_leuart.c \
../common/emlib/src/em_leuart.c \
../common/emdrv/sleep/src/sleep.c \
../common/drivers/lcd.c \
../common/drivers/buttons.c \
......@@ -185,7 +188,19 @@ src/low_power_tick_management.c \
../common/drivers/gps/nmealib/src/time.c \
../common/drivers/gps/nmealib/src/tok.c \
../common/drivers/gps/gps.c \
src/apps/gpscoord.c
src/apps/gpscoord.c \
../common/drivers/usb/usbdbg.c \
../common/drivers/usb/src/em_usbd.c \
../common/drivers/usb/src/em_usbdch9.c \
../common/drivers/usb/src/em_usbdep.c \
../common/drivers/usb/src/em_usbdint.c \
../common/drivers/usb/src/em_usbh.c \
../common/drivers/usb/src/em_usbhal.c \
../common/drivers/usb/src/em_usbhep.c \
../common/drivers/usb/src/em_usbhint.c \
../common/drivers/usb/src/em_usbtimer.c \
../common/drivers/emlib/src/em_timer.c
# TODO remove the USB stuff above
s_SRC +=
......
......@@ -36,26 +36,22 @@
#include "application.h"
static int i = 0;
static struct gps_coord coord;
static void gps_redraw(struct ui_widget *w)
{
char buf[16];
struct gps_coord c;
gps_get_coord(&c);
if (gps_fixed())
gps_get_coord(&coord);
gfx_clear(&w->dc, 0);
sprintf(buf, "%2.4f", c.lat);
gfx_text(&w->dc, &font_helv17b, 10, 0, buf, 0);
i++;
sprintf(buf, "(%d)%d", i, gps_fixed());
gfx_text(&w->dc, &font_helv17b, 10, 50, buf, 0);
// sprintf(buf, "%2.4f", c.lon);
// gfx_text(&w->dc, &font_helv38b, 30, 0, buf, 0);
// sprintf(buf, "%2.4fm", c.elev);
// gfx_text(&w->dc, &font_helv38b, 50, 0, buf, 0);
sprintf(buf, "%4.4f", coord.lat);
gfx_text(&w->dc, &font_helv22b, 10, 10, buf, 0);
sprintf(buf, "%4.4f", coord.lon);
gfx_text(&w->dc, &font_helv22b, 10, 30, buf, 0);
sprintf(buf, "%5.0f m", coord.elev);
gfx_text(&w->dc, &font_helv22b, 10, 50, buf, 0);
}
static void gps_event(struct ui_widget *w, const struct event *evt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment