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