Skip to content

Commit 66d86d4

Browse files
committed
Update Flex with v1.1 hardware
1 parent 37eaa4e commit 66d86d4

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ void beginBoard()
780780
present.charger_mp2762a = true;
781781

782782
present.button_powerLow = true; // Button is pressed when high
783-
// present.button_mode = true; //TODO remove comment. This won't be available until v1.1 of hardware
783+
present.button_mode = true;
784784
present.beeper = true;
785785
present.gnss_to_uart = true;
786786

@@ -795,14 +795,18 @@ void beginBoard()
795795
present.displayInverted = true;
796796
present.tiltPossible = true;
797797

798+
present.fastPowerOff = true;
799+
present.invertedFastPowerOff = true; // Drive POWER_KILL high to cause powerdown
800+
798801
pin_I2C0_SDA = 15;
799802
pin_I2C0_SCL = 4;
800803

801804
pin_GnssUart_RX = 26;
802805
pin_GnssUart_TX = 27;
803806

804807
pin_powerSenseAndControl = 34;
805-
// pin_modeButton = 25; //TODO remove comment. This won't be available until v1.1 of hardware
808+
pin_powerFastOff = 23;
809+
pin_modeButton = 25;
806810

807811
pin_IMU_RX = 14; // ESP32 UART2
808812
pin_IMU_TX = 17;
@@ -823,6 +827,9 @@ void beginBoard()
823827
pin_gpioExpanderInterrupt =
824828
2; // TODO remove on v1.1 hardware. Not used since all GPIO expanded pins are outputs
825829

830+
digitalWrite(pin_powerFastOff, LOW); // Low = Stay on. High = turn off.
831+
pinMode(pin_powerFastOff, OUTPUT);
832+
826833
DMW_if systemPrintf("pin_bluetoothStatusLED: %d\r\n", pin_bluetoothStatusLED);
827834
pinMode(pin_bluetoothStatusLED, OUTPUT);
828835

@@ -866,13 +873,12 @@ void beginBoard()
866873
present.gnss_lg290p = true;
867874
present.antennaPhaseCenter_mm = 116.5; // Default to Torch helical APC, average of L1/L2
868875
present.fuelgauge_bq40z50 = true;
869-
present.charger_mp2762a = true;
870876
present.button_powerLow = true; // Button is pressed when low
871877
present.beeper = true;
872878
present.gnss_to_uart = true;
873879
present.needsExternalPpl = true; // Uses the PointPerfect Library
874880
present.fastPowerOff = true;
875-
present.invertedFastPowerOff = true; // Driving PWRKILL high will cause powerdown
881+
present.invertedFastPowerOff = true; // Drive PWRKILL high to cause powerdown
876882

877883
// We can't enable GNSS features here because we don't know if lg290pFirmwareVersion is >= v05
878884
// present.minElevation = true;

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ const int gpioExpanderSwitch_S4 = 3; // Controls U19 switch 4: connect GNSS UART
292292
const int gpioExpanderSwitch_LoraEnable = 4; // LoRa_EN
293293
const int gpioExpanderSwitch_GNSS_Reset = 5; // RST_GNSS
294294
const int gpioExpanderSwitch_LoraBoot = 6; // LoRa_BOOT0 - Used for bootloading the STM32 radio IC
295-
const int gpioExpanderSwitch_PowerFastOff = 7; // PWRKILL
295+
const int gpioExpanderSwitch_S5 = 7; // Controls U61 switch 5: connect GNSS UART1 to Port A of CH342
296296
const int gpioExpanderNumSwitches = 8;
297297

298298
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Firmware/RTK_Everywhere/System.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,11 +920,10 @@ void beginGpioExpanderSwitches()
920920

921921
// SW1 is on pin 0. Driving it high will disconnect the ESP32 from USB
922922
// GNSS_RST is on pin 5. Driving it low when an LG290P is connected will kill the I2C bus.
923-
// PWRKILL is on pin 7. Driving it low will turn off the system
924923
for (int i = 0; i < gpioExpanderNumSwitches; i++)
925924
{
926-
// Set all pins to low except GNSS RESET and PWRKILL
927-
if (i == gpioExpanderSwitch_GNSS_Reset || i == gpioExpanderSwitch_PowerFastOff)
925+
// Set all pins to low except GNSS RESET
926+
if (i == gpioExpanderSwitch_GNSS_Reset)
928927
gpioExpanderSwitches->digitalWrite(i, HIGH);
929928
else
930929
gpioExpanderSwitches->digitalWrite(i, LOW);

0 commit comments

Comments
 (0)