X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=boards%2Fek-lm3s1968%2Fexamples%2Fgps%2Fmain.c;h=5e32dc5ef8a0af6c4268c4609da7bd1465185563;hb=4aacaf44941f4c80032f5bb6f2779f4d782647a6;hp=cf7b561dd978bc2a01f15f1805da5dc32b4a175d;hpb=e9ccb7d4eec1b5e4d3fc670336828caa52df8056;p=bertos.git diff --git a/boards/ek-lm3s1968/examples/gps/main.c b/boards/ek-lm3s1968/examples/gps/main.c index cf7b561d..5e32dc5e 100644 --- a/boards/ek-lm3s1968/examples/gps/main.c +++ b/boards/ek-lm3s1968/examples/gps/main.c @@ -1,9 +1,48 @@ +/** + * \file + * + * + * \author Andrea Righi + * + * \brief DevelGPS demo application with gps. + */ + +#include "hw/hw_led.h" + #include #include #include #include -#include +#include #include #include @@ -44,7 +83,7 @@ static long target_lat, target_lon; /* Storage stuff */ #define GPS_POS_MAGIC 0xdeadbeef -static FlashLM3S flash; +static Flash flash; static void flash_load_target(void) { @@ -70,24 +109,6 @@ static void flash_save_target(void) kfile_flush(&flash.fd); } -/* Status LED management */ -static void led_init(void) -{ - SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOG; - (void)SYSCTL_RCGC2_R; - GPIO_PORTG_DIR_R = 0x04; - GPIO_PORTG_DEN_R = 0x04; -} - -INLINE void led_on(void) -{ - GPIO_PORTG_DATA_R |= 0x04; -} - -INLINE void led_off(void) -{ - GPIO_PORTG_DATA_R &= ~0x04; -} /* Display management */ INLINE void video_off(void) @@ -142,9 +163,9 @@ static void NORETURN led_process(void) timer_delay(1000); continue; } - led_on(); + LED_ON(); timer_delay(100); - led_off(); + LED_OFF(); nmea_update = false; } } @@ -496,7 +517,7 @@ static struct MenuItem main_items[] = static struct Menu main_menu = { - main_items, "DevelGPS v0.1", MF_STICKY | MF_SAVESEL, &lcd_bitmap, 0 + main_items, "DevelGPS v0.1", MF_STICKY | MF_SAVESEL, &lcd_bitmap, 0, rit128x96_blitBitmap }; static void init(void) @@ -508,9 +529,9 @@ static void init(void) proc_init(); scrsvr_timestamp = ticks_to_ms(timer_clock_unlocked()); - led_init(); + LED_INIT(); - flash_lm3sInit(&flash); + flash_init(&flash); flash_load_target(); ser_init(&ser_port, SER_UART1);