Commit 3721575 1 parent 09cc349 commit 3721575 Copy full SHA for 3721575
File tree 2 files changed +30
-2
lines changed
2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,15 @@ void Tracker::enableIoCanPower(bool enable)
168
168
digitalWrite (MCP_CAN_PWR_EN_PIN, (_canPowerEnabled = enable) ? HIGH : LOW);
169
169
}
170
170
171
+ void Tracker::forceShutdownGnss ()
172
+ {
173
+ // Forceably shutdown the GNSS module
174
+ digitalWrite (UBLOX_RESETN_PIN, LOW);
175
+ delay (100 );
176
+ digitalWrite (UBLOX_RESETN_PIN, HIGH);
177
+ digitalWrite (UBLOX_PWR_EN_PIN, LOW);
178
+ }
179
+
171
180
int Tracker::initEsp32 ()
172
181
{
173
182
// ESP32 related GPIO
@@ -640,7 +649,7 @@ int Tracker::init()
640
649
641
650
shipping.init ();
642
651
shipping.regShutdownBeginCallback (std::bind (&Tracker::stop, this ));
643
- shipping.regShutdownIoCallback (std::bind (&Tracker::end , this ));
652
+ shipping.regShutdownIoCallback (std::bind (&Tracker::shutdown , this ));
644
653
shipping.regShutdownFinalCallback (
645
654
[this ](){
646
655
enableWatchdog (false );
@@ -752,6 +761,12 @@ int Tracker::end() {
752
761
return SYSTEM_ERROR_NONE;
753
762
}
754
763
764
+ int Tracker::shutdown () {
765
+ end ();
766
+ forceShutdownGnss ();
767
+ return SYSTEM_ERROR_NONE;
768
+ }
769
+
755
770
int Tracker::reset () {
756
771
stop ();
757
772
end ();
Original file line number Diff line number Diff line change @@ -314,12 +314,19 @@ class Tracker {
314
314
int stop ();
315
315
316
316
/* *
317
- * @brief Prepare tracker IO and peripherals for shutdown
317
+ * @brief Prepare tracker IO and peripherals for low power
318
318
*
319
319
* @retval SYSTEM_ERROR_NONE
320
320
*/
321
321
int end ();
322
322
323
+ /* *
324
+ * @brief Prepare tracker IO and peripherals for shutdown
325
+ *
326
+ * @retval SYSTEM_ERROR_NONE
327
+ */
328
+ int shutdown ();
329
+
323
330
/* *
324
331
* @brief Prepare tracker for reset and issue
325
332
*
@@ -388,6 +395,12 @@ class Tracker {
388
395
*/
389
396
void enableIoCanPower (bool enable);
390
397
398
+ /* *
399
+ * @brief Force the GNSS module into low power state
400
+ *
401
+ */
402
+ void forceShutdownGnss ();
403
+
391
404
/* *
392
405
* @brief Indicates whether device can accept commands through USB interface
393
406
*
You can’t perform that action at this time.
0 commit comments