Skip to content

Commit

Permalink
ublox-8 wake up
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jun 23, 2020
1 parent 32df032 commit 72831c2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions software/firmware/source/SoftRF/GNSSHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ const uint8_t setNav5[] PROGMEM = {0xFF, 0xFF, 0x07, 0x03, 0x00, 0x00, 0x00, 0x0
const uint8_t CFG_RST[12] PROGMEM = {0xb5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00,
0x00, 0x01, 0x00, 0x0F, 0x66};

const uint8_t RXM_PMREQ[16] PROGMEM = {0xb5, 0x62, 0x02, 0x41, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x4d, 0x3b};
const uint8_t RXM_PMREQ_OFF[16] PROGMEM = {0xb5, 0x62, 0x02, 0x41, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x4d, 0x3b};

#if defined(USE_GNSS_PSM)
static bool gnss_psm_active = false;
Expand Down Expand Up @@ -524,6 +524,13 @@ byte GNSS_setup() {

SoC->swSer_begin(SERIAL_IN_BR);

if (hw_info.model == SOFTRF_MODEL_PRIME_MK2 ||
hw_info.model == SOFTRF_MODEL_UNI) {

// power on by wakeup call
swSer.write((uint8_t) 0); swSer.flush(); delay(500);
}

if (!GNSS_probe())
return rval;

Expand Down Expand Up @@ -610,8 +617,8 @@ void GNSS_fini()
delay(hw_info.gnss == GNSS_MODULE_U8 ? 1000 : 600);

// power off until wakeup call
for (int i = 0; i < sizeof(RXM_PMREQ); i++) {
swSer.write(pgm_read_byte(&RXM_PMREQ[i]));
for (int i = 0; i < sizeof(RXM_PMREQ_OFF); i++) {
swSer.write(pgm_read_byte(&RXM_PMREQ_OFF[i]));
}
}
}
Expand Down

0 comments on commit 72831c2

Please sign in to comment.