diff --git a/docs/software/nrf52-TODO.md b/docs/software/nrf52-TODO.md index 42c535757..294a09de0 100644 --- a/docs/software/nrf52-TODO.md +++ b/docs/software/nrf52-TODO.md @@ -7,8 +7,13 @@ ### PPR1 TODO -* fix usb - check latest tinyusb -* Test GPS - try pulsing reset +* fix usb - I think the problem is VBUS in HW + +* Test GPS - try pulsing reset - no joy. R19 is the resistor on the TX path from GPS to CPU +R17 is the resistor for V_BK GPS power (measured 3V - ok!), R20 is the resistor for the RX path from CPU to GPS. R18 for RESET (it is low and GPS reset is high - ok!) +* V_BK for the GPS should probably be supplied from something always on + +* use S113 soft device 7.2.0 * properly test charge controller config and read battery/charge status * fix bluetooth * fix LCD max contrast (currently too high, needs to be about 40?) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 6076749f3..d72ff70f5 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -25,6 +25,22 @@ uint8_t GPS::i2cAddress = 0; GPS *gps; +bool GPS::setupGPS() +{ + if (_serial_gps) { +#ifdef GPS_RX_PIN + _serial_gps->begin(GPS_BAUDRATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN); +#else + _serial_gps->begin(GPS_BAUDRATE); +#endif +#ifndef NO_ESP32 + _serial_gps->setRxBufferSize(2048); // the default is 256 +#endif + } + + return true; +} + bool GPS::setup() { // Master power for the GPS diff --git a/src/gps/GPS.h b/src/gps/GPS.h index 36859c9dc..98ad185f2 100644 --- a/src/gps/GPS.h +++ b/src/gps/GPS.h @@ -72,7 +72,7 @@ class GPS : private concurrency::OSThread protected: /// Do gps chipset specific init, return true for success - virtual bool setupGPS() = 0; + virtual bool setupGPS(); /// If possible force the GPS into sleep/low power mode virtual void sleep(); diff --git a/src/gps/NMEAGPS.cpp b/src/gps/NMEAGPS.cpp index 9062c20ad..78a8e4eb4 100644 --- a/src/gps/NMEAGPS.cpp +++ b/src/gps/NMEAGPS.cpp @@ -13,6 +13,8 @@ static int32_t toDegInt(RawDegrees d) bool NMEAGPS::setupGPS() { + GPS::setupGPS(); + #ifdef PIN_GPS_PPS // pulse per second // FIXME - move into shared GPS code diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 1ff622897..2db5d775f 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -29,16 +29,7 @@ bool UBloxGPS::tryConnect() bool UBloxGPS::setupGPS() { - if (_serial_gps) { -#ifdef GPS_RX_PIN - _serial_gps->begin(GPS_BAUDRATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN); -#else - _serial_gps->begin(GPS_BAUDRATE); -#endif -#ifndef NO_ESP32 - _serial_gps->setRxBufferSize(2048); // the default is 256 -#endif - } + GPS::setupGPS(); // uncomment to see debug info // ublox.enableDebugging(Serial);