Commit f9419a5a authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

Added checking of GPS WAKEUP pin

parent ea178110
...@@ -141,6 +141,18 @@ void gps_on_off_pulse() ...@@ -141,6 +141,18 @@ void gps_on_off_pulse()
fixed = 0; fixed = 0;
} }
/**
* @brief
* Get state of the GPS WAKUP pin.
* @return
* '1' when the GPS is on (WAKUP = 1)
* '0' when the GPS is off (WAKUP = 0)
*/
int gps_on()
{
return GPIO_PinInGet(gpioPortA, 1);
}
/** /**
* @brief * @brief
* Set state of the GPS reset pin. * Set state of the GPS reset pin.
......
...@@ -59,6 +59,7 @@ struct gps_utc { ...@@ -59,6 +59,7 @@ struct gps_utc {
/*=====================*/ /*=====================*/
void gps_init(int pulse_onoff); void gps_init(int pulse_onoff);
void gps_on_off_pulse(); void gps_on_off_pulse();
int gps_on();
void gps_reset(int val); void gps_reset(int val);
int gps_get_irq_sync(); int gps_get_irq_sync();
void gps_set_irq_sync(); void gps_set_irq_sync();
......
...@@ -54,7 +54,7 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt) ...@@ -54,7 +54,7 @@ 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 (setting_get(&setting_gps_on)) { if (gps_on()) {
if (gps_fixed()) { if (gps_fixed()) {
memcpy(&gps_ico, &gps_receiving, memcpy(&gps_ico, &gps_receiving,
sizeof(struct rle_bitmap)); sizeof(struct rle_bitmap));
......
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