Commit 8554978d authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana Committed by Theodor-Adrian Stana

Added tracking icon when option is set

parent 70835247
This diff is collapsed.
/*
* Copyright (C) 2014 Julian Lewis
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/gpl-3.0-standalone.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef BITMAPS_H
#define BITMAPS_H
......@@ -31,22 +10,23 @@ struct rle_bitmap
const uint8_t *data;
};
extern const struct rle_bitmap comp_circle;
extern const struct rle_bitmap gps_disconnected;
extern const struct rle_bitmap comp_circle3;
extern const struct rle_bitmap date_icon;
extern const struct rle_bitmap comp_ico;
extern const struct rle_bitmap gps_receiving;
extern const struct rle_bitmap settings_icon;
extern const struct rle_bitmap comp_circle2;
extern const struct rle_bitmap game_ico;
extern const struct rle_bitmap tracking;
extern const struct rle_bitmap comp_arrow;
extern const struct rle_bitmap usb_ms_icon;
extern const struct rle_bitmap battery;
extern const struct rle_bitmap date_icon;
extern const struct rle_bitmap battery_charging;
extern const struct rle_bitmap comp_circle3;
extern const struct rle_bitmap clock_icon;
extern const struct rle_bitmap comp_arrow2;
extern const struct rle_bitmap gps_disconnected;
extern const struct rle_bitmap example_icon;
extern const struct rle_bitmap battery_charging;
extern const struct rle_bitmap comp_circle;
extern const struct rle_bitmap gps_receiving;
extern const struct rle_bitmap gps_searching;
extern const struct rle_bitmap settings_icon;
extern const struct rle_bitmap game_ico;
extern const struct rle_bitmap comp_arrow2;
extern const struct rle_bitmap comp_ico;
extern const struct rle_bitmap usb_ms_icon;
extern const struct rle_bitmap battery;
#endif /* BITMAPS_H */
......@@ -38,7 +38,7 @@
#include "../settings/settings.h"
static const unsigned int GPS_POS = 0;
static const unsigned int TRACK_POS = 36;
static const unsigned int TRACK_POS = 16;
static const unsigned int BATTERY_POS = 111;
static const unsigned int BATTERY_BARS = 10;
......@@ -70,21 +70,15 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt)
} else {
memcpy(&gps_ico, 0, sizeof(struct rle_bitmap));
}
// if (setting_get(&setting_tracking))
// memset(&track_ico, &tracking, sizeof(struct rle_bitmap));
// else
// memset(&track_ico, 0, sizeof(struct rle_bitmap));
if (setting_get(&setting_tracking))
memcpy(&track_ico, &tracking, sizeof(struct rle_bitmap));
else
memset(&track_ico, 0, sizeof(struct rle_bitmap));
w->flags |= WF_DIRTY;
break;
// case GPS_TRACK_ON:
// w->flags |= WF_DIRTY;
// break;
//
// case GPS_TRACK_OFF:
// memset(&track_ico, 0, sizeof(struct rle_bitmap));
// w->flags |= WF_DIRTY;
// break;
break;
case BATTERY_STATUS:
if(abs(percentage - evt->data.battery.percentage) > 5 ||
......
......@@ -102,23 +102,15 @@ static void gpsbkgnd_task(void *params)
/*
* Tracking actions based on previous and current value of setting
* - ON to OFF -- take control of storage so we can store and inform other
* tasks that tracking has turned on
* - ON to OFF -- take control of storage so we can store
* - OFF to ON -- give control of storage so other tasks can store to it
* and inform other tasks that tracking has been turned off
*/
ptrack = track;
track = setting_get(&setting_tracking);
if (track) {
if (!ptrack || firstrun) {
take_storage();
// e.type = GPS_TRACK_ON;
// xQueueSendToBack(appQueue, &e, 0);
}
if ((track) && (!ptrack || firstrun)) {
take_storage();
} else if (ptrack) {
give_storage();
// e.type = GPS_TRACK_OFF;
// xQueueSendToBack(appQueue, &e, 0);
}
/* Set time and track according to setting */
......
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