fix M1 GPS power control

This commit is contained in:
liquidraver committed 2026-06-17 14:15:45 +02:00
1 parent 8e6ceff8e3
commit 7b3716bd6a
2 files changed
+27 -9

No files matched your search

+11 -2
View File
@@ -749,9 +749,18 @@ static void gps_power_control(bool on, bool keep_vrtc = false)
#if HAS_GPS_RESET
/* Hold GPS in reset during power-off — matches Arduino sleep_gps()/stop_gps().
* Ensures chip sees RESET asserted when GPS_EN goes HIGH on next
* power-on, preventing uncontrolled startup before the reset pulse. */
* power-on, preventing uncontrolled startup before the reset pulse.
* Configure-on-first-use (mirrors the GPS_EN pin below): on a
* boot-with-GPS-off the power-on path never ran, so the pin isn't an
* output yet — gpio_pin_set_dt() alone would leave it floating instead
* of asserting reset. GPIO_OUTPUT_ACTIVE drives the active (asserted)
* level directly. */
if (gpio_is_ready_dt(&gps_reset_gpio)) {
gpio_pin_set_dt(&gps_reset_gpio, 1);
if (!gps_gpio_configured) {
gpio_pin_configure_dt(&gps_reset_gpio, GPIO_OUTPUT_ACTIVE);
} else {
gpio_pin_set_dt(&gps_reset_gpio, 1);
}
}
#endif
@@ -49,6 +49,7 @@
watchdog0 = &wdt0;
buzzer = &buzzer;
gps-enable = &gps_enable_pin;
gps-reset = &gps_reset_pin;
};
/* ---- LEDs (active-high, matches MeshCore LED_STATE_ON=HIGH) ---- */
@@ -106,13 +107,21 @@
regulator-boot-on;
};
/* LoRa radio power enable — must be HIGH before SX1262 can communicate */
lora_pwr_enable: lora-pwr-enable {
compatible = "regulator-fixed";
regulator-name = "lora-pwr-enable";
enable-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
startup-delay-us = <10000>;
/* GPS hardware reset (P1.05, active-LOW).
* This pin is the Air530Z RESET line — NOT a LoRa power rail (the SX1262
* is fed by pwr_enable P0.12 + tcxo_enable P0.21). Confirmed against
* Arduino MeshCore (PIN_GPS_RESET=37=P1.05) and Meshtastic (PIN_GPS_REINIT).
* Asserted (pin LOW) on standby/off to halt the module cleanly: the CASIC
* chip ignores UART/standby-pin sleep, so holding reset is the only reliable
* way to stop it drawing. Released (pin HIGH) after GPS_EN on wake.
* (Previously mislabelled lora_pwr_enable + regulator-boot-on, which pinned
* reset permanently de-asserted so the GPS never powered down.) */
gps_rst: gps-reset {
compatible = "gpio-leds";
gps_reset_pin: gps_reset {
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
label = "GPS Reset";
};
};
/* External TCXO power enable — SX1262 DIO3 provides reference voltage,