From 16a4a28a1c356d979361e0d2c1407fa5c3406021 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Wed, 13 Nov 2024 18:59:42 +0100
Subject: [PATCH 01/55] chore: Update version
---
include/hal.hpp | 2 +-
lib/battery/battery.cpp | 2 +-
lib/battery/battery.hpp | 2 +-
lib/bme/bme.cpp | 2 +-
lib/bme/bme.hpp | 2 +-
lib/cli/utils.h | 2 +-
lib/compass/compass.cpp | 2 +-
lib/compass/compass.hpp | 2 +-
lib/gps/gps.cpp | 2 +-
lib/gps/gps.hpp | 2 +-
lib/gps/timezone.hpp | 2 +-
lib/gpx/src/addWaypoint.cpp | 2 +-
lib/gpx/src/addWaypoint.hpp | 2 +-
lib/gpx/src/deleteWaypoint.cpp | 2 +-
lib/gpx/src/deleteWaypoint.hpp | 2 +-
lib/gpx/src/editWaypoint.cpp | 2 +-
lib/gpx/src/editWaypoint.hpp | 2 +-
lib/gpx/src/globalGpxDef.h | 2 +-
lib/gpx/src/loadWaypoint.cpp | 2 +-
lib/gpx/src/loadWaypoint.hpp | 2 +-
lib/gui/src/buttonBar.cpp | 2 +-
lib/gui/src/buttonBar.hpp | 2 +-
lib/gui/src/deviceSettingsScr.cpp | 2 +-
lib/gui/src/deviceSettingsScr.hpp | 2 +-
lib/gui/src/globalGuiDef.h | 2 +-
lib/gui/src/mainScr.cpp | 2 +-
lib/gui/src/mainScr.hpp | 2 +-
lib/gui/src/mapSettingsScr.cpp | 2 +-
lib/gui/src/mapSettingsScr.hpp | 2 +-
lib/gui/src/navScr.cpp | 2 +-
lib/gui/src/navScr.hpp | 2 +-
lib/gui/src/notifyBar.cpp | 2 +-
lib/gui/src/notifyBar.hpp | 2 +-
lib/gui/src/satInfoScr.cpp | 2 +-
lib/gui/src/satInfoScr.hpp | 2 +-
lib/gui/src/searchSatScr.cpp | 2 +-
lib/gui/src/searchSatScr.hpp | 2 +-
lib/gui/src/settingsScr.cpp | 2 +-
lib/gui/src/settingsScr.hpp | 2 +-
lib/gui/src/splashScr.cpp | 2 +-
lib/gui/src/splashScr.hpp | 2 +-
lib/gui/src/waypointListScr.cpp | 2 +-
lib/gui/src/waypointListScr.hpp | 2 +-
lib/gui/src/waypointScr.cpp | 2 +-
lib/gui/src/waypointScr.hpp | 2 +-
lib/gui/src/widgets.cpp | 2 +-
lib/gui/src/widgets.hpp | 2 +-
lib/lvgl/src/lvglFuncs.cpp | 2 +-
lib/lvgl/src/lvglFuncs.hpp | 2 +-
lib/lvgl/src/lvglSetup.cpp | 2 +-
lib/lvgl/src/lvglSetup.hpp | 2 +-
lib/maps/src/globalMapsDef.h | 2 +-
lib/maps/src/mapsDrawFunc.h | 2 +-
lib/maps/src/renderMaps.cpp | 2 +-
lib/maps/src/renderMaps.hpp | 2 +-
lib/maps/src/vectorMaps.cpp | 2 +-
lib/maps/src/vectorMaps.hpp | 2 +-
lib/panel/ICENAV_BOARD.hpp | 2 +-
lib/panel/ILI9341_XPT2046_SPI.hpp | 2 +-
lib/panel/ILI9488_FT5x06_16B.hpp | 2 +-
lib/panel/ILI9488_FT5x06_SPI.hpp | 2 +-
lib/panel/ILI9488_NOTOUCH_8B.hpp | 2 +-
lib/panel/ILI9488_XPT2046_SPI.hpp | 2 +-
lib/panel/LILYGO_TDECK.hpp | 2 +-
lib/power/power.cpp | 2 +-
lib/power/power.hpp | 2 +-
lib/settings/settings.cpp | 2 +-
lib/settings/settings.hpp | 2 +-
lib/storage/storage.cpp | 2 +-
lib/storage/storage.hpp | 2 +-
lib/tasks/tasks.cpp | 2 +-
lib/tasks/tasks.hpp | 2 +-
lib/tft/tft.cpp | 2 +-
lib/tft/tft.hpp | 2 +-
lib/utils/src/gpsMath.cpp | 2 +-
lib/utils/src/gpsMath.hpp | 2 +-
lib/webfile/src/webpage.h | 2 +-
lib/webfile/src/webserver.h | 2 +-
platformio.ini | 4 ++--
src/main.cpp | 4 ++--
80 files changed, 82 insertions(+), 82 deletions(-)
diff --git a/include/hal.hpp b/include/hal.hpp
index 551f118b..a45074a8 100644
--- a/include/hal.hpp
+++ b/include/hal.hpp
@@ -2,7 +2,7 @@
* @file hal.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Boards Pin definitions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/battery/battery.cpp b/lib/battery/battery.cpp
index 80ae3446..33010b99 100644
--- a/lib/battery/battery.cpp
+++ b/lib/battery/battery.cpp
@@ -2,7 +2,7 @@
* @file battery.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Battery monitor definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/battery/battery.hpp b/lib/battery/battery.hpp
index b85ed78d..b972fe63 100644
--- a/lib/battery/battery.hpp
+++ b/lib/battery/battery.hpp
@@ -2,7 +2,7 @@
* @file battery.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Battery monitor definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/bme/bme.cpp b/lib/bme/bme.cpp
index 59e72dad..5df81cc6 100644
--- a/lib/bme/bme.cpp
+++ b/lib/bme/bme.cpp
@@ -2,7 +2,7 @@
* @file bme.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief BME280 Sensor functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/bme/bme.hpp b/lib/bme/bme.hpp
index d9b23178..c4d3a0e2 100644
--- a/lib/bme/bme.hpp
+++ b/lib/bme/bme.hpp
@@ -2,7 +2,7 @@
* @file bme.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief BME280 Sensor functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/cli/utils.h b/lib/cli/utils.h
index 4e327594..51f0043f 100644
--- a/lib/cli/utils.h
+++ b/lib/cli/utils.h
@@ -2,7 +2,7 @@
* @file utils.h
* @author @Hpsaturn
* @brief Network CLI and custom internal commands
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/compass/compass.cpp b/lib/compass/compass.cpp
index 73c55089..43f83d40 100644
--- a/lib/compass/compass.cpp
+++ b/lib/compass/compass.cpp
@@ -2,7 +2,7 @@
* @file compass.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Compass definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/compass/compass.hpp b/lib/compass/compass.hpp
index cf08bc33..f9b56c03 100644
--- a/lib/compass/compass.hpp
+++ b/lib/compass/compass.hpp
@@ -2,7 +2,7 @@
* @file compass.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Compass definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gps/gps.cpp b/lib/gps/gps.cpp
index 60c2284f..9a8f1f90 100644
--- a/lib/gps/gps.cpp
+++ b/lib/gps/gps.cpp
@@ -2,7 +2,7 @@
* @file gps.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief GPS definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gps/gps.hpp b/lib/gps/gps.hpp
index 88959c7c..f7c1a51c 100644
--- a/lib/gps/gps.hpp
+++ b/lib/gps/gps.hpp
@@ -2,7 +2,7 @@
* @file gps.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief GPS definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gps/timezone.hpp b/lib/gps/timezone.hpp
index 99d2d21e..2b9a6709 100644
--- a/lib/gps/timezone.hpp
+++ b/lib/gps/timezone.hpp
@@ -2,7 +2,7 @@
* @file timezone.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Time zone adjust
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/addWaypoint.cpp b/lib/gpx/src/addWaypoint.cpp
index 2b05770a..4e9a5d48 100644
--- a/lib/gpx/src/addWaypoint.cpp
+++ b/lib/gpx/src/addWaypoint.cpp
@@ -2,7 +2,7 @@
* @file addWaypoint.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Add Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/addWaypoint.hpp b/lib/gpx/src/addWaypoint.hpp
index 809571b0..9a01b9cd 100644
--- a/lib/gpx/src/addWaypoint.hpp
+++ b/lib/gpx/src/addWaypoint.hpp
@@ -2,7 +2,7 @@
* @file addWaypoint.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Add Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/deleteWaypoint.cpp b/lib/gpx/src/deleteWaypoint.cpp
index e453453a..ce9175f4 100644
--- a/lib/gpx/src/deleteWaypoint.cpp
+++ b/lib/gpx/src/deleteWaypoint.cpp
@@ -2,7 +2,7 @@
* @file deleteWaypoint.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Delete Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/deleteWaypoint.hpp b/lib/gpx/src/deleteWaypoint.hpp
index d21ad13e..1111f5a0 100644
--- a/lib/gpx/src/deleteWaypoint.hpp
+++ b/lib/gpx/src/deleteWaypoint.hpp
@@ -2,7 +2,7 @@
* @file deleteWaypoint.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Delete Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/editWaypoint.cpp b/lib/gpx/src/editWaypoint.cpp
index e3651712..155689ed 100644
--- a/lib/gpx/src/editWaypoint.cpp
+++ b/lib/gpx/src/editWaypoint.cpp
@@ -2,7 +2,7 @@
* @file editWaypoint.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Edit Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/editWaypoint.hpp b/lib/gpx/src/editWaypoint.hpp
index fe4026e0..281742e0 100644
--- a/lib/gpx/src/editWaypoint.hpp
+++ b/lib/gpx/src/editWaypoint.hpp
@@ -2,7 +2,7 @@
* @file editWaypoint.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Edit Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/globalGpxDef.h b/lib/gpx/src/globalGpxDef.h
index 04741142..5f43c37e 100644
--- a/lib/gpx/src/globalGpxDef.h
+++ b/lib/gpx/src/globalGpxDef.h
@@ -2,7 +2,7 @@
* @file globalGpxDef.h
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Global GPX Variables
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/loadWaypoint.cpp b/lib/gpx/src/loadWaypoint.cpp
index 2a8b4802..1152b58b 100644
--- a/lib/gpx/src/loadWaypoint.cpp
+++ b/lib/gpx/src/loadWaypoint.cpp
@@ -2,7 +2,7 @@
* @file loadWaypoint.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Load Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gpx/src/loadWaypoint.hpp b/lib/gpx/src/loadWaypoint.hpp
index 678dcf69..f27460b5 100644
--- a/lib/gpx/src/loadWaypoint.hpp
+++ b/lib/gpx/src/loadWaypoint.hpp
@@ -2,7 +2,7 @@
* @file loadWaypoint.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Load Waypoint functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/buttonBar.cpp b/lib/gui/src/buttonBar.cpp
index 4c22c2b1..46aa87d1 100644
--- a/lib/gui/src/buttonBar.cpp
+++ b/lib/gui/src/buttonBar.cpp
@@ -2,7 +2,7 @@
* @file buttonBar.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Button Bar
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/buttonBar.hpp b/lib/gui/src/buttonBar.hpp
index 04ed9a60..24f9a1db 100644
--- a/lib/gui/src/buttonBar.hpp
+++ b/lib/gui/src/buttonBar.hpp
@@ -2,7 +2,7 @@
* @file buttonBar.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Button Bar
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/deviceSettingsScr.cpp b/lib/gui/src/deviceSettingsScr.cpp
index 52f428e2..00c2b7c3 100644
--- a/lib/gui/src/deviceSettingsScr.cpp
+++ b/lib/gui/src/deviceSettingsScr.cpp
@@ -2,7 +2,7 @@
* @file deviceSettingsScr.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Device Settings Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/deviceSettingsScr.hpp b/lib/gui/src/deviceSettingsScr.hpp
index 5ce3c2d6..248d6147 100644
--- a/lib/gui/src/deviceSettingsScr.hpp
+++ b/lib/gui/src/deviceSettingsScr.hpp
@@ -2,7 +2,7 @@
* @file deviceSettingsScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Device Settings Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/globalGuiDef.h b/lib/gui/src/globalGuiDef.h
index 23d977f9..92a12d53 100644
--- a/lib/gui/src/globalGuiDef.h
+++ b/lib/gui/src/globalGuiDef.h
@@ -1,7 +1,7 @@
/**
* @file globalGuiDef.h
* @brief Global GUI Variables
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/mainScr.cpp b/lib/gui/src/mainScr.cpp
index 4ebfda2f..1627d2d1 100644
--- a/lib/gui/src/mainScr.cpp
+++ b/lib/gui/src/mainScr.cpp
@@ -2,7 +2,7 @@
* @file mainScr.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Main Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/mainScr.hpp b/lib/gui/src/mainScr.hpp
index b97532fe..4d8c9f2e 100644
--- a/lib/gui/src/mainScr.hpp
+++ b/lib/gui/src/mainScr.hpp
@@ -2,7 +2,7 @@
* @file mainScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Main Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/mapSettingsScr.cpp b/lib/gui/src/mapSettingsScr.cpp
index d0e52f66..110ff6a2 100644
--- a/lib/gui/src/mapSettingsScr.cpp
+++ b/lib/gui/src/mapSettingsScr.cpp
@@ -2,7 +2,7 @@
* @file mapSettingsScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Map Settings screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/mapSettingsScr.hpp b/lib/gui/src/mapSettingsScr.hpp
index 2572245d..e09a6eac 100644
--- a/lib/gui/src/mapSettingsScr.hpp
+++ b/lib/gui/src/mapSettingsScr.hpp
@@ -2,7 +2,7 @@
* @file mapSettingsScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Map Settings screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/navScr.cpp b/lib/gui/src/navScr.cpp
index ab96fc07..3e8754e6 100644
--- a/lib/gui/src/navScr.cpp
+++ b/lib/gui/src/navScr.cpp
@@ -2,7 +2,7 @@
* @file navScr.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Navigation screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/navScr.hpp b/lib/gui/src/navScr.hpp
index a8bdd982..b53b8f69 100644
--- a/lib/gui/src/navScr.hpp
+++ b/lib/gui/src/navScr.hpp
@@ -2,7 +2,7 @@
* @file navScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Navigation screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/notifyBar.cpp b/lib/gui/src/notifyBar.cpp
index 056d6cfc..cbcebce9 100644
--- a/lib/gui/src/notifyBar.cpp
+++ b/lib/gui/src/notifyBar.cpp
@@ -2,7 +2,7 @@
* @file notifyBar.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Notify Bar Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/notifyBar.hpp b/lib/gui/src/notifyBar.hpp
index fdf5c311..470bb14d 100644
--- a/lib/gui/src/notifyBar.hpp
+++ b/lib/gui/src/notifyBar.hpp
@@ -2,7 +2,7 @@
* @file notifyBar.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Notify Bar Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/satInfoScr.cpp b/lib/gui/src/satInfoScr.cpp
index b543e37a..c418a9b0 100644
--- a/lib/gui/src/satInfoScr.cpp
+++ b/lib/gui/src/satInfoScr.cpp
@@ -2,7 +2,7 @@
* @file satInfoScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Satellite info screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/satInfoScr.hpp b/lib/gui/src/satInfoScr.hpp
index 659ece63..e66c44e4 100644
--- a/lib/gui/src/satInfoScr.hpp
+++ b/lib/gui/src/satInfoScr.hpp
@@ -2,7 +2,7 @@
* @file satInfoScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Satellite info screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/searchSatScr.cpp b/lib/gui/src/searchSatScr.cpp
index 44fee130..87bdb7b3 100644
--- a/lib/gui/src/searchSatScr.cpp
+++ b/lib/gui/src/searchSatScr.cpp
@@ -2,7 +2,7 @@
* @file searchSatScr.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - GPS satellite search screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/searchSatScr.hpp b/lib/gui/src/searchSatScr.hpp
index d2929e64..489b8335 100644
--- a/lib/gui/src/searchSatScr.hpp
+++ b/lib/gui/src/searchSatScr.hpp
@@ -2,7 +2,7 @@
* @file searchSatScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - GPS satellite search screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/settingsScr.cpp b/lib/gui/src/settingsScr.cpp
index 3b351691..37fb9ae0 100644
--- a/lib/gui/src/settingsScr.cpp
+++ b/lib/gui/src/settingsScr.cpp
@@ -2,7 +2,7 @@
* @file settingsScr.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Settings Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/settingsScr.hpp b/lib/gui/src/settingsScr.hpp
index cf7f32e7..40ee59b7 100644
--- a/lib/gui/src/settingsScr.hpp
+++ b/lib/gui/src/settingsScr.hpp
@@ -2,7 +2,7 @@
* @file settingsScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Settings Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/splashScr.cpp b/lib/gui/src/splashScr.cpp
index 136cea6b..01a18a7d 100644
--- a/lib/gui/src/splashScr.cpp
+++ b/lib/gui/src/splashScr.cpp
@@ -2,7 +2,7 @@
* @file splashScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Splash screen - NOT LVGL
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/splashScr.hpp b/lib/gui/src/splashScr.hpp
index 3d272514..b1519785 100644
--- a/lib/gui/src/splashScr.hpp
+++ b/lib/gui/src/splashScr.hpp
@@ -2,7 +2,7 @@
* @file splashScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Splash screen - NOT LVGL
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/waypointListScr.cpp b/lib/gui/src/waypointListScr.cpp
index 22a00c9d..b726e052 100644
--- a/lib/gui/src/waypointListScr.cpp
+++ b/lib/gui/src/waypointListScr.cpp
@@ -2,7 +2,7 @@
* @file waypointListScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Waypoint list screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/waypointListScr.hpp b/lib/gui/src/waypointListScr.hpp
index c312e8a6..31f566ae 100644
--- a/lib/gui/src/waypointListScr.hpp
+++ b/lib/gui/src/waypointListScr.hpp
@@ -2,7 +2,7 @@
* @file waypointListScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Waypoint list screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/waypointScr.cpp b/lib/gui/src/waypointScr.cpp
index 23d73094..425bfcfd 100644
--- a/lib/gui/src/waypointScr.cpp
+++ b/lib/gui/src/waypointScr.cpp
@@ -2,7 +2,7 @@
* @file waypointScr.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Waypoint Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/waypointScr.hpp b/lib/gui/src/waypointScr.hpp
index 18db45c6..111f95c8 100644
--- a/lib/gui/src/waypointScr.hpp
+++ b/lib/gui/src/waypointScr.hpp
@@ -2,7 +2,7 @@
* @file waypointScr.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Add Waypoint Screen
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/widgets.cpp b/lib/gui/src/widgets.cpp
index 12934720..a1885e78 100644
--- a/lib/gui/src/widgets.cpp
+++ b/lib/gui/src/widgets.cpp
@@ -2,7 +2,7 @@
* @file widgets.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Widgets
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/gui/src/widgets.hpp b/lib/gui/src/widgets.hpp
index f02c241d..b3e7bfc3 100644
--- a/lib/gui/src/widgets.hpp
+++ b/lib/gui/src/widgets.hpp
@@ -2,7 +2,7 @@
* @file widgets.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL - Widgets
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/lvgl/src/lvglFuncs.cpp b/lib/lvgl/src/lvglFuncs.cpp
index c98b40e2..59196ff2 100644
--- a/lib/lvgl/src/lvglFuncs.cpp
+++ b/lib/lvgl/src/lvglFuncs.cpp
@@ -2,7 +2,7 @@
* @file lvglFuncs.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL custom functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/lvgl/src/lvglFuncs.hpp b/lib/lvgl/src/lvglFuncs.hpp
index 73f29959..1f8cf7b5 100644
--- a/lib/lvgl/src/lvglFuncs.hpp
+++ b/lib/lvgl/src/lvglFuncs.hpp
@@ -2,7 +2,7 @@
* @file lvglFuncs.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL custom functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/lvgl/src/lvglSetup.cpp b/lib/lvgl/src/lvglSetup.cpp
index b5b623de..45b9af48 100644
--- a/lib/lvgl/src/lvglSetup.cpp
+++ b/lib/lvgl/src/lvglSetup.cpp
@@ -2,7 +2,7 @@
* @file lvglSetup.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL Screen implementation
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/lvgl/src/lvglSetup.hpp b/lib/lvgl/src/lvglSetup.hpp
index c0588183..f38c237e 100644
--- a/lib/lvgl/src/lvglSetup.hpp
+++ b/lib/lvgl/src/lvglSetup.hpp
@@ -2,7 +2,7 @@
* @file lvglSetup.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LVGL Screen implementation
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/maps/src/globalMapsDef.h b/lib/maps/src/globalMapsDef.h
index 18151ba6..92f4a19f 100644
--- a/lib/maps/src/globalMapsDef.h
+++ b/lib/maps/src/globalMapsDef.h
@@ -1,7 +1,7 @@
/**
* @file globalMapsDef.h
* @brief Global Maps Variables
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/maps/src/mapsDrawFunc.h b/lib/maps/src/mapsDrawFunc.h
index 0f2709bb..fffdff20 100644
--- a/lib/maps/src/mapsDrawFunc.h
+++ b/lib/maps/src/mapsDrawFunc.h
@@ -1,7 +1,7 @@
/**
* @file mapsDrawFunc.h
* @brief Extra Draw functions for maps
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/maps/src/renderMaps.cpp b/lib/maps/src/renderMaps.cpp
index c71dadc1..ca28d0dc 100644
--- a/lib/maps/src/renderMaps.cpp
+++ b/lib/maps/src/renderMaps.cpp
@@ -2,7 +2,7 @@
* @file renderMaps.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Render maps draw functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/maps/src/renderMaps.hpp b/lib/maps/src/renderMaps.hpp
index 0355c7c0..677ed4a7 100644
--- a/lib/maps/src/renderMaps.hpp
+++ b/lib/maps/src/renderMaps.hpp
@@ -2,7 +2,7 @@
* @file renderMaps.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Render maps draw functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/maps/src/vectorMaps.cpp b/lib/maps/src/vectorMaps.cpp
index a162658c..85f1de10 100644
--- a/lib/maps/src/vectorMaps.cpp
+++ b/lib/maps/src/vectorMaps.cpp
@@ -2,7 +2,7 @@
* @file vectorMaps.cpp
* @author @aresta - https://github.com/aresta/ESP32_GPS
* @brief Vector maps draw functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/maps/src/vectorMaps.hpp b/lib/maps/src/vectorMaps.hpp
index bbef50d4..a17d78ab 100644
--- a/lib/maps/src/vectorMaps.hpp
+++ b/lib/maps/src/vectorMaps.hpp
@@ -2,7 +2,7 @@
* @file vectorMaps.hpp
* @author @aresta - https://github.com/aresta/ESP32_GPS
* @brief Vector maps draw functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/panel/ICENAV_BOARD.hpp b/lib/panel/ICENAV_BOARD.hpp
index a70a8a04..04790821 100644
--- a/lib/panel/ICENAV_BOARD.hpp
+++ b/lib/panel/ICENAV_BOARD.hpp
@@ -2,7 +2,7 @@
* @file ICENAV_BOARD.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LOVYANGFX TFT driver for IceNaV board
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/panel/ILI9341_XPT2046_SPI.hpp b/lib/panel/ILI9341_XPT2046_SPI.hpp
index 43d3c2c0..97fc0003 100644
--- a/lib/panel/ILI9341_XPT2046_SPI.hpp
+++ b/lib/panel/ILI9341_XPT2046_SPI.hpp
@@ -2,7 +2,7 @@
// * @file ILI9341_XPT2046_SPI.hpp
// * @author Jordi Gauchía (jgauchia@gmx.es)
// * @brief LOVYANGFX TFT driver for ILI9341 SPI With XPT2046 Touch controller
-// * @version 0.1.8
+// * @version 0.1.9_alpha
// * @date 2024-11
// */
diff --git a/lib/panel/ILI9488_FT5x06_16B.hpp b/lib/panel/ILI9488_FT5x06_16B.hpp
index 03d17c0e..5c886792 100644
--- a/lib/panel/ILI9488_FT5x06_16B.hpp
+++ b/lib/panel/ILI9488_FT5x06_16B.hpp
@@ -2,7 +2,7 @@
* @file ILI9488_FT5x06_16B.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LOVYANGFX TFT driver for ILI9488 16 Bits parallel With FT5x06 Touch controller
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/panel/ILI9488_FT5x06_SPI.hpp b/lib/panel/ILI9488_FT5x06_SPI.hpp
index 0828819d..00d37723 100644
--- a/lib/panel/ILI9488_FT5x06_SPI.hpp
+++ b/lib/panel/ILI9488_FT5x06_SPI.hpp
@@ -2,7 +2,7 @@
* @file ILI9488_XPT2046_SPI.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LOVYANGFX TFT driver for ILI9488 SPI With XPT2046 Touch controller
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/panel/ILI9488_NOTOUCH_8B.hpp b/lib/panel/ILI9488_NOTOUCH_8B.hpp
index 8dc3efc8..9ca36f08 100644
--- a/lib/panel/ILI9488_NOTOUCH_8B.hpp
+++ b/lib/panel/ILI9488_NOTOUCH_8B.hpp
@@ -2,7 +2,7 @@
* @file ILI9488_NOTOUCH_8B.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LOVYANGFX TFT driver for ILI9488 8 Bits parallel Without Touch controller
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/panel/ILI9488_XPT2046_SPI.hpp b/lib/panel/ILI9488_XPT2046_SPI.hpp
index 5535bba2..c43300e8 100644
--- a/lib/panel/ILI9488_XPT2046_SPI.hpp
+++ b/lib/panel/ILI9488_XPT2046_SPI.hpp
@@ -2,7 +2,7 @@
* @file ILI9488_XPT2046_SPI.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief LOVYANGFX TFT driver for ILI9488 SPI With XPT2046 Touch controller
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/panel/LILYGO_TDECK.hpp b/lib/panel/LILYGO_TDECK.hpp
index effad505..9e1a5f09 100644
--- a/lib/panel/LILYGO_TDECK.hpp
+++ b/lib/panel/LILYGO_TDECK.hpp
@@ -2,7 +2,7 @@
* @file LILYGO_TDECK.hpp
* @author Jordi Gauchía (jgauchia@gmx.es) and Antonio Vanegas @Hpsturn
* @brief LOVYANGFX TFT driver for ST7789 SPI With GT911 Touch controller
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/power/power.cpp b/lib/power/power.cpp
index 6641aac6..c5a51c91 100644
--- a/lib/power/power.cpp
+++ b/lib/power/power.cpp
@@ -2,7 +2,7 @@
* @file power.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief ESP32 Power Management functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/power/power.hpp b/lib/power/power.hpp
index 6ad300aa..78192ab7 100644
--- a/lib/power/power.hpp
+++ b/lib/power/power.hpp
@@ -2,7 +2,7 @@
* @file power.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief ESP32 Power Management functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/settings/settings.cpp b/lib/settings/settings.cpp
index 142625b7..2adfeea2 100644
--- a/lib/settings/settings.cpp
+++ b/lib/settings/settings.cpp
@@ -2,7 +2,7 @@
* @file settings.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Settings functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/settings/settings.hpp b/lib/settings/settings.hpp
index 40df22e1..f4b64b36 100644
--- a/lib/settings/settings.hpp
+++ b/lib/settings/settings.hpp
@@ -2,7 +2,7 @@
* @file settings.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Settings functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/storage/storage.cpp b/lib/storage/storage.cpp
index 5530f5ab..8a26730e 100644
--- a/lib/storage/storage.cpp
+++ b/lib/storage/storage.cpp
@@ -2,7 +2,7 @@
* @file storage.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Storage definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/storage/storage.hpp b/lib/storage/storage.hpp
index 166ba4d6..ec754c21 100644
--- a/lib/storage/storage.hpp
+++ b/lib/storage/storage.hpp
@@ -2,7 +2,7 @@
* @file storage.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Storage definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/tasks/tasks.cpp b/lib/tasks/tasks.cpp
index 8ecf3e8b..fe654cc3 100644
--- a/lib/tasks/tasks.cpp
+++ b/lib/tasks/tasks.cpp
@@ -2,7 +2,7 @@
* @file tasks.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Core Tasks functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/tasks/tasks.hpp b/lib/tasks/tasks.hpp
index 2351aeac..0283d7d0 100644
--- a/lib/tasks/tasks.hpp
+++ b/lib/tasks/tasks.hpp
@@ -2,7 +2,7 @@
* @file tasks.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Core Tasks functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/tft/tft.cpp b/lib/tft/tft.cpp
index b01896fa..9df780ca 100644
--- a/lib/tft/tft.cpp
+++ b/lib/tft/tft.cpp
@@ -2,7 +2,7 @@
* @file tft.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief TFT definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/tft/tft.hpp b/lib/tft/tft.hpp
index 9b9ab578..e94c0672 100644
--- a/lib/tft/tft.hpp
+++ b/lib/tft/tft.hpp
@@ -2,7 +2,7 @@
* @file tft.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief TFT definition and functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/utils/src/gpsMath.cpp b/lib/utils/src/gpsMath.cpp
index d4a3248c..b168ec5a 100644
--- a/lib/utils/src/gpsMath.cpp
+++ b/lib/utils/src/gpsMath.cpp
@@ -2,7 +2,7 @@
* @file gpsMath.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Math and various functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/utils/src/gpsMath.hpp b/lib/utils/src/gpsMath.hpp
index a87d9eda..e5242300 100644
--- a/lib/utils/src/gpsMath.hpp
+++ b/lib/utils/src/gpsMath.hpp
@@ -2,7 +2,7 @@
* @file gpsMath.hpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Math and various functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/webfile/src/webpage.h b/lib/webfile/src/webpage.h
index 373c703e..99cd6a6c 100644
--- a/lib/webfile/src/webpage.h
+++ b/lib/webfile/src/webpage.h
@@ -2,7 +2,7 @@
* @file webpage.h
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Web file server page
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/lib/webfile/src/webserver.h b/lib/webfile/src/webserver.h
index 11d88d56..600236b8 100644
--- a/lib/webfile/src/webserver.h
+++ b/lib/webfile/src/webserver.h
@@ -2,7 +2,7 @@
* @file webserver.h
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief Web file server functions
- * @version 0.1.8
+ * @version 0.1.9_alpha
* @date 2024-11
*/
diff --git a/platformio.ini b/platformio.ini
index 7587d769..7fe1ea36 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -15,7 +15,7 @@ default_envs = ICENAV_BOARD
[common]
platform = espressif32
framework = arduino
-version = 0.1.8
+version = 0.1.9_alpha
revision = 82
monitor_speed = 115200
;monitor_rts = 0
@@ -25,7 +25,7 @@ monitor_filters =
extra_scripts = pre:prebuild.py
build_flags =
-D LV_CONF_PATH="${PROJECT_DIR}/lib/lvgl/lv_conf.h"
- -D CORE_DEBUG_LEVEL=0
+ -D CORE_DEBUG_LEVEL=5
-D USE_LINE_BUFFER=1
-D DISABLE_RADIO=1
-D BAUDRATE=115200
diff --git a/src/main.cpp b/src/main.cpp
index eeaff483..40b743f6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,8 +2,8 @@
* @file main.cpp
* @author Jordi Gauchía (jgauchia@gmx.es)
* @brief ESP32 GPS Navigation main code
- * @version 0.1.8
- * @date 2024-08
+ * @version 0.1.9_alpha
+ * @date 2024-11
*/
#include
From 4b76d942fac6aae3a54c3387398312acf566a6a5 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Wed, 13 Nov 2024 20:14:08 +0100
Subject: [PATCH 02/55] build: Update libraries
---
README.md | 8 ++++----
platformio.ini | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index d8ce1e5d..2d9180b8 100644
--- a/README.md
+++ b/README.md
@@ -107,10 +107,10 @@ To do this, simply include the following Build Flag in the required env in platf
|:------------|:--------------|:-----------------------------------|:-------------------------------------------------------|
| | 🔋 Batt. Monitor | ```-DADC1``` or ```-DADC2```
```-DBATT_PIN=ADCn_CHANNEL_x``` | |
| AT6558D | 🛰️ GPS | ```-DAT6558D_GPS``` | |
-| HMC5883L | 🧭 Compass | ```-DHMC5883L``` | ```dfrobot/DFRobot_QMC5883@^1.0.0``` |
-| QMC5883 | 🧭 Compass | ```-DQMC5883``` | ```dfrobot/DFRobot_QMC5883@^1.0.0``` |
-| MPU9250 | 🧭 IMU (Compass) | ```-DIMU_MPU9250``` | ```bolderflight/Bolder Flight Systems MPU9250@^1.0.2```|
-| BME280 | 🌡️ Temp
☁️ Pres
💧 Hum | ```-DBME280``` | ```adafruit/Adafruit Unified Sensor@^1.1.14```
```adafruit/Adafruit BusIO@^1.16.1```
```adafruit/Adafruit BME280 Library@^2.2.4```|
+| HMC5883L | 🧭 Compass | ```-DHMC5883L``` | ```dfrobot/DFRobot_QMC5883@1.0.0``` |
+| QMC5883 | 🧭 Compass | ```-DQMC5883``` | ```dfrobot/DFRobot_QMC5883@1.0.0``` |
+| MPU9250 | 🧭 IMU (Compass) | ```-DIMU_MPU9250``` | ```bolderflight/Bolder Flight Systems MPU9250@1.0.2```|
+| BME280 | 🌡️ Temp
☁️ Pres
💧 Hum | ```-DBME280``` | ```adafruit/Adafruit Unified Sensor@1.1.14```
```adafruit/Adafruit BusIO@1.16.2```
```adafruit/Adafruit BME280 Library@2.2.4```|
[^1]: For ELECROW board UART port is shared with USB connection, GPS pinout are mapped to IO19 and IO40 (Analog and Digital Port). If CLI isn't used is possible to attach GPS module to UART port but for upload the firmware (change pinout at **hal.hpp**), the module should be disconnected.
[^2]: See **hal.hpp** for pinouts configuration
diff --git a/platformio.ini b/platformio.ini
index 7fe1ea36..b9828ab5 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -41,13 +41,13 @@ build_flags =
lib_deps =
; slashdevin/NeoGPS@4.2.9
https://github.com/jgauchia/NeoGPS.git#43c4766
- lvgl/lvgl@9.2.0
+ lvgl/lvgl@9.2.2
lovyan03/LovyanGFX@1.1.16
bblanchon/StreamUtils@1.9.0
- hpsaturn/EasyPreferences@0.1.2
- hpsaturn/ESP32 Wifi CLI@0.3.2
+ hpsaturn/EasyPreferences@0.1.3
+ hpsaturn/ESP32 Wifi CLI@0.3.3
kubafilinger/AsyncTCP@1.1.1
- esphome/ESPAsyncWebServer-esphome@2.1.0
+ esphome/ESPAsyncWebServer-esphome@3.3.0
[esp32_common]
extends = common
@@ -58,7 +58,7 @@ board = icenav-esp32-s3
lib_deps =
${common.lib_deps}
adafruit/Adafruit Unified Sensor@1.1.14
- adafruit/Adafruit BusIO@1.16.1
+ adafruit/Adafruit BusIO@1.16.2
adafruit/Adafruit BME280 Library@2.2.4
dfrobot/DFRobot_QMC5883@1.0.0
build_flags =
@@ -83,7 +83,7 @@ board = elecrow-esp32-s3-n16r8v-terminal
lib_deps =
${common.lib_deps}
; adafruit/Adafruit Unified Sensor@1.1.14
-; adafruit/Adafruit BusIO@1.16.1
+; adafruit/Adafruit BusIO@1.16.2
; adafruit/Adafruit BME280 Library@2.2.4
; dfrobot/DFRobot_QMC5883@1.0.0
build_flags =
@@ -122,7 +122,7 @@ board_build.partitions = default_16MB.csv
lib_deps =
${common.lib_deps}
; adafruit/Adafruit Unified Sensor@1.1.14
-; adafruit/Adafruit BusIO@1.16.1
+; adafruit/Adafruit BusIO@1.16.2
; adafruit/Adafruit BME280 Library@2.2.4
; dfrobot/DFRobot_QMC5883@1.0.0
build_flags =
@@ -143,7 +143,7 @@ board_build.partitions = default_16MB.csv
lib_deps =
${common.lib_deps}
; adafruit/Adafruit Unified Sensor@1.1.14
-; adafruit/Adafruit BusIO@1.16.1
+; adafruit/Adafruit BusIO@1.16.2
; adafruit/Adafruit BME280 Library@2.2.4
; dfrobot/DFRobot_QMC5883@1.0.0
build_flags =
From 487235911d686431e37cb9ecd7ed4d9a35495153 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Wed, 13 Nov 2024 20:40:06 +0100
Subject: [PATCH 03/55] fix(gps): Maintain last fixed coordinates after fix
---
lib/gps/gps.cpp | 5 +++--
src/main.cpp | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/gps/gps.cpp b/lib/gps/gps.cpp
index 9a8f1f90..74fcdd0d 100644
--- a/lib/gps/gps.cpp
+++ b/lib/gps/gps.cpp
@@ -151,8 +151,9 @@ void getGPSData()
gpsData.speed = (uint16_t)fix.speed_kph();
// Latitude and Longitude
- gpsData.latitude = getLat();
- gpsData.longitude = getLon();
+ if (fix.valid.location)
+ gpsData.latitude = getLat();
+ gpsData.longitude = getLon();
// Heading
if (fix.valid.heading)
diff --git a/src/main.cpp b/src/main.cpp
index 40b743f6..ba693aea 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -104,6 +104,9 @@ void setup()
mapTempSprite.deleteSprite();
mapTempSprite.createSprite(TILE_WIDTH, TILE_HEIGHT);
+ gpsData.latitude = getLat();
+ gpsData.longitude = getLon();
+
// Preload Map
if (isVectorMap)
{
@@ -111,8 +114,6 @@ void setup()
else
{
// Get init Latitude and Longitude
- gpsData.latitude = getLat();
- gpsData.longitude = getLon();
tileSize = RENDER_TILE_SIZE;
generateRenderMap();
}
From 0ec35380ee58f8e16a8cdaf11004e40d80e0698d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jordi=20Gauch=C3=ADa?=
Date: Thu, 14 Nov 2024 09:22:56 +0100
Subject: [PATCH 04/55] build: Fix espressif version
---
platformio.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platformio.ini b/platformio.ini
index b9828ab5..4023d7c7 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -13,7 +13,7 @@ description = ESP32 GPS Navigator
default_envs = ICENAV_BOARD
[common]
-platform = espressif32
+platform = espressif32@6.9.0
framework = arduino
version = 0.1.9_alpha
revision = 82
From 5a9e25979006674479c59a5ba04ff6df5de9a447 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Thu, 14 Nov 2024 23:00:19 +0100
Subject: [PATCH 05/55] feat(wpt): Add back button in waypoint add/edit screen
---
lib/gui/src/waypointScr.cpp | 59 ++++++++++++++++++++++++++++++-------
lib/gui/src/waypointScr.hpp | 1 +
2 files changed, 50 insertions(+), 10 deletions(-)
diff --git a/lib/gui/src/waypointScr.cpp b/lib/gui/src/waypointScr.cpp
index 425bfcfd..e56feb8b 100644
--- a/lib/gui/src/waypointScr.cpp
+++ b/lib/gui/src/waypointScr.cpp
@@ -55,8 +55,6 @@ static void waypointScreenEvent(lv_event_t *event)
editWaypointName(loadWpt.name, newName);
}
break;
- // default:
- // break;
}
isMainScreen = true;
@@ -106,8 +104,6 @@ static void waypointScreenEvent(lv_event_t *event)
editWaypointName(loadWpt.name, newName);
}
break;
- // default:
- // break;
}
isMainScreen = true;
@@ -155,6 +151,46 @@ static void rotateScreen(lv_event_t *event)
lv_refr_now(display);
}
+/**
+ * @brief Waypoint Name event
+ *
+ * @param event
+ */
+static void waypointNameEvent(lv_event_t *event)
+{
+ lv_event_code_t code = lv_event_get_code(event);
+ if(code == LV_EVENT_CLICKED)
+ {
+ switch (wptAction)
+ {
+ case WPT_ADD:
+ addWpt.name = (char *)lv_textarea_get_text(waypointName);
+
+ if ( strcmp(addWpt.name,"") != 0)
+ {
+ openGpxFile(wptFile);
+ vTaskDelay(100);
+ addWaypointToFile(wptFile,addWpt);
+ }
+ break;
+ case WPT_EDIT:
+ char *newName = (char *)lv_textarea_get_text(waypointName);
+
+ if ( strcmp(loadWpt.name, newName) != 0)
+ {
+ editWaypointName(loadWpt.name, newName);
+ }
+ break;
+ }
+
+ isMainScreen = true;
+ redrawMap = true;
+ wptAction = WPT_NONE;
+ lv_refr_now(display);
+ loadMainScreen();
+ }
+}
+
/**
* @brief Update current waypoint postion to add
*
@@ -221,13 +257,16 @@ void createWaypointScreen()
lv_obj_center(rotateScreenLbl);
#endif
- lv_obj_t* label;
- label = lv_label_create(waypointScreen);
- lv_obj_set_style_text_font(label, fontOptions, 0);
- lv_label_set_text_static(label, "Waypoint Name:");
- lv_obj_center(label);
- lv_obj_align(label,LV_ALIGN_TOP_LEFT,10,10);
+ lv_obj_t* labelWpt;
+ labelWpt = lv_label_create(waypointScreen);
+ lv_obj_set_style_text_font(labelWpt, fontOptions, 0);
+ lv_label_set_text_static(labelWpt, LV_SYMBOL_LEFT " Waypoint Name:");
+ lv_obj_center(labelWpt);
+ lv_obj_align(labelWpt,LV_ALIGN_TOP_LEFT,10,10);
+ lv_obj_add_flag(labelWpt, LV_OBJ_FLAG_CLICKABLE);
+ lv_obj_add_event_cb(labelWpt, waypointNameEvent, LV_EVENT_ALL, NULL);
+ lv_obj_t* label;
label = lv_label_create(waypointScreen);
lv_obj_set_style_text_font(label, fontOptions, 0);
lv_label_set_text_static(label, "Lat:");
diff --git a/lib/gui/src/waypointScr.hpp b/lib/gui/src/waypointScr.hpp
index 111f95c8..593be18b 100644
--- a/lib/gui/src/waypointScr.hpp
+++ b/lib/gui/src/waypointScr.hpp
@@ -19,6 +19,7 @@ void loadMainScreen();
static void waypointScreenEvent(lv_event_t *event);
static void rotateScreen(lv_event_t *event);
+static void waypointNameEvent(lv_event_t *event);
void updateWaypointPos();
void createWaypointScreen();
From 6877719369206cadb740d4dbf5a2e09b9c70b0b5 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Thu, 14 Nov 2024 23:23:52 +0100
Subject: [PATCH 06/55] fix(wpt): Fix waypoint add/edit rotation button size
---
lib/gui/src/waypointScr.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/gui/src/waypointScr.cpp b/lib/gui/src/waypointScr.cpp
index e56feb8b..e8bcb441 100644
--- a/lib/gui/src/waypointScr.cpp
+++ b/lib/gui/src/waypointScr.cpp
@@ -252,6 +252,7 @@ void createWaypointScreen()
lv_obj_align(rotateScreenBtn, LV_ALIGN_TOP_RIGHT, -10, 5);
lv_obj_add_flag(rotateScreenBtn, LV_OBJ_FLAG_CLICKABLE);
lv_obj_add_event_cb(rotateScreenBtn, rotateScreen, LV_EVENT_CLICKED, NULL);
+ lv_obj_set_size(rotateScreenBtn, 40, 35);
lv_obj_t *rotateScreenLbl = lv_label_create(rotateScreenBtn);
lv_label_set_text(rotateScreenLbl, LV_SYMBOL_LOOP);
lv_obj_center(rotateScreenLbl);
From cff1c7a12ebda7b9cdcec51b3bc8fdbd27652b08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jordi=20Gauch=C3=ADa?=
Date: Fri, 15 Nov 2024 07:29:26 +0100
Subject: [PATCH 07/55] docs: Update README.md
---
README.md | 2 --
1 file changed, 2 deletions(-)
diff --git a/README.md b/README.md
index 2d9180b8..23fe16ca 100644
--- a/README.md
+++ b/README.md
@@ -84,8 +84,6 @@ If the board has a BOOT button (GPIO0) it is possible to use power saving functi
To do this, simply include the following Build Flag in the required env in platformio.ini
```-DPOWER_SAVE```
-```-DARDUINO_RUNNING_CORE=1```
-```-DARDUINO_EVENT_RUNNING_CORE=1```
> [!IMPORTANT]
> Currently, this project can run on any board with an ESP32S3 and at least a 320x480 TFT screen. The idea is to support all existing boards on the market that I can get to work, so if you don't want to use the specific IceNav board, please feel free to create an issue, and I will look into providing support.
From fff3bfcde397a98559ef0ab0150890fd78ef0147 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jordi=20Gauch=C3=ADa?=
Date: Fri, 15 Nov 2024 07:31:11 +0100
Subject: [PATCH 08/55] fix(board): Fix elecrow board definition
---
boards/elecrow-esp32-s3-n16r8v-terminal.json | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/boards/elecrow-esp32-s3-n16r8v-terminal.json b/boards/elecrow-esp32-s3-n16r8v-terminal.json
index 730b6480..1bdd7ad9 100644
--- a/boards/elecrow-esp32-s3-n16r8v-terminal.json
+++ b/boards/elecrow-esp32-s3-n16r8v-terminal.json
@@ -8,9 +8,7 @@
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
- "-DARDUINO_USB_MODE=1",
- "-DARDUINO_RUNNING_CORE=1",
- "-DARDUINO_EVENT_RUNNING_CORE=1"
+ "-DARDUINO_USB_MODE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
From 043dd1bc6328dbb601f3cb7ad95637ae0154a6e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jordi=20Gauch=C3=ADa?=
Date: Fri, 15 Nov 2024 07:43:46 +0100
Subject: [PATCH 09/55] docs: Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 23fe16ca..607f783c 100644
--- a/README.md
+++ b/README.md
@@ -336,7 +336,7 @@ To access the Web File Server, simply use any browser and go to the following ad
- [X] Vector maps
- [ ] Google Maps navigation style
- [x] Optimize code
-- [ ] Fix bugs!
+- [X] Fix bugs!
- [X] Web file server
From f91aed0f604e767ee5d4cdd5b9fdaa890d1a4334 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Fri, 15 Nov 2024 08:45:23 +0100
Subject: [PATCH 10/55] fix(board): Fix IceNav board definition
---
boards/icenav-esp32-s3.json | 2 --
1 file changed, 2 deletions(-)
diff --git a/boards/icenav-esp32-s3.json b/boards/icenav-esp32-s3.json
index ef141a4a..19728ee6 100644
--- a/boards/icenav-esp32-s3.json
+++ b/boards/icenav-esp32-s3.json
@@ -11,8 +11,6 @@
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
- "-DARDUINO_RUNNING_CORE=1",
- "-DARDUINO_EVENT_RUNNING_CORE=1",
"-DPOWER_SAVE",
"-DADC2",
"-DBATT_PIN=ADC2_CHANNEL_6",
From cd6d568188ffd694ce929389a9f63c9c3241ce59 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sat, 16 Nov 2024 12:34:41 +0100
Subject: [PATCH 11/55] refactor(cli): Delete settings option from CLI
---
README.md | 3 ---
lib/cli/cli.cpp | 43 -------------------------------------------
platformio.ini | 2 +-
3 files changed, 1 insertion(+), 47 deletions(-)
diff --git a/README.md b/README.md
index 607f783c..25c71863 100644
--- a/README.md
+++ b/README.md
@@ -246,7 +246,6 @@ outnmea: toggle GPS NMEA output (or Ctrl+C to stop)
poweroff: perform a ESP32 deep sleep
reboot: perform a ESP32 reboot
scshot: screenshot to SD or sending a PC
-settings: device settings
waypoint: waypoint utilities
webfile: enable/disable Web file server
wipe: wipe preferences to factory default
@@ -298,8 +297,6 @@ nc -l -p 8123 > screenshot.png
Additionally, you can download the screenshot with webfile server.
-**settings**: Device settings type `settings` for detailed options.
-
**waypoint**: type `waypoint` for detailed options.
Additionally, this waypoint command can send the waypoint over WiFi using the following syntax (replace IP with your PC IP):
diff --git a/lib/cli/cli.cpp b/lib/cli/cli.cpp
index 6d836280..f5bacbf7 100644
--- a/lib/cli/cli.cpp
+++ b/lib/cli/cli.cpp
@@ -267,48 +267,6 @@ void wcli_waypoint(char *args, Stream *response)
}
}
-void wcli_settings(char *args, Stream *response)
-{
- Pair operands = wcli.parseCommand(args);
- String commands = operands.first();
- String value = operands.second();
- int8_t gpio = -1;
-
- if (commands.isEmpty())
- {
- response->println("");
- response->println(F( "\033[1;31m----\033[1;32m Available commands \033[1;31m----\033[0;37m\r\n" ));
- response->println(F( "\033[1;32msetgpstx:\t\033[0;37mset GPS Tx GPIO"));
- response->println(F( "\033[1;32msetgpsrx:\t\033[0;37mset GPS Rx GPIO"));
- }
- else if (commands.equals("setgpstx"))
- {
- if(value.isEmpty())
- response->println(F("Tx GPIO missing, use: setgpstx \033[1;32mGPIO\033[0;37m"));
- else
- {
- gpio = value.toInt();
- saveGpsGpio(gpio, -1);
- response->println("");
- response->printf("GPS \033[1;31mTx GPIO\033[0;37m set to: \033[1;32m%i\033[0;37m\r\n",gpio);
- response->println("Please reboot device");
- }
- }
- else if (commands.equals("setgpsrx"))
- {
- if(value.isEmpty())
- response->println(F("Rx GPIO missing, use: setgpsrx \033[1;32mGPIO\033[0;37m"));
- else
- {
- gpio = value.toInt();
- saveGpsGpio(-1, gpio);
- response->println("");
- response->printf("GPS \033[1;31mRx GPIO\033[0;37m set to: \033[1;32m%i\033[0;37m\r\n",gpio);
- response->println("Please reboot device");
- }
- }
-}
-
void wcli_outnmea (char *args, Stream *response){
nmea_output_enable = !nmea_output_enable;
}
@@ -365,7 +323,6 @@ void initShell(){
wcli.add("clear", &wcli_clear, "\t\tclear shell");
wcli.add("scshot", &wcli_scshot, "\tscreenshot to SD or sending a PC");
wcli.add("waypoint", &wcli_waypoint, "\twaypoint utilities");
- wcli.add("settings", &wcli_settings, "\tdevice settings");
wcli.add("webfile", &wcli_webfile, "\tenable/disable Web file server");
wcli.add("klist", &wcli_klist, "\t\tlist of user preferences. ('all' param show all)");
wcli.add("kset", &wcli_kset, "\t\tset an user extra preference");
diff --git a/platformio.ini b/platformio.ini
index 4023d7c7..0c321b26 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -34,7 +34,7 @@ build_flags =
-D SHELLMINATOR_BUFF_DIM=70
-D SHELLMINATOR_LOGO_COLOR=BLUE
-D COMMANDER_MAX_COMMAND_SIZE=70
- -D WCLI_MAX_CMDS=14 # set n+1 of defined commands for CLI
+ -D WCLI_MAX_CMDS=12 # set n+1 of defined commands for CLI
; -D DISABLE_CLI_TELNET=1 # disable remote access via telnet. It needs CLI
; -D DISABLE_CLI=1 # removed CLI module. Config via Bluetooth only
From 2a21a638eb0a35aab271baa766f3d7c8ce2154a9 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sat, 16 Nov 2024 12:44:32 +0100
Subject: [PATCH 12/55] fix(cli): Fix poweroff CLI option
---
lib/cli/cli.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cli/cli.cpp b/lib/cli/cli.cpp
index f5bacbf7..ebf19034 100644
--- a/lib/cli/cli.cpp
+++ b/lib/cli/cli.cpp
@@ -28,7 +28,7 @@ void wcli_reboot(char *args, Stream *response)
}
void wcli_poweroff(char *args, Stream *response) {
- deviceSuspend();
+ deviceShutdown();
}
void wcli_info(char *args, Stream *response)
From 6a029810ee6083324b524ade39c4361e3adb416f Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sat, 16 Nov 2024 22:20:19 +0100
Subject: [PATCH 13/55] fix(power): Fix deep sleep for IceNav board
---
lib/power/power.cpp | 12 +++++++++---
src/main.cpp | 7 ++++++-
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/lib/power/power.cpp b/lib/power/power.cpp
index c5a51c91..faa2ed60 100644
--- a/lib/power/power.cpp
+++ b/lib/power/power.cpp
@@ -21,9 +21,14 @@ void powerDeepSleep()
esp_wifi_stop();
esp_deep_sleep_disable_rom_logging();
delay(10);
- // If you need other peripherals to maintain power, please set the IO port to hold
- // gpio_hold_en((gpio_num_t)BOARD_POWERON);
- // gpio_deep_sleep_hold_en();
+
+ #ifdef ICENAV_BOARD
+ // If you need other peripherals to maintain power, please set the IO port to hold
+ gpio_hold_en((gpio_num_t)TFT_BL);
+ gpio_hold_en((gpio_num_t)BOARD_BOOT_PIN);
+ gpio_deep_sleep_hold_en();
+ #endif
+
esp_sleep_enable_ext1_wakeup(1ull << BOARD_BOOT_PIN, ESP_EXT1_WAKEUP_ANY_LOW);
esp_deep_sleep_start();
}
@@ -83,6 +88,7 @@ void deviceShutdown()
void powerOffPeripherals()
{
tftOff();
+ tft.fillScreen(TFT_BLACK);
SPI.end();
Wire.end();
}
diff --git a/src/main.cpp b/src/main.cpp
index ba693aea..ff18c3ea 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -59,7 +59,12 @@ void setup()
// Force GPIO0 to internal PullUP during boot (avoid LVGL key read)
#ifdef POWER_SAVE
- pinMode(BOARD_BOOT_PIN,INPUT_PULLUP);
+ pinMode(BOARD_BOOT_PIN,INPUT_PULLUP);
+ #ifdef ICENAV_BOARD
+ gpio_hold_dis((gpio_num_t)TFT_BL);
+ gpio_hold_dis((gpio_num_t)BOARD_BOOT_PIN);
+ gpio_deep_sleep_hold_dis();
+ #endif
#endif
#ifdef ARDUINO_USB_CDC_ON_BOOT
From 8038ff6f3526cc9a4938d022b5bd5a3851bf266e Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 17 Nov 2024 01:03:18 +0100
Subject: [PATCH 14/55] feat(cli): Add GMT user settings (kset) in CLI #159
---
README.md | 1 +
lib/gps/timezone.hpp | 14 ++++++--------
lib/preferences/preferences-keys.h | 1 +
lib/settings/settings.cpp | 2 ++
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 25c71863..a57e1edc 100644
--- a/README.md
+++ b/README.md
@@ -267,6 +267,7 @@ Some extra details:
VmaxBatt custom
VminBatt custom
tempOffs custom
+ defGMT custom
```
**kset KEYNAME**: Set user custom settings:
diff --git a/lib/gps/timezone.hpp b/lib/gps/timezone.hpp
index 2b9a6709..a380b818 100644
--- a/lib/gps/timezone.hpp
+++ b/lib/gps/timezone.hpp
@@ -9,14 +9,7 @@
#ifndef TIMEZONE_HPP
#define TIMEZONE_HPP
-// Set these values to the offset of your timezone from GMT
-
-static const int32_t zone_hours = 1L;
-static const int32_t zone_minutes = 0L; // usually zero
-static const NeoGPS::clock_t zone_offset =
- zone_hours * NeoGPS::SECONDS_PER_HOUR +
- zone_minutes * NeoGPS::SECONDS_PER_MINUTE;
-
+extern int32_t defGMT; // Default GMT offset
// Uncomment one DST changeover rule, or define your own:
@@ -51,6 +44,11 @@ static void adjustTime( NeoGPS::time_t & dt )
{
NeoGPS::clock_t seconds = dt; // convert date/time structure to seconds
+ // Set these values to the offset of your timezone from GMT
+ static const int32_t zone_minutes = 0L; // usually zero
+ static const NeoGPS::clock_t zone_offset = (int32_t)defGMT * NeoGPS::SECONDS_PER_HOUR +
+ zone_minutes * NeoGPS::SECONDS_PER_MINUTE;
+
#ifdef CALCULATE_DST
// Calculate DST changeover times once per reset and year!
static NeoGPS::time_t changeover;
diff --git a/lib/preferences/preferences-keys.h b/lib/preferences/preferences-keys.h
index 88d13d00..09a1d110 100644
--- a/lib/preferences/preferences-keys.h
+++ b/lib/preferences/preferences-keys.h
@@ -29,4 +29,5 @@
X(KVMAX_BATT, "VmaxBatt", FLOAT) \
X(KVMIN_BATT, "VminBatt", FLOAT) \
X(KTEMP_OFFS, "tempOffs", INT) \
+ X(KGMT_OFFS, "defGMT", INT) \
X(KCOUNT, "KCOUNT", UNKNOWN)
diff --git a/lib/settings/settings.cpp b/lib/settings/settings.cpp
index 2adfeea2..7a797369 100644
--- a/lib/settings/settings.cpp
+++ b/lib/settings/settings.cpp
@@ -31,6 +31,7 @@ uint8_t zoom = 0; // Actual Zoom Level
bool isMapRotation = true; // Map Compass Rotation
uint8_t defaultZoom = 0; // Default Zoom Value
uint8_t defBright = 255; // Default Brightness
+int32_t defGMT = 1; // Default GMT offset
bool showMapCompass = true; // Compass in map screen
bool isCompassRot = true; // Compass rotation in map screen
bool showMapSpeed = true; // Speed in map screen
@@ -81,6 +82,7 @@ void loadPreferences()
speedPosY = cfg.getInt(PKEYS::KSPEED_Y, TFT_HEIGHT - 130);
isVectorMap = cfg.getBool(PKEYS::KMAP_VECTOR, false);
defBright = cfg.getUInt(PKEYS::KDEF_BRIGT, 254);
+ defGMT = cfg.getInt(PKEYS::KGMT_OFFS, 1);
if (isVectorMap)
{
minZoom = 1;
From 36bb08978d6d370e5b32cbc5f0c37e8bfc112e6f Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 17 Nov 2024 11:56:25 +0100
Subject: [PATCH 15/55] refactor(storage): Refactor to class
---
lib/gui/src/notifyBar.cpp | 5 +-
lib/storage/storage.cpp | 107 +++++++++++++++++++++-----------------
lib/storage/storage.hpp | 17 ++++--
src/main.cpp | 6 ++-
4 files changed, 80 insertions(+), 55 deletions(-)
diff --git a/lib/gui/src/notifyBar.cpp b/lib/gui/src/notifyBar.cpp
index cbcebce9..6c85b8fc 100644
--- a/lib/gui/src/notifyBar.cpp
+++ b/lib/gui/src/notifyBar.cpp
@@ -7,6 +7,7 @@
*/
#include "notifyBar.hpp"
+#include "storage.hpp"
#include "font/lv_symbol_def.h"
#include "misc/lv_event.h"
@@ -14,6 +15,8 @@ lv_obj_t *mainScreen;
lv_obj_t *notifyBarIcons;
lv_obj_t *notifyBarHour;
+Storage storage;
+
/**
* @brief Update notify bar event
*
@@ -168,7 +171,7 @@ void createNotifyBar()
lv_obj_add_event_cb(temp, updateNotifyBar, LV_EVENT_VALUE_CHANGED, NULL);
#endif
- if (isSdLoaded)
+ if (storage.getSdLoaded())
{
sdCard = lv_label_create(notifyBarIcons);
lv_label_set_text_static(sdCard, LV_SYMBOL_SD_CARD);
diff --git a/lib/storage/storage.cpp b/lib/storage/storage.cpp
index 8a26730e..e04ad8e6 100644
--- a/lib/storage/storage.cpp
+++ b/lib/storage/storage.cpp
@@ -10,74 +10,85 @@
#include "esp_err.h"
#include "esp_spiffs.h"
-bool isSdLoaded = false;
+// Pin definitions (should be configurable if needed)
extern const int SD_CS;
extern const int SD_MISO;
extern const int SD_MOSI;
extern const int SD_CLK;
-extern const int BOARD_TFT_CS;
-extern const int RADIO_CS_PIN;
+
+Storage::Storage() : isSdLoaded(false) {}
+
/**
* @brief SD Card init
*
*/
-void initSD()
+void Storage::initSD()
{
- bool SDInitOk = false;
- pinMode(SD_CS,OUTPUT);
- digitalWrite(SD_CS,LOW);
+ bool SDInitOk = false;
+ pinMode(SD_CS, OUTPUT);
+ digitalWrite(SD_CS, LOW);
- SPI.begin(SD_CLK, SD_MISO, SD_MOSI);
- SDInitOk = SD.begin(SD_CS, SPI, sdFreq);
-
- if (!SDInitOk)
- {
- log_e("SD Card Mount Failed");
- return;
- }
- else
- {
- log_v("SD Card Mounted");
- isSdLoaded = true;
- }
- }
+ SPI.begin(SD_CLK, SD_MISO, SD_MOSI);
+
+ if (!SD.begin(SD_CS, SPI, sdFreq))
+ {
+ log_e("SD Card Mount Failed");
+ isSdLoaded = false;
+ }
+ else
+ {
+ log_v("SD Card Mounted");
+ isSdLoaded = true;
+ }
+}
/**
- * @brief SPIFFS Init
+ * @brief SPIFFS initialization
*
+ * @return esp_err_t Error code for SPIFFS setup
*/
-esp_err_t initSPIFFS()
+esp_err_t Storage::initSPIFFS()
{
- log_i("Initializing SPIFFS");
+ log_i("Initializing SPIFFS");
- esp_vfs_spiffs_conf_t conf = {
- .base_path = "/spiffs",
- .partition_label = NULL,
- .max_files = 5,
- .format_if_mount_failed = false
- };
+ esp_vfs_spiffs_conf_t conf =
+ {
+ .base_path = "/spiffs",
+ .partition_label = NULL,
+ .max_files = 5,
+ .format_if_mount_failed = false
+ };
- esp_err_t ret = esp_vfs_spiffs_register(&conf);
+ esp_err_t ret = esp_vfs_spiffs_register(&conf);
- if (ret !=ESP_OK)
- {
- if (ret == ESP_FAIL)
- log_e("Failed to mount or format filesystem");
- else if (ret == ESP_ERR_NOT_FOUND)
- log_e("Failed to find SPIFFS partition");
+ if (ret != ESP_OK)
+ {
+ if (ret == ESP_FAIL)
+ log_e("Failed to mount or format filesystem");
+ else if (ret == ESP_ERR_NOT_FOUND)
+ log_e("Failed to find SPIFFS partition");
+ else
+ log_e("Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
+ return ESP_FAIL;
+ }
+
+ size_t total = 0, used = 0;
+ ret = esp_spiffs_info(NULL, &total, &used);
+ if (ret != ESP_OK)
+ log_e("Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret));
else
- log_e("Failed to initialize SPIFFS (%s)",esp_err_to_name(ret));
- return ESP_FAIL;
- }
+ log_i("Partition size: total: %d used: %d", total, used);
- size_t total = 0, used = 0;
- ret = esp_spiffs_info(NULL, &total, &used);
- if (ret!= ESP_OK)
- log_e("Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret));
- else
- log_i("Partition size: total: %d used: %d", total, used);
-
- return ESP_OK;
+ return ESP_OK;
}
+/**
+ * @brief Get SD status
+ *
+ * @return true if SD card is loaded, false otherwise
+ */
+bool Storage::getSdLoaded() const
+{
+ return isSdLoaded;
+}
diff --git a/lib/storage/storage.hpp b/lib/storage/storage.hpp
index ec754c21..35ccac5a 100644
--- a/lib/storage/storage.hpp
+++ b/lib/storage/storage.hpp
@@ -14,11 +14,20 @@
#include
#include
-static uint32_t sdFreq = 40000000;
-extern bool isSdLoaded;
+class Storage
+{
+private:
+ bool isSdLoaded;
+ static const uint32_t sdFreq = 40000000;
-void initSD();
-esp_err_t initSPIFFS();
+public:
+ Storage();
+
+ void initSD();
+ esp_err_t initSPIFFS();
+
+ bool getSdLoaded() const;
+};
#endif
diff --git a/src/main.cpp b/src/main.cpp
index ff18c3ea..ab043f91 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,6 +40,7 @@
#endif
extern xSemaphoreHandle gpsMutex;
+extern Storage storage;
#include "webpage.h"
#include "webserver.h"
@@ -49,6 +50,7 @@ extern xSemaphoreHandle gpsMutex;
#include "lvglSetup.hpp"
#include "tasks.hpp"
+
/**
* @brief Setup
*
@@ -97,8 +99,8 @@ void setup()
#endif
powerOn();
- initSD();
- initSPIFFS();
+ storage.initSD();
+ storage.initSPIFFS();
initTFT();
loadPreferences();
initGPS();
From 9a4ae4883c94c8d6ccf0e5aea1ad724a550b3d2a Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 17 Nov 2024 13:38:00 +0100
Subject: [PATCH 16/55] refactor(battery): Refactor to class
---
lib/battery/battery.cpp | 102 +++++++++++++++++++-------------------
lib/battery/battery.hpp | 21 ++++----
lib/gui/src/notifyBar.cpp | 14 +++---
lib/gui/src/notifyBar.hpp | 7 ++-
lib/settings/settings.cpp | 7 ++-
lib/settings/settings.hpp | 2 -
src/main.cpp | 8 ++-
7 files changed, 86 insertions(+), 75 deletions(-)
diff --git a/lib/battery/battery.cpp b/lib/battery/battery.cpp
index 33010b99..278e8f3d 100644
--- a/lib/battery/battery.cpp
+++ b/lib/battery/battery.cpp
@@ -9,73 +9,75 @@
#include "battery.hpp"
-/**
- * @brief Battery values
- *
- */
-uint8_t battLevel = 0;
-uint8_t battLevelOld = 0;
-float batteryMax = 4.2; // maximum voltage of battery
-float batteryMin = 3.6; // minimum voltage of battery before shutdown
+
+// ADC characteristics (global for simplicity)
+static esp_adc_cal_characteristics_t characteristics;
+
+Battery::Battery() {}
/**
* @brief Configure ADC Channel for battery reading
*
*/
-void initADC()
+void Battery::initADC()
{
- // When VDD_A is 3.3V:
- // 0dB attenuation (ADC_ATTEN_DB_0) gives full-scale voltage 1.1V
- // 2.5dB attenuation (ADC_ATTEN_DB_2_5) gives full-scale voltage 1.5V
- // 6dB attenuation (ADC_ATTEN_DB_6) gives full-scale voltage 2.2V
- // 12dB attenuation (ADC_ATTEN_DB_12) gives full-scale voltage 3.9V
-
- #ifdef ADC1
+#ifdef ADC1
adc1_config_width(ADC_WIDTH_BIT_12);
- adc1_config_channel_atten(BATT_PIN, ADC_ATTEN_DB_12);
- #endif
+ adc1_config_channel_atten(BATT_PIN, ADC_ATTEN_DB_12);
+#endif
- #ifdef ADC2
+#ifdef ADC2
adc2_config_channel_atten(BATT_PIN, ADC_ATTEN_DB_12);
- #endif
+#endif
+}
+
+/**
+ * @brief Set battery voltage levels
+ *
+ * @param maxVoltage -> Full Charge voltage
+ * @param minVoltage -> Min Charge voltage
+ */
+void Battery::setBatteryLevels(float maxVoltage, float minVoltage)
+{
+ batteryMax = maxVoltage;
+ batteryMin = minVoltage;
}
/**
- * @brief Read battery charge and return %
+ * @brief Read battery charge and return %.
*
* @return float -> % Charge
*/
-float batteryRead()
+float Battery::readBattery()
{
- long sum = 0; // sum of samples taken
- float voltage = 0.0; // calculated voltage
- float output = 0.0; // output value
- for (int i = 0; i < 100; i++)
- {
+ long sum = 0; // Sum of samples taken
+ float voltage = 0.0; // Calculated voltage
+ float output = 0.0; // Output value
+
+ for (int i = 0; i < 100; i++)
+ {
+ #ifdef ADC1
+ sum += static_cast(adc1_get_raw(BATT_PIN));
+ #endif
+
+ #ifdef ADC2
+ int readRaw;
+ esp_err_t r = adc2_get_raw(BATT_PIN, ADC_WIDTH_BIT_12, &readRaw);
+ if (r == ESP_OK)
+ sum += static_cast(readRaw);
+ #endif
- #ifdef ADC1
- sum += (long)adc1_get_raw(BATT_PIN);
- #endif
+ delayMicroseconds(150);
+ }
- #ifdef ADC2
- int readRaw;
- esp_err_t r = adc2_get_raw(BATT_PIN, ADC_WIDTH_BIT_12, &readRaw);
- if (r == ESP_OK)
- sum += (long)readRaw;
- #endif
+ voltage = sum / 100.0;
+ // Custom board has a divider circuit
+ constexpr float R1 = 100000.0; // Resistance of R1 (100K)
+ constexpr float R2 = 100000.0; // Resistance of R2 (100K)
+ voltage = (voltage * V_REF) / 4096.0;
+ voltage = voltage / (R2 / (R1 + R2));
+ voltage = roundf(voltage * 100) / 100;
- delayMicroseconds(150);
- }
- voltage = sum / (float)100;
- // custom board has a divider circuit
- float R1 = 100000.0; // resistance of R1 (100K)
- float R2 = 100000.0; // resistance of R2 (100K)
- voltage = (voltage * V_REF) / 4096.0;
- voltage = voltage / (R2 / (R1 + R2));
- voltage = roundf(voltage * 100) / 100;
- output = ((voltage - batteryMin) / (batteryMax - batteryMin)) * 100;
- if (output <= 160)
- return output;
- else
- return 0.0f;
+ output = ((voltage - batteryMin) / (batteryMax - batteryMin)) * 100;
+ return (output <= 160) ? output : 0.0f;
}
diff --git a/lib/battery/battery.hpp b/lib/battery/battery.hpp
index b972fe63..072f360e 100644
--- a/lib/battery/battery.hpp
+++ b/lib/battery/battery.hpp
@@ -13,16 +13,19 @@
#include
#include
-static esp_adc_cal_characteristics_t characteristics;
-#define V_REF 3.9 // ADC reference voltage
+class Battery
+{
+private:
+ float batteryMax;
+ float batteryMin;
+ static constexpr float V_REF = 3.9; // ADC reference voltage
-extern float batteryMax; // 4.2; // maximum voltage of battery
-extern float batteryMin; // 3.6; // minimum voltage of battery before shutdown
+public:
+ Battery();
-extern uint8_t battLevel;
-extern uint8_t battLevelOld;
-
-void initADC();
-float batteryRead();
+ void initADC();
+ void setBatteryLevels(float maxVoltage, float minVoltage);
+ float readBattery();
+};
#endif
diff --git a/lib/gui/src/notifyBar.cpp b/lib/gui/src/notifyBar.cpp
index 6c85b8fc..06a8709a 100644
--- a/lib/gui/src/notifyBar.cpp
+++ b/lib/gui/src/notifyBar.cpp
@@ -7,7 +7,6 @@
*/
#include "notifyBar.hpp"
-#include "storage.hpp"
#include "font/lv_symbol_def.h"
#include "misc/lv_event.h"
@@ -16,6 +15,7 @@ lv_obj_t *notifyBarIcons;
lv_obj_t *notifyBarHour;
Storage storage;
+Battery battery;
/**
* @brief Update notify bar event
@@ -37,7 +37,7 @@ void updateNotifyBar(lv_event_t *event)
if (obj == gpsCount)
lv_label_set_text_fmt(obj, LV_SYMBOL_GPS "%2d", gpsData.satellites);
- if (obj == battery)
+ if (obj == battIcon)
{
if (battLevel <= 160 && battLevel > 140)
lv_label_set_text_static(obj, " " LV_SYMBOL_CHARGE);
@@ -118,10 +118,10 @@ void updateNotifyBarTimer(lv_timer_t *t)
}
#endif
- battLevel = batteryRead();
+ battLevel = battery.readBattery();
if (battLevel != battLevelOld)
{
- lv_obj_send_event(battery, LV_EVENT_VALUE_CHANGED, NULL);
+ lv_obj_send_event(battIcon, LV_EVENT_VALUE_CHANGED, NULL);
battLevelOld = battLevel;
}
}
@@ -191,9 +191,9 @@ void createNotifyBar()
lv_label_set_text_static(gpsFixMode, "----");
lv_obj_add_event_cb(gpsFixMode, updateNotifyBar, LV_EVENT_VALUE_CHANGED, NULL);
- battery = lv_label_create(notifyBarIcons);
- lv_label_set_text_static(battery, LV_SYMBOL_BATTERY_EMPTY);
- lv_obj_add_event_cb(battery, updateNotifyBar, LV_EVENT_VALUE_CHANGED, NULL);
+ battIcon = lv_label_create(notifyBarIcons);
+ lv_label_set_text_static(battIcon, LV_SYMBOL_BATTERY_EMPTY);
+ lv_obj_add_event_cb(battIcon, updateNotifyBar, LV_EVENT_VALUE_CHANGED, NULL);
lv_timer_t *timerNotifyBar = lv_timer_create(updateNotifyBarTimer, UPDATE_NOTIFY_PERIOD, NULL);
lv_timer_ready(timerNotifyBar);
diff --git a/lib/gui/src/notifyBar.hpp b/lib/gui/src/notifyBar.hpp
index 470bb14d..b0b9ba11 100644
--- a/lib/gui/src/notifyBar.hpp
+++ b/lib/gui/src/notifyBar.hpp
@@ -13,6 +13,8 @@
#include "globalGuiDef.h"
#include "tasks.hpp"
#include "storage.hpp"
+#include "battery.hpp"
+#include "settings.hpp"
/**
* @brief Notify Bar screen objects
@@ -22,11 +24,14 @@ static lv_obj_t *gpsTime; // Time
static lv_obj_t *gpsCount; // Satellite count
static lv_obj_t *gpsFix; // Satellite fix
static lv_obj_t *gpsFixMode; // Satellite fix mode
-static lv_obj_t *battery; // Battery level
+static lv_obj_t *battIcon; // Battery level
static lv_obj_t *sdCard; // SD card icon
static lv_obj_t *temp; // Temperature
static lv_obj_t *wifi; // Wifi
+static float battLevel = 0;
+static float battLevelOld = 0;
+
#define UPDATE_NOTIFY_PERIOD 1000 // Notify Bar update time
/**
diff --git a/lib/settings/settings.cpp b/lib/settings/settings.cpp
index 7a797369..315f3bfa 100644
--- a/lib/settings/settings.cpp
+++ b/lib/settings/settings.cpp
@@ -51,8 +51,8 @@ uint16_t speedPosY = 0; // Speed widget position Y
bool enableWeb = true; // Enable/disable web file server
bool showToolBar = false; // Show Map Toolbar
int8_t tempOffset = 0; // BME Temperature offset
-// float batteryMax = 0.0; // 4.2; // maximum voltage of battery
-// float batteryMin = 0.0; // 3.6; // minimum voltage of battery before shutdown
+
+extern Battery battery;
/**
* @brief Load stored preferences
@@ -114,8 +114,7 @@ void loadPreferences()
speedPosY = cfg.isKey(CONFKEYS::KSPEED_Y) ? cfg.getInt(CONFKEYS::KSPEED_Y, speedPosY) : 94;
#endif
- batteryMax = cfg.getFloat(PKEYS::KVMAX_BATT,4.2);
- batteryMin = cfg.getFloat(PKEYS::KVMIN_BATT,3.6);
+ battery.setBatteryLevels(cfg.getFloat(PKEYS::KVMAX_BATT,4.2),cfg.getFloat(PKEYS::KVMIN_BATT,3.6));
// compassPosX = 60;
// compassPosY = 82;
diff --git a/lib/settings/settings.hpp b/lib/settings/settings.hpp
index f4b64b36..5da632cb 100644
--- a/lib/settings/settings.hpp
+++ b/lib/settings/settings.hpp
@@ -21,8 +21,6 @@ extern uint8_t defZoomRender; // Default Zoom Level for render map
extern uint8_t defZoomVector; // Default Zoom Level for vector map
extern uint8_t zoom; // Actual Zoom Level
extern uint8_t defBright; // Default brightness
-extern float batteryMax; // 4.2; // maximum voltage of battery
-extern float batteryMin; // 3.6; // minimum voltage of battery before shutdown
extern bool isMapRotation; // Map Compass Rotation
extern uint8_t defaultZoom; // Default Zoom Value
diff --git a/src/main.cpp b/src/main.cpp
index ab043f91..072295cc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,11 +40,14 @@
#endif
extern xSemaphoreHandle gpsMutex;
-extern Storage storage;
#include "webpage.h"
#include "webserver.h"
#include "battery.hpp"
+
+extern Storage storage;
+extern Battery battery;
+
#include "power.hpp"
#include "settings.hpp"
#include "lvglSetup.hpp"
@@ -101,11 +104,12 @@ void setup()
powerOn();
storage.initSD();
storage.initSPIFFS();
+ battery.initADC();
initTFT();
loadPreferences();
initGPS();
initLVGL();
- initADC();
+
// Reserve PSRAM for buffer map
mapTempSprite.deleteSprite();
From cf8ed80a6404d97006c9807e6fdf9967d03a0b18 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 17 Nov 2024 14:28:21 +0100
Subject: [PATCH 17/55] build: Clear unused variables
---
lib/battery/battery.cpp | 4 ----
lib/gui/src/mainScr.cpp | 1 -
lib/gui/src/notifyBar.cpp | 2 --
lib/lvgl/src/lvglSetup.cpp | 2 --
lib/maps/src/vectorMaps.cpp | 2 --
lib/storage/storage.cpp | 1 -
lib/webfile/src/webserver.h | 1 -
7 files changed, 13 deletions(-)
diff --git a/lib/battery/battery.cpp b/lib/battery/battery.cpp
index 278e8f3d..473306bd 100644
--- a/lib/battery/battery.cpp
+++ b/lib/battery/battery.cpp
@@ -9,10 +9,6 @@
#include "battery.hpp"
-
-// ADC characteristics (global for simplicity)
-static esp_adc_cal_characteristics_t characteristics;
-
Battery::Battery() {}
/**
diff --git a/lib/gui/src/mainScr.cpp b/lib/gui/src/mainScr.cpp
index 1627d2d1..671845cd 100644
--- a/lib/gui/src/mainScr.cpp
+++ b/lib/gui/src/mainScr.cpp
@@ -206,7 +206,6 @@ void updateMainScreen(lv_timer_t *t)
*/
void gestureEvent(lv_event_t *event)
{
- lv_obj_t *screen = (lv_obj_t *)lv_event_get_current_target(event);
lv_dir_t dir = lv_indev_get_gesture_dir(lv_indev_get_act());
if (activeTile == MAP && isMainScreen)
{
diff --git a/lib/gui/src/notifyBar.cpp b/lib/gui/src/notifyBar.cpp
index 06a8709a..d4ee873c 100644
--- a/lib/gui/src/notifyBar.cpp
+++ b/lib/gui/src/notifyBar.cpp
@@ -154,8 +154,6 @@ void createNotifyBar()
lv_obj_add_style(notifyBarIcons, &styleBar, LV_PART_MAIN);
lv_obj_add_style(notifyBarHour, &styleBar, LV_PART_MAIN);
- lv_obj_t *label;
-
gpsTime = lv_label_create(notifyBarHour);
lv_obj_set_style_text_font(gpsTime, fontLarge, 0);
lv_label_set_text_fmt(gpsTime, timeFormat, 0, 0, 0);
diff --git a/lib/lvgl/src/lvglSetup.cpp b/lib/lvgl/src/lvglSetup.cpp
index 45b9af48..4b8e2acd 100644
--- a/lib/lvgl/src/lvglSetup.cpp
+++ b/lib/lvgl/src/lvglSetup.cpp
@@ -137,7 +137,6 @@ void IRAM_ATTR gpioRead(lv_indev_t *indev_driver, lv_indev_data_t *data)
*/
void gpioLongEvent(lv_event_t *event)
{
- lv_event_code_t code = lv_event_get_code(event);
log_v("Shuting down device");
powerMsg = lv_msgbox_create(lv_scr_act());
lv_obj_set_width(powerMsg,TFT_WIDTH);
@@ -158,7 +157,6 @@ void gpioLongEvent(lv_event_t *event)
*/
void gpioClickEvent(lv_event_t *event)
{
- lv_event_code_t code = lv_event_get_code(event);
lv_indev_reset_long_press(lv_indev_active());
lv_indev_reset(NULL,lv_scr_act());
log_v("Entering sleep mode");
diff --git a/lib/maps/src/vectorMaps.cpp b/lib/maps/src/vectorMaps.cpp
index 85f1de10..b6e5339b 100644
--- a/lib/maps/src/vectorMaps.cpp
+++ b/lib/maps/src/vectorMaps.cpp
@@ -204,7 +204,6 @@ BBox parseBbox(String str)
MapBlock *readMapBlock(String fileName)
{
log_d("readMapBlock: %s", fileName.c_str());
- char c;
char str[30];
MapBlock *mblock = new MapBlock();
fs::File file_ = SD.open(fileName + ".fmp");
@@ -236,7 +235,6 @@ MapBlock *readMapBlock(String fileName)
uint32_t totalPoints = 0;
Polygon polygon;
Point16 p;
- int16_t maxVectorZoom;// = 4;
while (count > 0)
{
// log_d("line: %i", line);
diff --git a/lib/storage/storage.cpp b/lib/storage/storage.cpp
index e04ad8e6..faaa39d1 100644
--- a/lib/storage/storage.cpp
+++ b/lib/storage/storage.cpp
@@ -25,7 +25,6 @@ Storage::Storage() : isSdLoaded(false) {}
*/
void Storage::initSD()
{
- bool SDInitOk = false;
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, LOW);
diff --git a/lib/webfile/src/webserver.h b/lib/webfile/src/webserver.h
index 600236b8..a27abb39 100644
--- a/lib/webfile/src/webserver.h
+++ b/lib/webfile/src/webserver.h
@@ -237,7 +237,6 @@ String listFiles(bool ishtml, int page = 0)
{
String returnText = "";
- int fileIndex = 0;
int startIdx = page * FILES_PER_PAGE;
int endIdx = startIdx + FILES_PER_PAGE;
From 2fc21c99b1b8bdcc4bb07a4224dd702a0f33b2de Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 17 Nov 2024 16:23:36 +0100
Subject: [PATCH 18/55] refactor(power): Refactor to class
---
lib/cli/cli.cpp | 4 ++-
lib/lvgl/src/lvglSetup.cpp | 6 ++--
lib/power/power.cpp | 72 +++++++++++++++++++++++---------------
lib/power/power.hpp | 24 +++++++++----
lib/storage/storage.hpp | 1 -
src/main.cpp | 5 +--
6 files changed, 70 insertions(+), 42 deletions(-)
diff --git a/lib/cli/cli.cpp b/lib/cli/cli.cpp
index ebf19034..5cb46baa 100644
--- a/lib/cli/cli.cpp
+++ b/lib/cli/cli.cpp
@@ -22,13 +22,15 @@ const char logo[] =
""
;
+extern Power power;
+
void wcli_reboot(char *args, Stream *response)
{
ESP.restart();
}
void wcli_poweroff(char *args, Stream *response) {
- deviceShutdown();
+ power.deviceShutdown();
}
void wcli_info(char *args, Stream *response)
diff --git a/lib/lvgl/src/lvglSetup.cpp b/lib/lvgl/src/lvglSetup.cpp
index 4b8e2acd..43f1e725 100644
--- a/lib/lvgl/src/lvglSetup.cpp
+++ b/lib/lvgl/src/lvglSetup.cpp
@@ -26,6 +26,8 @@ lv_group_t *scrGroup; // Screen group
lv_group_t *keyGroup; // GPIO group
lv_obj_t *powerMsg; // Power Message
+Power power;
+
/**
* @brief LVGL display update
*
@@ -148,7 +150,7 @@ void gpioLongEvent(lv_event_t *event)
lv_obj_invalidate(powerMsg);
lv_refr_now(display);
vTaskDelay(2000);
- deviceShutdown();
+ power.deviceShutdown();
}
/**
@@ -170,7 +172,7 @@ void gpioClickEvent(lv_event_t *event)
lv_obj_invalidate(powerMsg);
lv_refr_now(display);
vTaskDelay(2000);
- deviceSuspend();
+ power.deviceSuspend();
}
/**
diff --git a/lib/power/power.cpp b/lib/power/power.cpp
index faa2ed60..62bdb978 100644
--- a/lib/power/power.cpp
+++ b/lib/power/power.cpp
@@ -10,11 +10,22 @@
extern const uint8_t BOARD_BOOT_PIN;
+Power::Power()
+{
+ #ifdef DISABLE_RADIO
+ WiFi.disconnect(true);
+ WiFi.mode(WIFI_OFF);
+ btStop();
+ esp_wifi_stop();
+ esp_bt_controller_disable();
+ #endif
+}
+
/**
* @brief Deep Sleep Mode
*
*/
-void powerDeepSleep()
+void Power::powerDeepSleep()
{
esp_bluedroid_disable();
esp_bt_controller_disable();
@@ -38,7 +49,7 @@ void powerDeepSleep()
*
* @param millis
*/
-void powerLightSleepTimer(int millis)
+void Power::powerLightSleepTimer(int millis)
{
esp_sleep_enable_timer_wakeup(millis * 1000);
esp_err_t rtc_gpio_hold_en(gpio_num_t GPIO_NUM_5);
@@ -49,16 +60,27 @@ void powerLightSleepTimer(int millis)
* @brief Sleep Mode
*
*/
-void powerLightSleep()
+void Power::powerLightSleep()
{
esp_sleep_enable_ext1_wakeup(1ull << BOARD_BOOT_PIN, ESP_EXT1_WAKEUP_ANY_LOW);
esp_light_sleep_start();
}
+/**
+ * @brief Power off peripherals devices
+ */
+void Power::powerOffPeripherals()
+{
+ tftOff();
+ tft.fillScreen(TFT_BLACK);
+ SPI.end();
+ Wire.end();
+}
+
/**
* @brief Core light suspend and TFT off
*/
-void deviceSuspend()
+void Power::deviceSuspend()
{
int brightness = tft.getBrightness();
lv_msgbox_close(powerMsg);
@@ -75,35 +97,27 @@ void deviceSuspend()
/**
* @brief Power off peripherals and deep sleep
+ *
*/
-void deviceShutdown()
+void Power::deviceShutdown()
{
powerOffPeripherals();
powerDeepSleep();
}
-/**
- * @brief Power off peripherals devices
- */
-void powerOffPeripherals()
-{
- tftOff();
- tft.fillScreen(TFT_BLACK);
- SPI.end();
- Wire.end();
-}
-/**
- * @brief On Mode
- *
- */
-void powerOn()
-{
-#ifdef DISABLE_RADIO
- WiFi.disconnect(true);
- WiFi.mode(WIFI_OFF);
- btStop();
- esp_wifi_stop();
- esp_bt_controller_disable();
-#endif
-}
+
+// /**
+// * @brief On Mode
+// *
+// */
+// void powerOn()
+// {
+// #ifdef DISABLE_RADIO
+// WiFi.disconnect(true);
+// WiFi.mode(WIFI_OFF);
+// btStop();
+// esp_wifi_stop();
+// esp_bt_controller_disable();
+// #endif
+// }
diff --git a/lib/power/power.hpp b/lib/power/power.hpp
index 78192ab7..bc9e7db0 100644
--- a/lib/power/power.hpp
+++ b/lib/power/power.hpp
@@ -19,12 +19,22 @@
#include "lvgl.h"
#include "globalGuiDef.h"
-void powerDeepSeep();
-void powerLightSleepTimer(int millis);
-void powerLightSleep();
-void powerOffPeripherals();
-void deviceSuspend();
-void deviceShutdown();
-void powerOn();
+// void powerOn();
+
+class Power
+{
+private:
+ void powerDeepSleep();
+ void powerLightSleepTimer(int millis);
+ void powerLightSleep();
+ void powerOffPeripherals();
+
+public:
+ Power();
+
+ void deviceSuspend();
+ void deviceShutdown();
+};
+
#endif
\ No newline at end of file
diff --git a/lib/storage/storage.hpp b/lib/storage/storage.hpp
index 35ccac5a..aa42897a 100644
--- a/lib/storage/storage.hpp
+++ b/lib/storage/storage.hpp
@@ -14,7 +14,6 @@
#include
#include
-
class Storage
{
private:
diff --git a/src/main.cpp b/src/main.cpp
index 072295cc..f768ccd3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -44,11 +44,12 @@ extern xSemaphoreHandle gpsMutex;
#include "webpage.h"
#include "webserver.h"
#include "battery.hpp"
+#include "power.hpp"
extern Storage storage;
extern Battery battery;
+extern Power power;
-#include "power.hpp"
#include "settings.hpp"
#include "lvglSetup.hpp"
#include "tasks.hpp"
@@ -101,7 +102,7 @@ void setup()
initCompass();
#endif
- powerOn();
+ // powerOn();
storage.initSD();
storage.initSPIFFS();
battery.initADC();
From 4b4f19904155b21ac67386cfc577efb2e28da681 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 24 Nov 2024 11:37:01 +0100
Subject: [PATCH 19/55] refactor: Clean Code
---
lib/gpx/src/addWaypoint.cpp | 2 +-
lib/gpx/src/addWaypoint.hpp | 6 +-----
lib/gpx/src/deleteWaypoint.hpp | 4 ----
lib/gpx/src/editWaypoint.hpp | 4 ----
lib/gpx/src/loadWaypoint.hpp | 5 -----
lib/gui/src/buttonBar.cpp | 5 -----
lib/gui/src/buttonBar.hpp | 2 ++
lib/gui/src/deviceSettingsScr.cpp | 1 -
lib/gui/src/deviceSettingsScr.hpp | 2 --
lib/gui/src/globalGuiDef.h | 9 ++-------
lib/gui/src/mainScr.cpp | 29 ++++-------------------------
lib/gui/src/mainScr.hpp | 9 +++------
lib/gui/src/mapSettingsScr.cpp | 2 --
lib/gui/src/mapSettingsScr.hpp | 1 -
lib/gui/src/navScr.hpp | 1 -
lib/gui/src/notifyBar.cpp | 2 --
lib/gui/src/notifyBar.hpp | 1 -
lib/gui/src/satInfoScr.cpp | 1 -
lib/gui/src/satInfoScr.hpp | 1 -
lib/gui/src/searchSatScr.cpp | 1 -
lib/gui/src/searchSatScr.hpp | 1 -
lib/gui/src/settingsScr.cpp | 1 -
lib/gui/src/settingsScr.hpp | 2 --
lib/gui/src/splashScr.hpp | 1 -
lib/gui/src/waypointListScr.hpp | 4 ----
lib/gui/src/waypointScr.cpp | 6 ------
lib/gui/src/waypointScr.hpp | 2 +-
lib/gui/src/widgets.hpp | 2 --
lib/lvgl/src/lvglFuncs.hpp | 3 ---
lib/lvgl/src/lvglSetup.cpp | 4 ----
lib/lvgl/src/lvglSetup.hpp | 19 ++++---------------
lib/maps/src/mapsDrawFunc.h | 4 ++--
lib/maps/src/renderMaps.cpp | 8 --------
lib/maps/src/renderMaps.hpp | 6 ------
lib/maps/src/vectorMaps.hpp | 7 -------
lib/power/power.hpp | 2 --
lib/settings/settings.cpp | 9 ---------
lib/storage/storage.cpp | 10 ++++------
lib/storage/storage.hpp | 4 +---
lib/tasks/tasks.cpp | 2 --
lib/tasks/tasks.hpp | 6 +++++-
lib/tft/tft.cpp | 6 ------
42 files changed, 30 insertions(+), 167 deletions(-)
diff --git a/lib/gpx/src/addWaypoint.cpp b/lib/gpx/src/addWaypoint.cpp
index 4e9a5d48..b2355171 100644
--- a/lib/gpx/src/addWaypoint.cpp
+++ b/lib/gpx/src/addWaypoint.cpp
@@ -8,7 +8,7 @@
#include "addWaypoint.hpp"
-extern const int SD_CS;
+extern const uint8_t SD_CS;
wayPoint addWpt = {0, 0, 0, (char *)"", (char *)"", (char *)"", (char *)"", (char *)"", (char *)"", 0, 0, 0, 0};
wayPoint loadWpt = {0, 0, 0, (char *)"", (char *)"", (char *)"", (char *)"", (char *)"", (char *)"", 0, 0, 0, 0};
diff --git a/lib/gpx/src/addWaypoint.hpp b/lib/gpx/src/addWaypoint.hpp
index 9a01b9cd..2ae526cf 100644
--- a/lib/gpx/src/addWaypoint.hpp
+++ b/lib/gpx/src/addWaypoint.hpp
@@ -9,12 +9,8 @@
#ifndef ADDWAYPOINT_HPP
#define ADDWAYPOINT_HPP
-#include "globalGpxDef.h"
#include "SD.h"
-#include "FS.h"
-#include "tft.hpp"
-#include "storage.hpp"
-#include "lvgl.h"
+#include "globalGpxDef.h"
extern wayPoint addWpt;
diff --git a/lib/gpx/src/deleteWaypoint.hpp b/lib/gpx/src/deleteWaypoint.hpp
index 1111f5a0..a610cf04 100644
--- a/lib/gpx/src/deleteWaypoint.hpp
+++ b/lib/gpx/src/deleteWaypoint.hpp
@@ -10,10 +10,6 @@
#define DELETEWAYPOINT_HPP
#include "SD.h"
-#include "FS.h"
-#include "tft.hpp"
-#include "storage.hpp"
-#include "globalGuiDef.h"
#include "globalGpxDef.h"
void deleteWaypointName(char * wpt);
diff --git a/lib/gpx/src/editWaypoint.hpp b/lib/gpx/src/editWaypoint.hpp
index 281742e0..e8b9ee31 100644
--- a/lib/gpx/src/editWaypoint.hpp
+++ b/lib/gpx/src/editWaypoint.hpp
@@ -10,10 +10,6 @@
#define EDITWAYPOINT_HPP
#include "SD.h"
-#include "FS.h"
-#include "tft.hpp"
-#include "storage.hpp"
-#include "globalGuiDef.h"
#include "globalGpxDef.h"
void editWaypointName(char* oldName, char *newName);
diff --git a/lib/gpx/src/loadWaypoint.hpp b/lib/gpx/src/loadWaypoint.hpp
index f27460b5..1fcfadf7 100644
--- a/lib/gpx/src/loadWaypoint.hpp
+++ b/lib/gpx/src/loadWaypoint.hpp
@@ -9,11 +9,6 @@
#ifndef LOADWAYPOINT_HPP
#define LOADWAYPOINT_HPP
-#include "SD.h"
-#include "FS.h"
-#include "tft.hpp"
-#include "storage.hpp"
-#include "globalGuiDef.h"
#include "globalGpxDef.h"
extern wayPoint loadWpt;
diff --git a/lib/gui/src/buttonBar.cpp b/lib/gui/src/buttonBar.cpp
index 46aa87d1..f7bc133e 100644
--- a/lib/gui/src/buttonBar.cpp
+++ b/lib/gui/src/buttonBar.cpp
@@ -7,10 +7,6 @@
*/
#include "buttonBar.hpp"
-#include "waypointScr.hpp"
-#include "waypointListScr.hpp"
-#include "display/lv_display.h"
-#include "globalGuiDef.h"
bool isWaypointOpt = false;
bool isTrackOpt = false;
@@ -59,7 +55,6 @@ void buttonBarEvent(lv_event_t *event)
if (strcmp(option,"waypoint") == 0)
{
log_v("Waypoint");
- // isMainScreen = false;
isWaypointOpt = true;
isTrackOpt = false;
if (!isOptionLoaded)
diff --git a/lib/gui/src/buttonBar.hpp b/lib/gui/src/buttonBar.hpp
index 24f9a1db..30a579f3 100644
--- a/lib/gui/src/buttonBar.hpp
+++ b/lib/gui/src/buttonBar.hpp
@@ -11,6 +11,8 @@
#include "globalGuiDef.h"
#include "mainScr.hpp"
+#include "waypointScr.hpp"
+#include "waypointListScr.hpp"
static const char *waypointIconFile PROGMEM = "/wpt.bin"; // Waypoint icon
static const char *trackIconFile PROGMEM = "/track.bin"; // Track icon
diff --git a/lib/gui/src/deviceSettingsScr.cpp b/lib/gui/src/deviceSettingsScr.cpp
index 00c2b7c3..3ad66778 100644
--- a/lib/gui/src/deviceSettingsScr.cpp
+++ b/lib/gui/src/deviceSettingsScr.cpp
@@ -7,7 +7,6 @@
*/
#include "deviceSettingsScr.hpp"
-#include "globalGuiDef.h"
lv_obj_t *deviceSettingsScreen; // Device Settings Screen
diff --git a/lib/gui/src/deviceSettingsScr.hpp b/lib/gui/src/deviceSettingsScr.hpp
index 248d6147..5ecec47d 100644
--- a/lib/gui/src/deviceSettingsScr.hpp
+++ b/lib/gui/src/deviceSettingsScr.hpp
@@ -10,8 +10,6 @@
#define DEVICESETTINGSCR_HPP
#include "globalGuiDef.h"
-#include "gps.hpp"
-#include "settings.hpp"
#include "lvglSetup.hpp"
static lv_obj_t *deviceSettingsOptions;
diff --git a/lib/gui/src/globalGuiDef.h b/lib/gui/src/globalGuiDef.h
index 92a12d53..858caf17 100644
--- a/lib/gui/src/globalGuiDef.h
+++ b/lib/gui/src/globalGuiDef.h
@@ -89,14 +89,9 @@ static bool getPngSize(const char* filename, uint16_t *width, uint16_t *height)
return false;
}
- byte table[32];
+ uint8_t table[32];
- // for (int i = 0; file.available() && i < 32; i++)
- // {
- // table[i] = file.read();
- // }
-
- fread(table, sizeof(byte), 32, file);
+ fread(table, sizeof(uint8_t), 32, file);
*width=table[16]*256*256*256+table[17]*256*256+table[18]*256+table[19];
*height=table[20]*256*256*256+table[21]*256*256+table[22]*256+table[23];
diff --git a/lib/gui/src/mainScr.cpp b/lib/gui/src/mainScr.cpp
index 671845cd..dab9ec3f 100644
--- a/lib/gui/src/mainScr.cpp
+++ b/lib/gui/src/mainScr.cpp
@@ -7,16 +7,6 @@
*/
#include "mainScr.hpp"
-#include "buttonBar.hpp"
-#include "core/lv_obj.h"
-#include "core/lv_obj_pos.h"
-#include "globalGuiDef.h"
-#include "globalMapsDef.h"
-#include "settings.hpp"
-#include "tft.hpp"
-
-extern const int SD_CS;
-extern const uint8_t TFT_SPI_CS;
bool isMainScreen = false; // Flag to indicate main screen is selected
bool isScrolled = true; // Flag to indicate when tileview was scrolled
@@ -27,12 +17,12 @@ uint8_t wptAction = WPT_NONE; // Current Waypoint Action
int wptPosX, wptPosY = 0; // Waypoint position on map
#ifdef LARGE_SCREEN
- int toolBarOffset = 100;
- int toolBarSpace = 60;
+ uint8_t toolBarOffset = 100;
+ uint8_t toolBarSpace = 60;
#endif
#ifndef LARGE_SCREEN
- int toolBarOffset = 80;
- int toolBarSpace = 50;
+ uint8_t toolBarOffset = 80;
+ uint8_t toolBarSpace = 50;
#endif
lv_obj_t *tilesScreen;
@@ -59,10 +49,8 @@ void updateCompassScr(lv_event_t * event)
lv_obj_t *obj = (lv_obj_t *)lv_event_get_current_target(event);
if (obj==compassHeading)
{
- //#ifdef ENABLE_COMPASS
lv_label_set_text_fmt(compassHeading, "%5d\xC2\xB0", heading);
lv_img_set_angle(compassImg, -(heading * 10));
- //#endif
}
if (obj==latitude)
lv_label_set_text_fmt(latitude, "%s", latFormatString(gpsData.latitude));
@@ -86,11 +74,6 @@ void getActTile(lv_event_t *event)
isScrolled = true;
redrawMap = true;
- if (activeTile == SATTRACK)
- {
- // createSatSprite(spriteSat);
- // createConstelSprite(constelSprite);
- }
if (activeTile == MAP)
{
createMapScrSprites();
@@ -240,8 +223,6 @@ void updateMap(lv_event_t *event)
getMapBlocks(viewPort.bbox, memCache);
- // deleteMapScrSprites();
- // createMapScrSprites();
generateVectorMap(viewPort, memCache, mapTempSprite);
isPosMoved = false;
@@ -418,9 +399,7 @@ void updateNavEvent(lv_event_t *event)
if (wptDistance == 0)
{
lv_img_set_src(arrowNav, &navfinish);
- //#ifdef ENABLE_COMPASS
lv_img_set_angle(arrowNav, 0);
- //#endif
}
else
{
diff --git a/lib/gui/src/mainScr.hpp b/lib/gui/src/mainScr.hpp
index 4d8c9f2e..a147f139 100644
--- a/lib/gui/src/mainScr.hpp
+++ b/lib/gui/src/mainScr.hpp
@@ -10,13 +10,9 @@
#define MAINSCR_HPP
#include "globalGuiDef.h"
-#include "lvglFuncs.hpp"
-#include "misc/lv_color.h"
-#include "notifyBar.hpp"
#include "buttonBar.hpp"
#include "renderMaps.hpp"
#include "vectorMaps.hpp"
-#include "addWaypoint.hpp"
#include "loadWaypoint.hpp"
#include "deleteWaypoint.hpp"
#include "editWaypoint.hpp"
@@ -57,13 +53,14 @@ extern lv_obj_t *satTrackTile;
extern lv_obj_t *btnFullScreen;
extern lv_obj_t *btnZoomIn;
extern lv_obj_t *btnZoomOut;
-extern int toolBarOffset;
-extern int toolBarSpace;
+extern uint8_t toolBarOffset;
+extern uint8_t toolBarSpace;
void updateCompassScr(lv_event_t * event);
void deleteMapScrSprites();
void createMapScrSprites();
+void displayMap(uint16_t tileSize);
void getActTile(lv_event_t *event);
void scrollTile(lv_event_t *event);
diff --git a/lib/gui/src/mapSettingsScr.cpp b/lib/gui/src/mapSettingsScr.cpp
index 110ff6a2..29db0312 100644
--- a/lib/gui/src/mapSettingsScr.cpp
+++ b/lib/gui/src/mapSettingsScr.cpp
@@ -7,8 +7,6 @@
*/
#include "mapSettingsScr.hpp"
-#include "core/lv_obj.h"
-#include "settings.hpp"
lv_obj_t *mapSettingsScreen; // Map Settings Screen
diff --git a/lib/gui/src/mapSettingsScr.hpp b/lib/gui/src/mapSettingsScr.hpp
index e09a6eac..6168abf5 100644
--- a/lib/gui/src/mapSettingsScr.hpp
+++ b/lib/gui/src/mapSettingsScr.hpp
@@ -10,7 +10,6 @@
#define MAPSETTINGSCR_HPP
#include "globalGuiDef.h"
-#include "settings.hpp"
#include "lvglFuncs.hpp"
#include "vectorMaps.hpp"
#include "renderMaps.hpp"
diff --git a/lib/gui/src/navScr.hpp b/lib/gui/src/navScr.hpp
index b53b8f69..5fea2489 100644
--- a/lib/gui/src/navScr.hpp
+++ b/lib/gui/src/navScr.hpp
@@ -9,7 +9,6 @@
#ifndef NAVSCR_HPP
#define NAVSCR_HPP
-#include "lvgl.h"
#include "globalGuiDef.h"
#include "navup.c"
diff --git a/lib/gui/src/notifyBar.cpp b/lib/gui/src/notifyBar.cpp
index d4ee873c..507d67fd 100644
--- a/lib/gui/src/notifyBar.cpp
+++ b/lib/gui/src/notifyBar.cpp
@@ -7,8 +7,6 @@
*/
#include "notifyBar.hpp"
-#include "font/lv_symbol_def.h"
-#include "misc/lv_event.h"
lv_obj_t *mainScreen;
lv_obj_t *notifyBarIcons;
diff --git a/lib/gui/src/notifyBar.hpp b/lib/gui/src/notifyBar.hpp
index b0b9ba11..cb7c5e7b 100644
--- a/lib/gui/src/notifyBar.hpp
+++ b/lib/gui/src/notifyBar.hpp
@@ -9,7 +9,6 @@
#ifndef NOTIFYBAR_HPP
#define NOTIFYBAR_HPP
-#include
#include "globalGuiDef.h"
#include "tasks.hpp"
#include "storage.hpp"
diff --git a/lib/gui/src/satInfoScr.cpp b/lib/gui/src/satInfoScr.cpp
index c418a9b0..cfd41f9b 100644
--- a/lib/gui/src/satInfoScr.cpp
+++ b/lib/gui/src/satInfoScr.cpp
@@ -35,7 +35,6 @@ void drawTextOnLayer(const char * text, lv_layer_t * layer, lv_point_t * p, lv_a
lv_draw_rect_dsc_t draw_rect_dsc;
lv_draw_rect_dsc_init(&draw_rect_dsc);
- //draw_rect_dsc.bg_color = lv_color_black();
draw_rect_dsc.bg_opa = LV_OPA_TRANSP;
draw_rect_dsc.radius = 0;
draw_rect_dsc.bg_image_symbol_font = font;
diff --git a/lib/gui/src/satInfoScr.hpp b/lib/gui/src/satInfoScr.hpp
index e66c44e4..ac98ccfd 100644
--- a/lib/gui/src/satInfoScr.hpp
+++ b/lib/gui/src/satInfoScr.hpp
@@ -9,7 +9,6 @@
#ifndef SATINFOSCR_HPP
#define SATINFOSCR_HPP
-#include "lvgl.h"
#include "globalGuiDef.h"
#include "gps.hpp"
diff --git a/lib/gui/src/searchSatScr.cpp b/lib/gui/src/searchSatScr.cpp
index 87bdb7b3..596e92ab 100644
--- a/lib/gui/src/searchSatScr.cpp
+++ b/lib/gui/src/searchSatScr.cpp
@@ -26,7 +26,6 @@ void buttonEvent(lv_event_t *event)
}
if (strcmp(option,"settings") == 0)
{
- //isMainScreen = false;
lv_screen_load(settingsScreen);
}
}
diff --git a/lib/gui/src/searchSatScr.hpp b/lib/gui/src/searchSatScr.hpp
index 489b8335..5f211cac 100644
--- a/lib/gui/src/searchSatScr.hpp
+++ b/lib/gui/src/searchSatScr.hpp
@@ -9,7 +9,6 @@
#ifndef SEARCHSATSCR_HPP
#define SEARCHSATSCR_HPP
-#include
#include "gps.hpp"
#include "globalGuiDef.h"
diff --git a/lib/gui/src/settingsScr.cpp b/lib/gui/src/settingsScr.cpp
index 37fb9ae0..c55e26b9 100644
--- a/lib/gui/src/settingsScr.cpp
+++ b/lib/gui/src/settingsScr.cpp
@@ -7,7 +7,6 @@
*/
#include "settingsScr.hpp"
-#include "globalGuiDef.h"
bool needReboot = false;
diff --git a/lib/gui/src/settingsScr.hpp b/lib/gui/src/settingsScr.hpp
index 40ee59b7..c68ee7bf 100644
--- a/lib/gui/src/settingsScr.hpp
+++ b/lib/gui/src/settingsScr.hpp
@@ -11,9 +11,7 @@
#include "globalGuiDef.h"
#include "mainScr.hpp"
-#include "compass.hpp"
#include "searchSatScr.hpp"
-#include "settings.hpp"
void loadMainScreen();
diff --git a/lib/gui/src/splashScr.hpp b/lib/gui/src/splashScr.hpp
index b1519785..61d22b61 100644
--- a/lib/gui/src/splashScr.hpp
+++ b/lib/gui/src/splashScr.hpp
@@ -9,7 +9,6 @@
#ifndef SPLASHSCR_HPP
#define SPLASHSCR_HPP
-#include "tft.hpp"
#include "globalGuiDef.h"
#include "settings.hpp"
diff --git a/lib/gui/src/waypointListScr.hpp b/lib/gui/src/waypointListScr.hpp
index 31f566ae..db3599b9 100644
--- a/lib/gui/src/waypointListScr.hpp
+++ b/lib/gui/src/waypointListScr.hpp
@@ -9,11 +9,7 @@
#ifndef WAYPOINTLISTSCR_HPP
#define WAYPOINTLISTSCR_HPP
-#include "globalGuiDef.h"
-#include "globalGpxDef.h"
#include "mainScr.hpp"
-#include "storage.hpp"
-#include
void loadMainScreen();
void updateWaypointPos();
diff --git a/lib/gui/src/waypointScr.cpp b/lib/gui/src/waypointScr.cpp
index e8bcb441..aed687a0 100644
--- a/lib/gui/src/waypointScr.cpp
+++ b/lib/gui/src/waypointScr.cpp
@@ -7,11 +7,6 @@
*/
#include "waypointScr.hpp"
-#include "core/lv_obj_pos.h"
-#include "display/lv_display.h"
-#include "globalGuiDef.h"
-#include "tft.hpp"
-#include "addWaypoint.hpp"
lv_obj_t *waypointScreen; // Add Waypoint Screen
lv_obj_t *waypointName;
@@ -238,7 +233,6 @@ void createWaypointScreen()
#ifdef TDECK_ESP32S3
lv_group_add_obj(scrGroup, waypointName);
lv_group_focus_obj(waypointName);
- //lv_group_add_obj(scrGroup, waypointScreen);
#endif
#ifndef TDECK_ESP32S3
diff --git a/lib/gui/src/waypointScr.hpp b/lib/gui/src/waypointScr.hpp
index 593be18b..4a2fff4d 100644
--- a/lib/gui/src/waypointScr.hpp
+++ b/lib/gui/src/waypointScr.hpp
@@ -9,7 +9,7 @@
#ifndef waypointScr_HPP
#define waypointScr_HPP
-#include "globalGuiDef.h"
+#include "addWaypoint.hpp"
#include "mainScr.hpp"
extern lv_obj_t *waypointName;
diff --git a/lib/gui/src/widgets.hpp b/lib/gui/src/widgets.hpp
index b3e7bfc3..5e15f6ee 100644
--- a/lib/gui/src/widgets.hpp
+++ b/lib/gui/src/widgets.hpp
@@ -9,8 +9,6 @@
#ifndef WIDGETS_HPP
#define WIDGETS_HPP
-#include "lvgl.h"
-#include "globalGuiDef.h"
#include "globalMapsDef.h"
#include "lvglFuncs.hpp"
#include "gpsMath.hpp"
diff --git a/lib/lvgl/src/lvglFuncs.hpp b/lib/lvgl/src/lvglFuncs.hpp
index 1f8cf7b5..0df59194 100644
--- a/lib/lvgl/src/lvglFuncs.hpp
+++ b/lib/lvgl/src/lvglFuncs.hpp
@@ -9,9 +9,6 @@
#ifndef LVGLFUNCS_HPP
#define LVGLFUNCS_HPP
-#include
-#include "tft.hpp"
-#include "lvgl.h"
#include "globalGuiDef.h"
void objHideCursor(_lv_obj_t *obj);
diff --git a/lib/lvgl/src/lvglSetup.cpp b/lib/lvgl/src/lvglSetup.cpp
index 43f1e725..32819911 100644
--- a/lib/lvgl/src/lvglSetup.cpp
+++ b/lib/lvgl/src/lvglSetup.cpp
@@ -6,11 +6,7 @@
* @date 2024-11
*/
-#include "lvgl_private.h"
#include "lvglSetup.hpp"
-#include "waypointScr.hpp"
-#include "waypointListScr.hpp"
-#include "globalGuiDef.h"
ViewPort viewPort; // Vector map viewport
MemCache memCache; // Vector map Memory Cache
diff --git a/lib/lvgl/src/lvglSetup.hpp b/lib/lvgl/src/lvglSetup.hpp
index f38c237e..386e02d9 100644
--- a/lib/lvgl/src/lvglSetup.hpp
+++ b/lib/lvgl/src/lvglSetup.hpp
@@ -9,28 +9,17 @@
#ifndef LVGLSETUP_HPP
#define LVGLSETUP_HPP
-#include
-
-#include "esp_attr.h"
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#ifdef TDECK_ESP32S3
- #include "Wire.h"
-#endif
-
#define LV_TICK_PERIOD_MS 5
-#include "globalGuiDef.h"
+#include "lvgl_private.h"
+// #ifdef TDECK_ESP32S3
+// #include "Wire.h"
+// #endif
#include "splashScr.hpp"
-#include "searchSatScr.hpp"
#include "notifyBar.hpp"
-#include "widgets.hpp"
-#include "mainScr.hpp"
-#include "buttonBar.hpp"
#include "settingsScr.hpp"
#include "deviceSettingsScr.hpp"
#include "mapSettingsScr.hpp"
-#include "waypointScr.hpp"
/**
* @brief Default display driver definition
diff --git a/lib/maps/src/mapsDrawFunc.h b/lib/maps/src/mapsDrawFunc.h
index fffdff20..b8428995 100644
--- a/lib/maps/src/mapsDrawFunc.h
+++ b/lib/maps/src/mapsDrawFunc.h
@@ -94,8 +94,8 @@ static void drawMapWidgets()
mapHeight = MAP_HEIGHT;
- int toolBarOffset = 0;
- int toolBarSpace = 0;
+ uint8_t toolBarOffset = 0;
+ uint8_t toolBarSpace = 0;
#ifdef LARGE_SCREEN
toolBarOffset = 100;
toolBarSpace = 60;
diff --git a/lib/maps/src/renderMaps.cpp b/lib/maps/src/renderMaps.cpp
index ca28d0dc..fe8ef46a 100644
--- a/lib/maps/src/renderMaps.cpp
+++ b/lib/maps/src/renderMaps.cpp
@@ -7,9 +7,6 @@
*/
#include "renderMaps.hpp"
-#include "mapsDrawFunc.h"
-
-extern const int SD_CS;
MapTile oldMapTile = {(char*)"", 0, 0, 0}; // Old Map tile coordinates and zoom
MapTile currentMapTile = {(char*)"", 0, 0, 0}; // Current Map tile coordinates and zoom
@@ -20,8 +17,6 @@ bool isMapFound = false;
tileBounds totalBounds = { 90.0, -90.0, 180.0, -180.0};
-
-
/**
* @brief Tile size for position calculation
*
@@ -172,9 +167,6 @@ void generateRenderMap()
if (strcmp(currentMapTile.file, oldMapTile.file) != 0 || currentMapTile.zoom != oldMapTile.zoom ||
currentMapTile.tilex != oldMapTile.tilex || currentMapTile.tiley != oldMapTile.tiley)
{
- // deleteMapScrSprites();
- // createMapScrSprites();
-
isMapFound = mapTempSprite.drawPngFile(SD, currentMapTile.file, tileSize, tileSize);
if (!isMapFound)
diff --git a/lib/maps/src/renderMaps.hpp b/lib/maps/src/renderMaps.hpp
index 677ed4a7..e225b12b 100644
--- a/lib/maps/src/renderMaps.hpp
+++ b/lib/maps/src/renderMaps.hpp
@@ -9,11 +9,7 @@
#ifndef RENDERMAPS_HPP
#define RENDERMAPS_HPP
-#include
-#include "tft.hpp"
-#include "compass.hpp"
#include "settings.hpp"
-#include "globalMapsDef.h"
#include "mapsDrawFunc.h"
/**
@@ -45,8 +41,6 @@ tileBounds getTileBounds(uint32_t tileX, uint32_t tileY, uint8_t zoom);
bool isCoordInBounds(double lat, double lon, tileBounds bound);
void coords2map(double lat, double lon, tileBounds bound, int *pixelX, int *pixelY);
MapTile getMapTile(double lon, double lat, uint8_t zoomLevel, int16_t offsetX, int16_t offsetY);
-void drawMapWidgets();
void generateRenderMap();
-void initSD();
#endif
diff --git a/lib/maps/src/vectorMaps.hpp b/lib/maps/src/vectorMaps.hpp
index a17d78ab..2fa746d6 100644
--- a/lib/maps/src/vectorMaps.hpp
+++ b/lib/maps/src/vectorMaps.hpp
@@ -9,17 +9,10 @@
#ifndef VECTORMAPS_HPP
#define VECTORMAPS_HPP
-#include
-#include
#include
-#include
-#include
#include
-#include
-#include
#include
";
}
From b21dce6567eb20cdb3d88f94c7e8849e8c835d73 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Wed, 27 Nov 2024 22:32:49 +0100
Subject: [PATCH 32/55] feat(webserver): Add path info in status
---
lib/webfile/src/webserver.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/webfile/src/webserver.h b/lib/webfile/src/webserver.h
index b535b4f0..9d35a22f 100644
--- a/lib/webfile/src/webserver.h
+++ b/lib/webfile/src/webserver.h
@@ -617,7 +617,7 @@ void configureWebServer()
if (oldDir == "")
oldDir = "/";
currentDir = "";
- request->send(200, "text/plain", "Directory changed successfully");
+ request->send(200, "text/plain", "Path:" + oldDir );
}
else
{
@@ -632,7 +632,7 @@ void configureWebServer()
else
oldDir = newDir;
currentDir = "";
- request->send(200, "text/plain", "Directory changed successfully");
+ request->send(200, "text/plain", "Path:" + oldDir);
}
cacheDirectoryContent(oldDir);
From 6f0114f190eb31325576a67a1b8105743c3add2b Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 1 Dec 2024 11:50:06 +0100
Subject: [PATCH 33/55] feat: Add Sunrise and Sunset Calculation
---
README.md | 3 ++-
lib/gps/gps.cpp | 6 ++++++
lib/gps/gps.hpp | 3 +++
lib/gps/timezone.hpp | 22 ++++++++++++++++++++++
platformio.ini | 1 +
src/main.cpp | 25 ++++++++++++++++++++++++-
6 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c36cfd39..f0f5e2fc 100644
--- a/README.md
+++ b/README.md
@@ -359,7 +359,8 @@ To access the Web File Server, simply use any browser and go to the following ad
* OSM to binary vectorial maps [OSM_Extract](https://github.com/aresta/OSM_Extract) thanks to [@aresta](https://github.com/aresta)
* Preferences Library [Easy Preferences](https://github.com/hpsaturn/easy-preferences) thanks to [@hpsaturn](https://github.com/hpsaturn)
* Wifi CLI manager [esp32-wifi-cli](https://github.com/hpsaturn/esp32-wifi-cli) thanks to [@hpsaturn](https://github.com/hpsaturn)
-* Web file server based in [@smford](https://github.com/smford) [esp32-asyncwebserver-fileupload-example ](https://github.com/smford/esp32-asyncwebserver-fileupload-example)
+* Web file server based in [@smford](https://github.com/smford) [esp32-asyncwebserver-fileupload-example](https://github.com/smford/esp32-asyncwebserver-fileupload-example)
+* Solar sunset and sunrise [SolarCalculator](https://github.com/jpb10/SolarCalculator) thanks to [@jpb10](https://github.com/jpb10)
---
diff --git a/lib/gps/gps.cpp b/lib/gps/gps.cpp
index 74fcdd0d..d3d50d74 100644
--- a/lib/gps/gps.cpp
+++ b/lib/gps/gps.cpp
@@ -140,6 +140,12 @@ void getGPSData()
{
adjustTime( fix.dateTime );
localTime = fix.dateTime;
+ // Calculate Sunrise and Sunset only one time when date & time was valid
+ if (calcSun)
+ {
+ calculateSun();
+ calcSun = false;
+ }
}
// Altitude
diff --git a/lib/gps/gps.hpp b/lib/gps/gps.hpp
index f7c1a51c..2d936ac3 100644
--- a/lib/gps/gps.hpp
+++ b/lib/gps/gps.hpp
@@ -78,6 +78,9 @@ struct GPSDATA
extern GPSDATA gpsData;
+static bool calcSun = true;
+void calculateSun();
+
void initGPS();
double getLat();
double getLon();
diff --git a/lib/gps/timezone.hpp b/lib/gps/timezone.hpp
index 14e12c07..3890e20b 100644
--- a/lib/gps/timezone.hpp
+++ b/lib/gps/timezone.hpp
@@ -98,4 +98,26 @@ static void adjustTime( NeoGPS::time_t & dt )
dt = seconds; // convert seconds back to a date/time structure
}
+
+/**
+ * @brief convert hour to HH:MM rounded
+ *
+ * @param h -> hour
+ * @param str -> HH:MM text format
+ */
+static char * hoursToString(double h, char *str)
+{
+ int m = int(round(h * 60));
+ int hr = (m / 60) % 24;
+ int mn = m % 60;
+
+ str[0] = (hr / 10) % 10 + '0';
+ str[1] = (hr % 10) + '0';
+ str[2] = ':';
+ str[3] = (mn / 10) % 10 + '0';
+ str[4] = (mn % 10) + '0';
+ str[5] = '\0';
+ return str;
+}
+
#endif
\ No newline at end of file
diff --git a/platformio.ini b/platformio.ini
index 742e855d..4c50a5b0 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -48,6 +48,7 @@ lib_deps =
hpsaturn/ESP32 Wifi CLI@0.3.3
kubafilinger/AsyncTCP@1.1.1
esphome/ESPAsyncWebServer-esphome@3.3.0
+ jpb10/SolarCalculator@2.0.1
[esp32_common]
extends = common
diff --git a/src/main.cpp b/src/main.cpp
index f768ccd3..336a9092 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,6 +16,7 @@
#include
#include
#include
+#include
// Hardware includes
#include "hal.hpp"
@@ -50,10 +51,32 @@ extern Storage storage;
extern Battery battery;
extern Power power;
+/**
+ * @brief Sunrise and Sunset
+ *
+ */
+static double transit, sunrise, sunset;
+
#include "settings.hpp"
#include "lvglSetup.hpp"
#include "tasks.hpp"
+/**
+ * @brief Calculate Sunrise and Sunset
+ * Must be a global function
+ *
+ */
+void calculateSun()
+{
+ calcSunriseSunset(2000 + localTime.year, localTime.month, localTime.date,
+ gpsData.latitude, gpsData.longitude,
+ transit, sunrise, sunset);
+
+ char str[6];
+ log_v("%d/%d/%d",2000 + localTime.year, localTime.month, localTime.date);
+ log_v("Sunrise: %s",hoursToString(sunrise + defGMT, str));
+ log_v("Sunset: %s", hoursToString(sunset + defGMT, str));
+}
/**
* @brief Setup
@@ -116,6 +139,7 @@ void setup()
mapTempSprite.deleteSprite();
mapTempSprite.createSprite(TILE_WIDTH, TILE_HEIGHT);
+ // Get init Latitude and Longitude
gpsData.latitude = getLat();
gpsData.longitude = getLon();
@@ -125,7 +149,6 @@ void setup()
}
else
{
- // Get init Latitude and Longitude
tileSize = RENDER_TILE_SIZE;
generateRenderMap();
}
From b8dfd00a11dbbd3dca6a9a7c5b42cc3559da7237 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 1 Dec 2024 11:59:02 +0100
Subject: [PATCH 34/55] build: Update LovyanGFX library
---
platformio.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platformio.ini b/platformio.ini
index 742e855d..ca63839b 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -42,7 +42,7 @@ lib_deps =
; slashdevin/NeoGPS@4.2.9
https://github.com/jgauchia/NeoGPS.git#43c4766
lvgl/lvgl@9.2.2
- lovyan03/LovyanGFX@1.1.16
+ lovyan03/LovyanGFX@1.2.0
bblanchon/StreamUtils@1.9.0
hpsaturn/EasyPreferences@0.1.3
hpsaturn/ESP32 Wifi CLI@0.3.3
From 311436c8cae06f64e837496bb6178e43e360818f Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 1 Dec 2024 13:26:16 +0100
Subject: [PATCH 35/55] feat: Change default Tile if Search satellite skipped
---
lib/gui/src/mainScr.cpp | 4 ++++
lib/gui/src/searchSatScr.cpp | 3 +++
lib/lvgl/src/lvglSetup.cpp | 1 +
3 files changed, 8 insertions(+)
diff --git a/lib/gui/src/mainScr.cpp b/lib/gui/src/mainScr.cpp
index dab9ec3f..c33f8144 100644
--- a/lib/gui/src/mainScr.cpp
+++ b/lib/gui/src/mainScr.cpp
@@ -141,6 +141,10 @@ void scrollTile(lv_event_t *event)
*/
void updateMainScreen(lv_timer_t *t)
{
+ log_v("scrolled %d", isScrolled);
+ log_v("tile %d",activeTile);
+ log_v("main scr %d", isMainScreen);
+
if (isScrolled && isMainScreen)
{
switch (activeTile)
diff --git a/lib/gui/src/searchSatScr.cpp b/lib/gui/src/searchSatScr.cpp
index 596e92ab..5fa9eaa7 100644
--- a/lib/gui/src/searchSatScr.cpp
+++ b/lib/gui/src/searchSatScr.cpp
@@ -11,6 +11,7 @@
static unsigned long millisActual = 0;
static bool skipSearch = false;
bool isSearchingSat = true;
+extern uint8_t activeTile;
/**
* @brief Button events
@@ -51,6 +52,8 @@ void searchGPS(lv_timer_t *searchTimer)
lv_timer_del(searchTimer);
isSearchingSat = false;
zoom = defaultZoom;
+ activeTile = 3;
+ lv_tileview_set_tile_by_index(tilesScreen, 3, 0, LV_ANIM_OFF);
loadMainScreen();
}
}
diff --git a/lib/lvgl/src/lvglSetup.cpp b/lib/lvgl/src/lvglSetup.cpp
index 32819911..c1c0396c 100644
--- a/lib/lvgl/src/lvglSetup.cpp
+++ b/lib/lvgl/src/lvglSetup.cpp
@@ -346,6 +346,7 @@ void initLVGL()
void loadMainScreen()
{
isMainScreen = true;
+ isScrolled = true;
isSearchingSat = false;
wptAction = WPT_NONE;
lv_screen_load(mainScreen);
From 483923ebf4964e47b1f6714600f4a1f0e847e5b0 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 1 Dec 2024 13:44:33 +0100
Subject: [PATCH 36/55] fix(timer): Fix main app Timer init.
---
lib/gui/src/mainScr.cpp | 4 ----
lib/gui/src/mainScr.hpp | 2 +-
lib/gui/src/searchSatScr.cpp | 4 ++++
lib/gui/src/settingsScr.cpp | 3 +++
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/lib/gui/src/mainScr.cpp b/lib/gui/src/mainScr.cpp
index c33f8144..dab9ec3f 100644
--- a/lib/gui/src/mainScr.cpp
+++ b/lib/gui/src/mainScr.cpp
@@ -141,10 +141,6 @@ void scrollTile(lv_event_t *event)
*/
void updateMainScreen(lv_timer_t *t)
{
- log_v("scrolled %d", isScrolled);
- log_v("tile %d",activeTile);
- log_v("main scr %d", isMainScreen);
-
if (isScrolled && isMainScreen)
{
switch (activeTile)
diff --git a/lib/gui/src/mainScr.hpp b/lib/gui/src/mainScr.hpp
index a147f139..06f3eb82 100644
--- a/lib/gui/src/mainScr.hpp
+++ b/lib/gui/src/mainScr.hpp
@@ -20,7 +20,7 @@
#include "navScr.hpp"
#include "satInfoScr.hpp"
-static lv_timer_t *mainTimer; // Main Screen Timer
+extern lv_timer_t *mainTimer; // Main Screen Timer
#define UPDATE_MAINSCR_PERIOD 30 // Main Screen update time
extern bool isMainScreen; // Flag to indicate main screen is selected
diff --git a/lib/gui/src/searchSatScr.cpp b/lib/gui/src/searchSatScr.cpp
index 5fa9eaa7..29856b36 100644
--- a/lib/gui/src/searchSatScr.cpp
+++ b/lib/gui/src/searchSatScr.cpp
@@ -12,6 +12,7 @@ static unsigned long millisActual = 0;
static bool skipSearch = false;
bool isSearchingSat = true;
extern uint8_t activeTile;
+lv_timer_t *mainTimer; // Main Screen Timer
/**
* @brief Button events
@@ -29,6 +30,7 @@ void buttonEvent(lv_event_t *event)
{
lv_screen_load(settingsScreen);
}
+ lv_timer_resume(mainTimer);
}
/**
@@ -43,6 +45,7 @@ void searchGPS(lv_timer_t *searchTimer)
while (millis() < millisActual + 500)
;
lv_timer_del(searchTimer);
+ lv_timer_resume(mainTimer);
isSearchingSat = false;
loadMainScreen();
}
@@ -66,6 +69,7 @@ void createSearchSatScr()
{
searchTimer = lv_timer_create(searchGPS, 100, NULL);
lv_timer_ready(searchTimer);
+ lv_timer_pause(mainTimer);
searchSatScreen = lv_obj_create(NULL);
diff --git a/lib/gui/src/settingsScr.cpp b/lib/gui/src/settingsScr.cpp
index c55e26b9..518fda83 100644
--- a/lib/gui/src/settingsScr.cpp
+++ b/lib/gui/src/settingsScr.cpp
@@ -18,7 +18,10 @@ bool needReboot = false;
static void back(lv_event_t *event)
{
if (isSearchingSat)
+ {
+ lv_timer_pause(mainTimer);
lv_screen_load(searchSatScreen);
+ }
else
loadMainScreen();
}
From acaf54964fcac69db66b7a6f1230a44debe74fa9 Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Sun, 1 Dec 2024 13:52:34 +0100
Subject: [PATCH 37/55] refactor(settings): Refactor device settings code
---
lib/gui/src/deviceSettingsScr.cpp | 33 +++++++++++++++++--------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/lib/gui/src/deviceSettingsScr.cpp b/lib/gui/src/deviceSettingsScr.cpp
index 3ad66778..a015eeed 100644
--- a/lib/gui/src/deviceSettingsScr.cpp
+++ b/lib/gui/src/deviceSettingsScr.cpp
@@ -37,7 +37,11 @@ void deviceSettingsEvent(lv_event_t *event)
}
}
-void lv_brightness_cb(lv_event_t *e)
+/**
+ * @brief Brightness callback
+ *
+ */
+void brightnessEvent(lv_event_t *e)
{
lv_obj_t *obj =(lv_obj_t*) lv_event_get_target(e);
defBright = lv_slider_get_value(obj);
@@ -45,17 +49,11 @@ void lv_brightness_cb(lv_event_t *e)
tft.setBrightness(defBright);
}
-// void lv_background_opa_cb(lv_event_t *e)
-// {
-// lv_obj_t *obj =(lv_obj_t*) lv_event_get_target(e);
-// uint8_t val = lv_slider_get_value(obj);
-// std::vector::iterator it;
-// for (it = sub_section.begin(); it != sub_section.end(); it++) {
-// lv_obj_set_style_bg_opa(*it, val, LV_PART_MAIN);
-// }
-// }
-
-static lv_obj_t *create_text(lv_obj_t *parent, const char *icon, const char *txt)
+/**
+ * @brief Create brightness text
+ *
+ */
+static lv_obj_t *createBrightText(lv_obj_t *parent, const char *icon, const char *txt)
{
lv_obj_t *obj = lv_menu_cont_create(parent);
@@ -82,10 +80,14 @@ static lv_obj_t *create_text(lv_obj_t *parent, const char *icon, const char *txt
return obj;
}
-static lv_obj_t *create_slider(lv_obj_t *parent, const char *icon, const char *txt, int32_t min, int32_t max,
+/**
+ * @brief Create brightness slider
+ *
+ */
+static lv_obj_t *createBrightSlider(lv_obj_t *parent, const char *icon, const char *txt, int32_t min, int32_t max,
int32_t val, lv_event_cb_t cb, lv_event_code_t filter)
{
- lv_obj_t *obj = create_text(parent, icon, txt);
+ lv_obj_t *obj = createBrightText(parent, icon, txt);
lv_obj_t *slider = lv_slider_create(obj);
lv_obj_set_width(slider,TFT_WIDTH - 80);
@@ -153,7 +155,8 @@ void createDeviceSettingsScr()
lv_obj_align_to(dropdown, list, LV_ALIGN_OUT_RIGHT_MID, 0, 0);
lv_obj_add_event_cb(dropdown, deviceSettingsEvent, LV_EVENT_VALUE_CHANGED, (char*)"rate");
- create_slider(deviceSettingsOptions, LV_SYMBOL_SETTINGS, "Brightness", 5, 255, defBright, lv_brightness_cb, LV_EVENT_VALUE_CHANGED);
+ // Brightness Slider
+ createBrightSlider(deviceSettingsOptions, LV_SYMBOL_SETTINGS, "Brightness", 5, 255, defBright, brightnessEvent, LV_EVENT_VALUE_CHANGED);
// Back button
btn = lv_btn_create(deviceSettingsScreen);
From 4ac533ec9460431761bf5819fd8ab73c47e5c20d Mon Sep 17 00:00:00 2001
From: jgauchia
Date: Mon, 2 Dec 2024 19:39:27 +0100
Subject: [PATCH 38/55] feat(firmware): Add firmware upgrade from SD Card
---
README.md | 2 +-
images/dev/devicesettings.jpg | Bin 11276 -> 0 bytes
images/dev/devicesettings.png | Bin 0 -> 7306 bytes
lib/gui/src/deviceSettingsScr.cpp | 38 +++++++++++-
lib/gui/src/deviceSettingsScr.hpp | 4 ++
lib/gui/src/upgradeScr.cpp | 89 +++++++++++++++++++++++++++
lib/gui/src/upgradeScr.hpp | 26 ++++++++
lib/upgrade/src/firmUpgrade.cpp | 98 ++++++++++++++++++++++++++++++
lib/upgrade/src/firmUpgrade.hpp | 26 ++++++++
lib/webfile/src/webserver.h | 2 +-
10 files changed, 280 insertions(+), 5 deletions(-)
delete mode 100644 images/dev/devicesettings.jpg
create mode 100644 images/dev/devicesettings.png
create mode 100644 lib/gui/src/upgradeScr.cpp
create mode 100644 lib/gui/src/upgradeScr.hpp
create mode 100644 lib/upgrade/src/firmUpgrade.cpp
create mode 100644 lib/upgrade/src/firmUpgrade.hpp
diff --git a/README.md b/README.md
index c36cfd39..1c31fcd8 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ ESP32 Based GPS Navigator (LVGL - LovyanGFX).
|:-:|:-:|:-:|
| Add Waypoint | Add Waypoint (landscape) | Waypoint List |
-||||||
+||||||
|:-:|:-:|:-:|:-:|:-:|
| Settings | Compass Calibration | Touch Calibration | Map Settings | Device Settings |
diff --git a/images/dev/devicesettings.jpg b/images/dev/devicesettings.jpg
deleted file mode 100644
index 8547b0dbd4fb5807a5e48ddda5929113545e41b9..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 11276
zcmeHs2Ut|g(%_juk}xyGANy+qeGv?)%^U_xr!y?e4EmS9Nur>gulUI(_zr_r?LZjy6#n
z0D(XNft-Q85kM1wLLmDE3V~8Up%j#ds3^&ap5_qsAs9Uz4x@)LAefNM2u3zW1{ez$
z3mZE-CnqPInVXlJgBQuc$+0g41f`&$q@bjuqN3wKzz`h&a@uPF5Y(V?kQxMp0l)|l
z1OeJ>131a50+4-me3`osW&wdAdv5_c2nYbfA#gIj*wT>UqKH
zD!z+mIjwST5TQ`-;;`0
zO6$D>8gg{V5+MA_p<}xd&`gJ^=dVT#o1$C9-NCC33*+auzD?TQvka=%yJ0Whr=OUT
zs!K|=vqz?C^BexGB+O&%?byvj%+R;O$QAx)I8#}SWdT**gA65=VC9m}8Mb`~ih^Rh
zzb*L->sZEz|Hux#OTViY`0=&G`Ox@aMeYYoRk99OngF^DvT+i4G#6~2e%J9@A9@!w
z?J_nO!*^)drQ^f=d;jCS@3Zwxbq$h=j=8j72{ny4miWM>&HVDpr2(Fp=}ZZfxAvEw
zZyq(ni`7mK224f4eqAx25?C68ZW-E}@Ev5yom`nslWLlx#Aj_*#hN1UXKhmDbpPAR
zSE)ggbK=2h_D#Q^Kql4X(SpzrR>ug<|epLNT*%6c1-Y{lYZwu36k|RnR&J=2K^$U
zXCLP&pWbquU(Y&bIMn-e=7GsF-Ed#iegh=CJ(+oAp=I9JTUx0j@*)SW!Leg0kMo~a
z`#Mr?Zpf1TSp-h@UkWG)3MPB}zDNK9K*1DD%+er6i~*byAt}XzW<{yt4wHSHn#=;C
z0EY_;kB9$t8F^oT{f2a0qYp-xJ9y%##1Sshg6I#5Pm&%bJ>8|hj9hys+u(A2XsKlC
zR7Y*pMUEe6V%N-*lk7LVD+H_3Dx3}U8aZi&KF*{n2AmZOE>!W@=}ws99ev1jqf~0c
zRYhLSqC4P;LbbbtvH2U)_KTPF`y6rizcDjfzX0Ut~HkE08
zWc5>%L?W5baoZ-bI$951mMJ}C&)l3RSEe@;dDvCb(Ts^0#IU*~mi0I>TCh68kgS8;
zvnh#?l8-|51by*~cgIthPozC@rA!bK%w$?N>N?wX36=yKba*+OjjZ~H^{snJ9?&M|
z*ZB8Kv!`#~7k*Yz{1Xhm{c<;C)5_k8jiTB8&w|DGB9Vsa5yeT_C03SM@Sa8CJM3-|c3
z(r}#QM~RlJ+48$HonskQMzv;Z?{J)6SBsBr=ua7oU0&`g*3axIDCIkmK^T)sg3Viz
z_UBT;(IJk#C_ScmIIi9lPK5Ff#0lMiY$apw@fxUg4_;Q~x2Sx0A$a8@lf-ew_#VEB
zg-_yZN}5&ay%{G?$NVnDJ3)V^L!Nq~GU