Skip to content

Commit

Permalink
Merge branch 'release/v1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
matteocarnelos committed Apr 16, 2022
2 parents 2ae247d + 1eeb70f commit ad87752
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions include/SailtrackModuleCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
class SailtrackModuleCallbacks {
public:

/**
* Called when the module is entering deep sleep mode. Use this callback to power off peripherals so to save
* power during deep sleep.
*/
virtual void onDeepSleepEnter() {}

/**
* Called when the connection to the WiFi network begins.
*/
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SailtrackModule",
"version": "1.4.1",
"version": "1.5.0",
"description": "Base library required for all SailTrack's ESP32-based modules.",
"keywords": "sailtrack, module, sailing",
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ lib_dir = ..
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
bblanchon/ArduinoJson@^6.18.2
monitor_speed = 115200
lib_deps = bblanchon/ArduinoJson@^6.18.2

[env:SimpleCounter]
src_filter = +<SimpleCounter>
1 change: 1 addition & 0 deletions src/SailtrackModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void SailtrackModule::beginWifi() {
if (WiFi.status() != WL_CONNECTED) {
ESP_LOGI(LOG_TAG, "Impossible to connect to '%s'", wifiConfig.ssid);
ESP_LOGI(LOG_TAG, "Going to deep sleep, goodnight...");
if (callbacks) callbacks->onDeepSleepEnter();
ESP.deepSleep(WIFI_SLEEP_DURATION_US);
}

Expand Down

0 comments on commit ad87752

Please sign in to comment.