From: asterix Date: Wed, 12 May 2010 10:38:36 +0000 (+0000) Subject: Move leds function to hw file. Comply flash api. Add Copyright. X-Git-Tag: 2.5.0~263 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=b61708e9dc0a7dd917fa386727b6a0bff43b63ac;p=bertos.git Move leds function to hw file. Comply flash api. Add Copyright. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3654 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/boards/ek-lm3s1968/examples/gps/main.c b/boards/ek-lm3s1968/examples/gps/main.c index cf7b561d..afa799b6 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; } } @@ -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);