summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinhold Gschweicher <pyro4hell@gmail.com>2022-02-15 22:59:38 (GMT)
committerJF <JF002@users.noreply.github.com>2022-02-19 12:17:00 (GMT)
commitb857fdb9f438cd9a3440c82face944323301cfad (patch)
treebcf74e8b14c352f25f6caa7d17825dc4a446da8d /src
parent4aaa3a3b49b3b70509345f83ebe1c4f4bacd524d (diff)
SystemTask: forward declare BatteryController to fix of cyclic dependency
SystemTask.h included BatteryController.h, and BatteryController.h included SystemTask.h. If unlucky the class SystemTask isn't created yet when BatteryController wants to use it. Fix that cyclic dependency by forward declaring the BatteryController class and including it in the SystemTask.cpp file, where it is needed.
Diffstat (limited to 'src')
-rw-r--r--src/systemtask/SystemTask.cpp1
-rw-r--r--src/systemtask/SystemTask.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index 6460cd4..8d9cb1d 100644
--- a/src/systemtask/SystemTask.cpp
+++ b/src/systemtask/SystemTask.cpp
@@ -4,6 +4,7 @@
#include <libraries/log/nrf_log.h>
#include "BootloaderVersion.h"
+#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
#include "drivers/Cst816s.h"
#include "drivers/St7789.h"
diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h
index abeffd2..517ed1a 100644
--- a/src/systemtask/SystemTask.h
+++ b/src/systemtask/SystemTask.h
@@ -13,7 +13,6 @@
#include <components/motion/MotionController.h>
#include "systemtask/SystemMonitor.h"
-#include "components/battery/BatteryController.h"
#include "components/ble/NimbleController.h"
#include "components/ble/NotificationManager.h"
#include "components/motor/MotorController.h"
@@ -47,6 +46,7 @@ namespace Pinetime {
class Hrs3300;
}
namespace Controllers {
+ class Battery;
class TouchHandler;
class ButtonHandler;
}