displayapp: Make Ble references const

This commit is contained in:
Riku Isokoski 2023-02-23 22:24:07 +02:00
parent 76f07de64b
commit 255b07094b
30 changed files with 42 additions and 42 deletions

View file

@ -63,7 +63,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Components::LittleVgl& lvgl,
const Drivers::Cst816S& touchPanel,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,
Pinetime::Controllers::NotificationManager& notificationManager,

View file

@ -55,7 +55,7 @@ namespace Pinetime {
Components::LittleVgl& lvgl,
const Drivers::Cst816S&,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,
Pinetime::Controllers::NotificationManager& notificationManager,
@ -82,7 +82,7 @@ namespace Pinetime {
Pinetime::Components::LittleVgl& lvgl;
const Pinetime::Drivers::Cst816S& touchPanel;
const Pinetime::Controllers::Battery& batteryController;
Pinetime::Controllers::Ble& bleController;
const Pinetime::Controllers::Ble& bleController;
Pinetime::Controllers::DateTime& dateTimeController;
Pinetime::Drivers::WatchdogView& watchdog;
Pinetime::System::SystemTask* systemTask = nullptr;

View file

@ -14,7 +14,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Components::LittleVgl& /*lvgl*/,
const Drivers::Cst816S& /*touchPanel*/,
const Controllers::Battery& /*batteryController*/,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::DateTime& /*dateTimeController*/,
Drivers::WatchdogView& /*watchdog*/,
Pinetime::Controllers::NotificationManager& /*notificationManager*/,

View file

@ -50,7 +50,7 @@ namespace Pinetime {
Components::LittleVgl& lvgl,
const Drivers::Cst816S&,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,
Pinetime::Controllers::NotificationManager& notificationManager,
@ -80,7 +80,7 @@ namespace Pinetime {
void InitHw();
void Refresh();
Pinetime::Drivers::St7789& lcd;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
static constexpr uint8_t queueSize = 10;
static constexpr uint8_t itemSize = 1;

View file

@ -21,7 +21,7 @@ auto ApplicationList::CreateScreenList() const {
ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp* app,
Pinetime::Controllers::Settings& settingsController,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::Ble& bleController,
const Pinetime::Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController)
: Screen(app),
settingsController {settingsController},

View file

@ -19,7 +19,7 @@ namespace Pinetime {
explicit ApplicationList(DisplayApp* app,
Pinetime::Controllers::Settings& settingsController,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::Ble& bleController,
const Pinetime::Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController);
~ApplicationList() override;
bool OnTouchEvent(TouchEvents event) override;
@ -30,7 +30,7 @@ namespace Pinetime {
Controllers::Settings& settingsController;
const Pinetime::Controllers::Battery& batteryController;
Pinetime::Controllers::Ble& bleController;
const Pinetime::Controllers::Ble& bleController;
Controllers::DateTime& dateTimeController;
static constexpr int appsPerScreen = 6;

View file

@ -20,7 +20,7 @@ using namespace Pinetime::Applications::Screens;
Clock::Clock(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,

View file

@ -24,7 +24,7 @@ namespace Pinetime {
Clock(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
@ -38,7 +38,7 @@ namespace Pinetime {
private:
Controllers::DateTime& dateTimeController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;
Controllers::HeartRateController& heartRateController;

View file

@ -5,7 +5,7 @@
using namespace Pinetime::Applications::Screens;
FirmwareUpdate::FirmwareUpdate(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Ble& bleController)
FirmwareUpdate::FirmwareUpdate(Pinetime::Applications::DisplayApp* app, const Pinetime::Controllers::Ble& bleController)
: Screen(app), bleController {bleController} {
titleLabel = lv_label_create(lv_scr_act(), nullptr);

View file

@ -14,14 +14,14 @@ namespace Pinetime {
class FirmwareUpdate : public Screen {
public:
FirmwareUpdate(DisplayApp* app, Pinetime::Controllers::Ble& bleController);
FirmwareUpdate(DisplayApp* app, const Pinetime::Controllers::Ble& bleController);
~FirmwareUpdate() override;
void Refresh() override;
private:
enum class States { Idle, Running, Validated, Error };
Pinetime::Controllers::Ble& bleController;
const Pinetime::Controllers::Ble& bleController;
lv_obj_t* bar1;
lv_obj_t* percentLabel;
lv_obj_t* titleLabel;

View file

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

View file

@ -26,7 +26,7 @@ namespace Pinetime {
Pinetime::Controllers::DateTime& dateTimeController,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::Ble& bleController,
const Pinetime::Controllers::Ble& bleController,
Pinetime::Drivers::WatchdogView& watchdog,
Pinetime::Controllers::MotionController& motionController,
const Pinetime::Drivers::Cst816S& touchPanel);
@ -37,7 +37,7 @@ namespace Pinetime {
Pinetime::Controllers::DateTime& dateTimeController;
const Pinetime::Controllers::Battery& batteryController;
Pinetime::Controllers::BrightnessController& brightnessController;
Pinetime::Controllers::Ble& bleController;
const Pinetime::Controllers::Ble& bleController;
Pinetime::Drivers::WatchdogView& watchdog;
Pinetime::Controllers::MotionController& motionController;
const Pinetime::Drivers::Cst816S& touchPanel;

View file

@ -29,7 +29,7 @@ Tile::Tile(uint8_t screenID,
DisplayApp* app,
Controllers::Settings& settingsController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
std::array<Applications, 6>& applications)
: Screen(app),

View file

@ -26,7 +26,7 @@ namespace Pinetime {
DisplayApp* app,
Controllers::Settings& settingsController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
std::array<Applications, 6>& applications);

View file

@ -46,7 +46,7 @@ namespace {
WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController)
: Screen(app),

View file

@ -27,7 +27,7 @@ namespace Pinetime {
WatchFaceAnalog(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController);
@ -75,7 +75,7 @@ namespace Pinetime {
const Controllers::DateTime& dateTimeController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;

View file

@ -18,7 +18,7 @@ using namespace Pinetime::Applications::Screens;
WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,

View file

@ -27,7 +27,7 @@ namespace Pinetime {
WatchFaceCasioStyleG7710(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
@ -95,7 +95,7 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
Controllers::NotificationManager& notificatioManager;
Controllers::Settings& settingsController;
Controllers::HeartRateController& heartRateController;

View file

@ -17,7 +17,7 @@ using namespace Pinetime::Applications::Screens;
WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,

View file

@ -27,7 +27,7 @@ namespace Pinetime {
WatchFaceDigital(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,

View file

@ -23,7 +23,7 @@ namespace {
WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::MotionController& motionController,

View file

@ -24,7 +24,7 @@ namespace Pinetime {
WatchFaceInfineat(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::MotionController& motionController,
@ -102,7 +102,7 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;
Controllers::MotionController& motionController;

View file

@ -47,7 +47,7 @@ namespace {
WatchFacePineTimeStyle::WatchFacePineTimeStyle(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::MotionController& motionController)

View file

@ -27,7 +27,7 @@ namespace Pinetime {
WatchFacePineTimeStyle(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::MotionController& motionController);
@ -104,7 +104,7 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;
Controllers::MotionController& motionController;

View file

@ -16,7 +16,7 @@ using namespace Pinetime::Applications::Screens;
WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,

View file

@ -25,7 +25,7 @@ namespace Pinetime {
WatchFaceTerminal(DisplayApp* app,
Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
@ -67,7 +67,7 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;
Controllers::HeartRateController& heartRateController;

View file

@ -33,7 +33,7 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
Controllers::BrightnessController& brightness,
Controllers::MotorController& motorController,
Pinetime::Controllers::Settings& settingsController,
Controllers::Ble& bleController)
const Controllers::Ble& bleController)
: Screen(app),
dateTimeController {dateTimeController},
brightness {brightness},

View file

@ -23,7 +23,7 @@ namespace Pinetime {
Controllers::BrightnessController& brightness,
Controllers::MotorController& motorController,
Pinetime::Controllers::Settings& settingsController,
Controllers::Ble& bleController);
const Controllers::Ble& bleController);
~QuickSettings() override;

View file

@ -3,7 +3,7 @@
using namespace Pinetime::Applications::Widgets;
StatusIcons::StatusIcons(const Controllers::Battery& batteryController, Controllers::Ble& bleController)
StatusIcons::StatusIcons(const Controllers::Battery& batteryController, const Controllers::Ble& bleController)
: batteryController {batteryController}, bleController {bleController} {
}

View file

@ -12,7 +12,7 @@ namespace Pinetime {
namespace Widgets {
class StatusIcons {
public:
StatusIcons(const Controllers::Battery& batteryController, Controllers::Ble& bleController);
StatusIcons(const Controllers::Battery& batteryController, const Controllers::Ble& bleController);
void Align();
void Create();
@ -25,7 +25,7 @@ namespace Pinetime {
private:
Screens::BatteryIcon batteryIcon;
const Pinetime::Controllers::Battery& batteryController;
Controllers::Ble& bleController;
const Controllers::Ble& bleController;
Screens::DirtyValue<uint8_t> batteryPercentRemaining {};
Screens::DirtyValue<bool> powerPresent {};