Commit 70835247 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana Committed by Theodor-Adrian Stana

Removed GPS_OFF event and fixed an error related to turn-on-turn-off

parent 3ea39e9b
...@@ -39,7 +39,6 @@ enum event_type { ...@@ -39,7 +39,6 @@ enum event_type {
RTC_TICK, RTC_TICK,
BATTERY_STATUS, BATTERY_STATUS,
GPS_TICK, GPS_TICK,
GPS_OFF,
GPS_TRACK_ON, GPS_TRACK_ON,
GPS_TRACK_OFF GPS_TRACK_OFF
}; };
......
...@@ -54,17 +54,21 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt) ...@@ -54,17 +54,21 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt)
{ {
switch(evt->type) { switch(evt->type) {
case GPS_TICK: case GPS_TICK:
if (gps_fixed()) { if (setting_get(&setting_gps_on)) {
memcpy(&gps_ico, &gps_receiving, if (gps_fixed()) {
sizeof(struct rle_bitmap)); memcpy(&gps_ico, &gps_receiving,
} else { sizeof(struct rle_bitmap));
gps_ico_blink ^= 1;
if (gps_ico_blink) {
memcpy(&gps_ico, &gps_searching,
sizeof(struct rle_bitmap));
} else { } else {
memset(&gps_ico, 0, sizeof(struct rle_bitmap)); gps_ico_blink ^= 1;
if (gps_ico_blink) {
memcpy(&gps_ico, &gps_searching,
sizeof(struct rle_bitmap));
} else {
memset(&gps_ico, 0, sizeof(struct rle_bitmap));
}
} }
} else {
memcpy(&gps_ico, 0, sizeof(struct rle_bitmap));
} }
// if (setting_get(&setting_tracking)) // if (setting_get(&setting_tracking))
// memset(&track_ico, &tracking, sizeof(struct rle_bitmap)); // memset(&track_ico, &tracking, sizeof(struct rle_bitmap));
...@@ -73,11 +77,6 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt) ...@@ -73,11 +77,6 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt)
w->flags |= WF_DIRTY; w->flags |= WF_DIRTY;
break; break;
case GPS_OFF:
memset(&gps_ico, 0, sizeof(struct rle_bitmap));
w->flags |= WF_DIRTY;
break;
// case GPS_TRACK_ON: // case GPS_TRACK_ON:
// w->flags |= WF_DIRTY; // w->flags |= WF_DIRTY;
// break; // break;
......
...@@ -52,8 +52,6 @@ extern xSemaphoreHandle mutexSdCardAccess; ...@@ -52,8 +52,6 @@ extern xSemaphoreHandle mutexSdCardAccess;
static int mutexours = 0; static int mutexours = 0;
static int firstrun, firstfix; static int firstrun, firstfix;
static int gpson, pgpson;
static int track, ptrack;
static FIL f; static FIL f;
static FATFS fatfs; static FATFS fatfs;
...@@ -90,22 +88,16 @@ static void gpsbkgnd_task(void *params) ...@@ -90,22 +88,16 @@ static void gpsbkgnd_task(void *params)
{ {
(void) params; (void) params;
struct event e; struct event e;
static int gpson, pgpson;
static int track, ptrack;
/* Previous and current state of GPS ON setting */ /* Previous and current state of GPS ON setting */
pgpson = gpson; pgpson = gpson;
gpson = setting_get(&setting_gps_on); gpson = setting_get(&setting_gps_on);
/* Pulse GPS ON_OFF pin if setting changed */ /* Pulse GPS ON_OFF pin if setting changed */
if ((pgpson != gpson) && !firstrun) if ((pgpson != gpson) && !firstrun) {
gps_on_off_pulse(); gps_on_off_pulse();
if (!gpson) {
/* Turn off status bar icon if GPS turns off */
if (pgpson) {
e.type = GPS_OFF;
xQueueSendToBack(appQueue, (void *)&e, 0);
}
return;
} }
/* /*
......
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