corvus2 gps still doesn't work WIP

pull/503/head
Kevin Hester 2020-10-13 14:43:28 +08:00
rodzic 965c2bda8d
commit ca77d48b20
5 zmienionych plików z 27 dodań i 20 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
echo "Converting to uf2 for NRF52 Adafruit bootloader" echo "Converting to uf2 for NRF52 Adafruit bootloader"
bin/uf2conv.py .pio/build/lora-relay-v1/firmware.hex -f 0xADA52840 bin/uf2conv.py .pio/build/lora-relay-v2/firmware.hex -f 0xADA52840
# cp flash.uf2 /media/kevinh/FTH*BOOT/ # cp flash.uf2 /media/kevinh/FTH*BOOT/

Wyświetl plik

@ -36,10 +36,15 @@ bool GPS::setup()
return ok; return ok;
} }
// Allow defining the polarity of the WAKE output. default is active high
#ifndef GPS_WAKE_ACTIVE
#define GPS_WAKE_ACTIVE 1
#endif
void GPS::wake() void GPS::wake()
{ {
#ifdef PIN_GPS_WAKE #ifdef PIN_GPS_WAKE
digitalWrite(PIN_GPS_WAKE, 1); digitalWrite(PIN_GPS_WAKE, GPS_WAKE_ACTIVE);
pinMode(PIN_GPS_WAKE, OUTPUT); pinMode(PIN_GPS_WAKE, OUTPUT);
#endif #endif
} }
@ -47,7 +52,7 @@ void GPS::wake()
void GPS::sleep() { void GPS::sleep() {
#ifdef PIN_GPS_WAKE #ifdef PIN_GPS_WAKE
digitalWrite(PIN_GPS_WAKE, 0); digitalWrite(PIN_GPS_WAKE, GPS_WAKE_ACTIVE ? 0 : 1);
pinMode(PIN_GPS_WAKE, OUTPUT); pinMode(PIN_GPS_WAKE, OUTPUT);
#endif #endif
} }

Wyświetl plik

@ -102,7 +102,7 @@ bool NMEAGPS::whileIdle()
// First consume any chars that have piled up at the receiver // First consume any chars that have piled up at the receiver
while (_serial_gps->available() > 0) { while (_serial_gps->available() > 0) {
int c = _serial_gps->read(); int c = _serial_gps->read();
// DEBUG_MSG("%c", c); DEBUG_MSG("%c", c);
isValid |= reader.encode(c); isValid |= reader.encode(c);
} }

Wyświetl plik

@ -301,39 +301,39 @@ void setup()
readFromRTC(); // read the main CPU RTC at first (in case we can't get GPS time) readFromRTC(); // read the main CPU RTC at first (in case we can't get GPS time)
// If we know we have a L80 GPS, don't try UBLOX // If we don't have bidirectional comms, we can't even try talking to UBLOX
#ifndef L80_RESET UBloxGPS *ublox = NULL;
#ifdef GPS_TX_PIN
// Init GPS - first try ublox // Init GPS - first try ublox
auto ublox = new UBloxGPS(); ublox = new UBloxGPS();
gps = ublox; gps = ublox;
if (!gps->setup()) { if (!gps->setup()) {
DEBUG_MSG("ERROR: No UBLOX GPS found\n"); DEBUG_MSG("ERROR: No UBLOX GPS found\n");
delete ublox; delete ublox;
gps = ublox = NULL; gps = ublox = NULL;
}
#endif
if (GPS::_serial_gps) { if (!gps && GPS::_serial_gps) {
// Some boards might have only the TX line from the GPS connected, in that case, we can't configure it at all. Just // Some boards might have only the TX line from the GPS connected, in that case, we can't configure it at all. Just
// assume NMEA at 9600 baud. // assume NMEA at 9600 baud.
// dumb NMEA access only work for serial GPSes) // dumb NMEA access only work for serial GPSes)
DEBUG_MSG("Hoping that NMEA might work\n"); DEBUG_MSG("Hoping that NMEA might work\n");
#ifdef HAS_AIR530_GPS #ifdef HAS_AIR530_GPS
gps = new Air530GPS(); gps = new Air530GPS();
#else #else
gps = new NMEAGPS(); gps = new NMEAGPS();
#endif #endif
gps->setup(); gps->setup();
}
} }
#else
gps = new NMEAGPS();
gps->setup();
#endif
if (gps) if (gps)
gpsStatus->observe(&gps->newStatus); gpsStatus->observe(&gps->newStatus);
else else
DEBUG_MSG("Warning: No GPS found - running without GPS\n"); DEBUG_MSG("Warning: No GPS found - running without GPS\n");
nodeStatus->observe(&nodeDB.newStatus); nodeStatus->observe(&nodeDB.newStatus);
service.init(); service.init();

Wyświetl plik

@ -38,6 +38,7 @@ serial flash
ok lora (inc boost en) ok lora (inc boost en)
mention dat1 and dat2 on sd card mention dat1 and dat2 on sd card
use hardware spi controller for lcd - not bitbang
*/ */
@ -161,6 +162,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define ST7735_SCK (37) // actually spi clk #define ST7735_SCK (37) // actually spi clk
#define PIN_GPS_WAKE 36 // Just kill GPS power when we want it to sleep? FIXME #define PIN_GPS_WAKE 36 // Just kill GPS power when we want it to sleep? FIXME
#define GPS_WAKE_ACTIVE 0 // GPS Power output is active low
// #define LORA_DISABLE_SENDING // The board can brownout during lora TX if you don't have a battery connected. Disable sending // #define LORA_DISABLE_SENDING // The board can brownout during lora TX if you don't have a battery connected. Disable sending
// to allow USB power only based debugging // to allow USB power only based debugging