watchdog: Replace WatchdogView with const Watchdog

This commit is contained in:
Riku Isokoski 2023-02-23 21:34:06 +02:00
parent 26478d9006
commit ff34cf196e
8 changed files with 12 additions and 26 deletions

View File

@ -65,7 +65,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
const Controllers::Battery& batteryController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,
const Drivers::Watchdog& watchdog,
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::HeartRateController& heartRateController,
Controllers::Settings& settingsController,

View File

@ -27,7 +27,7 @@ namespace Pinetime {
namespace Drivers {
class St7789;
class Cst816S;
class WatchdogView;
class Watchdog;
}
namespace Controllers {
@ -57,7 +57,7 @@ namespace Pinetime {
const Controllers::Battery& batteryController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,
const Drivers::Watchdog& watchdog,
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::HeartRateController& heartRateController,
Controllers::Settings& settingsController,
@ -84,7 +84,7 @@ namespace Pinetime {
const Pinetime::Controllers::Battery& batteryController;
const Pinetime::Controllers::Ble& bleController;
Pinetime::Controllers::DateTime& dateTimeController;
Pinetime::Drivers::WatchdogView& watchdog;
const Pinetime::Drivers::Watchdog& watchdog;
Pinetime::System::SystemTask* systemTask = nullptr;
Pinetime::Controllers::NotificationManager& notificationManager;
Pinetime::Controllers::HeartRateController& heartRateController;

View File

@ -16,7 +16,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
const Controllers::Battery& /*batteryController*/,
const Controllers::Ble& bleController,
Controllers::DateTime& /*dateTimeController*/,
Drivers::WatchdogView& /*watchdog*/,
const Drivers::Watchdog& /*watchdog*/,
Pinetime::Controllers::NotificationManager& /*notificationManager*/,
Pinetime::Controllers::HeartRateController& /*heartRateController*/,
Controllers::Settings& /*settingsController*/,

View File

@ -20,7 +20,7 @@ namespace Pinetime {
namespace Drivers {
class St7789;
class Cst816S;
class WatchdogView;
class Watchdog;
}
namespace Controllers {
@ -52,7 +52,7 @@ namespace Pinetime {
const Controllers::Battery& batteryController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,
const Drivers::Watchdog& watchdog,
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::HeartRateController& heartRateController,
Controllers::Settings& settingsController,

View File

@ -35,7 +35,7 @@ SystemInfo::SystemInfo(Pinetime::Applications::DisplayApp* app,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::BrightnessController& brightnessController,
const Pinetime::Controllers::Ble& bleController,
Pinetime::Drivers::WatchdogView& watchdog,
const Pinetime::Drivers::Watchdog& watchdog,
Pinetime::Controllers::MotionController& motionController,
const Pinetime::Drivers::Cst816S& touchPanel)
: app {app},

View File

@ -13,7 +13,7 @@ namespace Pinetime {
}
namespace Drivers {
class WatchdogView;
class Watchdog;
}
namespace Applications {
@ -27,7 +27,7 @@ namespace Pinetime {
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::BrightnessController& brightnessController,
const Pinetime::Controllers::Ble& bleController,
Pinetime::Drivers::WatchdogView& watchdog,
const Pinetime::Drivers::Watchdog& watchdog,
Pinetime::Controllers::MotionController& motionController,
const Pinetime::Drivers::Cst816S& touchPanel);
~SystemInfo() override;
@ -39,7 +39,7 @@ namespace Pinetime {
const Pinetime::Controllers::Battery& batteryController;
Pinetime::Controllers::BrightnessController& brightnessController;
const Pinetime::Controllers::Ble& bleController;
Pinetime::Drivers::WatchdogView& watchdog;
const Pinetime::Drivers::Watchdog& watchdog;
Pinetime::Controllers::MotionController& motionController;
const Pinetime::Drivers::Cst816S& touchPanel;

View File

@ -20,18 +20,5 @@ namespace Pinetime {
ResetReasons resetReason;
ResetReasons ActualResetReason() const;
};
class WatchdogView {
public:
WatchdogView(const Watchdog& watchdog) : watchdog {watchdog} {
}
Watchdog::ResetReasons ResetReason() const {
return watchdog.ResetReason();
}
private:
const Watchdog& watchdog;
};
}
}

View File

@ -106,7 +106,6 @@ Pinetime::Controllers::MotorController motorController {};
Pinetime::Controllers::DateTime dateTimeController {settingsController};
Pinetime::Drivers::Watchdog watchdog;
Pinetime::Drivers::WatchdogView watchdogView(watchdog);
Pinetime::Controllers::NotificationManager notificationManager;
Pinetime::Controllers::MotionController motionController;
Pinetime::Controllers::TimerController timerController;
@ -121,7 +120,7 @@ Pinetime::Applications::DisplayApp displayApp(lcd,
batteryController,
bleController,
dateTimeController,
watchdogView,
watchdog,
notificationManager,
heartRateController,
settingsController,