From b857fdb9f438cd9a3440c82face944323301cfad Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 15 Feb 2022 23:59:38 +0100 Subject: [PATCH] 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. --- src/systemtask/SystemTask.cpp | 1 + src/systemtask/SystemTask.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 6460cd4b..8d9cb1d1 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -4,6 +4,7 @@ #include #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 abeffd2f..517ed1ae 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -13,7 +13,6 @@ #include #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; }