Commit b9eb9a3
committed
Fix GPS UART consuming +8mA when disabled (nRF52)
When GPS is disabled (or not detected), Serial1.begin() was called
during initBasicGPS() but never ended. On nRF52840 the UARTE
peripheral stays active, drawing ~8mA through the peripheral itself
and current leaking via TX pin into the GPS module's ESD diodes.
- Call Serial1.end() in initBasicGPS() and stop_gps() to disable UART
- Re-initialize Serial1 in start_gps() so GPS can be toggled back on
- Gate _location->loop() behind gps_active to prevent accessing ended
Serial (and avoid pointless NMEA polling when GPS is off)
Fixes #16281 parent b1094c2 commit b9eb9a3
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| 586 | + | |
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
| |||
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
683 | 692 | | |
684 | 693 | | |
685 | 694 | | |
| |||
697 | 706 | | |
698 | 707 | | |
699 | 708 | | |
| 709 | + | |
700 | 710 | | |
701 | 711 | | |
702 | 712 | | |
| |||
707 | 717 | | |
708 | 718 | | |
709 | 719 | | |
710 | | - | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
711 | 723 | | |
712 | 724 | | |
713 | 725 | | |
| |||
0 commit comments