Skip to content

Commit 9c81cc2

Browse files
committed
Fix power button and SD pins
1 parent c205228 commit 9c81cc2

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -772,13 +772,6 @@ void beginBoard()
772772

773773
else if (productVariant == RTK_FLEX)
774774
{
775-
// #ifdef COMPILE_LG290P
776-
// gnss = (GNSS *)new GNSS_LG290P();
777-
// #else // COMPILE_LGP290P
778-
// gnss = (GNSS *)new GNSS_None();
779-
// systemPrintln("<<<<<<<<<< !!!!!!!!!! LG290P NOT COMPILED !!!!!!!!!! >>>>>>>>>>");
780-
// #endif // COMPILE_LGP290P
781-
782775
present.brand = BRAND_SPARKPNT;
783776
present.psram_2mb = true;
784777

@@ -791,7 +784,8 @@ void beginBoard()
791784

792785
// TODO Change to MFi present.encryption_atecc608a = true;
793786

794-
present.button_powerHigh = true; // Button is pressed when high
787+
present.button_powerLow = true; // Button is pressed when high
788+
//present.button_mode = true; //TODO remove comment. This won't be available until v1.1 of hardware
795789
present.beeper = true;
796790
present.gnss_to_uart = true;
797791
present.needsExternalPpl = true; // Uses the PointPerfect Library
@@ -802,9 +796,10 @@ void beginBoard()
802796
present.dynamicModel = true;
803797

804798
present.gpioExpanderSwitches = true;
799+
present.microSd = true;
805800

806801
present.display_i2c0 = true;
807-
//present.i2c0BusSpeed_400 = true; // Run display bus at higher speed
802+
// present.i2c0BusSpeed_400 = true; // Run display bus at higher speed
808803
present.display_type = DISPLAY_128x64_INVERTED;
809804
present.tiltPossible = true;
810805

@@ -814,7 +809,8 @@ void beginBoard()
814809
pin_GnssUart_RX = 26;
815810
pin_GnssUart_TX = 27;
816811

817-
pin_powerButton = 34;
812+
pin_powerSenseAndControl = 34;
813+
//pin_modeButton = 25; //TODO remove comment. This won't be available until v1.1 of hardware
818814

819815
pin_IMU_RX = 14; // ESP32 UART2
820816
pin_IMU_TX = 17;
@@ -826,6 +822,12 @@ void beginBoard()
826822

827823
pin_beeper = 33;
828824

825+
pin_microSD_CS = 22;
826+
pin_microSD_CardDetect = 39;
827+
// D18 : SPI SCK --> microSD card
828+
// D19 : SPI POCI --> microSD card
829+
// D21 : SPI PICO --> microSD card
830+
829831
pin_gpioExpanderInterrupt = 2; // Not used since all GPIO expanded pins are outputs
830832

831833
DMW_if systemPrintf("pin_bluetoothStatusLED: %d\r\n", pin_bluetoothStatusLED);
@@ -834,14 +836,20 @@ void beginBoard()
834836
DMW_if systemPrintf("pin_gnssStatusLED: %d\r\n", pin_gnssStatusLED);
835837
pinMode(pin_gnssStatusLED, OUTPUT);
836838

839+
pinMode(pin_microSD_CardDetect, INPUT_PULLUP);
840+
841+
// Disable the microSD card
842+
pinMode(pin_microSD_CS, OUTPUT);
843+
sdDeselectCard();
844+
837845
// Turn on Bluetooth, GNSS, and Battery LEDs to indicate power on
838846
bluetoothLedOn();
839847
gnssStatusLedOn();
840848

841849
pinMode(pin_beeper, OUTPUT);
842850
beepOff();
843851

844-
pinMode(pin_powerButton, INPUT);
852+
pinMode(pin_powerSenseAndControl, INPUT);
845853

846854
pinMode(pin_powerAdapterDetect, INPUT); // Has 10k pullup
847855

@@ -1161,10 +1169,8 @@ void pinGnssUartTask(void *pvParameters)
11611169
}
11621170
else if (productVariant == RTK_FLEX)
11631171
{
1164-
Serial.println("Starting UART for flex");
11651172
if (settings.detectedGnssReceiver == GNSS_RECEIVER_LG290P)
11661173
{
1167-
Serial.println("Starting UART for LG290P");
11681174
// LG290P communicates at 460800bps.
11691175
platformGnssCommunicationRate = 115200 * 4;
11701176
}
@@ -1447,7 +1453,7 @@ void beginButtons()
14471453
userBtn = new Button(pin_powerButton, 25, true,
14481454
false); // Turn off inversion. Needed for buttons that are high when pressed.
14491455

1450-
// EVK mode button
1456+
// EVK/Flex user button (Mode or Fn)
14511457
if (present.button_mode == true)
14521458
userBtn = new Button(pin_modeButton);
14531459

0 commit comments

Comments
 (0)