From 947ece0bc9ad90dd4c1fcd5875594a4a48eddd56 Mon Sep 17 00:00:00 2001 From: Mark Russell Date: Wed, 10 Nov 2021 20:11:09 -0500 Subject: Status bar displays time in 12 or 24 hour format based on settings diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index e9c5d87..49b3e75 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -11,6 +11,9 @@ namespace { char const* MonthsStringLow[] = {"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; } +DateTime::DateTime(Controllers::Settings& settingsController) : settingsController {settingsController} { +} + void DateTime::SetCurrentTime(std::chrono::time_point t) { this->currentDateTime = t; UpdateTime(previousSystickCounter); // Update internal state without updating the time @@ -101,3 +104,23 @@ void DateTime::Register(Pinetime::System::SystemTask* systemTask) { this->systemTask = systemTask; } +using ClockType = Pinetime::Controllers::Settings::ClockType; +std::string DateTime::FormattedTime() { + // Return time as a string in 12- or 24-hour format + char buff[9]; + if (settingsController.GetClockType() == ClockType::H12) { + uint8_t hour12; + const char* amPmStr; + if (hour < 12) { + hour12 = (hour == 0) ? 12 : hour; + amPmStr = "AM"; + } else { + hour12 = (hour == 12) ? 12 : hour - 12; + amPmStr = "PM"; + } + sprintf(buff, "%i:%02i %s", hour12, minute, amPmStr); + } else { + sprintf(buff, "%02i:%02i", hour, minute); + } + return std::string(buff); +} diff --git a/src/components/datetime/DateTimeController.h b/src/components/datetime/DateTimeController.h index 77ed68e..19e8fc4 100644 --- a/src/components/datetime/DateTimeController.h +++ b/src/components/datetime/DateTimeController.h @@ -2,6 +2,8 @@ #include #include +#include +#include "components/settings/Settings.h" namespace Pinetime { namespace System { @@ -10,6 +12,7 @@ namespace Pinetime { namespace Controllers { class DateTime { public: + DateTime(Controllers::Settings& settingsController); enum class Days : uint8_t { Unknown, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }; enum class Months : uint8_t { Unknown, @@ -71,6 +74,7 @@ namespace Pinetime { void Register(System::SystemTask* systemTask); void SetCurrentTime(std::chrono::time_point t); + std::string FormattedTime(); private: uint16_t year = 0; @@ -87,6 +91,7 @@ namespace Pinetime { bool isMidnightAlreadyNotified = false; System::SystemTask* systemTask = nullptr; + Controllers::Settings& settingsController; }; } } diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 871ff3b..d818cbe 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -1,7 +1,6 @@ #pragma once #include #include -#include "components/datetime/DateTimeController.h" #include "components/brightness/BrightnessController.h" #include "components/fs/FS.h" #include "drivers/Cst816s.h" diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp index 1d4f0d0..7610591 100644 --- a/src/displayapp/screens/Tile.cpp +++ b/src/displayapp/screens/Tile.cpp @@ -33,7 +33,7 @@ Tile::Tile(uint8_t screenID, // Time label_time = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes()); + lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); lv_obj_align(label_time, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); @@ -119,7 +119,7 @@ Tile::~Tile() { } void Tile::UpdateScreen() { - lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes()); + lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); } diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp index dd62607..a6ed144 100644 --- a/src/displayapp/screens/settings/QuickSettings.cpp +++ b/src/displayapp/screens/settings/QuickSettings.cpp @@ -35,7 +35,7 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app, // Time label_time = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes()); + lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 0, 0); @@ -123,7 +123,7 @@ QuickSettings::~QuickSettings() { } void QuickSettings::UpdateScreen() { - lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes()); + lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); } diff --git a/src/main.cpp b/src/main.cpp index 53f78ce..81d297f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -101,7 +101,11 @@ Pinetime::Controllers::Ble bleController; Pinetime::Controllers::HeartRateController heartRateController; Pinetime::Applications::HeartRateTask heartRateApp(heartRateSensor, heartRateController); -Pinetime::Controllers::DateTime dateTimeController; +Pinetime::Controllers::FS fs {spiNorFlash}; +Pinetime::Controllers::Settings settingsController {fs}; +Pinetime::Controllers::MotorController motorController {}; + +Pinetime::Controllers::DateTime dateTimeController {settingsController}; Pinetime::Drivers::Watchdog watchdog; Pinetime::Drivers::WatchdogView watchdogView(watchdog); Pinetime::Controllers::NotificationManager notificationManager; @@ -111,10 +115,6 @@ Pinetime::Controllers::AlarmController alarmController {dateTimeController}; Pinetime::Controllers::TouchHandler touchHandler(touchPanel, lvgl); Pinetime::Controllers::ButtonHandler buttonHandler; -Pinetime::Controllers::FS fs {spiNorFlash}; -Pinetime::Controllers::Settings settingsController {fs}; -Pinetime::Controllers::MotorController motorController {}; - Pinetime::Applications::DisplayApp displayApp(lcd, lvgl, touchPanel, -- cgit v0.10.2 From 4cc95091ab07f0b90c078f087f3826e845443873 Mon Sep 17 00:00:00 2001 From: Yehoshua Pesach Wallach Date: Mon, 13 Dec 2021 12:39:34 +0200 Subject: order ReadHrs, ReadAls bitwise according to bit ordering diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index c14fe7a..45458ad 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -58,14 +58,14 @@ uint16_t Hrs3300::ReadHrs() { auto m = ReadRegister(static_cast(Registers::C0DataM)); auto h = ReadRegister(static_cast(Registers::C0DataH)); auto l = ReadRegister(static_cast(Registers::C0dataL)); - return (m << 8) | ((h & 0x0f) << 4) | (l & 0x0f) | ((l & 0x30) << 12); + return ((l & 0x30) << 12) | (m << 8) | ((h & 0x0f) << 4) | (l & 0x0f); } uint16_t Hrs3300::ReadAls() { auto m = ReadRegister(static_cast(Registers::C1dataM)); auto h = ReadRegister(static_cast(Registers::C1dataH)); auto l = ReadRegister(static_cast(Registers::C1dataL)); - return (m << 3) | ((h & 0x3f) << 11) | (l & 0x07); + return ((h & 0x3f) << 11) | (m << 3) | (l & 0x07); } void Hrs3300::SetGain(uint8_t gain) { -- cgit v0.10.2 From 464b689a03bca06099fba316b4c6c66c619d5521 Mon Sep 17 00:00:00 2001 From: Yehoshua Pesach Wallach Date: Mon, 13 Dec 2021 12:47:52 +0200 Subject: changed ReadHrs and ReadAls to uint32, and did static_cast instead of hidden cast when using it diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index 45458ad..cfc476c 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -54,14 +54,14 @@ void Hrs3300::Disable() { WriteRegister(static_cast(Registers::Enable), value); } -uint16_t Hrs3300::ReadHrs() { +uint32_t Hrs3300::ReadHrs() { auto m = ReadRegister(static_cast(Registers::C0DataM)); auto h = ReadRegister(static_cast(Registers::C0DataH)); auto l = ReadRegister(static_cast(Registers::C0dataL)); return ((l & 0x30) << 12) | (m << 8) | ((h & 0x0f) << 4) | (l & 0x0f); } -uint16_t Hrs3300::ReadAls() { +uint32_t Hrs3300::ReadAls() { auto m = ReadRegister(static_cast(Registers::C1dataM)); auto h = ReadRegister(static_cast(Registers::C1dataH)); auto l = ReadRegister(static_cast(Registers::C1dataL)); diff --git a/src/drivers/Hrs3300.h b/src/drivers/Hrs3300.h index 01310c6..8bbdc69 100644 --- a/src/drivers/Hrs3300.h +++ b/src/drivers/Hrs3300.h @@ -30,8 +30,8 @@ namespace Pinetime { void Init(); void Enable(); void Disable(); - uint16_t ReadHrs(); - uint16_t ReadAls(); + uint32_t ReadHrs(); + uint32_t ReadAls(); void SetGain(uint8_t gain); void SetDrive(uint8_t drive); diff --git a/src/heartratetask/HeartRateTask.cpp b/src/heartratetask/HeartRateTask.cpp index 213ab4a..2f689b9 100644 --- a/src/heartratetask/HeartRateTask.cpp +++ b/src/heartratetask/HeartRateTask.cpp @@ -65,8 +65,7 @@ void HeartRateTask::Work() { } if (measurementStarted) { - auto hrs = heartRateSensor.ReadHrs(); - ppg.Preprocess(hrs); + ppg.Preprocess(static_cast(heartRateSensor.ReadHrs())); auto bpm = ppg.HeartRate(); if (lastBpm == 0 && bpm == 0) -- cgit v0.10.2 From 319030d9e16e833cf8bff569a9ecfa452165ea27 Mon Sep 17 00:00:00 2001 From: "James A. Jerkins" Date: Thu, 23 Dec 2021 20:30:14 -0600 Subject: Add airplane mode feature Implements 'Airplane mode' feature to disable and enable bluetooth/ble Adds airplaneMode as a non-persisted setting Adds a setting menu for switching airplane mode on and off Displays an airplane symbol on the Digital watch face and the PineTimeStyle watch face when airplane mode is enabled Always enables bluetooth/ble on boot (disable airplane mode) Alphabetizes the settings menu options Style cleanups Closes #632 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 809544c..ae8eece 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -448,6 +448,7 @@ list(APPEND SOURCE_FILES displayapp/screens/settings/SettingPineTimeStyle.cpp displayapp/screens/settings/SettingSetDate.cpp displayapp/screens/settings/SettingSetTime.cpp + displayapp/screens/settings/SettingAirplaneMode.cpp ## Watch faces displayapp/icons/bg_clock.c diff --git a/src/components/ble/BleController.cpp b/src/components/ble/BleController.cpp index a80c971..0e1c5d7 100644 --- a/src/components/ble/BleController.cpp +++ b/src/components/ble/BleController.cpp @@ -2,12 +2,12 @@ using namespace Pinetime::Controllers; -void Ble::Connect() { - isConnected = true; +void Ble::SetConnectState(Ble::ConnectStates newState) { + connectionState = newState; } -void Ble::Disconnect() { - isConnected = false; +Ble::ConnectStates Ble::GetConnectState() const { + return connectionState; } void Ble::StartFirmwareUpdate() { diff --git a/src/components/ble/BleController.h b/src/components/ble/BleController.h index 72b8766..2714c0c 100644 --- a/src/components/ble/BleController.h +++ b/src/components/ble/BleController.h @@ -10,13 +10,14 @@ namespace Pinetime { using BleAddress = std::array; enum class FirmwareUpdateStates { Idle, Running, Validated, Error }; enum class AddressTypes { Public, Random, RPA_Public, RPA_Random }; + enum class ConnectStates { Disconnected, Connected, Airplane }; Ble() = default; bool IsConnected() const { - return isConnected; + return (connectionState == ConnectStates::Connected); } - void Connect(); - void Disconnect(); + void SetConnectState(ConnectStates newState); + ConnectStates GetConnectState() const; void StartFirmwareUpdate(); void StopFirmwareUpdate(); @@ -56,7 +57,7 @@ namespace Pinetime { } private: - bool isConnected = false; + ConnectStates connectionState = ConnectStates::Disconnected; bool isFirmwareUpdating = false; uint32_t firmwareUpdateTotalBytes = 0; uint32_t firmwareUpdateCurrentBytes = 0; diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index d8510bd..d85ec5d 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -23,14 +23,14 @@ using namespace Pinetime::Controllers; NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask, - Pinetime::Controllers::Ble& bleController, + Ble& bleController, DateTime& dateTimeController, - Pinetime::Controllers::NotificationManager& notificationManager, - Controllers::Battery& batteryController, + NotificationManager& notificationManager, + Battery& batteryController, Pinetime::Drivers::SpiNorFlash& spiNorFlash, - Controllers::HeartRateController& heartRateController, - Controllers::MotionController& motionController, - Controllers::FS& fs) + HeartRateController& heartRateController, + MotionController& motionController, + FS& fs) : systemTask {systemTask}, bleController {bleController}, dateTimeController {dateTimeController}, @@ -184,7 +184,9 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { case BLE_GAP_EVENT_ADV_COMPLETE: NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE"); NRF_LOG_INFO("reason=%d; status=%0X", event->adv_complete.reason, event->connect.status); - StartAdvertising(); + if (bleController.GetConnectState() == Ble::ConnectStates::Disconnected) { + StartAdvertising(); + } break; case BLE_GAP_EVENT_CONNECT: @@ -197,12 +199,12 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { currentTimeClient.Reset(); alertNotificationClient.Reset(); connectionHandle = BLE_HS_CONN_HANDLE_NONE; - bleController.Disconnect(); + bleController.SetConnectState(Ble::ConnectStates::Disconnected); fastAdvCount = 0; StartAdvertising(); } else { connectionHandle = event->connect.conn_handle; - bleController.Connect(); + bleController.SetConnectState(Ble::ConnectStates::Connected); systemTask.PushMessage(Pinetime::System::Messages::BleConnected); // Service discovery is deferred via systemtask } @@ -220,9 +222,11 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { currentTimeClient.Reset(); alertNotificationClient.Reset(); connectionHandle = BLE_HS_CONN_HANDLE_NONE; - bleController.Disconnect(); - fastAdvCount = 0; - StartAdvertising(); + if (bleController.GetConnectState() == Ble::ConnectStates::Connected) { + bleController.SetConnectState(Ble::ConnectStates::Disconnected); + fastAdvCount = 0; + StartAdvertising(); + } break; case BLE_GAP_EVENT_CONN_UPDATE: @@ -376,6 +380,22 @@ void NimbleController::NotifyBatteryLevel(uint8_t level) { } } +void NimbleController::SwitchAirplaneMode(bool enabled) { + if (enabled) { + if (bleController.IsConnected()) { + bleController.SetConnectState(Ble::ConnectStates::Airplane); + ble_gap_terminate(connectionHandle, BLE_ERR_REM_USER_CONN_TERM); + } else { + bleController.SetConnectState(Ble::ConnectStates::Airplane); + ble_gap_adv_stop(); + } + } else { + bleController.SetConnectState(Ble::ConnectStates::Disconnected); + fastAdvCount = 0; + StartAdvertising(); + } +} + void NimbleController::PersistBond(struct ble_gap_conn_desc& desc) { union ble_store_key key; union ble_store_value our_sec, peer_sec, peer_cccd_set[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)] = {0}; diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h index 2b300e6..7219ba6 100644 --- a/src/components/ble/NimbleController.h +++ b/src/components/ble/NimbleController.h @@ -14,6 +14,7 @@ #include "components/ble/CurrentTimeService.h" #include "components/ble/DeviceInformationService.h" #include "components/ble/DfuService.h" +#include "components/ble/FSService.h" #include "components/ble/HeartRateService.h" #include "components/ble/ImmediateAlertService.h" #include "components/ble/MusicService.h" @@ -22,7 +23,6 @@ #include "components/ble/MotionService.h" #include "components/ble/weather/WeatherService.h" #include "components/fs/FS.h" -#include "components/ble/FSService.h" namespace Pinetime { namespace Drivers { @@ -42,18 +42,19 @@ namespace Pinetime { public: NimbleController(Pinetime::System::SystemTask& systemTask, - Pinetime::Controllers::Ble& bleController, + Ble& bleController, DateTime& dateTimeController, - Pinetime::Controllers::NotificationManager& notificationManager, - Controllers::Battery& batteryController, + NotificationManager& notificationManager, + Battery& batteryController, Pinetime::Drivers::SpiNorFlash& spiNorFlash, - Controllers::HeartRateController& heartRateController, - Controllers::MotionController& motionController, - Pinetime::Controllers::FS& fs); + HeartRateController& heartRateController, + MotionController& motionController, + FS& fs); void Init(); void StartAdvertising(); int OnGAPEvent(ble_gap_event* event); + /* these are not implemented yet int OnDiscoveryEvent(uint16_t i, const ble_gatt_error* pError, const ble_gatt_svc* pSvc); int OnCTSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic); int OnANSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic); @@ -62,6 +63,7 @@ namespace Pinetime { const ble_gatt_error* error, uint16_t characteristicValueHandle, const ble_gatt_dsc* descriptor); + */ void StartDiscovery(); @@ -83,7 +85,9 @@ namespace Pinetime { void RestartFastAdv() { fastAdvCount = 0; - } + }; + + void SwitchAirplaneMode(bool enabled); private: void PersistBond(struct ble_gap_conn_desc& desc); @@ -91,12 +95,12 @@ namespace Pinetime { static constexpr const char* deviceName = "InfiniTime"; Pinetime::System::SystemTask& systemTask; - Pinetime::Controllers::Ble& bleController; + Ble& bleController; DateTime& dateTimeController; - Pinetime::Controllers::NotificationManager& notificationManager; + NotificationManager& notificationManager; Pinetime::Drivers::SpiNorFlash& spiNorFlash; - Pinetime::Controllers::FS& fs; - Pinetime::Controllers::DfuService dfuService; + FS& fs; + DfuService dfuService; DeviceInformationService deviceInformationService; CurrentTimeClient currentTimeClient; diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 2d7973d..a1529fe 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -17,7 +17,23 @@ namespace Pinetime { RaiseWrist = 2, }; enum class Colors : uint8_t { - White, Silver, Gray, Black, Red, Maroon, Yellow, Olive, Lime, Green, Cyan, Teal, Blue, Navy, Magenta, Purple, Orange + White, + Silver, + Gray, + Black, + Red, + Maroon, + Yellow, + Olive, + Lime, + Green, + Cyan, + Teal, + Blue, + Navy, + Magenta, + Purple, + Orange }; struct PineTimeStyle { Colors ColorTime = Colors::Teal; @@ -146,18 +162,29 @@ namespace Pinetime { } settings.brightLevel = level; }; + Controllers::BrightnessController::Levels GetBrightness() const { return settings.brightLevel; }; - void SetStepsGoal( uint32_t goal ) { - if ( goal != settings.stepsGoal ) { + void SetStepsGoal(uint32_t goal) { + if (goal != settings.stepsGoal) { settingsChanged = true; } settings.stepsGoal = goal; }; - uint32_t GetStepsGoal() const { return settings.stepsGoal; }; + uint32_t GetStepsGoal() const { + return settings.stepsGoal; + }; + + void SetAirplaneMode(bool mode) { + airplaneMode = mode; + }; + + bool GetAirplaneMode() const { + return airplaneMode; + }; private: Pinetime::Controllers::FS& fs; @@ -185,6 +212,10 @@ namespace Pinetime { uint8_t appMenu = 0; uint8_t settingsMenu = 0; + /* airplaneMode is intentionally not saved with the other watch settings and initialized + * to off (false) on every boot because we always want ble to be enabled on startup + */ + bool airplaneMode = false; void LoadSettingsFromFile(); void SaveSettingsToFile(); diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index b2f55cc..971c36b 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -37,7 +37,8 @@ namespace Pinetime { SettingPineTimeStyle, SettingSetDate, SettingSetTime, - Error, + SettingAirplaneMode, + Error }; } } diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 233f433..d3896b1 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -48,6 +48,7 @@ #include "displayapp/screens/settings/SettingPineTimeStyle.h" #include "displayapp/screens/settings/SettingSetDate.h" #include "displayapp/screens/settings/SettingSetTime.h" +#include "displayapp/screens/settings/SettingAirplaneMode.h" #include "libs/lv_conf.h" @@ -289,6 +290,9 @@ void DisplayApp::Refresh() { case Messages::BleFirmwareUpdateStarted: LoadApp(Apps::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down); break; + case Messages::AirplaneModeToggle: + PushMessageToSystemTask(System::Messages::AirplaneModeToggle); + break; case Messages::UpdateDateTime: // Added to remove warning // What should happen here? @@ -420,6 +424,10 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) currentScreen = std::make_unique(this, settingsController); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; + case Apps::SettingAirplaneMode: + currentScreen = std::make_unique(this, settingsController); + ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); + break; case Apps::BatteryInfo: currentScreen = std::make_unique(this, batteryController); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h index b22d6c3..4d52df2 100644 --- a/src/displayapp/Messages.h +++ b/src/displayapp/Messages.h @@ -20,7 +20,8 @@ namespace Pinetime { DimScreen, RestoreBrightness, ShowPairingKey, - AlarmTriggered + AlarmTriggered, + AirplaneModeToggle }; } } diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index 8a26084..40ecd3e 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -13,7 +13,7 @@ * Do not enable font compression and horizontal subpixel hinting * Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7f, 0x410-0x44f` * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following - range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015` + range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf072` * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` * Add the font .c file path to src/CMakeLists.txt * Add an LV_FONT_DECLARE line in src/libs/lv_conf.h diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index d870552..944e47a 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -840,6 +840,16 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xf8, 0xf, 0x80, 0xf8, 0x3e, 0x0, 0xff, 0xf0, 0x0, 0x3f, 0x80, 0x0, + /* U+F072 "" */ + 0x1, 0xc0, 0x0, 0x7, 0xc0, 0x0, 0x7, 0x80, + 0x0, 0xf, 0x80, 0x0, 0x1f, 0x0, 0x0, 0x1f, + 0x0, 0x38, 0x3e, 0x0, 0x78, 0x7e, 0x0, 0x7f, + 0xff, 0xe0, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xf3, + 0xff, 0xff, 0xe7, 0xff, 0xff, 0xdf, 0xff, 0xfc, + 0x3c, 0x3f, 0x0, 0x70, 0x7c, 0x0, 0x1, 0xf0, + 0x0, 0x3, 0xe0, 0x0, 0x7, 0x80, 0x0, 0xf, + 0x0, 0x0, 0x1c, 0x0, 0x0, + /* U+F095 "" */ 0x0, 0x0, 0x0, 0x0, 0x3e, 0x0, 0x7, 0xf0, 0x0, 0x7f, 0x0, 0x7, 0xf0, 0x0, 0xff, 0x0, @@ -1220,31 +1230,32 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 3028, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, {.bitmap_index = 3056, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 3104, .adv_w = 360, .box_w = 23, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3148, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3201, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3220, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3270, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3306, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3354, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3394, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3437, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3475, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3513, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3551, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3589, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3627, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3663, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 3701, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3730, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 3768, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3834, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3883, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3933, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3993, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4046, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4107, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4162, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4215, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} + {.bitmap_index = 3148, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3209, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3262, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3281, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3331, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3367, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3415, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3455, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3498, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3536, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3574, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3612, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3650, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3688, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3724, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 3762, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3791, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 3829, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3895, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3944, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3994, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4054, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4107, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4168, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4223, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4276, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} }; /*--------------------- @@ -1253,10 +1264,11 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { static const uint16_t unicode_list_2[] = { 0x0, 0x14, 0x16, 0x23, 0x26, 0x27, 0x28, 0x39, - 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x94, - 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, 0x240, - 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, 0x3dc, - 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, 0x6a8 + 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x71, + 0x94, 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, + 0x240, 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, + 0x3dc, 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, + 0x6a8 }; /*Collect the unicode lists and glyph_id offsets*/ @@ -1272,7 +1284,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = }, { .range_start = 61441, .range_length = 1705, .glyph_id_start = 160, - .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 40, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 41, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; @@ -1321,7 +1333,7 @@ lv_font_t jetbrains_mono_bold_20 = { #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif -#if LV_VERSION_CHECK(7, 4, 0) +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 .underline_position = -3, .underline_thickness = 1, #endif diff --git a/src/displayapp/screens/BleIcon.cpp b/src/displayapp/screens/BleIcon.cpp index 5058f3e..a30d23b 100644 --- a/src/displayapp/screens/BleIcon.cpp +++ b/src/displayapp/screens/BleIcon.cpp @@ -2,9 +2,11 @@ #include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; -const char* BleIcon::GetIcon(bool isConnected) { - if (isConnected) +const char* BleIcon::GetIcon(Pinetime::Controllers::Ble::ConnectStates state) { + if (state == Pinetime::Controllers::Ble::ConnectStates::Connected) return Symbols::bluetooth; + else if (state == Pinetime::Controllers::Ble::ConnectStates::Airplane) + return Symbols::airplane; else - return ""; -} \ No newline at end of file + return Symbols::none; +} diff --git a/src/displayapp/screens/BleIcon.h b/src/displayapp/screens/BleIcon.h index c1398d2..d7410ea 100644 --- a/src/displayapp/screens/BleIcon.h +++ b/src/displayapp/screens/BleIcon.h @@ -1,12 +1,14 @@ #pragma once +#include "components/ble/BleController.h" + namespace Pinetime { namespace Applications { namespace Screens { class BleIcon { public: - static const char* GetIcon(bool isConnected); + static const char* GetIcon(Pinetime::Controllers::Ble::ConnectStates state); }; } } -} \ No newline at end of file +} diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index d436869..e7b1f39 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -208,10 +208,10 @@ void PineTimeStyle::SetBatteryIcon() { } void PineTimeStyle::AlignIcons() { - if (notificationState.Get() && bleState.Get()) { + if (notificationState.Get() && bleState.Get() != Pinetime::Controllers::Ble::ConnectStates::Disconnected) { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25); lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25); - } else if (notificationState.Get() && !bleState.Get()) { + } else if (notificationState.Get() && bleState.Get() == Pinetime::Controllers::Ble::ConnectStates::Disconnected) { lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); } else { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); @@ -234,7 +234,7 @@ void PineTimeStyle::Refresh() { } } - bleState = bleController.IsConnected(); + bleState = bleController.GetConnectState(); if (bleState.IsUpdated()) { lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get())); AlignIcons(); diff --git a/src/displayapp/screens/PineTimeStyle.h b/src/displayapp/screens/PineTimeStyle.h index 8382c53..c5136fc 100644 --- a/src/displayapp/screens/PineTimeStyle.h +++ b/src/displayapp/screens/PineTimeStyle.h @@ -6,6 +6,7 @@ #include #include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" +#include "components/ble/BleController.h" namespace Pinetime { namespace Controllers { @@ -36,13 +37,13 @@ namespace Pinetime { char displayedChar[5]; uint16_t currentYear = 1970; - Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; - Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; + Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; + Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; uint8_t currentDay = 0; DirtyValue batteryPercentRemaining {}; DirtyValue isCharging {}; - DirtyValue bleState {}; + DirtyValue bleState {}; DirtyValue> currentDateTime {}; DirtyValue motionSensorOk {}; DirtyValue stepCount {}; diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index e68a7af..5ba8f95 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -44,6 +44,7 @@ namespace Pinetime { static constexpr const char* chartLine = "\xEF\x88\x81"; static constexpr const char* eye = "\xEF\x81\xAE"; static constexpr const char* home = "\xEF\x80\x95"; + static constexpr const char* airplane = "\xEF\x81\xB2"; // lv_font_sys_48.c static constexpr const char* settings = "\xEE\xA4\x82"; // e902 diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 8769579..8f06553 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -119,7 +119,7 @@ void WatchFaceDigital::Refresh() { lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); } - bleState = bleController.IsConnected(); + bleState = bleController.GetConnectState(); if (bleState.IsUpdated()) { lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get())); } diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index 627154c..addb539 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -6,6 +6,7 @@ #include #include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" +#include "components/ble/BleController.h" namespace Pinetime { namespace Controllers { @@ -38,13 +39,13 @@ namespace Pinetime { char displayedChar[5] {}; uint16_t currentYear = 1970; - Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; - Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; + Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; + Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; uint8_t currentDay = 0; DirtyValue batteryPercentRemaining {}; DirtyValue powerPresent {}; - DirtyValue bleState {}; + DirtyValue bleState {}; DirtyValue> currentDateTime {}; DirtyValue motionSensorOk {}; DirtyValue stepCount {}; diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.cpp b/src/displayapp/screens/settings/SettingAirplaneMode.cpp new file mode 100644 index 0000000..0a364de --- /dev/null +++ b/src/displayapp/screens/settings/SettingAirplaneMode.cpp @@ -0,0 +1,89 @@ +#include "displayapp/screens/settings/SettingAirplaneMode.h" +#include +#include "displayapp/DisplayApp.h" +#include "displayapp/Messages.h" +#include "displayapp/screens/Styles.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/Symbols.h" + +using namespace Pinetime::Applications::Screens; + +namespace { + static void event_handler(lv_obj_t* obj, lv_event_t event) { + SettingAirplaneMode* screen = static_cast(obj->user_data); + screen->UpdateSelected(obj, event); + } +} + +constexpr std::array SettingAirplaneMode::options; + +SettingAirplaneMode::SettingAirplaneMode(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) + : Screen(app), settingsController {settingsController} { + + lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr); + + lv_obj_set_style_local_bg_opa(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP); + lv_obj_set_style_local_pad_all(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 10); + lv_obj_set_style_local_pad_inner(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5); + lv_obj_set_style_local_border_width(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0); + + lv_obj_set_pos(container1, 10, 60); + lv_obj_set_width(container1, LV_HOR_RES - 20); + lv_obj_set_height(container1, LV_VER_RES - 50); + lv_cont_set_layout(container1, LV_LAYOUT_COLUMN_LEFT); + + lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(title, "Airplane mode"); + lv_label_set_align(title, LV_LABEL_ALIGN_CENTER); + lv_obj_align(title, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 15, 15); + + lv_obj_t* icon = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_text_color(icon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); + lv_label_set_text_static(icon, Symbols::airplane); + lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER); + lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0); + + for (unsigned int i = 0; i < options.size(); i++) { + cbOption[i] = lv_checkbox_create(container1, nullptr); + lv_checkbox_set_text(cbOption[i], options[i]); + cbOption[i]->user_data = this; + lv_obj_set_event_cb(cbOption[i], event_handler); + SetRadioButtonStyle(cbOption[i]); + } + + if (settingsController.GetAirplaneMode() == false) { + lv_checkbox_set_checked(cbOption[0], true); + priorMode = false; + } else { + lv_checkbox_set_checked(cbOption[1], true); + priorMode = true; + } +} + +SettingAirplaneMode::~SettingAirplaneMode() { + lv_obj_clean(lv_scr_act()); + // Do not call SaveSettings - see src/components/settings/Settings.h + if (priorMode != settingsController.GetAirplaneMode()) { + app->PushMessage(Pinetime::Applications::Display::Messages::AirplaneModeToggle); + } +} + +void SettingAirplaneMode::UpdateSelected(lv_obj_t* object, lv_event_t event) { + if (event == LV_EVENT_VALUE_CHANGED) { + for (unsigned int i = 0; i < options.size(); i++) { + if (object == cbOption[i]) { + lv_checkbox_set_checked(cbOption[i], true); + + if (i == 0) { + settingsController.SetAirplaneMode(false); + }; + if (i == 1) { + settingsController.SetAirplaneMode(true); + }; + + } else { + lv_checkbox_set_checked(cbOption[i], false); + } + } + } +} diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.h b/src/displayapp/screens/settings/SettingAirplaneMode.h new file mode 100644 index 0000000..fcc0222 --- /dev/null +++ b/src/displayapp/screens/settings/SettingAirplaneMode.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include +#include + +#include "components/settings/Settings.h" +#include "displayapp/screens/Screen.h" + +namespace Pinetime { + + namespace Applications { + namespace Screens { + + class SettingAirplaneMode : public Screen { + public: + SettingAirplaneMode(DisplayApp* app, Pinetime::Controllers::Settings& settingsController); + ~SettingAirplaneMode() override; + + void UpdateSelected(lv_obj_t* object, lv_event_t event); + + private: + static constexpr std::array options = {" No", " Yes"}; + Controllers::Settings& settingsController; + lv_obj_t* cbOption[options.size()]; + bool priorMode; + }; + } + } +} diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index 392c12e..6be00f5 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -36,10 +36,10 @@ bool Settings::OnTouchEvent(Pinetime::Applications::TouchEvents event) { std::unique_ptr Settings::CreateScreen1() { std::array applications {{ - {Symbols::sun, "Display", Apps::SettingDisplay}, - {Symbols::eye, "Wake Up", Apps::SettingWakeUp}, - {Symbols::clock, "Time format", Apps::SettingTimeFormat}, - {Symbols::home, "Watch face", Apps::SettingWatchFace}, + {Symbols::list, "About", Apps::SysInfo}, + {Symbols::airplane, "Airplane mode", Apps::SettingAirplaneMode}, + {Symbols::batteryHalf, "Battery", Apps::BatteryInfo}, + {Symbols::sun, "Display", Apps::SettingDisplay} }}; return std::make_unique(0, 3, app, settingsController, applications); @@ -48,10 +48,10 @@ std::unique_ptr Settings::CreateScreen1() { std::unique_ptr Settings::CreateScreen2() { std::array applications {{ - {Symbols::shoe, "Steps", Apps::SettingSteps}, + {Symbols::check, "Firmware", Apps::FirmwareValidation}, + {Symbols::paintbrush, "PTS colors", Apps::SettingPineTimeStyle}, {Symbols::clock, "Set date", Apps::SettingSetDate}, - {Symbols::clock, "Set time", Apps::SettingSetTime}, - {Symbols::batteryHalf, "Battery", Apps::BatteryInfo} + {Symbols::clock, "Set time", Apps::SettingSetTime} }}; return std::make_unique(1, 3, app, settingsController, applications); @@ -60,10 +60,10 @@ std::unique_ptr Settings::CreateScreen2() { std::unique_ptr Settings::CreateScreen3() { std::array applications {{ - {Symbols::paintbrush, "PTS Colors", Apps::SettingPineTimeStyle}, - {Symbols::check, "Firmware", Apps::FirmwareValidation}, - {Symbols::list, "About", Apps::SysInfo}, - {Symbols::none, "None", Apps::None}, + {Symbols::shoe, "Steps", Apps::SettingSteps}, + {Symbols::clock, "Time format", Apps::SettingTimeFormat}, + {Symbols::eye, "Wake up", Apps::SettingWakeUp}, + {Symbols::home, "Watch face", Apps::SettingWatchFace} }}; return std::make_unique(2, 3, app, settingsController, applications); diff --git a/src/systemtask/Messages.h b/src/systemtask/Messages.h index cc30fdc..886505b 100644 --- a/src/systemtask/Messages.h +++ b/src/systemtask/Messages.h @@ -29,6 +29,7 @@ namespace Pinetime { BatteryPercentageUpdated, StartFileTransfer, StopFileTransfer, + AirplaneModeToggle }; } } diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index a95d479..5ce223a 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -261,7 +261,7 @@ void SystemTask::Work() { displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToRunning); heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::WakeUp); - if (!bleController.IsConnected()) { + if (bleController.GetConnectState() == Controllers::Ble::ConnectStates::Disconnected) { nimbleController.RestartFastAdv(); } @@ -424,7 +424,9 @@ void SystemTask::Work() { motorController.RunForDuration(35); displayApp.PushMessage(Pinetime::Applications::Display::Messages::ShowPairingKey); break; - + case Messages::AirplaneModeToggle: + nimbleController.SwitchAirplaneMode(settingsController.GetAirplaneMode()); + break; default: break; } -- cgit v0.10.2 From 5e6868d9eb0957eeaaeb34269a7614a0a3f417e8 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 1 Jan 2022 16:22:35 +0200 Subject: Improved notification timeout diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 2354107..383badf 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -362,12 +362,12 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) case Apps::Notifications: currentScreen = std::make_unique( - this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Normal); + this, notificationManager, systemTask->nimble().alertService(), motorController, *systemTask, Screens::Notifications::Modes::Normal); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); break; case Apps::NotificationsPreview: currentScreen = std::make_unique( - this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Preview); + this, notificationManager, systemTask->nimble().alertService(), motorController, *systemTask, Screens::Notifications::Modes::Preview); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); break; case Apps::Timer: diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 569c422..8fe08a8 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -12,8 +12,13 @@ Notifications::Notifications(DisplayApp* app, Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::AlertNotificationService& alertNotificationService, Pinetime::Controllers::MotorController& motorController, + System::SystemTask& systemTask, Modes mode) - : Screen(app), notificationManager {notificationManager}, alertNotificationService {alertNotificationService}, mode {mode} { + : Screen(app), + notificationManager {notificationManager}, + alertNotificationService {alertNotificationService}, + systemTask {systemTask}, + mode {mode} { notificationManager.ClearNewNotificationFlag(); auto notification = notificationManager.GetLastNotification(); if (notification.valid) { @@ -37,20 +42,22 @@ Notifications::Notifications(DisplayApp* app, } if (mode == Modes::Preview) { + systemTask.PushMessage(System::Messages::DisableSleeping); if (notification.category == Controllers::NotificationManager::Categories::IncomingCall) { motorController.StartRinging(); } else { motorController.RunForDuration(35); - timeoutLine = lv_line_create(lv_scr_act(), nullptr); + } - lv_obj_set_style_local_line_width(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3); - lv_obj_set_style_local_line_color(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); - lv_obj_set_style_local_line_rounded(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true); + timeoutLine = lv_line_create(lv_scr_act(), nullptr); - lv_line_set_points(timeoutLine, timeoutLinePoints, 2); - timeoutTickCountStart = xTaskGetTickCount(); - timeoutTickCountEnd = timeoutTickCountStart + (5 * 1024); - } + lv_obj_set_style_local_line_width(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3); + lv_obj_set_style_local_line_color(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); + lv_obj_set_style_local_line_rounded(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true); + + lv_line_set_points(timeoutLine, timeoutLinePoints, 2); + timeoutTickCountStart = xTaskGetTickCount(); + interacted = false; } taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); @@ -60,23 +67,40 @@ Notifications::~Notifications() { lv_task_del(taskRefresh); // make sure we stop any vibrations before exiting Controllers::MotorController::StopRinging(); + systemTask.PushMessage(System::Messages::EnableSleeping); lv_obj_clean(lv_scr_act()); } void Notifications::Refresh() { if (mode == Modes::Preview && timeoutLine != nullptr) { - auto tick = xTaskGetTickCount(); - int32_t pos = 240 - ((tick - timeoutTickCountStart) / ((timeoutTickCountEnd - timeoutTickCountStart) / 240)); - if (pos < 0) + TickType_t tick = xTaskGetTickCount(); + int32_t pos = 240 - ((tick - timeoutTickCountStart) / (timeoutLength / 240)); + if (pos <= 0) { running = false; + } else { + timeoutLinePoints[1].x = pos; + lv_line_set_points(timeoutLine, timeoutLinePoints, 2); + } + } + running = currentItem->IsRunning() && running; +} - timeoutLinePoints[1].x = pos; - lv_line_set_points(timeoutLine, timeoutLinePoints, 2); +void Notifications::OnPreviewInteraction() { + systemTask.PushMessage(System::Messages::EnableSleeping); + Controllers::MotorController::StopRinging(); + if (timeoutLine != nullptr) { + lv_obj_del(timeoutLine); + timeoutLine = nullptr; } } bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { if (mode != Modes::Normal) { + if (!interacted && event == TouchEvents::Tap) { + interacted = true; + OnPreviewInteraction(); + return true; + } return false; } diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index cbb7af6..2f444c7 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -1,11 +1,13 @@ #pragma once #include +#include #include #include #include "displayapp/screens/Screen.h" #include "components/ble/NotificationManager.h" #include "components/motor/MotorController.h" +#include "systemtask/SystemTask.h" namespace Pinetime { namespace Controllers { @@ -21,11 +23,13 @@ namespace Pinetime { Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::AlertNotificationService& alertNotificationService, Pinetime::Controllers::MotorController& motorController, + System::SystemTask& systemTask, Modes mode); ~Notifications() override; void Refresh() override; bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override; + void OnPreviewInteraction(); class NotificationItem { public: @@ -62,6 +66,7 @@ namespace Pinetime { }; Pinetime::Controllers::NotificationManager& notificationManager; Pinetime::Controllers::AlertNotificationService& alertNotificationService; + System::SystemTask& systemTask; Modes mode = Modes::Normal; std::unique_ptr currentItem; Controllers::NotificationManager::Notification::Id currentId; @@ -69,8 +74,9 @@ namespace Pinetime { lv_point_t timeoutLinePoints[2] {{0, 1}, {239, 1}}; lv_obj_t* timeoutLine = nullptr; - uint32_t timeoutTickCountStart; - uint32_t timeoutTickCountEnd; + TickType_t timeoutTickCountStart; + static const TickType_t timeoutLength = pdMS_TO_TICKS(7000); + bool interacted = true; lv_task_t* taskRefresh; }; diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index a95d479..0eb0761 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -239,6 +239,7 @@ void SystemTask::Work() { if (!bleController.IsFirmwareUpdating()) { doNotGoToSleep = false; } + ReloadIdleTimer(); break; case Messages::DisableSleeping: doNotGoToSleep = true; -- cgit v0.10.2 From 48e9458301f7503da12b90046427c883c3d0c92b Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 16 Jan 2022 20:45:57 +0100 Subject: ButtonHandler: includes relative to src dir diff --git a/src/buttonhandler/ButtonHandler.cpp b/src/buttonhandler/ButtonHandler.cpp index 02ee22c..3c2bc72 100644 --- a/src/buttonhandler/ButtonHandler.cpp +++ b/src/buttonhandler/ButtonHandler.cpp @@ -1,4 +1,4 @@ -#include "ButtonHandler.h" +#include "buttonhandler/ButtonHandler.h" using namespace Pinetime::Controllers; diff --git a/src/buttonhandler/ButtonHandler.h b/src/buttonhandler/ButtonHandler.h index 44b20f1..5802b99 100644 --- a/src/buttonhandler/ButtonHandler.h +++ b/src/buttonhandler/ButtonHandler.h @@ -1,6 +1,6 @@ #pragma once -#include "ButtonActions.h" +#include "buttonhandler/ButtonActions.h" #include "systemtask/SystemTask.h" #include #include -- cgit v0.10.2 From bbc5af078d91a70f757173441a79077164cc372d Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 16 Jan 2022 22:39:07 +0100 Subject: SystemTask: add missing queue.h include for QueueHandle_t diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index e2e6de7..abeffd2 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include -- cgit v0.10.2 From 688dc2fed7b207bdf80b5f4af5a5df8faad9f2ec Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 17 Jan 2022 21:25:16 +0100 Subject: Create Version.h in binary dir instead of src dir Don't use source directory for generated files. Use the binary (build) directory instead. diff --git a/CMakeLists.txt b/CMakeLists.txt index c2e0a11..8846531 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ else() endif() set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/Version.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 062d8a5..aec6ce0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -612,6 +612,7 @@ list(APPEND RECOVERYLOADER_SOURCE_FILES set(INCLUDE_FILES + ${CMAKE_CURRENT_BINARY_DIR}/src/Version.h BootloaderVersion.h logging/Logger.h logging/NrfLogger.h @@ -710,6 +711,7 @@ set(INCLUDE_FILES ) include_directories( + ${CMAKE_BINARY_DIR}/src # include generated files like Version.h . ../ libs/ -- cgit v0.10.2 From 6bf6bb7e2a9e636f496341419a12a7720b3d4dac Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Thu, 20 Jan 2022 16:04:26 +0200 Subject: PTS and digital watchface code cleanups diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index b2b972d..7ce0bc0 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -60,12 +60,6 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, settingsController {settingsController}, motionController {motionController} { - displayedChar[0] = 0; - displayedChar[1] = 0; - displayedChar[2] = 0; - displayedChar[3] = 0; - displayedChar[4] = 0; - // Create a 200px wide background rectangle timebar = lv_obj_create(lv_scr_act(), nullptr); lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorBG())); @@ -77,19 +71,19 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, timeDD1 = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &open_sans_light); lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime())); - lv_label_set_text(timeDD1, "00"); + lv_label_set_text_static(timeDD1, "00"); lv_obj_align(timeDD1, timebar, LV_ALIGN_IN_TOP_MID, 5, 5); timeDD2 = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &open_sans_light); lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime())); - lv_label_set_text(timeDD2, "00"); + lv_label_set_text_static(timeDD2, "00"); lv_obj_align(timeDD2, timebar, LV_ALIGN_IN_BOTTOM_MID, 5, -5); timeAMPM = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime())); lv_obj_set_style_local_text_line_space(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, -3); - lv_label_set_text(timeAMPM, ""); + lv_label_set_text_static(timeAMPM, ""); lv_obj_align(timeAMPM, timebar, LV_ALIGN_IN_BOTTOM_LEFT, 2, -20); // Create a 40px wide bar down the right side of the screen @@ -102,17 +96,17 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, // Display icons batteryIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); - lv_label_set_text(batteryIcon, Symbols::batteryFull); + lv_label_set_text_static(batteryIcon, Symbols::batteryFull); lv_obj_align(batteryIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 2); lv_obj_set_auto_realign(batteryIcon, true); bleIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000)); - lv_label_set_text(bleIcon, ""); + lv_label_set_text_static(bleIcon, ""); notificationIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000)); - lv_label_set_text(notificationIcon, ""); + lv_label_set_text_static(notificationIcon, ""); // Calendar icon calendarOuter = lv_obj_create(lv_scr_act(), nullptr); @@ -154,17 +148,17 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, // Display date dateDayOfWeek = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(dateDayOfWeek, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); - lv_label_set_text(dateDayOfWeek, "THU"); + lv_label_set_text_static(dateDayOfWeek, "THU"); lv_obj_align(dateDayOfWeek, sidebar, LV_ALIGN_CENTER, 0, -34); dateDay = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(dateDay, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); - lv_label_set_text(dateDay, "25"); + lv_label_set_text_static(dateDay, "25"); lv_obj_align(dateDay, sidebar, LV_ALIGN_CENTER, 0, 3); dateMonth = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(dateMonth, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); - lv_label_set_text(dateMonth, "MAR"); + lv_label_set_text_static(dateMonth, "MAR"); lv_obj_align(dateMonth, sidebar, LV_ALIGN_CENTER, 0, 32); // Step count gauge @@ -199,7 +193,7 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); lv_obj_set_size(backgroundLabel, 240, 240); lv_obj_set_pos(backgroundLabel, 0, 0); - lv_label_set_text(backgroundLabel, ""); + lv_label_set_text_static(backgroundLabel, ""); btnNextTime = lv_btn_create(lv_scr_act(), nullptr); btnNextTime->user_data = this; @@ -339,7 +333,7 @@ bool PineTimeStyle::OnButtonPushed() { void PineTimeStyle::SetBatteryIcon() { auto batteryPercent = batteryPercentRemaining.Get(); - lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); + lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); } void PineTimeStyle::AlignIcons() { @@ -357,7 +351,7 @@ void PineTimeStyle::Refresh() { isCharging = batteryController.IsCharging(); if (isCharging.IsUpdated()) { if (isCharging.Get()) { - lv_label_set_text(batteryIcon, Symbols::plug); + lv_label_set_text_static(batteryIcon, Symbols::plug); } else { SetBatteryIcon(); } @@ -371,13 +365,13 @@ void PineTimeStyle::Refresh() { bleState = bleController.IsConnected(); if (bleState.IsUpdated()) { - lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get())); + lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get())); AlignIcons(); } notificationState = notificatioManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); AlignIcons(); } @@ -394,45 +388,31 @@ void PineTimeStyle::Refresh() { auto day = static_cast(yearMonthDay.day()); auto dayOfWeek = static_cast(date::weekday(yearMonthDay).iso_encoding()); - int hour = time.hours().count(); - auto minute = time.minutes().count(); - - char minutesChar[3]; - sprintf(minutesChar, "%02d", static_cast(minute)); - - char hoursChar[3]; - char ampmChar[5]; - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) { - sprintf(hoursChar, "%02d", hour); - } else { - if (hour == 0 && hour != 12) { - hour = 12; - sprintf(ampmChar, "A\nM"); - } else if (hour == 12 && hour != 0) { - hour = 12; - sprintf(ampmChar, "P\nM"); - } else if (hour < 12 && hour != 0) { - sprintf(ampmChar, "A\nM"); - } else if (hour > 12 && hour != 0) { - hour = hour - 12; - sprintf(ampmChar, "P\nM"); - } - sprintf(hoursChar, "%02d", hour); - } + uint8_t hour = time.hours().count(); + uint8_t minute = time.minutes().count(); - if (hoursChar[0] != displayedChar[0] or hoursChar[1] != displayedChar[1] or minutesChar[0] != displayedChar[2] or - minutesChar[1] != displayedChar[3]) { - displayedChar[0] = hoursChar[0]; - displayedChar[1] = hoursChar[1]; - displayedChar[2] = minutesChar[0]; - displayedChar[3] = minutesChar[1]; + if (displayedHour != hour || displayedMinute != minute) { + displayedHour = hour; + displayedMinute = minute; if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + char ampmChar[4] = "A\nM"; + if (hour == 0) { + hour = 12; + } else if (hour == 12) { + ampmChar[0] = 'P'; + } else if (hour > 12) { + hour = hour - 12; + ampmChar[0] = 'P'; + } lv_label_set_text(timeAMPM, ampmChar); + // Should be padded with blank spaces, but the space character doesn't exist in the font + lv_label_set_text_fmt(timeDD1, "%02d", hour); + lv_label_set_text_fmt(timeDD2, "%02d", minute); + } else { + lv_label_set_text_fmt(timeDD1, "%02d", hour); + lv_label_set_text_fmt(timeDD2, "%02d", minute); } - - lv_label_set_text_fmt(timeDD1, "%s", hoursChar); - lv_label_set_text_fmt(timeDD2, "%s", minutesChar); } if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) { diff --git a/src/displayapp/screens/PineTimeStyle.h b/src/displayapp/screens/PineTimeStyle.h index df8b7d5..1b972ce 100644 --- a/src/displayapp/screens/PineTimeStyle.h +++ b/src/displayapp/screens/PineTimeStyle.h @@ -39,7 +39,8 @@ namespace Pinetime { void UpdateSelected(lv_obj_t *object, lv_event_t event); private: - char displayedChar[5]; + uint8_t displayedHour = -1; + uint8_t displayedMinute = -1; uint16_t currentYear = 1970; Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 4d9eaf3..b3cb0f9 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -35,22 +35,22 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, settingsController.SetClockFace(0); batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(batteryIcon, Symbols::batteryFull); + lv_label_set_text_static(batteryIcon, Symbols::batteryFull); lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0); batteryPlug = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFF0000)); - lv_label_set_text(batteryPlug, Symbols::plug); + lv_label_set_text_static(batteryPlug, Symbols::plug); lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0); bleIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x0082FC)); - lv_label_set_text(bleIcon, Symbols::bluetooth); + lv_label_set_text_static(bleIcon, Symbols::bluetooth); lv_obj_align(bleIcon, batteryPlug, LV_ALIGN_OUT_LEFT_MID, -5, 0); notificationIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00)); - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false)); lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); label_date = lv_label_create(lv_scr_act(), nullptr); @@ -71,26 +71,26 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); lv_obj_set_size(backgroundLabel, 240, 240); lv_obj_set_pos(backgroundLabel, 0, 0); - lv_label_set_text(backgroundLabel, ""); + lv_label_set_text_static(backgroundLabel, ""); heartbeatIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(heartbeatIcon, Symbols::heartBeat); + lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat); lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B)); lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); heartbeatValue = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B)); - lv_label_set_text(heartbeatValue, ""); + lv_label_set_text_static(heartbeatValue, ""); lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0); stepValue = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7)); - lv_label_set_text(stepValue, "0"); + lv_label_set_text_static(stepValue, "0"); lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0); stepIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7)); - lv_label_set_text(stepIcon, Symbols::shoe); + lv_label_set_text_static(stepIcon, Symbols::shoe); lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0); taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); @@ -105,7 +105,7 @@ WatchFaceDigital::~WatchFaceDigital() { void WatchFaceDigital::Refresh() { powerPresent = batteryController.IsPowerPresent(); if (powerPresent.IsUpdated()) { - lv_label_set_text(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get())); + lv_label_set_text_static(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get())); } batteryPercentRemaining = batteryController.PercentRemaining(); @@ -116,20 +116,20 @@ void WatchFaceDigital::Refresh() { } else { lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); } - lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); + lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); } bleState = bleController.IsConnected(); if (bleState.IsUpdated()) { - lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get())); + lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get())); } - lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0); - lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0); - lv_obj_align(bleIcon, batteryPlug, LV_ALIGN_OUT_LEFT_MID, -5, 0); + lv_obj_realign(batteryIcon); + lv_obj_realign(batteryPlug); + lv_obj_realign(bleIcon); notificationState = notificatioManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); } currentDateTime = dateTimeController.CurrentDateTime(); @@ -146,62 +146,41 @@ void WatchFaceDigital::Refresh() { auto day = static_cast(yearMonthDay.day()); auto dayOfWeek = static_cast(date::weekday(yearMonthDay).iso_encoding()); - int hour = time.hours().count(); - auto minute = time.minutes().count(); - - char minutesChar[3]; - sprintf(minutesChar, "%02d", static_cast(minute)); - - char hoursChar[3]; - char ampmChar[3]; - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) { - sprintf(hoursChar, "%02d", hour); - } else { - if (hour == 0 && hour != 12) { - hour = 12; - sprintf(ampmChar, "AM"); - } else if (hour == 12 && hour != 0) { - hour = 12; - sprintf(ampmChar, "PM"); - } else if (hour < 12 && hour != 0) { - sprintf(ampmChar, "AM"); - } else if (hour > 12 && hour != 0) { - hour = hour - 12; - sprintf(ampmChar, "PM"); - } - sprintf(hoursChar, "%02d", hour); - } + uint8_t hour = time.hours().count(); + uint8_t minute = time.minutes().count(); - if ((hoursChar[0] != displayedChar[0]) or (hoursChar[1] != displayedChar[1]) or (minutesChar[0] != displayedChar[2]) or - (minutesChar[1] != displayedChar[3])) { - displayedChar[0] = hoursChar[0]; - displayedChar[1] = hoursChar[1]; - displayedChar[2] = minutesChar[0]; - displayedChar[3] = minutesChar[1]; + if (displayedHour != hour || displayedMinute != minute) { + displayedHour = hour; + displayedMinute = minute; if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - lv_label_set_text(label_time_ampm, ampmChar); - if (hoursChar[0] == '0') { - hoursChar[0] = ' '; + char ampmChar[3] = "AM"; + if (hour == 0) { + hour = 12; + } else if (hour == 12) { + ampmChar[0] = 'P'; + } else if (hour > 12) { + hour = hour - 12; + ampmChar[0] = 'P'; } - } - - lv_label_set_text_fmt(label_time, "%s:%s", hoursChar, minutesChar); - - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + lv_label_set_text(label_time_ampm, ampmChar); + lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0); } else { + lv_label_set_text_fmt(label_time, "%02d:%02d", hour, minute); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); } } if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) { if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) { - lv_label_set_text_fmt(label_date, "%s %d %s %d", dateTimeController.DayOfWeekShortToString(), day, dateTimeController.MonthShortToString(), year); + lv_label_set_text_fmt( + label_date, "%s %d %s %d", dateTimeController.DayOfWeekShortToString(), day, dateTimeController.MonthShortToString(), year); } else { - lv_label_set_text_fmt(label_date, "%s %s %d %d", dateTimeController.DayOfWeekShortToString(), dateTimeController.MonthShortToString(), day, year); + lv_label_set_text_fmt( + label_date, "%s %s %d %d", dateTimeController.DayOfWeekShortToString(), dateTimeController.MonthShortToString(), day, year); } - lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_CENTER, 0, 60); + lv_obj_realign(label_date); currentYear = year; currentMonth = month; @@ -221,15 +200,15 @@ void WatchFaceDigital::Refresh() { lv_label_set_text_static(heartbeatValue, ""); } - lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); - lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0); + lv_obj_realign(heartbeatIcon); + lv_obj_realign(heartbeatValue); } stepCount = motionController.NbSteps(); motionSensorOk = motionController.IsSensorOk(); if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) { lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get()); - lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0); - lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0); + lv_obj_realign(stepValue); + lv_obj_realign(stepIcon); } } diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index 627154c..ab3a028 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -35,7 +35,8 @@ namespace Pinetime { void Refresh() override; private: - char displayedChar[5] {}; + uint8_t displayedHour = -1; + uint8_t displayedMinute = -1; uint16_t currentYear = 1970; Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; -- cgit v0.10.2 From 470db4ab99c214001b3064cfaad135b2b3b6c584 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 22 Jan 2022 12:47:23 +0200 Subject: Fix alarm on time change diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index 673903c..97ccbe3 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -36,6 +36,8 @@ void DateTime::SetTime( UpdateTime(systickCounter); NRF_LOG_INFO("* %d %d %d ", this->hour, this->minute, this->second); NRF_LOG_INFO("* %d %d %d ", this->day, this->month, this->year); + + systemTask->PushMessage(System::Messages::OnNewTime); } void DateTime::UpdateTime(uint32_t systickCounter) { diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 94d40c9..d449455 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -295,6 +295,9 @@ void SystemTask::Work() { case Messages::OnNewTime: ReloadIdleTimer(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime); + if (alarmController.State() == Controllers::AlarmController::AlarmState::Set) { + alarmController.ScheduleAlarm(); + } break; case Messages::OnNewNotification: if (settingsController.GetNotificationStatus() == Pinetime::Controllers::Settings::Notification::ON) { -- cgit v0.10.2 From 314c02194a19016d83fb71a41f6f647959b7be1e Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 23 Jan 2022 23:34:25 +0100 Subject: Music: initialize totalLength to have non-random data from the start In the first `Music::Refresh` call the lastLength and totalLength are not initialized. The `lastLength` value is read first from the musicService. Naturally in the first itereation that is changed and `UpdateLength()` is called. There the variable `totalLength` is used as well, but that variable isn't initialed to a sensible value yet. This leads to sometimes the `Music.h` screen segfaulting (depending on the random uninitialized data in the `lastLength` variable) diff --git a/src/displayapp/screens/Music.h b/src/displayapp/screens/Music.h index f9b4eaa..35f7bab 100644 --- a/src/displayapp/screens/Music.h +++ b/src/displayapp/screens/Music.h @@ -69,7 +69,7 @@ namespace Pinetime { std::string track; /** Total length in seconds */ - int totalLength; + int totalLength = 0; /** Current length in seconds */ int currentLength; /** Last length */ -- cgit v0.10.2 From b4e956227e69d29e9440e3b125521c4f8d23d649 Mon Sep 17 00:00:00 2001 From: hatmajster Date: Mon, 24 Jan 2022 20:28:05 +0100 Subject: Hrs3300: changed default gain to x8 diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index c14fe7a..9d71253 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -36,8 +36,8 @@ void Hrs3300::Init() { // HRS and ALS both in 16-bit mode WriteRegister(static_cast(Registers::Res), 0x88); - // 64x gain - WriteRegister(static_cast(Registers::Hgain), 0x10); + // 8x gain, non default, reduced value for better readings + WriteRegister(static_cast(Registers::Hgain), 0xc); } void Hrs3300::Enable() { -- cgit v0.10.2 From 67f546fa330f7bbe251bfde432b36284db1a79dd Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 24 Jan 2022 23:03:08 +0100 Subject: StopWatch: cleanup unused includes and use relative to src includes diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index a260d29..8749839 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -1,13 +1,10 @@ -#include "StopWatch.h" +#include "displayapp/screens/StopWatch.h" #include "displayapp/screens/Screen.h" #include "displayapp/screens/Symbols.h" #include -#include "projdefs.h" -#include "FreeRTOSConfig.h" -#include "task.h" - -#include +#include +#include using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/StopWatch.h b/src/displayapp/screens/StopWatch.h index 0720a58..06193f6 100644 --- a/src/displayapp/screens/StopWatch.h +++ b/src/displayapp/screens/StopWatch.h @@ -4,7 +4,7 @@ #include "components/datetime/DateTimeController.h" #include "displayapp/LittleVgl.h" -#include "FreeRTOS.h" +#include #include "portmacro_cmsis.h" #include -- cgit v0.10.2 From 698288d82202f5b55689db500033224f562481bc Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Sun, 2 Jan 2022 10:24:34 -0500 Subject: Added 12 hour set time diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index cc544fd..1b77e87 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -417,7 +417,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; case Apps::SettingSetTime: - currentScreen = std::make_unique(this, dateTimeController); + currentScreen = std::make_unique(this, dateTimeController, settingsController); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; case Apps::SettingChimes: diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index 5351ade..a432c75 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -4,6 +4,7 @@ #include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Symbols.h" +#include "components/settings/Settings.h" using namespace Pinetime::Applications::Screens; @@ -22,9 +23,13 @@ namespace { } } -SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::DateTime &dateTimeController) : - Screen(app), - dateTimeController {dateTimeController} { +SettingSetTime::SettingSetTime( + Pinetime::Applications::DisplayApp *app, + Pinetime::Controllers::DateTime& dateTimeController, + Pinetime::Controllers::Settings& settingsController) + : Screen(app), + dateTimeController {dateTimeController}, + settingsController {settingsController} { lv_obj_t * title = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_static(title, "Set current time"); lv_label_set_align(title, LV_LABEL_ALIGN_CENTER); @@ -71,6 +76,24 @@ SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp *app, Pinetime lv_label_set_align(lblSeconds, LV_LABEL_ALIGN_CENTER); lv_obj_align(lblSeconds, lv_scr_act(), LV_ALIGN_CENTER, POS_X_SECONDS, POS_Y_TEXT); + lblampm = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_text_font(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20); + lv_label_set_align(lblampm, LV_LABEL_ALIGN_CENTER); + lv_obj_align(lblampm, lv_scr_act(), LV_ALIGN_CENTER, POS_X_SECONDS, POS_Y_TEXT - 40); + lv_label_set_text_fmt(lblampm, "%02c", ampmValue); + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) + lv_label_set_text(lblampm, " "); + else { + if (hoursValue > 11) + lv_label_set_text(lblampm, "PM"); + else + lv_label_set_text(lblampm, "AM"); + if (hoursValue > 12) + lv_label_set_text_fmt(lblHours, "%02d", hoursValue-12); + else if (hoursValue == 0) + lv_label_set_text_fmt(lblHours, "%02d", hoursValue+1); + } + btnHoursPlus = lv_btn_create(lv_scr_act(), nullptr); btnHoursPlus->user_data = this; lv_obj_set_size(btnHoursPlus, 50, 40); @@ -111,21 +134,63 @@ SettingSetTime::~SettingSetTime() { lv_obj_clean(lv_scr_act()); } +int timeConvert(int time24H) { + switch (time24H) { + case 0: + return 12; + break; + case 1 ... 12: + return time24H; + break; + case 13 ... 23: + return time24H - 12; + break; + default: + return 99; + break; + } +} + void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) { if (event != LV_EVENT_CLICKED) return; + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) { + is24H = true; + } + else { + is24H = false; + } + if (object == btnHoursPlus) { hoursValue++; if (hoursValue > 23) hoursValue = 0; - lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + if (!is24H) { + if (hoursValue < 12) + lv_label_set_text(lblampm, "AM"); + else + lv_label_set_text(lblampm, "PM"); + } + if (!is24H) + lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue)); + else + lv_label_set_text_fmt(lblHours, "%02d", hoursValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnHoursMinus) { hoursValue--; if (hoursValue < 0) hoursValue = 23; - lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + if (!is24H) { + if (hoursValue < 12) + lv_label_set_text(lblampm, "AM"); + else + lv_label_set_text(lblampm, "PM"); + } + if (!is24H) + lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue)); + else + lv_label_set_text_fmt(lblHours, "%02d", hoursValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnMinutesPlus) { minutesValue++; diff --git a/src/displayapp/screens/settings/SettingSetTime.h b/src/displayapp/screens/settings/SettingSetTime.h index 8ba41ea..31f7d0b 100644 --- a/src/displayapp/screens/settings/SettingSetTime.h +++ b/src/displayapp/screens/settings/SettingSetTime.h @@ -3,6 +3,7 @@ #include #include #include "components/datetime/DateTimeController.h" +#include "components/settings/Settings.h" #include "displayapp/screens/Screen.h" namespace Pinetime { @@ -10,18 +11,24 @@ namespace Pinetime { namespace Screens { class SettingSetTime : public Screen{ public: - SettingSetTime(DisplayApp* app, Pinetime::Controllers::DateTime &dateTimeController); + SettingSetTime(DisplayApp* app, + Pinetime::Controllers::DateTime& dateTimeController, + Pinetime::Controllers::Settings& settingsController); ~SettingSetTime() override; void HandleButtonPress(lv_obj_t *object, lv_event_t event); - + private: Controllers::DateTime& dateTimeController; + Controllers::Settings& settingsController; int hoursValue; int minutesValue; + char ampmValue[3]; + bool is24H; lv_obj_t * lblHours; lv_obj_t * lblMinutes; + lv_obj_t * lblampm; lv_obj_t * btnHoursPlus; lv_obj_t * btnHoursMinus; lv_obj_t * btnMinutesPlus; -- cgit v0.10.2 From 2bc338ceede540aabbb9d6054e14760c7f4fc95b Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Mon, 3 Jan 2022 18:13:47 -0500 Subject: Cleaned up redundant if statements, spacing Removed redundant if statements in hour button logic. Spacing is now in line with repo guidelines. diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index a432c75..8d64dd9 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -24,9 +24,9 @@ namespace { } SettingSetTime::SettingSetTime( - Pinetime::Applications::DisplayApp *app, - Pinetime::Controllers::DateTime& dateTimeController, - Pinetime::Controllers::Settings& settingsController) + Pinetime::Applications::DisplayApp *app, + Pinetime::Controllers::DateTime& dateTimeController, + Pinetime::Controllers::Settings& settingsController) : Screen(app), dateTimeController {dateTimeController}, settingsController {settingsController} { @@ -82,16 +82,16 @@ SettingSetTime::SettingSetTime( lv_obj_align(lblampm, lv_scr_act(), LV_ALIGN_CENTER, POS_X_SECONDS, POS_Y_TEXT - 40); lv_label_set_text_fmt(lblampm, "%02c", ampmValue); if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) - lv_label_set_text(lblampm, " "); + lv_label_set_text(lblampm, " "); else { - if (hoursValue > 11) + if (hoursValue > 11) lv_label_set_text(lblampm, "PM"); else - lv_label_set_text(lblampm, "AM"); - if (hoursValue > 12) - lv_label_set_text_fmt(lblHours, "%02d", hoursValue-12); - else if (hoursValue == 0) - lv_label_set_text_fmt(lblHours, "%02d", hoursValue+1); + lv_label_set_text(lblampm, "AM"); + if (hoursValue > 12) + lv_label_set_text_fmt(lblHours, "%02d", hoursValue-12); + else if (hoursValue == 0) + lv_label_set_text_fmt(lblHours, "%02d", hoursValue+1); } btnHoursPlus = lv_btn_create(lv_scr_act(), nullptr); @@ -135,20 +135,20 @@ SettingSetTime::~SettingSetTime() { } int timeConvert(int time24H) { - switch (time24H) { - case 0: - return 12; - break; - case 1 ... 12: - return time24H; - break; - case 13 ... 23: - return time24H - 12; - break; - default: - return 99; - break; - } + switch (time24H) { + case 0: + return 12; + break; + case 1 ... 12: + return time24H; + break; + case 13 ... 23: + return time24H - 12; + break; + default: + return 99; + break; + } } void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) { @@ -156,41 +156,36 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) { return; if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) { - is24H = true; + is24H = true; } else { - is24H = false; + is24H = false; } - if (object == btnHoursPlus) { hoursValue++; if (hoursValue > 23) hoursValue = 0; - if (!is24H) { - if (hoursValue < 12) - lv_label_set_text(lblampm, "AM"); - else - lv_label_set_text(lblampm, "PM"); - } - if (!is24H) + if (!is24H) { + if (hoursValue < 12) + lv_label_set_text(lblampm, "AM"); + else + lv_label_set_text(lblampm, "PM"); lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue)); - else - lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + } else + lv_label_set_text_fmt(lblHours, "%02d", hoursValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnHoursMinus) { hoursValue--; if (hoursValue < 0) hoursValue = 23; - if (!is24H) { - if (hoursValue < 12) - lv_label_set_text(lblampm, "AM"); - else - lv_label_set_text(lblampm, "PM"); - } - if (!is24H) + if (!is24H) { + if (hoursValue < 12) + lv_label_set_text(lblampm, "AM"); + else + lv_label_set_text(lblampm, "PM"); lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue)); - else - lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + } else + lv_label_set_text_fmt(lblHours, "%02d", hoursValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnMinutesPlus) { minutesValue++; @@ -217,3 +212,4 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) { lv_btn_set_state(btnSetTime, LV_BTN_STATE_DISABLED); } } +} diff --git a/src/displayapp/screens/settings/SettingSetTime.h b/src/displayapp/screens/settings/SettingSetTime.h index 31f7d0b..74588ca 100644 --- a/src/displayapp/screens/settings/SettingSetTime.h +++ b/src/displayapp/screens/settings/SettingSetTime.h @@ -12,8 +12,8 @@ namespace Pinetime { class SettingSetTime : public Screen{ public: SettingSetTime(DisplayApp* app, - Pinetime::Controllers::DateTime& dateTimeController, - Pinetime::Controllers::Settings& settingsController); + Pinetime::Controllers::DateTime& dateTimeController, + Pinetime::Controllers::Settings& settingsController); ~SettingSetTime() override; void HandleButtonPress(lv_obj_t *object, lv_event_t event); -- cgit v0.10.2 From 18133999593574e48ecbf1284e669dc0d8f53011 Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Mon, 3 Jan 2022 18:22:42 -0500 Subject: Removed redundant brackets Also corrected orphaned bracket diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index 8d64dd9..7e4215d 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -155,12 +155,11 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) { if (event != LV_EVENT_CLICKED) return; - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) { + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) is24H = true; - } - else { + else is24H = false; - } + if (object == btnHoursPlus) { hoursValue++; if (hoursValue > 23) @@ -212,4 +211,3 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) { lv_btn_set_state(btnSetTime, LV_BTN_STATE_DISABLED); } } -} -- cgit v0.10.2 From 5be2f57a78edd37bd8d844b4d56adc82f2d183dc Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Sun, 9 Jan 2022 10:39:04 -0500 Subject: Consolidated time conversion logic Consolidated 24 hour to 12 hour time conversion logic into function, addressed formatting issues, cleaned up code. diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index 7e4215d..b68e540 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Symbols.h" #include "components/settings/Settings.h" @@ -17,27 +18,31 @@ namespace { constexpr int16_t POS_Y_MINUS = 40; constexpr int16_t OFS_Y_COLON = -2; - void event_handler(lv_obj_t * obj, lv_event_t event) { - auto* screen = static_cast(obj->user_data); + void event_handler(lv_obj_t* obj, lv_event_t event) { + auto* screen = static_cast(obj->user_data); screen->HandleButtonPress(obj, event); } } -SettingSetTime::SettingSetTime( - Pinetime::Applications::DisplayApp *app, - Pinetime::Controllers::DateTime& dateTimeController, - Pinetime::Controllers::Settings& settingsController) - : Screen(app), - dateTimeController {dateTimeController}, - settingsController {settingsController} { - lv_obj_t * title = lv_label_create(lv_scr_act(), nullptr); +struct Time12H { + std::string ampm; + int hours; +}; + +Time12H timeConvert(int time24H); + +SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app, + Pinetime::Controllers::DateTime& dateTimeController, + Pinetime::Controllers::Settings& settingsController) + : Screen(app), dateTimeController {dateTimeController}, settingsController {settingsController} { + lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_static(title, "Set current time"); lv_label_set_align(title, LV_LABEL_ALIGN_CENTER); lv_obj_align(title, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 15, 15); - lv_obj_t * icon = lv_label_create(lv_scr_act(), nullptr); + lv_obj_t* icon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(icon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); - + lv_label_set_text_static(icon, Symbols::clock); lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER); lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0); @@ -50,7 +55,7 @@ SettingSetTime::SettingSetTime( lv_obj_align(lblHours, lv_scr_act(), LV_ALIGN_CENTER, POS_X_HOURS, POS_Y_TEXT); lv_obj_set_auto_realign(lblHours, true); - lv_obj_t * lblColon1 = lv_label_create(lv_scr_act(), nullptr); + lv_obj_t* lblColon1 = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(lblColon1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); lv_label_set_text_static(lblColon1, ":"); lv_label_set_align(lblColon1, LV_LABEL_ALIGN_CENTER); @@ -64,13 +69,13 @@ SettingSetTime::SettingSetTime( lv_obj_align(lblMinutes, lv_scr_act(), LV_ALIGN_CENTER, POS_X_MINUTES, POS_Y_TEXT); lv_obj_set_auto_realign(lblMinutes, true); - lv_obj_t * lblColon2 = lv_label_create(lv_scr_act(), nullptr); + lv_obj_t* lblColon2 = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(lblColon2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); lv_label_set_text_static(lblColon2, ":"); lv_label_set_align(lblColon2, LV_LABEL_ALIGN_CENTER); lv_obj_align(lblColon2, lv_scr_act(), LV_ALIGN_CENTER, (POS_X_MINUTES + POS_X_SECONDS) / 2, POS_Y_TEXT + OFS_Y_COLON); - lv_obj_t * lblSeconds = lv_label_create(lv_scr_act(), nullptr); + lv_obj_t* lblSeconds = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(lblSeconds, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); lv_label_set_text_static(lblSeconds, "00"); lv_label_set_align(lblSeconds, LV_LABEL_ALIGN_CENTER); @@ -78,21 +83,9 @@ SettingSetTime::SettingSetTime( lblampm = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20); + lv_label_set_text_static(lblampm, " "); lv_label_set_align(lblampm, LV_LABEL_ALIGN_CENTER); - lv_obj_align(lblampm, lv_scr_act(), LV_ALIGN_CENTER, POS_X_SECONDS, POS_Y_TEXT - 40); - lv_label_set_text_fmt(lblampm, "%02c", ampmValue); - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) - lv_label_set_text(lblampm, " "); - else { - if (hoursValue > 11) - lv_label_set_text(lblampm, "PM"); - else - lv_label_set_text(lblampm, "AM"); - if (hoursValue > 12) - lv_label_set_text_fmt(lblHours, "%02d", hoursValue-12); - else if (hoursValue == 0) - lv_label_set_text_fmt(lblHours, "%02d", hoursValue+1); - } + lv_obj_align(lblampm, lv_scr_act(), LV_ALIGN_CENTER, POS_X_SECONDS, POS_Y_PLUS); btnHoursPlus = lv_btn_create(lv_scr_act(), nullptr); btnHoursPlus->user_data = this; @@ -128,74 +121,90 @@ SettingSetTime::SettingSetTime( lv_obj_align(btnSetTime, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, 0); lv_obj_set_style_local_value_str(btnSetTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "Set"); lv_obj_set_event_cb(btnSetTime, event_handler); + + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + struct Time12H convertedTime = timeConvert(hoursValue); + if (hoursValue < 12) { + lv_label_set_text_static(lblampm, "AM"); + } else { + lv_label_set_text_static(lblampm, "PM"); + } + lv_label_set_text_fmt(lblHours, "%02d", convertedTime.hours); + } } SettingSetTime::~SettingSetTime() { lv_obj_clean(lv_scr_act()); } -int timeConvert(int time24H) { - switch (time24H) { - case 0: - return 12; - break; - case 1 ... 12: - return time24H; - break; - case 13 ... 23: - return time24H - 12; - break; - default: - return 99; - break; - } +Time12H timeConvert(int time24H) { + struct Time12H time12H; + switch (time24H) { + case 0: + time12H.hours = 12; + time12H.ampm = "AM"; + break; + case 1 ... 11: + time12H.hours = time24H; + time12H.ampm = "AM"; + break; + case 12: + time12H.hours = 12; + time12H.ampm = "PM"; + break; + case 13 ... 23: + time12H.hours = time24H - 12; + time12H.ampm = "PM"; + break; + } + return time12H; } -void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) { +void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { + bool is24H; if (event != LV_EVENT_CLICKED) return; - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) - is24H = true; - else - is24H = false; + is24H = (settingsController.GetClockType() == Controllers::Settings::ClockType::H24); if (object == btnHoursPlus) { hoursValue++; - if (hoursValue > 23) + if (hoursValue > 23) { hoursValue = 0; + } + struct Time12H convertedTime = timeConvert(hoursValue); if (!is24H) { - if (hoursValue < 12) - lv_label_set_text(lblampm, "AM"); - else - lv_label_set_text(lblampm, "PM"); - lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue)); - } else + lv_label_set_text_static(lblampm, convertedTime.ampm.c_str()); + lv_label_set_text_fmt(lblHours, "%02d", convertedTime.hours); + } else { lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + } lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnHoursMinus) { hoursValue--; - if (hoursValue < 0) + if (hoursValue < 0) { hoursValue = 23; + } + struct Time12H convertedTime = timeConvert(hoursValue); if (!is24H) { - if (hoursValue < 12) - lv_label_set_text(lblampm, "AM"); - else - lv_label_set_text(lblampm, "PM"); - lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue)); - } else + lv_label_set_text_static(lblampm, convertedTime.ampm.c_str()); + lv_label_set_text_fmt(lblHours, "%02d", convertedTime.hours); + } else { lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + } lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnMinutesPlus) { minutesValue++; - if (minutesValue > 59) + if (minutesValue > 59) { minutesValue = 0; + } lv_label_set_text_fmt(lblMinutes, "%02d", minutesValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnMinutesMinus) { minutesValue--; - if (minutesValue < 0) + if (minutesValue < 0) { minutesValue = 59; + } lv_label_set_text_fmt(lblMinutes, "%02d", minutesValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnSetTime) { diff --git a/src/displayapp/screens/settings/SettingSetTime.h b/src/displayapp/screens/settings/SettingSetTime.h index 74588ca..eb0423f 100644 --- a/src/displayapp/screens/settings/SettingSetTime.h +++ b/src/displayapp/screens/settings/SettingSetTime.h @@ -9,31 +9,29 @@ namespace Pinetime { namespace Applications { namespace Screens { - class SettingSetTime : public Screen{ - public: - SettingSetTime(DisplayApp* app, - Pinetime::Controllers::DateTime& dateTimeController, - Pinetime::Controllers::Settings& settingsController); - ~SettingSetTime() override; + class SettingSetTime : public Screen { + public: + SettingSetTime(DisplayApp* app, + Pinetime::Controllers::DateTime& dateTimeController, + Pinetime::Controllers::Settings& settingsController); + ~SettingSetTime() override; - void HandleButtonPress(lv_obj_t *object, lv_event_t event); + void HandleButtonPress(lv_obj_t* object, lv_event_t event); - private: - Controllers::DateTime& dateTimeController; - Controllers::Settings& settingsController; + private: + Controllers::DateTime& dateTimeController; + Controllers::Settings& settingsController; - int hoursValue; - int minutesValue; - char ampmValue[3]; - bool is24H; - lv_obj_t * lblHours; - lv_obj_t * lblMinutes; - lv_obj_t * lblampm; - lv_obj_t * btnHoursPlus; - lv_obj_t * btnHoursMinus; - lv_obj_t * btnMinutesPlus; - lv_obj_t * btnMinutesMinus; - lv_obj_t * btnSetTime; + int hoursValue; + int minutesValue; + lv_obj_t* lblHours; + lv_obj_t* lblMinutes; + lv_obj_t* lblampm; + lv_obj_t* btnHoursPlus; + lv_obj_t* btnHoursMinus; + lv_obj_t* btnMinutesPlus; + lv_obj_t* btnMinutesMinus; + lv_obj_t* btnSetTime; }; } } -- cgit v0.10.2 From c8d998e82c691a79ddfd19b7a175dfba2d958ffa Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Mon, 10 Jan 2022 10:16:38 -0500 Subject: Consolidated label changes, optimizations Consolidated 12 hour label changes to function. Removed use of strings, struct. diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index b68e540..7540a4d 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Symbols.h" #include "components/settings/Settings.h" @@ -24,12 +23,7 @@ namespace { } } -struct Time12H { - std::string ampm; - int hours; -}; - -Time12H timeConvert(int time24H); +void set12HourLabels(int time24H, lv_obj_t* lblampm, lv_obj_t* lblHours); SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::DateTime& dateTimeController, @@ -123,13 +117,7 @@ SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app, lv_obj_set_event_cb(btnSetTime, event_handler); if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - struct Time12H convertedTime = timeConvert(hoursValue); - if (hoursValue < 12) { - lv_label_set_text_static(lblampm, "AM"); - } else { - lv_label_set_text_static(lblampm, "PM"); - } - lv_label_set_text_fmt(lblHours, "%02d", convertedTime.hours); + set12HourLabels(hoursValue, lblampm, lblHours); } } @@ -137,45 +125,38 @@ SettingSetTime::~SettingSetTime() { lv_obj_clean(lv_scr_act()); } -Time12H timeConvert(int time24H) { - struct Time12H time12H; +void set12HourLabels(int time24H, lv_obj_t* lblampm, lv_obj_t* lblHours) { switch (time24H) { case 0: - time12H.hours = 12; - time12H.ampm = "AM"; + lv_label_set_text_fmt(lblHours, "%02d", 12); + lv_label_set_text_static(lblampm, "AM"); break; case 1 ... 11: - time12H.hours = time24H; - time12H.ampm = "AM"; + lv_label_set_text_fmt(lblHours, "%02d", time24H); + lv_label_set_text_static(lblampm, "AM"); break; case 12: - time12H.hours = 12; - time12H.ampm = "PM"; + lv_label_set_text_fmt(lblHours, "%02d", 12); + lv_label_set_text_static(lblampm, "PM"); break; case 13 ... 23: - time12H.hours = time24H - 12; - time12H.ampm = "PM"; + lv_label_set_text_fmt(lblHours, "%02d", time24H - 12); + lv_label_set_text_static(lblampm, "PM"); break; } - return time12H; } void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { - bool is24H; if (event != LV_EVENT_CLICKED) return; - is24H = (settingsController.GetClockType() == Controllers::Settings::ClockType::H24); - if (object == btnHoursPlus) { hoursValue++; if (hoursValue > 23) { hoursValue = 0; } - struct Time12H convertedTime = timeConvert(hoursValue); - if (!is24H) { - lv_label_set_text_static(lblampm, convertedTime.ampm.c_str()); - lv_label_set_text_fmt(lblHours, "%02d", convertedTime.hours); + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + set12HourLabels(hoursValue, lblampm, lblHours); } else { lv_label_set_text_fmt(lblHours, "%02d", hoursValue); } @@ -185,10 +166,8 @@ void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { if (hoursValue < 0) { hoursValue = 23; } - struct Time12H convertedTime = timeConvert(hoursValue); - if (!is24H) { - lv_label_set_text_static(lblampm, convertedTime.ampm.c_str()); - lv_label_set_text_fmt(lblHours, "%02d", convertedTime.hours); + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + set12HourLabels(hoursValue, lblampm, lblHours); } else { lv_label_set_text_fmt(lblHours, "%02d", hoursValue); } -- cgit v0.10.2 From d86f81b9ad68dd6baab434f6adcbf0e728caf3c6 Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Tue, 11 Jan 2022 10:24:17 -0500 Subject: Changed setHourLabels function to handle 24H too Changed setHourLabels function to handle 24 hour time labeling, changed to private diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index 7540a4d..b6d64dd 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -23,8 +23,6 @@ namespace { } } -void set12HourLabels(int time24H, lv_obj_t* lblampm, lv_obj_t* lblHours); - SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::DateTime& dateTimeController, Pinetime::Controllers::Settings& settingsController) @@ -116,36 +114,13 @@ SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app, lv_obj_set_style_local_value_str(btnSetTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "Set"); lv_obj_set_event_cb(btnSetTime, event_handler); - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - set12HourLabels(hoursValue, lblampm, lblHours); - } + setHourLabels(hoursValue); } SettingSetTime::~SettingSetTime() { lv_obj_clean(lv_scr_act()); } -void set12HourLabels(int time24H, lv_obj_t* lblampm, lv_obj_t* lblHours) { - switch (time24H) { - case 0: - lv_label_set_text_fmt(lblHours, "%02d", 12); - lv_label_set_text_static(lblampm, "AM"); - break; - case 1 ... 11: - lv_label_set_text_fmt(lblHours, "%02d", time24H); - lv_label_set_text_static(lblampm, "AM"); - break; - case 12: - lv_label_set_text_fmt(lblHours, "%02d", 12); - lv_label_set_text_static(lblampm, "PM"); - break; - case 13 ... 23: - lv_label_set_text_fmt(lblHours, "%02d", time24H - 12); - lv_label_set_text_static(lblampm, "PM"); - break; - } -} - void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { if (event != LV_EVENT_CLICKED) return; @@ -155,22 +130,14 @@ void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { if (hoursValue > 23) { hoursValue = 0; } - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - set12HourLabels(hoursValue, lblampm, lblHours); - } else { - lv_label_set_text_fmt(lblHours, "%02d", hoursValue); - } + setHourLabels(hoursValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnHoursMinus) { hoursValue--; if (hoursValue < 0) { hoursValue = 23; } - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - set12HourLabels(hoursValue, lblampm, lblHours); - } else { - lv_label_set_text_fmt(lblHours, "%02d", hoursValue); - } + setHourLabels(hoursValue); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnMinutesPlus) { minutesValue++; diff --git a/src/displayapp/screens/settings/SettingSetTime.h b/src/displayapp/screens/settings/SettingSetTime.h index eb0423f..cc4e469 100644 --- a/src/displayapp/screens/settings/SettingSetTime.h +++ b/src/displayapp/screens/settings/SettingSetTime.h @@ -32,6 +32,31 @@ namespace Pinetime { lv_obj_t* btnMinutesPlus; lv_obj_t* btnMinutesMinus; lv_obj_t* btnSetTime; + + void setHourLabels(int time24H) { + switch (time24H) { + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + case 0: + lv_label_set_text_static(lblHours, "12"); + lv_label_set_text_static(lblampm, "AM"); + break; + case 1 ... 11: + lv_label_set_text_fmt(lblHours, "%02d", time24H); + lv_label_set_text_static(lblampm, "AM"); + break; + case 12: + lv_label_set_text_static(lblHours, "12"); + lv_label_set_text_static(lblampm, "PM"); + break; + case 13 ... 23: + lv_label_set_text_fmt(lblHours, "%02d", time24H - 12); + lv_label_set_text_static(lblampm, "PM"); + break; + } else { + lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + } + } + } }; } } -- cgit v0.10.2 From 02e94acf185aa271e4b3773251efc3108c555fe2 Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Tue, 11 Jan 2022 16:23:49 -0500 Subject: Corrected code formatting Corrected formatting and removed unnecessary variable time24H diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index b6d64dd..fd0a8a3 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -114,13 +114,38 @@ SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app, lv_obj_set_style_local_value_str(btnSetTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "Set"); lv_obj_set_event_cb(btnSetTime, event_handler); - setHourLabels(hoursValue); + setHourLabels(); } SettingSetTime::~SettingSetTime() { lv_obj_clean(lv_scr_act()); } +void SettingSetTime::setHourLabels() { + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + switch (hoursValue) { + case 0: + lv_label_set_text_static(lblHours, "12"); + lv_label_set_text_static(lblampm, "AM"); + break; + case 1 ... 11: + lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + lv_label_set_text_static(lblampm, "AM"); + break; + case 12: + lv_label_set_text_static(lblHours, "12"); + lv_label_set_text_static(lblampm, "PM"); + break; + case 13 ... 23: + lv_label_set_text_fmt(lblHours, "%02d", hoursValue - 12); + lv_label_set_text_static(lblampm, "PM"); + break; + } + } else { + lv_label_set_text_fmt(lblHours, "%02d", hoursValue); + } +} + void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { if (event != LV_EVENT_CLICKED) return; @@ -130,14 +155,14 @@ void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { if (hoursValue > 23) { hoursValue = 0; } - setHourLabels(hoursValue); + setHourLabels(); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnHoursMinus) { hoursValue--; if (hoursValue < 0) { hoursValue = 23; } - setHourLabels(hoursValue); + setHourLabels(); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnMinutesPlus) { minutesValue++; diff --git a/src/displayapp/screens/settings/SettingSetTime.h b/src/displayapp/screens/settings/SettingSetTime.h index cc4e469..2851568 100644 --- a/src/displayapp/screens/settings/SettingSetTime.h +++ b/src/displayapp/screens/settings/SettingSetTime.h @@ -22,6 +22,8 @@ namespace Pinetime { Controllers::DateTime& dateTimeController; Controllers::Settings& settingsController; + void setHourLabels(); + int hoursValue; int minutesValue; lv_obj_t* lblHours; @@ -32,31 +34,6 @@ namespace Pinetime { lv_obj_t* btnMinutesPlus; lv_obj_t* btnMinutesMinus; lv_obj_t* btnSetTime; - - void setHourLabels(int time24H) { - switch (time24H) { - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - case 0: - lv_label_set_text_static(lblHours, "12"); - lv_label_set_text_static(lblampm, "AM"); - break; - case 1 ... 11: - lv_label_set_text_fmt(lblHours, "%02d", time24H); - lv_label_set_text_static(lblampm, "AM"); - break; - case 12: - lv_label_set_text_static(lblHours, "12"); - lv_label_set_text_static(lblampm, "PM"); - break; - case 13 ... 23: - lv_label_set_text_fmt(lblHours, "%02d", time24H - 12); - lv_label_set_text_static(lblampm, "PM"); - break; - } else { - lv_label_set_text_fmt(lblHours, "%02d", hoursValue); - } - } - } }; } } -- cgit v0.10.2 From ae0724c28c33cf99886aae7df1997ed5a23f0684 Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Tue, 11 Jan 2022 16:25:26 -0500 Subject: Corrected capitalization diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index fd0a8a3..037611f 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -114,14 +114,14 @@ SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app, lv_obj_set_style_local_value_str(btnSetTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "Set"); lv_obj_set_event_cb(btnSetTime, event_handler); - setHourLabels(); + SetHourLabels(); } SettingSetTime::~SettingSetTime() { lv_obj_clean(lv_scr_act()); } -void SettingSetTime::setHourLabels() { +void SettingSetTime::SetHourLabels() { if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { switch (hoursValue) { case 0: @@ -155,14 +155,14 @@ void SettingSetTime::HandleButtonPress(lv_obj_t* object, lv_event_t event) { if (hoursValue > 23) { hoursValue = 0; } - setHourLabels(); + SetHourLabels(); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnHoursMinus) { hoursValue--; if (hoursValue < 0) { hoursValue = 23; } - setHourLabels(); + SetHourLabels(); lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED); } else if (object == btnMinutesPlus) { minutesValue++; diff --git a/src/displayapp/screens/settings/SettingSetTime.h b/src/displayapp/screens/settings/SettingSetTime.h index 2851568..d02c332 100644 --- a/src/displayapp/screens/settings/SettingSetTime.h +++ b/src/displayapp/screens/settings/SettingSetTime.h @@ -22,7 +22,7 @@ namespace Pinetime { Controllers::DateTime& dateTimeController; Controllers::Settings& settingsController; - void setHourLabels(); + void SetHourLabels(); int hoursValue; int minutesValue; -- cgit v0.10.2 From 2daa5dcbeeecc0d6940906dadc42df1bd10b9b7e Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Sun, 16 Jan 2022 09:40:23 -0500 Subject: Added alarm 12 hour interface diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 1b77e87..672bcb3 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -379,7 +379,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) currentScreen = std::make_unique(this, timerController); break; case Apps::Alarm: - currentScreen = std::make_unique(this, alarmController); + currentScreen = std::make_unique(this, alarmController, settingsController); break; // Settings @@ -425,7 +425,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; case Apps::SettingShakeThreshold: - currentScreen = std::make_unique(this, settingsController,motionController,*systemTask); + currentScreen = std::make_unique(this, settingsController, motionController, *systemTask); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; case Apps::BatteryInfo: diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp index 537ac0e..b8eaa6d 100644 --- a/src/displayapp/screens/Alarm.cpp +++ b/src/displayapp/screens/Alarm.cpp @@ -27,8 +27,8 @@ static void btnEventHandler(lv_obj_t* obj, lv_event_t event) { screen->OnButtonEvent(obj, event); } -Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController) - : Screen(app), running {true}, alarmController {alarmController} { +Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pinetime::Controllers::Settings& settingsController) + : Screen(app), running {true}, alarmController {alarmController}, settingsController {settingsController} { time = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76); @@ -40,6 +40,13 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController) lv_obj_align(time, lv_scr_act(), LV_ALIGN_CENTER, 0, -25); + lblampm = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_text_font(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20); + lv_obj_set_style_local_text_color(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY); + lv_label_set_text_static(lblampm, " "); + lv_label_set_align(lblampm, LV_LABEL_ALIGN_CENTER); + lv_obj_align(lblampm, lv_scr_act(), LV_ALIGN_CENTER, 0, 30); + btnHoursUp = lv_btn_create(lv_scr_act(), nullptr); btnHoursUp->user_data = this; lv_obj_set_event_cb(btnHoursUp, btnEventHandler); @@ -95,6 +102,8 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController) lv_obj_align(btnInfo, lv_scr_act(), LV_ALIGN_CENTER, 0, -85); txtInfo = lv_label_create(btnInfo, nullptr); lv_label_set_text_static(txtInfo, "i"); + + UpdateAlarmTime(); } Alarm::~Alarm() { @@ -180,7 +189,28 @@ bool Alarm::OnButtonPushed() { } void Alarm::UpdateAlarmTime() { - lv_label_set_text_fmt(time, "%02d:%02d", alarmHours, alarmMinutes); + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + switch (alarmHours) { + case 0: + lv_label_set_text_static(lblampm, "AM"); + lv_label_set_text_fmt(time, "%02d:%02d", 12, alarmMinutes); + break; + case 1 ... 11: + lv_label_set_text_static(lblampm, "AM"); + lv_label_set_text_fmt(time, "%02d:%02d", alarmHours, alarmMinutes); + break; + case 12: + lv_label_set_text_static(lblampm, "PM"); + lv_label_set_text_fmt(time, "%02d:%02d", 12, alarmMinutes); + break; + case 13 ... 23: + lv_label_set_text_static(lblampm, "PM"); + lv_label_set_text_fmt(time, "%02d:%02d", alarmHours - 12, alarmMinutes); + break; + } + } else { + lv_label_set_text_fmt(time, "%02d:%02d", alarmHours, alarmMinutes); + } alarmController.SetAlarmTime(alarmHours, alarmMinutes); } diff --git a/src/displayapp/screens/Alarm.h b/src/displayapp/screens/Alarm.h index 4b301ce..d45fb96 100644 --- a/src/displayapp/screens/Alarm.h +++ b/src/displayapp/screens/Alarm.h @@ -27,7 +27,7 @@ namespace Pinetime { namespace Screens { class Alarm : public Screen { public: - Alarm(DisplayApp* app, Controllers::AlarmController& alarmController); + Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pinetime::Controllers::Settings& settingsController); ~Alarm() override; void SetAlerting(); void OnButtonEvent(lv_obj_t* obj, lv_event_t event); @@ -38,9 +38,10 @@ namespace Pinetime { uint8_t alarmHours; uint8_t alarmMinutes; Controllers::AlarmController& alarmController; + Controllers::Settings& settingsController; - lv_obj_t *time, *btnEnable, *txtEnable, *btnMinutesUp, *btnMinutesDown, *btnHoursUp, *btnHoursDown, *txtMinUp, *txtMinDown, - *txtHrUp, *txtHrDown, *btnRecur, *txtRecur, *btnInfo, *txtInfo; + lv_obj_t *time, *lblampm, *btnEnable, *txtEnable, *btnMinutesUp, *btnMinutesDown, *btnHoursUp, *btnHoursDown, *txtMinUp, + *txtMinDown, *txtHrUp, *txtHrDown, *btnRecur, *txtRecur, *btnInfo, *txtInfo; lv_obj_t* txtMessage = nullptr; lv_obj_t* btnMessage = nullptr; -- cgit v0.10.2 From 1ac1d5aa5a7023e63c03327a5233dd885d4e9c00 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Wed, 26 Jan 2022 15:18:54 +0200 Subject: Add issue links diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e5a555f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: PineTime community chat (Matrix) + url: https://app.element.io/#/room/#pinetime:matrix.org + about: Please ask questions about PineTime here. + - name: PineTime developers chat (Matrix) + url: https://app.element.io/#/room/#pinetime-dev:matrix.org + about: Please ask questions about PineTime development here. -- cgit v0.10.2 From a9b77ae0d4bb450c42a17d1610225b7ee83edfe5 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Wed, 2 Feb 2022 13:57:30 +0200 Subject: Alarm: Change checkable button for a switch diff --git a/doc/ui_guidelines.md b/doc/ui_guidelines.md index 0cbd39f..296497a 100644 --- a/doc/ui_guidelines.md +++ b/doc/ui_guidelines.md @@ -9,5 +9,6 @@ - Top bar takes at least 20px + padding - Top bar right icons move 8px to the left when using a page indicator - A black background helps to hide the screen border, allowing the UI to look less cramped when utilizing the entire display area. +- A switch should be twice as wide as it is tall. ![example layouts](./ui/example.png) diff --git a/src/displayapp/lv_pinetime_theme.c b/src/displayapp/lv_pinetime_theme.c index b74b2fd..deb66a9 100644 --- a/src/displayapp/lv_pinetime_theme.c +++ b/src/displayapp/lv_pinetime_theme.c @@ -199,17 +199,16 @@ static void basic_init(void) { style_init_reset(&style_sw_bg); lv_style_set_bg_opa(&style_sw_bg, LV_STATE_DEFAULT, LV_OPA_COVER); - lv_style_set_bg_color(&style_sw_bg, LV_STATE_DEFAULT, LV_PINETIME_LIGHT_GRAY); + lv_style_set_bg_color(&style_sw_bg, LV_STATE_DEFAULT, LV_PINETIME_BLUE); lv_style_set_radius(&style_sw_bg, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE); - lv_style_set_value_color(&style_sw_bg, LV_STATE_DEFAULT, LV_PINETIME_BLUE); style_init_reset(&style_sw_indic); lv_style_set_bg_opa(&style_sw_indic, LV_STATE_DEFAULT, LV_OPA_COVER); - lv_style_set_bg_color(&style_sw_indic, LV_STATE_DEFAULT, LV_PINETIME_GREEN); + lv_style_set_bg_color(&style_sw_indic, LV_STATE_DEFAULT, LV_COLOR_GREEN); style_init_reset(&style_sw_knob); lv_style_set_bg_opa(&style_sw_knob, LV_STATE_DEFAULT, LV_OPA_COVER); - lv_style_set_bg_color(&style_sw_knob, LV_STATE_DEFAULT, LV_PINETIME_WHITE); + lv_style_set_bg_color(&style_sw_knob, LV_STATE_DEFAULT, LV_COLOR_WHITE); lv_style_set_radius(&style_sw_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE); lv_style_set_pad_top(&style_sw_knob, LV_STATE_DEFAULT, -4); lv_style_set_pad_bottom(&style_sw_knob, LV_STATE_DEFAULT, -4); diff --git a/src/displayapp/lv_pinetime_theme.h b/src/displayapp/lv_pinetime_theme.h index f914516..714c424 100644 --- a/src/displayapp/lv_pinetime_theme.h +++ b/src/displayapp/lv_pinetime_theme.h @@ -23,7 +23,7 @@ extern "C" { #define LV_PINETIME_LIGHT lv_color_hex(0xf3f8fe) #define LV_PINETIME_GRAY lv_color_hex(0x8a8a8a) #define LV_PINETIME_LIGHT_GRAY lv_color_hex(0xc4c4c4) -#define LV_PINETIME_BLUE lv_color_hex(0x2f3243) // 006fb6 +#define LV_PINETIME_BLUE lv_color_hex(0x2f3540) #define LV_PINETIME_GREEN lv_color_hex(0x4cb242) #define LV_PINETIME_RED lv_color_hex(0xd51732) diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp index b8eaa6d..32f68b8 100644 --- a/src/displayapp/screens/Alarm.cpp +++ b/src/displayapp/screens/Alarm.cpp @@ -28,7 +28,7 @@ static void btnEventHandler(lv_obj_t* obj, lv_event_t event) { } Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pinetime::Controllers::Settings& settingsController) - : Screen(app), running {true}, alarmController {alarmController}, settingsController {settingsController} { + : Screen(app), alarmController {alarmController}, settingsController {settingsController} { time = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76); @@ -79,13 +79,15 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pin txtMinDown = lv_label_create(btnMinutesDown, nullptr); lv_label_set_text_static(txtMinDown, "-"); - btnEnable = lv_btn_create(lv_scr_act(), nullptr); - btnEnable->user_data = this; - lv_obj_set_event_cb(btnEnable, btnEventHandler); - lv_obj_set_size(btnEnable, 115, 50); - lv_obj_align(btnEnable, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); - txtEnable = lv_label_create(btnEnable, nullptr); - SetEnableButtonState(); + btnStop = lv_btn_create(lv_scr_act(), nullptr); + btnStop->user_data = this; + lv_obj_set_event_cb(btnStop, btnEventHandler); + lv_obj_set_size(btnStop, 120, 50); + lv_obj_align(btnStop, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, 0); + lv_obj_set_style_local_bg_color(btnStop, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); + txtStop = lv_label_create(btnStop, nullptr); + lv_label_set_text_static(txtStop, Symbols::stop); + lv_obj_set_hidden(btnStop, true); btnRecur = lv_btn_create(lv_scr_act(), nullptr); btnRecur->user_data = this; @@ -103,6 +105,13 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pin txtInfo = lv_label_create(btnInfo, nullptr); lv_label_set_text_static(txtInfo, "i"); + enableSwitch = lv_switch_create(lv_scr_act(), nullptr); + enableSwitch->user_data = this; + lv_obj_set_event_cb(enableSwitch, btnEventHandler); + lv_obj_set_size(enableSwitch, 100, 50); + // Align to the center of 115px from edge + lv_obj_align(enableSwitch, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 7, 0); + UpdateAlarmTime(); } @@ -113,15 +122,12 @@ Alarm::~Alarm() { void Alarm::OnButtonEvent(lv_obj_t* obj, lv_event_t event) { using Pinetime::Controllers::AlarmController; if (event == LV_EVENT_CLICKED) { - if (obj == btnEnable) { + if (obj == btnStop) { if (alarmController.State() == AlarmController::AlarmState::Alerting) { alarmController.StopAlerting(); - } else if (alarmController.State() == AlarmController::AlarmState::Set) { - alarmController.DisableAlarm(); - } else { - alarmController.ScheduleAlarm(); } - SetEnableButtonState(); + SetSwitchState(LV_ANIM_OFF); + StopAlerting(); return; } if (obj == btnInfo) { @@ -132,11 +138,19 @@ void Alarm::OnButtonEvent(lv_obj_t* obj, lv_event_t event) { HideInfo(); return; } + if (obj == enableSwitch) { + if (lv_switch_get_state(enableSwitch)) { + alarmController.ScheduleAlarm(); + } else { + alarmController.DisableAlarm(); + } + return; + } // If any other button was pressed, disable the alarm // this is to make it clear that the alarm won't be set until it is turned back on if (alarmController.State() == AlarmController::AlarmState::Set) { alarmController.DisableAlarm(); - SetEnableButtonState(); + lv_switch_off(enableSwitch, LV_ANIM_ON); } if (obj == btnMinutesUp) { if (alarmMinutes >= 59) { @@ -215,22 +229,27 @@ void Alarm::UpdateAlarmTime() { } void Alarm::SetAlerting() { - SetEnableButtonState(); + lv_obj_set_hidden(enableSwitch, true); + lv_obj_set_hidden(btnRecur, true); + lv_obj_set_hidden(btnStop, false); } -void Alarm::SetEnableButtonState() { +void Alarm::StopAlerting() { + lv_obj_set_hidden(enableSwitch, false); + lv_obj_set_hidden(btnRecur, false); + lv_obj_set_hidden(btnStop, true); +} + +void Alarm::SetSwitchState(lv_anim_enable_t anim) { switch (alarmController.State()) { case AlarmController::AlarmState::Set: - lv_label_set_text(txtEnable, "ON"); - lv_obj_set_style_local_bg_color(btnEnable, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + lv_switch_on(enableSwitch, anim); break; case AlarmController::AlarmState::Not_Set: - lv_label_set_text(txtEnable, "OFF"); - lv_obj_set_style_local_bg_color(btnEnable, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY); + lv_switch_off(enableSwitch, anim); + break; + default: break; - case AlarmController::AlarmState::Alerting: - lv_label_set_text(txtEnable, Symbols::stop); - lv_obj_set_style_local_bg_color(btnEnable, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); } } diff --git a/src/displayapp/screens/Alarm.h b/src/displayapp/screens/Alarm.h index d45fb96..a7f3523 100644 --- a/src/displayapp/screens/Alarm.h +++ b/src/displayapp/screens/Alarm.h @@ -34,21 +34,21 @@ namespace Pinetime { bool OnButtonPushed() override; private: - bool running; uint8_t alarmHours; uint8_t alarmMinutes; Controllers::AlarmController& alarmController; Controllers::Settings& settingsController; - lv_obj_t *time, *lblampm, *btnEnable, *txtEnable, *btnMinutesUp, *btnMinutesDown, *btnHoursUp, *btnHoursDown, *txtMinUp, - *txtMinDown, *txtHrUp, *txtHrDown, *btnRecur, *txtRecur, *btnInfo, *txtInfo; + lv_obj_t *time, *lblampm, *btnStop, *txtStop, *btnMinutesUp, *btnMinutesDown, *btnHoursUp, *btnHoursDown, *txtMinUp, + *txtMinDown, *txtHrUp, *txtHrDown, *btnRecur, *txtRecur, *btnInfo, *txtInfo, *enableSwitch; lv_obj_t* txtMessage = nullptr; lv_obj_t* btnMessage = nullptr; enum class EnableButtonState { On, Off, Alerting }; - void SetEnableButtonState(); void SetRecurButtonState(); + void SetSwitchState(lv_anim_enable_t anim); void SetAlarm(); + void StopAlerting(); void ShowInfo(); void HideInfo(); void ToggleRecurrence(); -- cgit v0.10.2 From 0930a79041f7d650b1e31e31cd659e271f7b027b Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Wed, 2 Feb 2022 16:22:44 +0200 Subject: Alarm: Fix missing stop button. Revert alert layout diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp index 32f68b8..06fb92f 100644 --- a/src/displayapp/screens/Alarm.cpp +++ b/src/displayapp/screens/Alarm.cpp @@ -82,8 +82,8 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pin btnStop = lv_btn_create(lv_scr_act(), nullptr); btnStop->user_data = this; lv_obj_set_event_cb(btnStop, btnEventHandler); - lv_obj_set_size(btnStop, 120, 50); - lv_obj_align(btnStop, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, 0); + lv_obj_set_size(btnStop, 115, 50); + lv_obj_align(btnStop, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); lv_obj_set_style_local_bg_color(btnStop, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); txtStop = lv_label_create(btnStop, nullptr); lv_label_set_text_static(txtStop, Symbols::stop); @@ -113,6 +113,10 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pin lv_obj_align(enableSwitch, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 7, 0); UpdateAlarmTime(); + + if (alarmController.State() == Controllers::AlarmController::AlarmState::Alerting) { + SetAlerting(); + } } Alarm::~Alarm() { @@ -230,13 +234,11 @@ void Alarm::UpdateAlarmTime() { void Alarm::SetAlerting() { lv_obj_set_hidden(enableSwitch, true); - lv_obj_set_hidden(btnRecur, true); lv_obj_set_hidden(btnStop, false); } void Alarm::StopAlerting() { lv_obj_set_hidden(enableSwitch, false); - lv_obj_set_hidden(btnRecur, false); lv_obj_set_hidden(btnStop, true); } -- cgit v0.10.2 From 76f63ed76a2c379b0ea192573cddb36f2bf683d4 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Wed, 2 Feb 2022 20:59:06 +0200 Subject: Fix switch default state diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp index 06fb92f..a2f534d 100644 --- a/src/displayapp/screens/Alarm.cpp +++ b/src/displayapp/screens/Alarm.cpp @@ -116,6 +116,8 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pin if (alarmController.State() == Controllers::AlarmController::AlarmState::Alerting) { SetAlerting(); + } else { + SetSwitchState(LV_ANIM_OFF); } } -- cgit v0.10.2 From 32fe7b660c59cda789a16f30e1371b087fdab6a0 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Thu, 3 Feb 2022 12:36:45 +0200 Subject: Make switch disabled state slightly dimmer diff --git a/src/displayapp/lv_pinetime_theme.c b/src/displayapp/lv_pinetime_theme.c index deb66a9..4fce5d6 100644 --- a/src/displayapp/lv_pinetime_theme.c +++ b/src/displayapp/lv_pinetime_theme.c @@ -208,7 +208,8 @@ static void basic_init(void) { style_init_reset(&style_sw_knob); lv_style_set_bg_opa(&style_sw_knob, LV_STATE_DEFAULT, LV_OPA_COVER); - lv_style_set_bg_color(&style_sw_knob, LV_STATE_DEFAULT, LV_COLOR_WHITE); + lv_style_set_bg_color(&style_sw_knob, LV_STATE_DEFAULT, LV_COLOR_SILVER); + lv_style_set_bg_color(&style_sw_knob, LV_STATE_CHECKED, LV_COLOR_WHITE); lv_style_set_radius(&style_sw_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE); lv_style_set_pad_top(&style_sw_knob, LV_STATE_DEFAULT, -4); lv_style_set_pad_bottom(&style_sw_knob, LV_STATE_DEFAULT, -4); -- cgit v0.10.2 From 5938b4b208e5684c13716fce16c3982182fd40f7 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sat, 29 Jan 2022 21:46:31 +0100 Subject: SystemTask: fix static cast missing brackets syntax The static_cast syntax requires brackets around the input variable. The implementation worked because the used input are defines, which add the missing brackets like the following: ```cpp #define GPIO_PIN_CNF_SENSE_Low (3UL) ``` diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 241b29b..e71ebc1 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -197,13 +197,13 @@ void SystemTask::Work() { // Touchscreen nrf_gpio_cfg_sense_input(PinMap::Cst816sIrq, static_cast(GPIO_PIN_CNF_PULL_Pullup), - static_cast GPIO_PIN_CNF_SENSE_Low); + static_cast(GPIO_PIN_CNF_SENSE_Low)); pinConfig.skip_gpio_setup = true; pinConfig.hi_accuracy = false; pinConfig.is_watcher = false; pinConfig.sense = static_cast(NRF_GPIOTE_POLARITY_HITOLO); - pinConfig.pull = static_cast GPIO_PIN_CNF_PULL_Pullup; + pinConfig.pull = static_cast(GPIO_PIN_CNF_PULL_Pullup); nrfx_gpiote_in_init(PinMap::Cst816sIrq, &pinConfig, nrfx_gpiote_evt_handler); -- cgit v0.10.2 From d967efa19710f85cee846c59adbbe07d2a2189dc Mon Sep 17 00:00:00 2001 From: Zorvalt Date: Sun, 19 Dec 2021 17:10:50 +0100 Subject: Fix biased BLE pass key generation diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index d8510bd..00a394f 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -278,7 +278,28 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { if (event->passkey.params.action == BLE_SM_IOACT_DISP) { struct ble_sm_io pkey = {0}; pkey.action = event->passkey.params.action; - pkey.passkey = ble_ll_rand() % 1000000; + + /* + * Passkey is a 6 digits code (1'000'000 possibilities). + * It is important every possible value has an equal probability + * of getting generated. Simply applying a modulo creates a bias + * since 2^32 is not a multiple of 1'000'000. + * To prevent that, we can reject values greater than 999'999. + * + * Rejecting values would happen a lot since 2^32-1 is way greater + * than 1'000'000. An optimisation is to use a multiple of 1'000'000. + * The greatest multiple of 1'000'000 lesser than 2^32-1 is + * 4'294'000'000. + * + * Great explanation at: + * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ + */ + uint32_t passkey_rand; + do { + passkey_rand = ble_ll_rand(); + } while (passkey_rand > 4293999999); + pkey.passkey = passkey_rand % 1000000; + bleController.SetPairingKey(pkey.passkey); systemTask.PushMessage(Pinetime::System::Messages::OnPairing); ble_sm_inject_io(event->passkey.conn_handle, &pkey); -- cgit v0.10.2 From 4f649a85448fc79b55202d9db0e8f4c8828975e3 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Tue, 18 Jan 2022 19:08:03 +0200 Subject: Improved alarm alert handling diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 672bcb3..495969b 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -379,7 +379,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) currentScreen = std::make_unique(this, timerController); break; case Apps::Alarm: - currentScreen = std::make_unique(this, alarmController, settingsController); + currentScreen = std::make_unique(this, alarmController, settingsController, *systemTask); break; // Settings diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp index a2f534d..879e50d 100644 --- a/src/displayapp/screens/Alarm.cpp +++ b/src/displayapp/screens/Alarm.cpp @@ -23,12 +23,20 @@ using namespace Pinetime::Applications::Screens; using Pinetime::Controllers::AlarmController; static void btnEventHandler(lv_obj_t* obj, lv_event_t event) { - Alarm* screen = static_cast(obj->user_data); + auto* screen = static_cast(obj->user_data); screen->OnButtonEvent(obj, event); } -Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pinetime::Controllers::Settings& settingsController) - : Screen(app), alarmController {alarmController}, settingsController {settingsController} { +static void StopAlarmTaskCallback(lv_task_t* task) { + auto* screen = static_cast(task->user_data); + screen->StopAlerting(); +} + +Alarm::Alarm(DisplayApp* app, + Controllers::AlarmController& alarmController, + Pinetime::Controllers::Settings& settingsController, + System::SystemTask& systemTask) + : Screen(app), alarmController {alarmController}, settingsController {settingsController}, systemTask {systemTask} { time = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76); @@ -122,6 +130,9 @@ Alarm::Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pin } Alarm::~Alarm() { + if (alarmController.State() == AlarmController::AlarmState::Alerting) { + StopAlerting(); + } lv_obj_clean(lv_scr_act()); } @@ -129,10 +140,6 @@ void Alarm::OnButtonEvent(lv_obj_t* obj, lv_event_t event) { using Pinetime::Controllers::AlarmController; if (event == LV_EVENT_CLICKED) { if (obj == btnStop) { - if (alarmController.State() == AlarmController::AlarmState::Alerting) { - alarmController.StopAlerting(); - } - SetSwitchState(LV_ANIM_OFF); StopAlerting(); return; } @@ -205,9 +212,18 @@ bool Alarm::OnButtonPushed() { HideInfo(); return true; } + if (alarmController.State() == AlarmController::AlarmState::Alerting) { + StopAlerting(); + return true; + } return false; } +bool Alarm::OnTouchEvent(Pinetime::Applications::TouchEvents event) { + // Don't allow closing the screen by swiping while the alarm is alerting + return alarmController.State() == AlarmController::AlarmState::Alerting && event == TouchEvents::SwipeDown; +} + void Alarm::UpdateAlarmTime() { if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { switch (alarmHours) { @@ -237,9 +253,18 @@ void Alarm::UpdateAlarmTime() { void Alarm::SetAlerting() { lv_obj_set_hidden(enableSwitch, true); lv_obj_set_hidden(btnStop, false); + taskStopAlarm = lv_task_create(StopAlarmTaskCallback, pdMS_TO_TICKS(60 * 1000), LV_TASK_PRIO_MID, this); + systemTask.PushMessage(System::Messages::DisableSleeping); } void Alarm::StopAlerting() { + alarmController.StopAlerting(); + SetSwitchState(LV_ANIM_OFF); + if (taskStopAlarm != nullptr) { + lv_task_del(taskStopAlarm); + taskStopAlarm = nullptr; + } + systemTask.PushMessage(System::Messages::EnableSleeping); lv_obj_set_hidden(enableSwitch, false); lv_obj_set_hidden(btnStop, true); } diff --git a/src/displayapp/screens/Alarm.h b/src/displayapp/screens/Alarm.h index a7f3523..f74dd68 100644 --- a/src/displayapp/screens/Alarm.h +++ b/src/displayapp/screens/Alarm.h @@ -27,28 +27,34 @@ namespace Pinetime { namespace Screens { class Alarm : public Screen { public: - Alarm(DisplayApp* app, Controllers::AlarmController& alarmController, Pinetime::Controllers::Settings& settingsController); + Alarm(DisplayApp* app, + Controllers::AlarmController& alarmController, + Pinetime::Controllers::Settings& settingsController, + System::SystemTask& systemTask); ~Alarm() override; void SetAlerting(); void OnButtonEvent(lv_obj_t* obj, lv_event_t event); bool OnButtonPushed() override; + bool OnTouchEvent(TouchEvents event) override; + void StopAlerting(); private: uint8_t alarmHours; uint8_t alarmMinutes; Controllers::AlarmController& alarmController; Controllers::Settings& settingsController; + System::SystemTask& systemTask; lv_obj_t *time, *lblampm, *btnStop, *txtStop, *btnMinutesUp, *btnMinutesDown, *btnHoursUp, *btnHoursDown, *txtMinUp, *txtMinDown, *txtHrUp, *txtHrDown, *btnRecur, *txtRecur, *btnInfo, *txtInfo, *enableSwitch; lv_obj_t* txtMessage = nullptr; lv_obj_t* btnMessage = nullptr; + lv_task_t* taskStopAlarm = nullptr; enum class EnableButtonState { On, Off, Alerting }; void SetRecurButtonState(); void SetSwitchState(lv_anim_enable_t anim); void SetAlarm(); - void StopAlerting(); void ShowInfo(); void HideInfo(); void ToggleRecurrence(); -- cgit v0.10.2 From d5b78ecd6690180f4f0891780dc7fe7a8ef91212 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sat, 29 Jan 2022 22:08:52 +0100 Subject: SystemTask: remove unused ble includes Remove unused includes. The firmware still compiles fine without the includes. diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index e71ebc1..6460cd4 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -1,13 +1,4 @@ #include "systemtask/SystemTask.h" -#define min // workaround: nimble's min/max macros conflict with libstdc++ -#define max -#include -#include -#include -#include -#include -#undef max -#undef min #include #include #include -- cgit v0.10.2 From 04eca81a956ad84a5604096515da1ac148fe8921 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sat, 29 Jan 2022 23:34:09 +0100 Subject: Notifications: use motorController object instead of class function We get the motoroController object, so store and use it. diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 8fe08a8..3a39dac 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -17,6 +17,7 @@ Notifications::Notifications(DisplayApp* app, : Screen(app), notificationManager {notificationManager}, alertNotificationService {alertNotificationService}, + motorController {motorController}, systemTask {systemTask}, mode {mode} { notificationManager.ClearNewNotificationFlag(); @@ -29,7 +30,8 @@ Notifications::Notifications(DisplayApp* app, notification.category, notificationManager.NbNotifications(), mode, - alertNotificationService); + alertNotificationService, + motorController); validDisplay = true; } else { currentItem = std::make_unique("Notification", @@ -38,7 +40,8 @@ Notifications::Notifications(DisplayApp* app, notification.category, notificationManager.NbNotifications(), Modes::Preview, - alertNotificationService); + alertNotificationService, + motorController); } if (mode == Modes::Preview) { @@ -66,7 +69,7 @@ Notifications::Notifications(DisplayApp* app, Notifications::~Notifications() { lv_task_del(taskRefresh); // make sure we stop any vibrations before exiting - Controllers::MotorController::StopRinging(); + motorController.StopRinging(); systemTask.PushMessage(System::Messages::EnableSleeping); lv_obj_clean(lv_scr_act()); } @@ -87,7 +90,7 @@ void Notifications::Refresh() { void Notifications::OnPreviewInteraction() { systemTask.PushMessage(System::Messages::EnableSleeping); - Controllers::MotorController::StopRinging(); + motorController.StopRinging(); if (timeoutLine != nullptr) { lv_obj_del(timeoutLine); timeoutLine = nullptr; @@ -125,7 +128,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { previousNotification.category, notificationManager.NbNotifications(), mode, - alertNotificationService); + alertNotificationService, + motorController); } return true; case Pinetime::Applications::TouchEvents::SwipeUp: { @@ -150,7 +154,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { nextNotification.category, notificationManager.NbNotifications(), mode, - alertNotificationService); + alertNotificationService, + motorController); } return true; default: @@ -171,8 +176,9 @@ Notifications::NotificationItem::NotificationItem(const char* title, Controllers::NotificationManager::Categories category, uint8_t notifNb, Modes mode, - Pinetime::Controllers::AlertNotificationService& alertNotificationService) - : mode {mode}, alertNotificationService {alertNotificationService} { + Pinetime::Controllers::AlertNotificationService& alertNotificationService, + Pinetime::Controllers::MotorController& motorController) + : mode {mode}, alertNotificationService {alertNotificationService}, motorController {motorController} { lv_obj_t* container1 = lv_cont_create(lv_scr_act(), NULL); lv_obj_set_style_local_bg_color(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x222222)); @@ -269,7 +275,7 @@ void Notifications::NotificationItem::OnCallButtonEvent(lv_obj_t* obj, lv_event_ return; } - Controllers::MotorController::StopRinging(); + motorController.StopRinging(); if (obj == bt_accept) { alertNotificationService.AcceptIncomingCall(); diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index 2f444c7..f49d3b3 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -39,7 +39,8 @@ namespace Pinetime { Controllers::NotificationManager::Categories, uint8_t notifNb, Modes mode, - Pinetime::Controllers::AlertNotificationService& alertNotificationService); + Pinetime::Controllers::AlertNotificationService& alertNotificationService, + Pinetime::Controllers::MotorController& motorController); ~NotificationItem(); bool IsRunning() const { return running; @@ -56,6 +57,7 @@ namespace Pinetime { lv_obj_t* label_reject; Modes mode; Pinetime::Controllers::AlertNotificationService& alertNotificationService; + Pinetime::Controllers::MotorController& motorController; bool running = true; }; @@ -66,6 +68,7 @@ namespace Pinetime { }; Pinetime::Controllers::NotificationManager& notificationManager; Pinetime::Controllers::AlertNotificationService& alertNotificationService; + Pinetime::Controllers::MotorController& motorController; System::SystemTask& systemTask; Modes mode = Modes::Normal; std::unique_ptr currentItem; -- cgit v0.10.2 From a2a70f8eda56b4cf859f456b2f842e4833cd3dbf Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sat, 29 Jan 2022 23:45:22 +0100 Subject: MotorController: no need to make this function a class function The `StopRinging()` function was used just in `Notifications.h` screen. That screen already has access to a `motorController` object. diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index c9326d5..b5a592b 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -12,7 +12,7 @@ namespace Pinetime { void Init(); void RunForDuration(uint8_t motorDuration); void StartRinging(); - static void StopRinging(); + void StopRinging(); private: static void Ring(void* p_context); -- cgit v0.10.2 From 4aaa3a3b49b3b70509345f83ebe1c4f4bacd524d Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 15 Feb 2022 23:56:42 +0100 Subject: SettingShakeThreshold: add missing SystemTask.h, relative include SettingShakeThreshold.h uses SystemTask, but doesn't include the header. Fixing that for the simulator. For consistency make the header include a relative to src include. diff --git a/src/displayapp/screens/settings/SettingShakeThreshold.cpp b/src/displayapp/screens/settings/SettingShakeThreshold.cpp index 1791b55..9d40fcf 100644 --- a/src/displayapp/screens/settings/SettingShakeThreshold.cpp +++ b/src/displayapp/screens/settings/SettingShakeThreshold.cpp @@ -1,4 +1,4 @@ -#include "SettingShakeThreshold.h" +#include "displayapp/screens/settings/SettingShakeThreshold.h" #include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Screen.h" diff --git a/src/displayapp/screens/settings/SettingShakeThreshold.h b/src/displayapp/screens/settings/SettingShakeThreshold.h index b9ddd8b..37f4a65 100644 --- a/src/displayapp/screens/settings/SettingShakeThreshold.h +++ b/src/displayapp/screens/settings/SettingShakeThreshold.h @@ -5,6 +5,7 @@ #include "components/settings/Settings.h" #include "displayapp/screens/Screen.h" #include +#include "systemtask/SystemTask.h" namespace Pinetime { namespace Applications { -- cgit v0.10.2 From b857fdb9f438cd9a3440c82face944323301cfad Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 15 Feb 2022 23:59:38 +0100 Subject: 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. 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 #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 #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; } -- cgit v0.10.2 From f829427c4186ec003d51c689c6831d076f3b0b69 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Wed, 16 Feb 2022 22:33:59 +0100 Subject: Remove unused and not compiling DropDownDemo For ease of use the simulator uses a globbing expression to get all screens source files. This one was picked up as well and lead to a compilation error. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aec6ce0..39d80b0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -626,7 +626,6 @@ set(INCLUDE_FILES displayapp/screens/InfiniPaint.h displayapp/screens/StopWatch.h displayapp/screens/Paddle.h - displayapp/screens/DropDownDemo.h displayapp/screens/BatteryIcon.h displayapp/screens/BleIcon.h displayapp/screens/NotificationIcon.h diff --git a/src/displayapp/screens/DropDownDemo.cpp b/src/displayapp/screens/DropDownDemo.cpp deleted file mode 100644 index cf239a2..0000000 --- a/src/displayapp/screens/DropDownDemo.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "displayapp/screens/DropDownDemo.h" -#include -#include -#include "displayapp/DisplayApp.h" - -using namespace Pinetime::Applications::Screens; - -DropDownDemo::DropDownDemo(Pinetime::Applications::DisplayApp* app) : Screen(app) { - // Create the dropdown object, with many item, and fix its height - ddlist = lv_ddlist_create(lv_scr_act(), nullptr); - lv_ddlist_set_options(ddlist, - "Apple\n" - "Banana\n" - "Orange\n" - "Melon\n" - "Grape\n" - "Raspberry\n" - "A\n" - "B\n" - "C\n" - "D\n" - "E"); - lv_ddlist_set_fix_width(ddlist, 150); - lv_ddlist_set_draw_arrow(ddlist, true); - lv_ddlist_set_fix_height(ddlist, 150); - lv_obj_align(ddlist, nullptr, LV_ALIGN_IN_TOP_MID, 0, 20); -} - -DropDownDemo::~DropDownDemo() { - // Reset the touchmode - app->SetTouchMode(DisplayApp::TouchModes::Gestures); - lv_obj_clean(lv_scr_act()); -} - -bool DropDownDemo::Refresh() { - auto* list = static_cast(ddlist->ext_attr); - - // Switch touchmode to Polling if the dropdown is opened. This will allow to scroll inside the - // dropdown while it is opened. - // Disable the polling mode when the dropdown is closed to be able to handle the gestures. - if (list->opened) - app->SetTouchMode(DisplayApp::TouchModes::Polling); - else - app->SetTouchMode(DisplayApp::TouchModes::Gestures); - return running; -} - -bool DropDownDemo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - // If the dropdown is opened, notify Display app that it doesn't need to handle the event - // (this will prevent displayApp from going back to the menu or clock scree). - auto* list = static_cast(ddlist->ext_attr); - if (list->opened) { - return true; - } else { - return false; - } -} diff --git a/src/displayapp/screens/DropDownDemo.h b/src/displayapp/screens/DropDownDemo.h deleted file mode 100644 index bcf0f45..0000000 --- a/src/displayapp/screens/DropDownDemo.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include -#include "displayapp/screens/Screen.h" -#include - -namespace Pinetime { - namespace Applications { - namespace Screens { - - class DropDownDemo : public Screen { - public: - DropDownDemo(DisplayApp* app); - ~DropDownDemo() override; - - bool Refresh() override; - - bool OnTouchEvent(TouchEvents event) override; - - private: - lv_obj_t* ddlist; - - bool isDropDownOpened = false; - }; - } - } -} -- cgit v0.10.2 From 407908686ac252615f35e5175fcb0c2fd19cce69 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 30 Jan 2022 14:31:13 +0100 Subject: Provide reference to BrightnessController in DisplayApp For the simulator I need a way to get to the brightnessController object and handle the set brightness-levels accoringly. This is done by the constructor expecting a brightnessController object instead of initializing one itself diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 495969b..fdd1682 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -97,6 +97,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler) : lcd {lcd}, lvgl {lvgl}, @@ -112,6 +113,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, motionController {motionController}, timerController {timerController}, alarmController {alarmController}, + brightnessController {brightnessController}, touchHandler {touchHandler} { } diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index 39fe631..1eaefaa 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -61,6 +61,7 @@ namespace Pinetime { Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler); void Start(System::BootErrors error); void PushMessage(Display::Messages msg); @@ -87,10 +88,10 @@ namespace Pinetime { Pinetime::Controllers::MotionController& motionController; Pinetime::Controllers::TimerController& timerController; Pinetime::Controllers::AlarmController& alarmController; + Pinetime::Controllers::BrightnessController &brightnessController; Pinetime::Controllers::TouchHandler& touchHandler; Pinetime::Controllers::FirmwareValidator validator; - Controllers::BrightnessController brightnessController; TaskHandle_t taskHandle; diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp index fd7017a..9d6eb22 100644 --- a/src/displayapp/DisplayAppRecovery.cpp +++ b/src/displayapp/DisplayAppRecovery.cpp @@ -23,6 +23,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler) : lcd {lcd}, bleController {bleController} { diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 86e956d..61f1c9b 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -34,6 +34,7 @@ namespace Pinetime { class MotorController; class TimerController; class AlarmController; + class BrightnessController; } namespace System { @@ -57,6 +58,7 @@ namespace Pinetime { Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler); void Start(); void Start(Pinetime::System::BootErrors){ Start(); }; diff --git a/src/main.cpp b/src/main.cpp index 81d297f..fa492d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,7 @@ #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" +#include "components/brightness/BrightnessController.h" #include "components/motor/MotorController.h" #include "components/datetime/DateTimeController.h" #include "components/heartrate/HeartRateController.h" @@ -114,6 +115,7 @@ Pinetime::Controllers::TimerController timerController; Pinetime::Controllers::AlarmController alarmController {dateTimeController}; Pinetime::Controllers::TouchHandler touchHandler(touchPanel, lvgl); Pinetime::Controllers::ButtonHandler buttonHandler; +Pinetime::Controllers::BrightnessController brightnessController {}; Pinetime::Applications::DisplayApp displayApp(lcd, lvgl, @@ -129,6 +131,7 @@ Pinetime::Applications::DisplayApp displayApp(lcd, motionController, timerController, alarmController, + brightnessController, touchHandler); Pinetime::System::SystemTask systemTask(spi, -- cgit v0.10.2 From 69e4ab6be101e7993035b56db75f5c32eda713ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 20 Feb 2022 13:20:43 +0100 Subject: Manual squash merge of PR #932 (https://github.com/InfiniTimeOrg/InfiniTime/pull/932) from 13werwolf13 (https://github.com/13werwolf13). This PR adds a new Terminal watchface to InfiniTime! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Squashed commit of the following: commit 23ea840b059c69667c8711265cecaf992791acb6 Author: Jean-François Milants Date: Sun Feb 20 13:14:27 2022 +0100 Terminal watch face : fix includes and a few code cleaning. commit 3c244def25e3ad8e1f56d708fb0864c122059948 Merge: 40790868 138a6552 Author: Jean-François Milants Date: Sun Feb 20 12:45:54 2022 +0100 Merge branch 'develop' of https://github.com/13werwolf13/InfiniTime into 13werwolf13-develop commit 138a65528a86799fd5c37f065023a92f222fe044 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:13:00 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.h Co-authored-by: NeroBurner commit 35156166b2f7589bf005ec7c7192a4226578f6d9 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:12:43 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 757ca2dd438f1f314267a8b81a6034c576f1d6be Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:12:30 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 60b6b4e5824d04faa3efa45173358d04fa68a368 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:12:20 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 6959d8c043013550a7a3e4e6588b234d3bb942b5 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:11:46 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 4d850281bedf342d0856da5eafc22e46d0767c56 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:11:17 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit af483bee33c225fcb03432db1eb14c0453df0ae7 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:10:57 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 6bc6c1a637be4e514ecd0097d1dc9e4aacdba1db Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:10:40 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.h Co-authored-by: NeroBurner commit 25fdafc6aba0d9e0173103501de3802af261e2ae Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:06:10 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 12e1b0f8c0202a7f62e3e1c297af850ce3526d13 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:05:44 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit e6c0f32056e9fea878d270d761607ac5ddc263b0 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:05:22 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.h Co-authored-by: NeroBurner commit 342ce8cd114f4af265078bc0cfa6b2d8831706d7 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:05:06 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 265fec5eeca27fcc1152a18e4af0273bcf119c46 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:04:06 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit b4669be38be0df2b6a3505d5f7a770c71636be60 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:03:29 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 471a84390957ded2ac23ebfe1cb99408e3783b0f Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:03:10 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit 6853166cf546a4ce561195eba01f1b1fd6d56420 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:02:51 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit bba34f69bfdd6b44f142c93644f71c9eda007290 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Sat Jan 22 12:32:41 2022 +0500 some fixes commit 74eea9f5800f273249846e6e1c887d15ba6eb10b Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Sat Jan 22 12:32:17 2022 +0500 some fixes commit 1e4a6763d73c3ba39c680ad25f90813e6a6a36d1 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Fri Jan 21 08:59:44 2022 +0500 no errors, no warnings, no work.. commit eb8bd4dc4ecbbf61f1e0f725fd2116ee25319fd6 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 20 23:50:04 2022 +0500 add ble state text output commit fda1c088becb4a7f9ced451a0291694abe2249dc Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 20 22:25:35 2022 +0500 add ble state text output commit 68d3d9b343c0f37830bb640fab10b186faf73067 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 20 22:22:20 2022 +0500 add ble state text output commit 0ed45a9916787f68c0aa6bab9c97b090f2eebdd5 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Tue Jan 18 15:48:15 2022 +0500 typo fix commit 477a3a7f27c7486be2c8f985afab1f1739608fed Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Tue Jan 18 10:36:19 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit d6849888ea5cc152f04c5bf6fe2631e66296c357 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Tue Jan 18 10:36:09 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner commit e2f7e318298b8a6f4d436cbbb1b92a738dacab7f Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Mon Jan 17 13:34:05 2022 +0500 typo fix commit fc246beb01d3feac4fd0b2fc9c45b38847e1d950 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Sat Jan 15 15:26:25 2022 +0500 typo fix commit ebbb31abf10ad9f61a8a7ecfdf29c2aaeaf33c19 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Fri Jan 14 10:08:29 2022 +0500 typo fix commit 3afedcaa28009f59e6960730e9349097ef455ea8 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 12:34:39 2022 +0500 time format commit 471a4c942f7e3cfd5c52bd61152ede770da5e026 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 12:27:10 2022 +0500 time format commit d3fd348de4b4a89c216a717de84fcc923cc099fe Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 12:26:49 2022 +0500 time format commit e540d103e3204649ff585742f8834d16136372d5 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 11:28:31 2022 +0500 add patch commit 728830178f31f71785c49cdc6b83daea4e0a7df6 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 22:08:07 2022 +0500 add menue item commit 4c5847669fa083f15ee3fdb404dadfdaef0f82aa Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 21:42:22 2022 +0500 typo fix commit 79273fe24f9162aca5508f07b17896149ad19839 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 20:48:06 2022 +0500 typo fix commit 1808a78ad94d0dfe97b6410a93ba30560de22f4b Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 20:17:15 2022 +0500 typo fix commit 6dfa141dca176789da4e978f008eb842d9ec515a Author: Дмитрий Марков Date: Wed Jan 12 20:12:09 2022 +0500 typo fix commit 88f01902325505a9206ced4504aae0762042535d Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 14:50:54 2022 +0500 add terminal watchface diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 39d80b0..5986d95 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -454,6 +454,7 @@ list(APPEND SOURCE_FILES displayapp/icons/bg_clock.c displayapp/screens/WatchFaceAnalog.cpp displayapp/screens/WatchFaceDigital.cpp + displayapp/screens/WatchFaceTerminal.cpp displayapp/screens/PineTimeStyle.cpp ## diff --git a/src/components/heartrate/Ppg.h b/src/components/heartrate/Ppg.h index ed79b08..7000c87 100644 --- a/src/components/heartrate/Ppg.h +++ b/src/components/heartrate/Ppg.h @@ -1,6 +1,8 @@ #pragma once #include +#include +#include #include "components/heartrate/Biquad.h" #include "components/heartrate/Ptagc.h" diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp index 1415e8e..fd74683 100644 --- a/src/displayapp/screens/Clock.cpp +++ b/src/displayapp/screens/Clock.cpp @@ -9,6 +9,7 @@ #include "components/settings/Settings.h" #include "displayapp/DisplayApp.h" #include "displayapp/screens/WatchFaceDigital.h" +#include "displayapp/screens/WatchFaceTerminal.h" #include "displayapp/screens/WatchFaceAnalog.h" #include "displayapp/screens/PineTimeStyle.h" @@ -41,6 +42,9 @@ Clock::Clock(DisplayApp* app, case 2: return PineTimeStyleScreen(); break; + case 3: + return WatchFaceTerminalScreen(); + break; } return WatchFaceDigitalScreen(); }()} { @@ -76,11 +80,17 @@ std::unique_ptr Clock::WatchFaceAnalogScreen() { } std::unique_ptr Clock::PineTimeStyleScreen() { - return std::make_unique(app, - dateTimeController, - batteryController, - bleController, - notificatioManager, - settingsController, - motionController); + return std::make_unique( + app, dateTimeController, batteryController, bleController, notificatioManager, settingsController, motionController); +} + +std::unique_ptr Clock::WatchFaceTerminalScreen() { + return std::make_unique(app, + dateTimeController, + batteryController, + bleController, + notificatioManager, + settingsController, + heartRateController, + motionController); } diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index fcecc6b..50996a7 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -47,6 +47,7 @@ namespace Pinetime { std::unique_ptr WatchFaceDigitalScreen(); std::unique_ptr WatchFaceAnalogScreen(); std::unique_ptr PineTimeStyleScreen(); + std::unique_ptr WatchFaceTerminalScreen(); }; } } diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp new file mode 100644 index 0000000..033aad8 --- /dev/null +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -0,0 +1,198 @@ +#include +#include +#include "displayapp/screens/WatchFaceTerminal.h" +#include "displayapp/screens/BatteryIcon.h" +#include "displayapp/screens/NotificationIcon.h" +#include "displayapp/screens/Symbols.h" +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" +#include "components/ble/NotificationManager.h" +#include "components/heartrate/HeartRateController.h" +#include "components/motion/MotionController.h" +#include "components/settings/Settings.h" + +using namespace Pinetime::Applications::Screens; + +WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, + Controllers::DateTime& dateTimeController, + Controllers::Battery& batteryController, + Controllers::Ble& bleController, + Controllers::NotificationManager& notificatioManager, + Controllers::Settings& settingsController, + Controllers::HeartRateController& heartRateController, + Controllers::MotionController& motionController) + : Screen(app), + currentDateTime {{}}, + dateTimeController {dateTimeController}, + batteryController {batteryController}, + bleController {bleController}, + notificatioManager {notificatioManager}, + settingsController {settingsController}, + heartRateController {heartRateController}, + motionController {motionController} { + settingsController.SetClockFace(3); + + batteryIcon = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text(batteryIcon, Symbols::batteryFull); + lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, 2); + + batteryPlug = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text(batteryPlug, Symbols::plug); + lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0); + + batteryValue = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_recolor(batteryValue, true); + lv_obj_align(batteryValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -20); + + connectState = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_recolor(connectState, true); + lv_label_set_text(connectState, "[STAT]#387b54 Disconnected#"); + lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); + + notificationIcon = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); + lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 10, 0); + + label_date = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_recolor(label_date, true); + lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -40); + + label_prompt_1 = lv_label_create(lv_scr_act(), nullptr); + lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -80); + lv_label_set_text(label_prompt_1, "user@watch:~ $ now"); + + label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); + lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60); + lv_label_set_text(label_prompt_2, "user@watch:~ $"); + + label_time = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_recolor(label_time, true); + lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -60); + + backgroundLabel = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_click(backgroundLabel, true); + lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); + lv_obj_set_size(backgroundLabel, 240, 240); + lv_obj_set_pos(backgroundLabel, 0, 0); + lv_label_set_text(backgroundLabel, ""); + + heartbeatValue = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_recolor(heartbeatValue, true); + lv_label_set_text(heartbeatValue, "[L_HR]#ee3311 0 bpm#"); + lv_obj_align(heartbeatValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 20); + + stepValue = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_recolor(stepValue, true); + lv_label_set_text(stepValue, "[STEP]#ee3377 0 steps#"); + lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 0); + + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); + Refresh(); +} + +WatchFaceTerminal::~WatchFaceTerminal() { + lv_task_del(taskRefresh); + lv_obj_clean(lv_scr_act()); +} + +void WatchFaceTerminal::Refresh() { + powerPresent = batteryController.IsPowerPresent(); + if (powerPresent.IsUpdated()) { + lv_label_set_text_static(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get())); + } + + batteryPercentRemaining = batteryController.PercentRemaining(); + if (batteryPercentRemaining.IsUpdated()) { + auto batteryPercent = batteryPercentRemaining.Get(); + if (batteryPercent == 100) { + lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + } else { + lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); + } + lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); + lv_label_set_text_fmt(batteryValue, "[BATT]#387b54 %d%\%#", batteryPercent); + } + + bleState = bleController.IsConnected(); + if (bleState.IsUpdated()) { + if (bleState.Get()) { + lv_label_set_text_static(connectState, "[STAT]#387b54 Connected#"); + } else { + lv_label_set_text_static(connectState, "[STAT]#387b54 Disconnected#"); + } + } + + notificationState = notificatioManager.AreNewNotificationsAvailable(); + if (notificationState.IsUpdated()) { + if (notificationState.Get()) { + lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(true)); + } else { + lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); + } + } + + currentDateTime = dateTimeController.CurrentDateTime(); + + if (currentDateTime.IsUpdated()) { + auto newDateTime = currentDateTime.Get(); + + auto dp = date::floor(newDateTime); + auto time = date::make_time(newDateTime - dp); + auto yearMonthDay = date::year_month_day(dp); + + auto year = static_cast(yearMonthDay.year()); + auto month = static_cast(static_cast(yearMonthDay.month())); + auto day = static_cast(yearMonthDay.day()); + auto dayOfWeek = static_cast(date::weekday(yearMonthDay).iso_encoding()); + + uint8_t hour = time.hours().count(); + uint8_t minute = time.minutes().count(); + uint8_t second = time.seconds().count(); + + if (displayedHour != hour || displayedMinute != minute || displayedSecond != second) { + displayedHour = hour; + displayedMinute = minute; + displayedSecond = second; + + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + char ampmChar[3] = "AM"; + if (hour == 0) { + hour = 12; + } else if (hour == 12) { + ampmChar[0] = 'P'; + } else if (hour > 12) { + hour = hour - 12; + ampmChar[0] = 'P'; + } + lv_label_set_text_fmt(label_time, "[TIME]#11cc55 %02d:%02d:%02d %s#", hour, minute, second, ampmChar); + } else { + lv_label_set_text_fmt(label_time, "[TIME]#11cc55 %02d:%02d:%02d", hour, minute, second); + } + } + + if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) { + lv_label_set_text_fmt(label_date, "[DATE]#007fff %04d.%02d.%02d#", short(year), char(month), char(day)); + + currentYear = year; + currentMonth = month; + currentDayOfWeek = dayOfWeek; + currentDay = day; + } + } + + heartbeat = heartRateController.HeartRate(); + heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped; + if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) { + if (heartbeatRunning.Get()) { + lv_label_set_text_fmt(heartbeatValue, "[L_HR]#ee3311 %d bpm#", heartbeat.Get()); + } else { + lv_label_set_text_static(heartbeatValue, "[L_HR]#ee3311 ---#"); + } + } + + stepCount = motionController.NbSteps(); + motionSensorOk = motionController.IsSensorOk(); + if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) { + lv_label_set_text_fmt(stepValue, "[STEP]#ee3377 %lu steps#", stepCount.Get()); + } +} diff --git a/src/displayapp/screens/WatchFaceTerminal.h b/src/displayapp/screens/WatchFaceTerminal.h new file mode 100644 index 0000000..c3df82b --- /dev/null +++ b/src/displayapp/screens/WatchFaceTerminal.h @@ -0,0 +1,82 @@ +#pragma once + +#include +#include +#include +#include +#include "displayapp/screens/Screen.h" +#include "components/datetime/DateTimeController.h" + +namespace Pinetime { + namespace Controllers { + class Settings; + class Battery; + class Ble; + class NotificationManager; + class HeartRateController; + class MotionController; + } + + namespace Applications { + namespace Screens { + + class WatchFaceTerminal : public Screen { + public: + WatchFaceTerminal(DisplayApp* app, + Controllers::DateTime& dateTimeController, + Controllers::Battery& batteryController, + Controllers::Ble& bleController, + Controllers::NotificationManager& notificatioManager, + Controllers::Settings& settingsController, + Controllers::HeartRateController& heartRateController, + Controllers::MotionController& motionController); + ~WatchFaceTerminal() override; + + void Refresh() override; + + private: + uint8_t displayedHour = -1; + uint8_t displayedMinute = -1; + uint8_t displayedSecond = -1; + + uint16_t currentYear = 1970; + Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; + Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; + uint8_t currentDay = 0; + + DirtyValue batteryPercentRemaining {}; + DirtyValue powerPresent {}; + DirtyValue bleState {}; + DirtyValue> currentDateTime {}; + DirtyValue motionSensorOk {}; + DirtyValue stepCount {}; + DirtyValue heartbeat {}; + DirtyValue heartbeatRunning {}; + DirtyValue notificationState {}; + + lv_obj_t* label_time; + lv_obj_t* label_date; + lv_obj_t* label_prompt_1; + lv_obj_t* label_prompt_2; + lv_obj_t* backgroundLabel; + lv_obj_t* batteryIcon; + lv_obj_t* batteryPlug; + lv_obj_t* batteryValue; + lv_obj_t* heartbeatValue; + lv_obj_t* stepValue; + lv_obj_t* notificationIcon; + lv_obj_t* connectState; + + Controllers::DateTime& dateTimeController; + Controllers::Battery& batteryController; + Controllers::Ble& bleController; + Controllers::NotificationManager& notificatioManager; + Controllers::Settings& settingsController; + Controllers::HeartRateController& heartRateController; + Controllers::MotionController& motionController; + + lv_task_t* taskRefresh; + }; + } + } +} diff --git a/src/displayapp/screens/settings/SettingWatchFace.cpp b/src/displayapp/screens/settings/SettingWatchFace.cpp index a24eaa1..5008592 100644 --- a/src/displayapp/screens/settings/SettingWatchFace.cpp +++ b/src/displayapp/screens/settings/SettingWatchFace.cpp @@ -14,7 +14,7 @@ namespace { } } -constexpr std::array SettingWatchFace::options; +constexpr std::array SettingWatchFace::options; SettingWatchFace::SettingWatchFace(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) : Screen(app), settingsController {settingsController} { diff --git a/src/displayapp/screens/settings/SettingWatchFace.h b/src/displayapp/screens/settings/SettingWatchFace.h index ccba7d1..62427b4 100644 --- a/src/displayapp/screens/settings/SettingWatchFace.h +++ b/src/displayapp/screens/settings/SettingWatchFace.h @@ -20,7 +20,7 @@ namespace Pinetime { void UpdateSelected(lv_obj_t* object, lv_event_t event); private: - static constexpr std::array options = {" Digital face", " Analog face", " PineTimeStyle"}; + static constexpr std::array options = {" Digital face", " Analog face", " PineTimeStyle", " Terminal"}; Controllers::Settings& settingsController; lv_obj_t* cbOption[options.size()]; -- cgit v0.10.2 From ef44b763d94cc6ff1be6f75ff3e638d7d356e99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 20 Feb 2022 15:40:49 +0100 Subject: Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime into evergreen22-airplane-mode Apply a few changes that were requested in the PR during the review. # Conflicts: # src/CMakeLists.txt # src/displayapp/Apps.h # src/displayapp/DisplayApp.cpp # src/displayapp/Messages.h # src/displayapp/screens/settings/Settings.cpp diff --git a/src/components/ble/BleController.cpp b/src/components/ble/BleController.cpp index 0e1c5d7..b6b7383 100644 --- a/src/components/ble/BleController.cpp +++ b/src/components/ble/BleController.cpp @@ -2,12 +2,28 @@ using namespace Pinetime::Controllers; -void Ble::SetConnectState(Ble::ConnectStates newState) { - connectionState = newState; +bool Ble::IsConnected() const { + return isConnected; } -Ble::ConnectStates Ble::GetConnectState() const { - return connectionState; +void Ble::Connect() { + isConnected = true; +} + +void Ble::Disconnect() { + isConnected = false; +} + +bool Ble::IsRadioEnabled() const { + return isRadioEnabled; +} + +void Ble::EnableRadio() { + isRadioEnabled = true; +} + +void Ble::DisableRadio() { + isRadioEnabled = false; } void Ble::StartFirmwareUpdate() { diff --git a/src/components/ble/BleController.h b/src/components/ble/BleController.h index 2714c0c..675ede2 100644 --- a/src/components/ble/BleController.h +++ b/src/components/ble/BleController.h @@ -10,14 +10,15 @@ namespace Pinetime { using BleAddress = std::array; enum class FirmwareUpdateStates { Idle, Running, Validated, Error }; enum class AddressTypes { Public, Random, RPA_Public, RPA_Random }; - enum class ConnectStates { Disconnected, Connected, Airplane }; Ble() = default; - bool IsConnected() const { - return (connectionState == ConnectStates::Connected); - } - void SetConnectState(ConnectStates newState); - ConnectStates GetConnectState() const; + bool IsConnected() const; + void Connect(); + void Disconnect(); + + bool IsRadioEnabled() const; + void EnableRadio(); + void DisableRadio(); void StartFirmwareUpdate(); void StopFirmwareUpdate(); @@ -57,7 +58,8 @@ namespace Pinetime { } private: - ConnectStates connectionState = ConnectStates::Disconnected; + bool isConnected = false; + bool isRadioEnabled = true; bool isFirmwareUpdating = false; uint32_t firmwareUpdateTotalBytes = 0; uint32_t firmwareUpdateCurrentBytes = 0; diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index 94d2d15..f6ab626 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -184,7 +184,7 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { case BLE_GAP_EVENT_ADV_COMPLETE: NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE"); NRF_LOG_INFO("reason=%d; status=%0X", event->adv_complete.reason, event->connect.status); - if (bleController.GetConnectState() == Ble::ConnectStates::Disconnected) { + if (bleController.IsRadioEnabled() && !bleController.IsConnected()) { StartAdvertising(); } break; @@ -199,12 +199,12 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { currentTimeClient.Reset(); alertNotificationClient.Reset(); connectionHandle = BLE_HS_CONN_HANDLE_NONE; - bleController.SetConnectState(Ble::ConnectStates::Disconnected); + bleController.Disconnect(); fastAdvCount = 0; StartAdvertising(); } else { connectionHandle = event->connect.conn_handle; - bleController.SetConnectState(Ble::ConnectStates::Connected); + bleController.Connect(); systemTask.PushMessage(Pinetime::System::Messages::BleConnected); // Service discovery is deferred via systemtask } @@ -222,8 +222,8 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { currentTimeClient.Reset(); alertNotificationClient.Reset(); connectionHandle = BLE_HS_CONN_HANDLE_NONE; - if (bleController.GetConnectState() == Ble::ConnectStates::Connected) { - bleController.SetConnectState(Ble::ConnectStates::Disconnected); + if(bleController.IsConnected()) { + bleController.Disconnect(); fastAdvCount = 0; StartAdvertising(); } @@ -401,19 +401,20 @@ void NimbleController::NotifyBatteryLevel(uint8_t level) { } } -void NimbleController::SwitchAirplaneMode(bool enabled) { - if (enabled) { - if (bleController.IsConnected()) { - bleController.SetConnectState(Ble::ConnectStates::Airplane); - ble_gap_terminate(connectionHandle, BLE_ERR_REM_USER_CONN_TERM); - } else { - bleController.SetConnectState(Ble::ConnectStates::Airplane); - ble_gap_adv_stop(); - } +void NimbleController::EnableRadio() { + bleController.EnableRadio(); + bleController.Disconnect(); + fastAdvCount = 0; + StartAdvertising(); +} + +void NimbleController::DisableRadio() { + bleController.DisableRadio(); + if (bleController.IsConnected()) { + ble_gap_terminate(connectionHandle, BLE_ERR_REM_USER_CONN_TERM); + bleController.Disconnect(); } else { - bleController.SetConnectState(Ble::ConnectStates::Disconnected); - fastAdvCount = 0; - StartAdvertising(); + ble_gap_adv_stop(); } } diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h index 7219ba6..ad19421 100644 --- a/src/components/ble/NimbleController.h +++ b/src/components/ble/NimbleController.h @@ -53,18 +53,6 @@ namespace Pinetime { void Init(); void StartAdvertising(); int OnGAPEvent(ble_gap_event* event); - - /* these are not implemented yet - int OnDiscoveryEvent(uint16_t i, const ble_gatt_error* pError, const ble_gatt_svc* pSvc); - int OnCTSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic); - int OnANSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic); - int OnCurrentTimeReadResult(uint16_t connectionHandle, const ble_gatt_error* error, ble_gatt_attr* attribute); - int OnANSDescriptorDiscoveryEventCallback(uint16_t connectionHandle, - const ble_gatt_error* error, - uint16_t characteristicValueHandle, - const ble_gatt_dsc* descriptor); - */ - void StartDiscovery(); Pinetime::Controllers::MusicService& music() { @@ -87,7 +75,8 @@ namespace Pinetime { fastAdvCount = 0; }; - void SwitchAirplaneMode(bool enabled); + void EnableRadio(); + void DisableRadio(); private: void PersistBond(struct ble_gap_conn_desc& desc); diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 9878aac..24a8260 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -202,12 +202,12 @@ namespace Pinetime { return settings.stepsGoal; }; - void SetAirplaneMode(bool mode) { - airplaneMode = mode; + void SetBleRadioEnabled(bool enabled) { + bleRadioEnabled = enabled; }; - bool GetAirplaneMode() const { - return airplaneMode; + bool GetBleRadioEnabled() const { + return bleRadioEnabled; }; private: @@ -240,7 +240,7 @@ namespace Pinetime { /* airplaneMode is intentionally not saved with the other watch settings and initialized * to off (false) on every boot because we always want ble to be enabled on startup */ - bool airplaneMode = false; + bool bleRadioEnabled = true; void LoadSettingsFromFile(); void SaveSettingsToFile(); diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 25ae9ad..fdc6376 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -293,8 +293,8 @@ void DisplayApp::Refresh() { case Messages::BleFirmwareUpdateStarted: LoadApp(Apps::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down); break; - case Messages::AirplaneModeToggle: - PushMessageToSystemTask(System::Messages::AirplaneModeToggle); + case Messages::BleRadioEnableToggle: + PushMessageToSystemTask(System::Messages::BleRadioEnableToggle); break; case Messages::UpdateDateTime: // Added to remove warning diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h index 62256b9..58df455 100644 --- a/src/displayapp/Messages.h +++ b/src/displayapp/Messages.h @@ -22,7 +22,7 @@ namespace Pinetime { ShowPairingKey, AlarmTriggered, Clock, - AirplaneModeToggle + BleRadioEnableToggle }; } } diff --git a/src/displayapp/screens/BleIcon.cpp b/src/displayapp/screens/BleIcon.cpp index a30d23b..019f803 100644 --- a/src/displayapp/screens/BleIcon.cpp +++ b/src/displayapp/screens/BleIcon.cpp @@ -2,11 +2,14 @@ #include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; -const char* BleIcon::GetIcon(Pinetime::Controllers::Ble::ConnectStates state) { - if (state == Pinetime::Controllers::Ble::ConnectStates::Connected) - return Symbols::bluetooth; - else if (state == Pinetime::Controllers::Ble::ConnectStates::Airplane) +const char* BleIcon::GetIcon(bool isRadioEnabled, bool isConnected) { + if(!isRadioEnabled) { return Symbols::airplane; - else - return Symbols::none; + } + + if (isConnected) { + return Symbols::bluetooth; + } + + return Symbols::none; } diff --git a/src/displayapp/screens/BleIcon.h b/src/displayapp/screens/BleIcon.h index d7410ea..d32dfad 100644 --- a/src/displayapp/screens/BleIcon.h +++ b/src/displayapp/screens/BleIcon.h @@ -7,7 +7,7 @@ namespace Pinetime { namespace Screens { class BleIcon { public: - static const char* GetIcon(Pinetime::Controllers::Ble::ConnectStates state); + static const char* GetIcon(bool isRadioEnabled, bool isConnected); }; } } diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index f1f7f92..44bf47a 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -42,6 +42,13 @@ namespace { auto* screen = static_cast(obj->user_data); screen->UpdateSelected(obj, event); } + + bool IsBleIconVisible(bool isRadioEnabled, bool isConnected) { + if(!isRadioEnabled) { + return true; + } + return isConnected; + } } PineTimeStyle::PineTimeStyle(DisplayApp* app, @@ -336,11 +343,13 @@ void PineTimeStyle::SetBatteryIcon() { lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); } + void PineTimeStyle::AlignIcons() { - if (notificationState.Get() && bleState.Get() != Pinetime::Controllers::Ble::ConnectStates::Disconnected) { + bool isBleIconVisible = IsBleIconVisible(bleRadioEnabled.Get(), bleState.Get()); + if (notificationState.Get() && isBleIconVisible) { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25); lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25); - } else if (notificationState.Get() && bleState.Get() == Pinetime::Controllers::Ble::ConnectStates::Disconnected) { + } else if (notificationState.Get() && !isBleIconVisible) { lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); } else { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); @@ -363,9 +372,10 @@ void PineTimeStyle::Refresh() { } } - bleState = bleController.GetConnectState(); - if (bleState.IsUpdated()) { - lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get())); + bleState = bleController.IsConnected(); + bleRadioEnabled = bleController.IsRadioEnabled(); + if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) { + lv_label_set_text(bleIcon, BleIcon::GetIcon(bleRadioEnabled.Get(), bleState.Get())); AlignIcons(); } diff --git a/src/displayapp/screens/PineTimeStyle.h b/src/displayapp/screens/PineTimeStyle.h index cb8f680..5de9a5f 100644 --- a/src/displayapp/screens/PineTimeStyle.h +++ b/src/displayapp/screens/PineTimeStyle.h @@ -51,7 +51,8 @@ namespace Pinetime { DirtyValue batteryPercentRemaining {}; DirtyValue isCharging {}; - DirtyValue bleState {}; + DirtyValue bleState {}; + DirtyValue bleRadioEnabled {}; DirtyValue> currentDateTime {}; DirtyValue motionSensorOk {}; DirtyValue stepCount {}; diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index fd36aa2..56155d5 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -119,9 +119,10 @@ void WatchFaceDigital::Refresh() { lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); } - bleState = bleController.GetConnectState(); - if (bleState.IsUpdated()) { - lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get())); + bleState = bleController.IsConnected(); + bleRadioEnabled = bleController.IsRadioEnabled(); + if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) { + lv_label_set_text(bleIcon, BleIcon::GetIcon(bleRadioEnabled.Get(), bleState.Get())); } lv_obj_realign(batteryIcon); lv_obj_realign(batteryPlug); diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index 6cf1131..d33434c 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -46,7 +46,8 @@ namespace Pinetime { DirtyValue batteryPercentRemaining {}; DirtyValue powerPresent {}; - DirtyValue bleState {}; + DirtyValue bleState {}; + DirtyValue bleRadioEnabled {}; DirtyValue> currentDateTime {}; DirtyValue motionSensorOk {}; DirtyValue stepCount {}; diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index 033aad8..ccfbdd0 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -114,11 +114,16 @@ void WatchFaceTerminal::Refresh() { } bleState = bleController.IsConnected(); - if (bleState.IsUpdated()) { - if (bleState.Get()) { - lv_label_set_text_static(connectState, "[STAT]#387b54 Connected#"); + bleRadioEnabled = bleController.IsRadioEnabled(); + if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) { + if(!bleRadioEnabled.Get()) { + lv_label_set_text_static(connectState, "[STAT]#387b54 Disabled#"); } else { - lv_label_set_text_static(connectState, "[STAT]#387b54 Disconnected#"); + if (bleState.Get()) { + lv_label_set_text_static(connectState, "[STAT]#387b54 Connected#"); + } else { + lv_label_set_text_static(connectState, "[STAT]#387b54 Disconnected#"); + } } } diff --git a/src/displayapp/screens/WatchFaceTerminal.h b/src/displayapp/screens/WatchFaceTerminal.h index c3df82b..78c7b8a 100644 --- a/src/displayapp/screens/WatchFaceTerminal.h +++ b/src/displayapp/screens/WatchFaceTerminal.h @@ -47,6 +47,7 @@ namespace Pinetime { DirtyValue batteryPercentRemaining {}; DirtyValue powerPresent {}; DirtyValue bleState {}; + DirtyValue bleRadioEnabled {}; DirtyValue> currentDateTime {}; DirtyValue motionSensorOk {}; DirtyValue stepCount {}; diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.cpp b/src/displayapp/screens/settings/SettingAirplaneMode.cpp index 0a364de..8517278 100644 --- a/src/displayapp/screens/settings/SettingAirplaneMode.cpp +++ b/src/displayapp/screens/settings/SettingAirplaneMode.cpp @@ -9,13 +9,16 @@ using namespace Pinetime::Applications::Screens; namespace { - static void event_handler(lv_obj_t* obj, lv_event_t event) { - SettingAirplaneMode* screen = static_cast(obj->user_data); - screen->UpdateSelected(obj, event); + static void OnAirplaneModeEnabledEvent(lv_obj_t* obj, lv_event_t event) { + auto* screen = static_cast(obj->user_data); + screen->OnAirplaneModeEnabled(obj, event); } -} -constexpr std::array SettingAirplaneMode::options; + static void OnAirplaneModeDisabledEvent(lv_obj_t* obj, lv_event_t event) { + auto* screen = static_cast(obj->user_data); + screen->OnAirplaneModeDisabled(obj, event); + } +} SettingAirplaneMode::SettingAirplaneMode(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) : Screen(app), settingsController {settingsController} { @@ -43,47 +46,48 @@ SettingAirplaneMode::SettingAirplaneMode(Pinetime::Applications::DisplayApp* app lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER); lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0); - for (unsigned int i = 0; i < options.size(); i++) { - cbOption[i] = lv_checkbox_create(container1, nullptr); - lv_checkbox_set_text(cbOption[i], options[i]); - cbOption[i]->user_data = this; - lv_obj_set_event_cb(cbOption[i], event_handler); - SetRadioButtonStyle(cbOption[i]); - } + cbEnabled = lv_checkbox_create(container1, nullptr); + lv_checkbox_set_text(cbEnabled, " Enable"); + cbEnabled->user_data = this; + lv_obj_set_event_cb(cbEnabled, OnAirplaneModeEnabledEvent); + SetRadioButtonStyle(cbEnabled); - if (settingsController.GetAirplaneMode() == false) { - lv_checkbox_set_checked(cbOption[0], true); - priorMode = false; - } else { - lv_checkbox_set_checked(cbOption[1], true); + cbDisabled = lv_checkbox_create(container1, nullptr); + lv_checkbox_set_text(cbDisabled, " Disable"); + cbDisabled->user_data = this; + lv_obj_set_event_cb(cbDisabled, OnAirplaneModeDisabledEvent); + SetRadioButtonStyle(cbDisabled); + + if (settingsController.GetBleRadioEnabled()) { + lv_checkbox_set_checked(cbDisabled, true); priorMode = true; + } else { + lv_checkbox_set_checked(cbEnabled, true); + priorMode = false; } } SettingAirplaneMode::~SettingAirplaneMode() { lv_obj_clean(lv_scr_act()); // Do not call SaveSettings - see src/components/settings/Settings.h - if (priorMode != settingsController.GetAirplaneMode()) { - app->PushMessage(Pinetime::Applications::Display::Messages::AirplaneModeToggle); + if (priorMode != settingsController.GetBleRadioEnabled()) { + app->PushMessage(Pinetime::Applications::Display::Messages::BleRadioEnableToggle); } } -void SettingAirplaneMode::UpdateSelected(lv_obj_t* object, lv_event_t event) { +void SettingAirplaneMode::OnAirplaneModeEnabled(lv_obj_t* object, lv_event_t event) { if (event == LV_EVENT_VALUE_CHANGED) { - for (unsigned int i = 0; i < options.size(); i++) { - if (object == cbOption[i]) { - lv_checkbox_set_checked(cbOption[i], true); - - if (i == 0) { - settingsController.SetAirplaneMode(false); - }; - if (i == 1) { - settingsController.SetAirplaneMode(true); - }; - - } else { - lv_checkbox_set_checked(cbOption[i], false); - } - } + lv_checkbox_set_checked(cbEnabled, true); + lv_checkbox_set_checked(cbDisabled, false); + settingsController.SetBleRadioEnabled(false); } } + +void SettingAirplaneMode::OnAirplaneModeDisabled(lv_obj_t* object, lv_event_t event) { + if (event == LV_EVENT_VALUE_CHANGED) { + lv_checkbox_set_checked(cbEnabled, false); + lv_checkbox_set_checked(cbDisabled, true); + settingsController.SetBleRadioEnabled(true); + } +} + diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.h b/src/displayapp/screens/settings/SettingAirplaneMode.h index fcc0222..b3478c6 100644 --- a/src/displayapp/screens/settings/SettingAirplaneMode.h +++ b/src/displayapp/screens/settings/SettingAirplaneMode.h @@ -17,12 +17,13 @@ namespace Pinetime { SettingAirplaneMode(DisplayApp* app, Pinetime::Controllers::Settings& settingsController); ~SettingAirplaneMode() override; - void UpdateSelected(lv_obj_t* object, lv_event_t event); + void OnAirplaneModeEnabled(lv_obj_t* object, lv_event_t event); + void OnAirplaneModeDisabled(lv_obj_t* object, lv_event_t event); private: - static constexpr std::array options = {" No", " Yes"}; Controllers::Settings& settingsController; - lv_obj_t* cbOption[options.size()]; + lv_obj_t* cbEnabled; + lv_obj_t* cbDisabled; bool priorMode; }; } diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index 7bc90b4..981b497 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -21,7 +21,11 @@ Settings::Settings(Pinetime::Applications::DisplayApp* app, Pinetime::Controller }, [this]() -> std::unique_ptr { return CreateScreen3(); - }}, + }, + [this]() -> std::unique_ptr { + return CreateScreen4(); + }, + }, Screens::ScreenListModes::UpDown} { } @@ -34,7 +38,6 @@ bool Settings::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr Settings::CreateScreen1() { - std::array applications {{ {Symbols::sun, "Display", Apps::SettingDisplay}, {Symbols::eye, "Wake Up", Apps::SettingWakeUp}, @@ -42,17 +45,17 @@ std::unique_ptr Settings::CreateScreen1() { {Symbols::home, "Watch face", Apps::SettingWatchFace}, }}; - return std::make_unique(0, 3, app, settingsController, applications); + return std::make_unique(0, 4, app, settingsController, applications); } std::unique_ptr Settings::CreateScreen2() { + std::array applications {{ + {Symbols::shoe, "Steps", Apps::SettingSteps}, + {Symbols::clock, "Set date", Apps::SettingSetDate}, + {Symbols::clock, "Set time", Apps::SettingSetTime}, + {Symbols::batteryHalf, "Battery", Apps::BatteryInfo}}}; - std::array applications {{{Symbols::shoe, "Steps", Apps::SettingSteps}, - {Symbols::clock, "Set date", Apps::SettingSetDate}, - {Symbols::clock, "Set time", Apps::SettingSetTime}, - {Symbols::batteryHalf, "Battery", Apps::BatteryInfo}}}; - - return std::make_unique(1, 3, app, settingsController, applications); + return std::make_unique(1, 4, app, settingsController, applications); } std::unique_ptr Settings::CreateScreen3() { @@ -61,8 +64,20 @@ std::unique_ptr Settings::CreateScreen3() { {Symbols::clock, "Chimes", Apps::SettingChimes}, {Symbols::tachometer, "Shake Calib.", Apps::SettingShakeThreshold}, {Symbols::check, "Firmware", Apps::FirmwareValidation}, - {Symbols::list, "About", Apps::SysInfo} + {Symbols::list, "Airplane mode", Apps::SettingAirplaneMode} + }}; + + return std::make_unique(2, 4, app, settingsController, applications); +} + +std::unique_ptr Settings::CreateScreen4() { + + std::array applications {{ + {Symbols::list, "About", Apps::SysInfo}, + {Symbols::none, "None", Apps::None}, + {Symbols::none, "None", Apps::None}, + {Symbols::none, "None", Apps::None} }}; - return std::make_unique(2, 3, app, settingsController, applications); + return std::make_unique(3, 4, app, settingsController, applications); } diff --git a/src/displayapp/screens/settings/Settings.h b/src/displayapp/screens/settings/Settings.h index 6c54cde..be09007 100644 --- a/src/displayapp/screens/settings/Settings.h +++ b/src/displayapp/screens/settings/Settings.h @@ -19,11 +19,12 @@ namespace Pinetime { private: Controllers::Settings& settingsController; - ScreenList<3> screens; + ScreenList<4> screens; std::unique_ptr CreateScreen1(); std::unique_ptr CreateScreen2(); std::unique_ptr CreateScreen3(); + std::unique_ptr CreateScreen4(); }; } } diff --git a/src/systemtask/Messages.h b/src/systemtask/Messages.h index ad13244..2e3456a 100644 --- a/src/systemtask/Messages.h +++ b/src/systemtask/Messages.h @@ -31,7 +31,7 @@ namespace Pinetime { BatteryPercentageUpdated, StartFileTransfer, StopFileTransfer, - AirplaneModeToggle + BleRadioEnableToggle }; } } diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 75a71ec..1e45fac 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -254,7 +254,7 @@ void SystemTask::Work() { displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToRunning); heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::WakeUp); - if (bleController.GetConnectState() == Controllers::Ble::ConnectStates::Disconnected) { + if (bleController.IsRadioEnabled() && !bleController.IsConnected()) { nimbleController.RestartFastAdv(); } @@ -440,8 +440,12 @@ void SystemTask::Work() { motorController.RunForDuration(35); displayApp.PushMessage(Pinetime::Applications::Display::Messages::ShowPairingKey); break; - case Messages::AirplaneModeToggle: - nimbleController.SwitchAirplaneMode(settingsController.GetAirplaneMode()); + case Messages::BleRadioEnableToggle: + if(settingsController.GetBleRadioEnabled()) { + nimbleController.EnableRadio(); + } else { + nimbleController.DisableRadio(); + } break; default: break; -- cgit v0.10.2 From 2803dd667f90bf8b19e45820235d3ab90490f96b Mon Sep 17 00:00:00 2001 From: avery Date: Tue, 22 Feb 2022 18:21:00 +0100 Subject: Use Bluetooth brand color for status text diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index ccfbdd0..c593e6b 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -46,7 +46,7 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, connectState = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(connectState, true); - lv_label_set_text(connectState, "[STAT]#387b54 Disconnected#"); + lv_label_set_text(connectState, "[STAT]#0082fc Disconnected#"); lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); notificationIcon = lv_label_create(lv_scr_act(), nullptr); @@ -117,12 +117,12 @@ void WatchFaceTerminal::Refresh() { bleRadioEnabled = bleController.IsRadioEnabled(); if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) { if(!bleRadioEnabled.Get()) { - lv_label_set_text_static(connectState, "[STAT]#387b54 Disabled#"); + lv_label_set_text_static(connectState, "[STAT]#0082fc Disabled#"); } else { if (bleState.Get()) { - lv_label_set_text_static(connectState, "[STAT]#387b54 Connected#"); + lv_label_set_text_static(connectState, "[STAT]#0082fc Connected#"); } else { - lv_label_set_text_static(connectState, "[STAT]#387b54 Disconnected#"); + lv_label_set_text_static(connectState, "[STAT]#0082fc Disconnected#"); } } } -- cgit v0.10.2 From 8dae4c82990df8236faa57ef4b6ae00c92298a1d Mon Sep 17 00:00:00 2001 From: avery Date: Tue, 22 Feb 2022 18:42:54 +0100 Subject: terminal: Replace notification icon with a text entry diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index c593e6b..ebd463f 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -50,8 +50,9 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); notificationIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); - lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 10, 0); + lv_label_set_recolor(notificationIcon, true); + lv_label_set_text(notificationIcon, "[NOTI]#387b54 ---"); + lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_LEFT_MID, 0, 60); label_date = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(label_date, true); @@ -62,7 +63,7 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, lv_label_set_text(label_prompt_1, "user@watch:~ $ now"); label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); - lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60); + lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 80); lv_label_set_text(label_prompt_2, "user@watch:~ $"); label_time = lv_label_create(lv_scr_act(), nullptr); @@ -130,9 +131,9 @@ void WatchFaceTerminal::Refresh() { notificationState = notificatioManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { if (notificationState.Get()) { - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(true)); + lv_label_set_text_static(notificationIcon, "[NOTI]#387b54 Unread"); } else { - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); + lv_label_set_text_static(notificationIcon, "[NOTI]#387b54 ---"); } } -- cgit v0.10.2 From 51640c72489109149c8a7c6c7cf044862cceabf5 Mon Sep 17 00:00:00 2001 From: Arsen6331 Date: Thu, 3 Mar 2022 17:01:34 +0000 Subject: Add ITD as a companion app diff --git a/README.md b/README.md index ae315f2..524f510 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/p - [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS) - [Siglo](https://github.com/alexr4535/siglo) (Linux) - [InfiniLink](https://github.com/xan-m/InfiniLink) **[Experimental]** (iOS) + - [ITD](https://gitea.arsenm.dev/Arsen6331/itd) (Linux) ## Development -- cgit v0.10.2 From 29f0bce46bd531ffa83f3445c0e0d893217aa50d Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 21 Feb 2022 22:50:20 +0100 Subject: Remove unused includes in HearRate and Motion.h The include `bits/unique_ptr.h` isn't used, so remove it. diff --git a/src/displayapp/screens/HeartRate.h b/src/displayapp/screens/HeartRate.h index baa0ccd..2ad0035 100644 --- a/src/displayapp/screens/HeartRate.h +++ b/src/displayapp/screens/HeartRate.h @@ -3,7 +3,6 @@ #include #include #include "displayapp/screens/Screen.h" -#include #include "systemtask/SystemTask.h" #include #include diff --git a/src/displayapp/screens/Motion.h b/src/displayapp/screens/Motion.h index d699740..4d2bd4f 100644 --- a/src/displayapp/screens/Motion.h +++ b/src/displayapp/screens/Motion.h @@ -3,7 +3,6 @@ #include #include #include "displayapp/screens/Screen.h" -#include #include #include #include -- cgit v0.10.2 From a29e30c1876891e504ad62fb35d3b1be76b175a4 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sat, 29 Jan 2022 23:30:03 +0100 Subject: Notifications: replace newlines in label-copy because of const char* title The variable `title` is defined as `const char*`, which means, that `strchr()` returns a `const char*` as well according to https://www.cplusplus.com/reference/cstring/strchr/ But in the same line the return value is assigned to a non-const `char*`, which shouldn't be allowed (error with `-pedantic`). Because the `lv_label` creates an internal copy of the title sting, just modify that one instead and replace newline in the copied string. diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 3a39dac..f9afd8c 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -198,15 +198,18 @@ Notifications::NotificationItem::NotificationItem(const char* title, lv_obj_t* alert_type = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888)); - if (title == nullptr) - title = "Notification"; - char* pchar; - pchar = strchr(title, '\n'); - while (pchar != nullptr) { - *pchar = ' '; - pchar = strchr(pchar + 1, '\n'); + if(title == nullptr) { + lv_label_set_text_static(alert_type, "Notification"); + } else { + // copy title to label and replace newlines with spaces + lv_label_set_text(alert_type, title); + char *pchar = strchr(lv_label_get_text(alert_type), '\n'); + while (pchar != nullptr) { + *pchar = ' '; + pchar = strchr(pchar + 1, '\n'); + } + lv_label_refr_text(alert_type); } - lv_label_set_text(alert_type, title); lv_label_set_long_mode(alert_type, LV_LABEL_LONG_SROLL_CIRC); lv_obj_set_width(alert_type, 180); lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 16); diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index f49d3b3..7416035 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -62,10 +62,6 @@ namespace Pinetime { }; private: - struct NotificationData { - const char* title; - const char* text; - }; Pinetime::Controllers::NotificationManager& notificationManager; Pinetime::Controllers::AlertNotificationService& alertNotificationService; Pinetime::Controllers::MotorController& motorController; -- cgit v0.10.2 From 1bfee61ef9f136b186199fb41abf04bf63918574 Mon Sep 17 00:00:00 2001 From: avery Date: Tue, 22 Feb 2022 17:37:28 +0100 Subject: Replace Airplane mode icon diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index 981b497..dce0c07 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -64,7 +64,7 @@ std::unique_ptr Settings::CreateScreen3() { {Symbols::clock, "Chimes", Apps::SettingChimes}, {Symbols::tachometer, "Shake Calib.", Apps::SettingShakeThreshold}, {Symbols::check, "Firmware", Apps::FirmwareValidation}, - {Symbols::list, "Airplane mode", Apps::SettingAirplaneMode} + {Symbols::airplane, "Airplane mode", Apps::SettingAirplaneMode} }}; return std::make_unique(2, 4, app, settingsController, applications); -- cgit v0.10.2 From f1c91e1ce0fb666449e751fc4a8216f1a672f95f Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 20 Feb 2022 15:06:28 +0200 Subject: terminal watchface: remove icons and other fixes diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index ccfbdd0..08a9db5 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -32,25 +32,15 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, motionController {motionController} { settingsController.SetClockFace(3); - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(batteryIcon, Symbols::batteryFull); - lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, 2); - - batteryPlug = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(batteryPlug, Symbols::plug); - lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0); - batteryValue = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(batteryValue, true); lv_obj_align(batteryValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -20); connectState = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(connectState, true); - lv_label_set_text(connectState, "[STAT]#387b54 Disconnected#"); lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); notificationIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 10, 0); label_date = lv_label_create(lv_scr_act(), nullptr); @@ -59,11 +49,11 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, label_prompt_1 = lv_label_create(lv_scr_act(), nullptr); lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -80); - lv_label_set_text(label_prompt_1, "user@watch:~ $ now"); + lv_label_set_text_static(label_prompt_1, "user@watch:~ $ now"); label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60); - lv_label_set_text(label_prompt_2, "user@watch:~ $"); + lv_label_set_text_static(label_prompt_2, "user@watch:~ $"); label_time = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(label_time, true); @@ -74,16 +64,14 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); lv_obj_set_size(backgroundLabel, 240, 240); lv_obj_set_pos(backgroundLabel, 0, 0); - lv_label_set_text(backgroundLabel, ""); + lv_label_set_text_static(backgroundLabel, ""); heartbeatValue = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(heartbeatValue, true); - lv_label_set_text(heartbeatValue, "[L_HR]#ee3311 0 bpm#"); lv_obj_align(heartbeatValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 20); stepValue = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(stepValue, true); - lv_label_set_text(stepValue, "[STEP]#ee3377 0 steps#"); lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 0); taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); @@ -97,20 +85,12 @@ WatchFaceTerminal::~WatchFaceTerminal() { void WatchFaceTerminal::Refresh() { powerPresent = batteryController.IsPowerPresent(); - if (powerPresent.IsUpdated()) { - lv_label_set_text_static(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get())); - } - batteryPercentRemaining = batteryController.PercentRemaining(); - if (batteryPercentRemaining.IsUpdated()) { - auto batteryPercent = batteryPercentRemaining.Get(); - if (batteryPercent == 100) { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); - } else { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); + if (batteryPercentRemaining.IsUpdated() || powerPresent.IsUpdated()) { + lv_label_set_text_fmt(batteryValue, "[BATT]#387b54 %d%%", batteryPercentRemaining.Get()); + if (batteryController.IsPowerPresent()) { + lv_label_ins_text(batteryValue, LV_LABEL_POS_LAST, " Charging"); } - lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); - lv_label_set_text_fmt(batteryValue, "[BATT]#387b54 %d%\%#", batteryPercent); } bleState = bleController.IsConnected(); @@ -130,9 +110,9 @@ void WatchFaceTerminal::Refresh() { notificationState = notificatioManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { if (notificationState.Get()) { - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(true)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); } else { - lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false)); } } diff --git a/src/displayapp/screens/WatchFaceTerminal.h b/src/displayapp/screens/WatchFaceTerminal.h index 78c7b8a..d236da3 100644 --- a/src/displayapp/screens/WatchFaceTerminal.h +++ b/src/displayapp/screens/WatchFaceTerminal.h @@ -60,8 +60,6 @@ namespace Pinetime { lv_obj_t* label_prompt_1; lv_obj_t* label_prompt_2; lv_obj_t* backgroundLabel; - lv_obj_t* batteryIcon; - lv_obj_t* batteryPlug; lv_obj_t* batteryValue; lv_obj_t* heartbeatValue; lv_obj_t* stepValue; -- cgit v0.10.2 From 1eaf258a633969abdd0e41fbcac9e17fe38eb409 Mon Sep 17 00:00:00 2001 From: medeyko Date: Mon, 7 Feb 2022 17:17:12 +0300 Subject: Update jetbrains_mono_bold_20.c Fix 0 (zero) symbol. For more details, #988 diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index 944e47a..6cd7aea 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -88,8 +88,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xe, 0x3, 0x80, 0xc0, 0x70, 0x18, 0xe, 0x0, /* U+0030 "0" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, - 0xdf, 0xf7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, 0x8f, 0xc0, /* U+0031 "1" */ -- cgit v0.10.2 From 43399b3832df7375f9139d7bd3c082a49549c616 Mon Sep 17 00:00:00 2001 From: medeyko Date: Mon, 7 Feb 2022 17:25:56 +0300 Subject: Update README.md diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index 40ecd3e..5007060 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -31,6 +31,23 @@ Add new symbols: static constexpr const char* newSymbol = "\xEF\x86\x85"; ``` +#### Fix the zero symbol +If you don't wish the inner dot of the 0 (zero) symbol to stick to the boundary), edit `src/displayapp/fonts/jetbrains_mono_bold_20.c` and replace: + + /* U+0030 "0" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, + 0xdf, 0xf7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, + +with + + /* U+0030 "0" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, + +(there are two changes: 7f -> 7e and f7 -> b7) + ## Simple method to generate a font If you want to generate a basic font containing only numbers and letters, you can use the above settings but instead of specifying a range, simply list the characters you need in the Symbols field and leave the range blank. This is the approach used for the PineTimeStyle watchface. -- cgit v0.10.2 From dd28359571088cc850d315b5c3689c69f54e5838 Mon Sep 17 00:00:00 2001 From: medeyko Date: Mon, 7 Feb 2022 17:31:18 +0300 Subject: Update README.md remove unnecessary ) diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index 5007060..a5f66b1 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -32,7 +32,7 @@ static constexpr const char* newSymbol = "\xEF\x86\x85"; ``` #### Fix the zero symbol -If you don't wish the inner dot of the 0 (zero) symbol to stick to the boundary), edit `src/displayapp/fonts/jetbrains_mono_bold_20.c` and replace: +If you don't wish the inner dot of the 0 (zero) symbol to stick to the boundary, edit `src/displayapp/fonts/jetbrains_mono_bold_20.c` and replace: /* U+0030 "0" */ 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, -- cgit v0.10.2 From dd47ba9782cb7a7a2268da5b493e6d385bdf08af Mon Sep 17 00:00:00 2001 From: medeyko Date: Mon, 7 Feb 2022 18:29:28 +0300 Subject: Update README.md More imperative tone diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index a5f66b1..b473768 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -31,8 +31,7 @@ Add new symbols: static constexpr const char* newSymbol = "\xEF\x86\x85"; ``` -#### Fix the zero symbol -If you don't wish the inner dot of the 0 (zero) symbol to stick to the boundary, edit `src/displayapp/fonts/jetbrains_mono_bold_20.c` and replace: +Then fix an error that happens during the font conversion (the inner dot of the 'zero' symbol sticks to the boundary): edit `src/displayapp/fonts/jetbrains_mono_bold_20.c` and replace: /* U+0030 "0" */ 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, -- cgit v0.10.2 From 5613449bfb16ed7bac672621f0f6c13afb1e1718 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Fri, 19 Nov 2021 23:14:19 +0100 Subject: Settings: more specific read and write mode For each filesystem interaction be more specific if we want to read from the file or write to it. Doing a non-creating read on the loading of the settings file, otherwise an empty file could be created, and when reading that empty file for the initial settings I would expect an error (or random data) when reading. diff --git a/src/components/settings/Settings.cpp b/src/components/settings/Settings.cpp index ef73ad1..fee62da 100644 --- a/src/components/settings/Settings.cpp +++ b/src/components/settings/Settings.cpp @@ -26,7 +26,7 @@ void Settings::LoadSettingsFromFile() { SettingsData bufferSettings; lfs_file_t settingsFile; - if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDWR | LFS_O_CREAT) != LFS_ERR_OK) { + if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDONLY) != LFS_ERR_OK) { return; } fs.FileRead(&settingsFile, reinterpret_cast(&bufferSettings), sizeof(settings)); @@ -39,7 +39,7 @@ void Settings::LoadSettingsFromFile() { void Settings::SaveSettingsToFile() { lfs_file_t settingsFile; - if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDWR | LFS_O_CREAT) != LFS_ERR_OK) { + if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_WRONLY | LFS_O_CREAT) != LFS_ERR_OK) { return; } fs.FileWrite(&settingsFile, reinterpret_cast(&settings), sizeof(settings)); -- cgit v0.10.2 From 30797b37bc509b24c86364f6d7b55be642a6dfb4 Mon Sep 17 00:00:00 2001 From: Yehoshua Pesach Wallach Date: Fri, 28 Jan 2022 14:34:59 +0200 Subject: removed SetClockFace from watchface Constructors diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index f027a74..f1b9144 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -57,7 +57,6 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app, bleController {bleController}, notificationManager {notificationManager}, settingsController {settingsController} { - settingsController.SetClockFace(1); sHour = 99; sMinute = 99; diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 56155d5..59bde83 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -32,7 +32,6 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, settingsController {settingsController}, heartRateController {heartRateController}, motionController {motionController} { - settingsController.SetClockFace(0); batteryIcon = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_static(batteryIcon, Symbols::batteryFull); -- cgit v0.10.2 From 5d974434ef2211c8feb7fe464bc9e2da3a3e1771 Mon Sep 17 00:00:00 2001 From: avery Date: Sat, 5 Mar 2022 13:01:50 +0100 Subject: Replace notif entry with "You have mail." text diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index ebd463f..d1d2230 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -50,9 +50,7 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); notificationIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_recolor(notificationIcon, true); - lv_label_set_text(notificationIcon, "[NOTI]#387b54 ---"); - lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_LEFT_MID, 0, 60); + lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_LEFT_MID, 0, -100); label_date = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(label_date, true); @@ -63,7 +61,7 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, lv_label_set_text(label_prompt_1, "user@watch:~ $ now"); label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); - lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 80); + lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60); lv_label_set_text(label_prompt_2, "user@watch:~ $"); label_time = lv_label_create(lv_scr_act(), nullptr); @@ -131,9 +129,9 @@ void WatchFaceTerminal::Refresh() { notificationState = notificatioManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { if (notificationState.Get()) { - lv_label_set_text_static(notificationIcon, "[NOTI]#387b54 Unread"); + lv_label_set_text_static(notificationIcon, "You have mail."); } else { - lv_label_set_text_static(notificationIcon, "[NOTI]#387b54 ---"); + lv_label_set_text_static(notificationIcon, ""); } } -- cgit v0.10.2 From 8844ea60b1ccb174e431f1dd96c72c5bb53c227b Mon Sep 17 00:00:00 2001 From: avery Date: Sun, 6 Mar 2022 14:01:20 +0100 Subject: Remove unnecessary line diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index e77d594..3a47fc5 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -38,7 +38,6 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, connectState = lv_label_create(lv_scr_act(), nullptr); lv_label_set_recolor(connectState, true); - lv_label_set_text(connectState, "[STAT]#0082fc Disconnected#"); lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); notificationIcon = lv_label_create(lv_scr_act(), nullptr); -- cgit v0.10.2 From 5fe5cee9ef76fdb57810a4434517ebc6442393fb Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 20 Feb 2022 14:45:59 +0100 Subject: Add missing nrf_log.h includes shadowed by SystemMonitor.h Some components were missing a `nrf_log.h` include. This missing include was accidentally provided by the SystemMonitor.h header, which was included by Systemtask.h diff --git a/src/components/ble/AlertNotificationClient.cpp b/src/components/ble/AlertNotificationClient.cpp index 0f85087..335845e 100644 --- a/src/components/ble/AlertNotificationClient.cpp +++ b/src/components/ble/AlertNotificationClient.cpp @@ -2,6 +2,7 @@ #include #include "components/ble/NotificationManager.h" #include "systemtask/SystemTask.h" +#include using namespace Pinetime::Controllers; constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid; diff --git a/src/components/ble/DfuService.cpp b/src/components/ble/DfuService.cpp index 71dcc7e..cf99f01 100644 --- a/src/components/ble/DfuService.cpp +++ b/src/components/ble/DfuService.cpp @@ -3,6 +3,7 @@ #include "components/ble/BleController.h" #include "drivers/SpiNorFlash.h" #include "systemtask/SystemTask.h" +#include using namespace Pinetime::Controllers; diff --git a/src/components/ble/HeartRateService.cpp b/src/components/ble/HeartRateService.cpp index f178af7..4824a6b 100644 --- a/src/components/ble/HeartRateService.cpp +++ b/src/components/ble/HeartRateService.cpp @@ -1,6 +1,7 @@ #include "components/ble/HeartRateService.h" #include "components/heartrate/HeartRateController.h" #include "systemtask/SystemTask.h" +#include using namespace Pinetime::Controllers; diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp index 6381915..87923c2 100644 --- a/src/components/ble/MotionService.cpp +++ b/src/components/ble/MotionService.cpp @@ -1,6 +1,7 @@ #include "components/ble/MotionService.h" #include "components/motion/MotionController.h" #include "systemtask/SystemTask.h" +#include using namespace Pinetime::Controllers; diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index f6ab626..0be7c0f 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -2,6 +2,7 @@ #include #include +#include #define min // workaround: nimble's min/max macros conflict with libstdc++ #define max #include -- cgit v0.10.2 From 187d99c0f710cf4827a026f02e41ebbd2b1271e2 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Thu, 27 Jan 2022 23:10:59 +0100 Subject: SystemMonitor: implement FreeRtosMonitor only if trace facility is set Split SystemMonitor into h and cpp file and move the logging code of the `Process` function into the cpp file. Depending of the `configUSE_TRACE_FACILITY` define from `src/FreeRTOSConfig.h` create either a "FreeRtosMonitor" or a "DummyMonitor". Make the `Process()` function non-const, as the FreeRtosMonitor changes the member variable `lastTick`. In `SystemTask.h` we then only need to use `SystemMonitor`, without knowledge of the `configUSE_TRACE_FACILITY` define. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 025fc33..ff0c9b0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -516,6 +516,7 @@ list(APPEND SOURCE_FILES displayapp/lv_pinetime_theme.c systemtask/SystemTask.cpp + systemtask/SystemMonitor.cpp drivers/TwiMaster.cpp heartratetask/HeartRateTask.cpp @@ -577,6 +578,7 @@ list(APPEND RECOVERY_SOURCE_FILES FreeRTOS/port_cmsis.c systemtask/SystemTask.cpp + systemtask/SystemMonitor.cpp drivers/TwiMaster.cpp components/gfx/Gfx.cpp components/rle/RleDecoder.cpp diff --git a/src/systemtask/SystemMonitor.cpp b/src/systemtask/SystemMonitor.cpp new file mode 100644 index 0000000..90765e3 --- /dev/null +++ b/src/systemtask/SystemMonitor.cpp @@ -0,0 +1,26 @@ +#include "systemtask/SystemTask.h" +#if configUSE_TRACE_FACILITY == 1 +// FreeRtosMonitor +#include +#include +#include + +void Pinetime::System::SystemMonitor::Process() { + if (xTaskGetTickCount() - lastTick > 10000) { + NRF_LOG_INFO("---------------------------------------\nFree heap : %d", xPortGetFreeHeapSize()); + TaskStatus_t tasksStatus[10]; + auto nb = uxTaskGetSystemState(tasksStatus, 10, nullptr); + for (uint32_t i = 0; i < nb; i++) { + NRF_LOG_INFO("Task [%s] - %d", tasksStatus[i].pcTaskName, tasksStatus[i].usStackHighWaterMark); + if (tasksStatus[i].usStackHighWaterMark < 20) + NRF_LOG_INFO("WARNING!!! Task %s task is nearly full, only %dB available", + tasksStatus[i].pcTaskName, + tasksStatus[i].usStackHighWaterMark * 4); + } + lastTick = xTaskGetTickCount(); + } +} +#else +// DummyMonitor +void Pinetime::System::SystemMonitor::Process() {} +#endif diff --git a/src/systemtask/SystemMonitor.h b/src/systemtask/SystemMonitor.h index 45c02c2..08c8740 100644 --- a/src/systemtask/SystemMonitor.h +++ b/src/systemtask/SystemMonitor.h @@ -1,44 +1,16 @@ #pragma once -#include +#include // declares configUSE_TRACE_FACILITY #include -#include namespace Pinetime { namespace System { - struct DummyMonitor {}; - struct FreeRtosMonitor {}; - - template class SystemMonitor { - public: - SystemMonitor() = delete; - }; - - template <> class SystemMonitor { + class SystemMonitor { public: - void Process() const { - } - }; - - template <> class SystemMonitor { - public: - void Process() const { - if (xTaskGetTickCount() - lastTick > 10000) { - NRF_LOG_INFO("---------------------------------------\nFree heap : %d", xPortGetFreeHeapSize()); - auto nb = uxTaskGetSystemState(tasksStatus, 10, nullptr); - for (uint32_t i = 0; i < nb; i++) { - NRF_LOG_INFO("Task [%s] - %d", tasksStatus[i].pcTaskName, tasksStatus[i].usStackHighWaterMark); - if (tasksStatus[i].usStackHighWaterMark < 20) - NRF_LOG_INFO("WARNING!!! Task %s task is nearly full, only %dB available", - tasksStatus[i].pcTaskName, - tasksStatus[i].usStackHighWaterMark * 4); - } - lastTick = xTaskGetTickCount(); - } - } - + void Process(); +#if configUSE_TRACE_FACILITY == 1 private: mutable TickType_t lastTick = 0; - mutable TaskStatus_t tasksStatus[10]; +#endif }; } -} \ No newline at end of file +} diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 517ed1a..c5b0379 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -148,11 +148,7 @@ namespace Pinetime { bool stepCounterMustBeReset = false; static constexpr TickType_t batteryMeasurementPeriod = pdMS_TO_TICKS(10 * 60 * 1000); -#if configUSE_TRACE_FACILITY == 1 - SystemMonitor monitor; -#else - SystemMonitor monitor; -#endif + SystemMonitor monitor; }; } } -- cgit v0.10.2 From 4c92ed410f89ba398b8762384bae395ff1d344c9 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 1 Feb 2022 21:48:56 +0100 Subject: CI: add lv_sim workflow and upload 'infinisim' executable use InfiniSim repo to build simulator in CI diff --git a/.github/workflows/lv_sim.yml b/.github/workflows/lv_sim.yml new file mode 100644 index 0000000..a3479f0 --- /dev/null +++ b/.github/workflows/lv_sim.yml @@ -0,0 +1,74 @@ +# GitHub Actions Workflow to build Simulator for PineTime Smart Watch LVGL Interface + +# Name of this Workflow +name: Build PineTime LVGL Simulator + +# When to run this Workflow... +on: + + # Run on all branches + push: + branches: [] + + # Also run this Workflow when a Pull Request is created or updated in the "master" and "develop" Branch + pull_request: + branches: [ master, develop ] + +# Steps to run for the Workflow +jobs: + build: + + # Run these steps on Ubuntu + runs-on: ubuntu-latest + + steps: + + ######################################################################################### + # Download and Install Dependencies + + - name: Install cmake + uses: lukka/get-cmake@v3.18.3 + + - name: Install SDL2 development package + run: | + sudo apt-get update + sudo apt-get -y install libsdl2-dev + + ######################################################################################### + # Checkout + + - name: Checkout source files + uses: actions/checkout@v2 + with: + submodules: recursive + + ######################################################################################### + # get InfiniSim repo + + - name: Get InfiniSim repo + run: | + git clone https://github.com/InfiniTimeOrg/InfiniSim.git --depth 1 --branch main + git -C InfiniSim submodule update --init lv_drivers + + ######################################################################################### + # CMake + + - name: CMake + run: | + cmake -G Ninja -S InfiniSim -B build_lv_sim -DInfiniTime_DIR="${PWD}" + + ######################################################################################### + # Build and Upload simulator + + # For Debugging Builds: Remove "make" option "-j" for clearer output. Add "--trace" to see details. + # For Faster Builds: Add "make" option "-j" + + - name: Build simulator executable + run: | + cmake --build build_lv_sim + + - name: Upload simulator executable + uses: actions/upload-artifact@v2 + with: + name: infinisim + path: build_lv_sim/infinisim diff --git a/README.md b/README.md index 524f510..8443e43 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/p - [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html) - [Tips on designing an app UI](doc/ui_guidelines.md) +### InfiniSim Simulator +Use the [InfiniSim Simulator](https://github.com/InfiniTimeOrg/InfiniSim) to experience the `InfiniTime` user interface directly on your PC, to shorten the time until you get your hands on a real [PineTime smartwatch](https://www.pine64.org/pinetime/). +Or use it to develop new Watchfaces, new Screens, or quickly iterate on the user interface. + ### Contributing - [How to contribute?](/doc/contribute.md) - [Coding conventions](/doc/coding-convention.md) -- cgit v0.10.2 From 204ad7ca2a8bf30caee7bc9b7395001c0d720b10 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 27 Feb 2022 14:30:47 +0200 Subject: Update font readme, update fonts, add missing files diff --git a/src/displayapp/fonts/JetBrainsMono-Bold.ttf b/src/displayapp/fonts/JetBrainsMono-Bold.ttf index 0cd1cb6..0a92809 100644 Binary files a/src/displayapp/fonts/JetBrainsMono-Bold.ttf and b/src/displayapp/fonts/JetBrainsMono-Bold.ttf differ diff --git a/src/displayapp/fonts/JetBrainsMono-Regular.ttf b/src/displayapp/fonts/JetBrainsMono-Regular.ttf new file mode 100644 index 0000000..8da8aa4 Binary files /dev/null and b/src/displayapp/fonts/JetBrainsMono-Regular.ttf differ diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index b473768..c8fb0d3 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -7,20 +7,12 @@ ## Generate the fonts: * Open the [LVGL font converter](https://lvgl.io/tools/fontconverter) -* Name : jetbrains_mono_bold_20 -* Size : 20 -* Bpp : 1 bit-per-pixel -* Do not enable font compression and horizontal subpixel hinting -* Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7f, 0x410-0x44f` -* Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following - range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf072` -* Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` -* Add the font .c file path to src/CMakeLists.txt -* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h +* Enter the settings for the font that you wish to convert +* Click on Convert, download the file and place it in `src/DisplayApp/Fonts` -Add new symbols: +### How to add new symbols: -* Browse the [cheatsheet](https://fontawesome.com/cheatsheet/free/solid) and find your new symbols +* Browse [this cheatsheet](https://fontawesome.com/cheatsheet/free/solid) and pick symbols * For each symbol, add its hex code (0xf641 for the 'Ad' icon, for example) to the *Range* list (Remember to keep this readme updated with newest range list) * Convert this hex value into a UTF-8 code @@ -31,7 +23,18 @@ Add new symbols: static constexpr const char* newSymbol = "\xEF\x86\x85"; ``` -Then fix an error that happens during the font conversion (the inner dot of the 'zero' symbol sticks to the boundary): edit `src/displayapp/fonts/jetbrains_mono_bold_20.c` and replace: +### Small font + +* Name: jetbrains_mono_bold_20 +* Size: 20 +* Bpp: 1 bit-per-pixel +* Do not enable font compression or horizontal subpixel rendering +* Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7e, 0x410-0x44f` +* Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following + range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf072` +* Fix an error in the font conversion. + +Replace the following: /* U+0030 "0" */ 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, @@ -47,25 +50,34 @@ with (there are two changes: 7f -> 7e and f7 -> b7) -## Simple method to generate a font -If you want to generate a basic font containing only numbers and letters, you can use the above settings but instead of specifying a range, simply list the characters you need in the Symbols field and leave the range blank. This is the approach used for the PineTimeStyle watchface. -This works well for fonts which will only be used to display numbers, but will fail if you try to add a colon or other punctuation. +### Medium font + +* Name: jetbrains_mono_42 +* Size: 42 +* Bpp: 1 bit-per-pixel +* Do not enable font compression or horizontal subpixel rendering +* Load the file `JetBrainsMono-Regular.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x25, 0x30-0x3a` + +### Large font +* Name: jetbrains_mono_76 +* Size: 76 +* Bpp: 1 bit-per-pixel +* Do not enable font compression or horizontal subpixel rendering +* Load the file `JetBrainsMono-Regular.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x25, 0x2D, 0x2F, 0x30-0x3a` + +### PineTimeStyle font -* Open the [LVGL font converter](https://lvgl.io/tools/fontconverter) * Name : open_sans_light * Size : 150 * Bpp : 1 bit-per-pixel -* Do not enable font compression and horizontal subpixel hinting +* Do not enable font compression or horizontal subpixel rendering * Load the file `open_sans_light.tff` (use the file in this repo to ensure the version matches) and specify the following symbols : `0123456789` -* Click on Convert, and download the file `open_sans_light.c` and copy it in `src/DisplayApp/Fonts` -* Add the font .c file path to src/CMakeLists.txt (search for jetbrains to find the appropriate location/format) -* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h (as above) #### Navigation font To create the navigtion.ttf I use the web app [icomoon](https://icomoon.io/app) -this app can import the svg files from the folder *src/displayapp/icons/navigation/unique* and creat a ttf file the +this app can import the svg files from the folder *src/displayapp/icons/navigation/unique* and create a ttf file the project for the site is *lv_font_navi_80.json* you can import it to add or remove icons You can also use the online LVGL tool to create the .c @@ -74,5 +86,3 @@ ttf file : navigation.ttf name : lv_font_navi_80 size : 80px Bpp : 2 bit-per-pix $lv_font_conv --font navigation.ttf -r '0xe900-0xe929' --size 80 --format lvgl --bpp 2 --no-prefilter -o lv_font_navi_80.c - -#### I use the method above to create the other ttf diff --git a/src/displayapp/fonts/jetbrains_mono_42.c b/src/displayapp/fonts/jetbrains_mono_42.c index 6f25f5a..b5218b9 100644 --- a/src/displayapp/fonts/jetbrains_mono_42.c +++ b/src/displayapp/fonts/jetbrains_mono_42.c @@ -61,13 +61,13 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xff, 0xf8, /* U+0032 "2" */ - 0x3, 0xf8, 0x1, 0xff, 0xc0, 0x7f, 0xfe, 0x1f, - 0x7, 0xc7, 0xc0, 0x3c, 0xf0, 0x7, 0xbc, 0x0, + 0x3, 0xf8, 0x1, 0xff, 0xc0, 0xff, 0xfc, 0x1f, + 0x7, 0xc7, 0xc0, 0x7c, 0xf0, 0x7, 0xbc, 0x0, 0x7f, 0x80, 0xf, 0xf0, 0x1, 0xe0, 0x0, 0x3c, 0x0, 0x7, 0x80, 0x1, 0xf0, 0x0, 0x3c, 0x0, 0xf, 0x80, 0x1, 0xe0, 0x0, 0x7c, 0x0, 0x1f, - 0x0, 0x7, 0xc0, 0x1, 0xf0, 0x0, 0x7e, 0x0, - 0xf, 0x80, 0x3, 0xe0, 0x0, 0xf8, 0x0, 0x3e, + 0x0, 0x7, 0xc0, 0x1, 0xf0, 0x0, 0x7c, 0x0, + 0x1f, 0x0, 0x3, 0xc0, 0x0, 0xf0, 0x0, 0x3e, 0x0, 0xf, 0x80, 0x3, 0xe0, 0x0, 0xf8, 0x0, 0x3e, 0x0, 0x7, 0xff, 0xfe, 0xff, 0xff, 0xdf, 0xff, 0xf8, @@ -75,12 +75,12 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+0033 "3" */ 0x7f, 0xff, 0x8f, 0xff, 0xf1, 0xff, 0xfe, 0x0, 0x3, 0xc0, 0x0, 0xf0, 0x0, 0x3c, 0x0, 0xf, - 0x0, 0x3, 0xc0, 0x0, 0xf0, 0x0, 0x3e, 0x0, - 0x7, 0x80, 0x1, 0xfe, 0x0, 0x3f, 0xf0, 0x7, - 0xff, 0x0, 0x3, 0xf0, 0x0, 0x1e, 0x0, 0x3, - 0xc0, 0x0, 0x3c, 0x0, 0x7, 0x80, 0x0, 0xf0, + 0x0, 0x3, 0xe0, 0x0, 0x78, 0x0, 0x1e, 0x0, + 0x7, 0x80, 0x1, 0xfc, 0x0, 0x3f, 0xe0, 0x7, + 0xfe, 0x0, 0xff, 0xe0, 0x0, 0x3e, 0x0, 0x3, + 0xc0, 0x0, 0x7c, 0x0, 0x7, 0x80, 0x0, 0xf0, 0x0, 0x1e, 0x0, 0x3, 0xfc, 0x0, 0x7f, 0x80, - 0xf, 0xf0, 0x1, 0xef, 0x0, 0x79, 0xf0, 0x1f, + 0xf, 0xf0, 0x1, 0xff, 0x0, 0x79, 0xe0, 0x1f, 0x1f, 0x7, 0xc3, 0xff, 0xf0, 0x1f, 0xfc, 0x0, 0xfe, 0x0, @@ -245,7 +245,7 @@ lv_font_t jetbrains_mono_42 = { #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif -#if LV_VERSION_CHECK(7, 4, 0) +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 .underline_position = -7, .underline_thickness = 2, #endif diff --git a/src/displayapp/fonts/jetbrains_mono_76.c b/src/displayapp/fonts/jetbrains_mono_76.c index 9c92e14..2200e39 100644 --- a/src/displayapp/fonts/jetbrains_mono_76.c +++ b/src/displayapp/fonts/jetbrains_mono_76.c @@ -175,30 +175,30 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* U+0032 "2" */ - 0x0, 0x7, 0xfc, 0x0, 0x0, 0x1f, 0xff, 0xe0, + 0x0, 0xf, 0xfc, 0x0, 0x0, 0x1f, 0xff, 0xe0, 0x0, 0x1f, 0xff, 0xfe, 0x0, 0xf, 0xff, 0xff, - 0xe0, 0x7, 0xff, 0xff, 0xfc, 0x3, 0xff, 0xff, - 0xff, 0x81, 0xff, 0xc0, 0x7f, 0xe0, 0xff, 0x80, + 0xc0, 0x7, 0xff, 0xff, 0xf8, 0x3, 0xff, 0xff, + 0xff, 0x1, 0xff, 0xc0, 0x7f, 0xe0, 0xff, 0x80, 0x7, 0xfc, 0x3f, 0xc0, 0x0, 0xff, 0x1f, 0xe0, 0x0, 0x1f, 0xe7, 0xf0, 0x0, 0x3, 0xf9, 0xfc, - 0x0, 0x0, 0xfe, 0xff, 0x0, 0x0, 0x1f, 0xff, + 0x0, 0x0, 0xfe, 0xff, 0x0, 0x0, 0x3f, 0xff, 0x80, 0x0, 0x7, 0xff, 0xe0, 0x0, 0x1, 0xff, 0xf8, 0x0, 0x0, 0x7f, 0xfe, 0x0, 0x0, 0x1f, 0xc0, 0x0, 0x0, 0x7, 0xf0, 0x0, 0x0, 0x1, 0xfc, 0x0, 0x0, 0x0, 0x7f, 0x0, 0x0, 0x0, - 0x3f, 0xc0, 0x0, 0x0, 0xf, 0xe0, 0x0, 0x0, - 0x7, 0xf8, 0x0, 0x0, 0x1, 0xfe, 0x0, 0x0, - 0x0, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xc0, 0x0, + 0x3f, 0x80, 0x0, 0x0, 0xf, 0xe0, 0x0, 0x0, + 0x7, 0xf8, 0x0, 0x0, 0x1, 0xfc, 0x0, 0x0, + 0x0, 0xff, 0x0, 0x0, 0x0, 0x3f, 0x80, 0x0, 0x0, 0x1f, 0xe0, 0x0, 0x0, 0xf, 0xf0, 0x0, - 0x0, 0x7, 0xfc, 0x0, 0x0, 0x3, 0xfe, 0x0, - 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x7f, 0xc0, - 0x0, 0x0, 0x3f, 0xe0, 0x0, 0x0, 0x1f, 0xf0, + 0x0, 0x7, 0xf8, 0x0, 0x0, 0x3, 0xfe, 0x0, + 0x0, 0x1, 0xff, 0x0, 0x0, 0x0, 0xff, 0x80, + 0x0, 0x0, 0x3f, 0xc0, 0x0, 0x0, 0x1f, 0xe0, 0x0, 0x0, 0xf, 0xf8, 0x0, 0x0, 0x7, 0xfc, 0x0, 0x0, 0x3, 0xfe, 0x0, 0x0, 0x1, 0xff, 0x0, 0x0, 0x0, 0xff, 0x80, 0x0, 0x0, 0x7f, 0xc0, 0x0, 0x0, 0x3f, 0xe0, 0x0, 0x0, 0x1f, - 0xf8, 0x0, 0x0, 0xf, 0xfc, 0x0, 0x0, 0x7, - 0xfe, 0x0, 0x0, 0x1, 0xff, 0x0, 0x0, 0x0, + 0xf0, 0x0, 0x0, 0xf, 0xf8, 0x0, 0x0, 0x7, + 0xfc, 0x0, 0x0, 0x3, 0xfe, 0x0, 0x0, 0x0, 0xff, 0x80, 0x0, 0x0, 0x7f, 0xc0, 0x0, 0x0, 0x3f, 0xe0, 0x0, 0x0, 0x1f, 0xf0, 0x0, 0x0, 0xf, 0xf8, 0x0, 0x0, 0x7, 0xfc, 0x0, 0x0, @@ -214,22 +214,22 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xff, 0x80, 0x0, 0x0, 0xf, 0xe0, 0x0, 0x0, 0x7, 0xf0, 0x0, 0x0, 0x3, 0xf8, 0x0, 0x0, 0x1, 0xfc, 0x0, 0x0, 0x0, 0xfe, 0x0, 0x0, - 0x0, 0x7f, 0x80, 0x0, 0x0, 0x1f, 0xc0, 0x0, - 0x0, 0xf, 0xe0, 0x0, 0x0, 0x7, 0xf0, 0x0, + 0x0, 0x7f, 0x80, 0x0, 0x0, 0x3f, 0xc0, 0x0, + 0x0, 0x1f, 0xe0, 0x0, 0x0, 0x7, 0xf0, 0x0, 0x0, 0x3, 0xf8, 0x0, 0x0, 0x1, 0xfc, 0x0, - 0x0, 0x0, 0xfe, 0x0, 0x0, 0x0, 0x7f, 0x80, + 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x7f, 0x80, 0x0, 0x0, 0x3f, 0xc0, 0x0, 0x0, 0x1f, 0xe0, - 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, 0x1, 0xff, + 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, 0x1, 0xff, 0xfc, 0x0, 0x0, 0x7f, 0xff, 0xc0, 0x0, 0x1f, 0xff, 0xf8, 0x0, 0x7, 0xff, 0xff, 0x0, 0x1, - 0xff, 0xff, 0xe0, 0x0, 0x0, 0x1f, 0xfc, 0x0, - 0x0, 0x1, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xe0, + 0xff, 0xff, 0xe0, 0x0, 0x0, 0xf, 0xfc, 0x0, + 0x0, 0x1, 0xff, 0x0, 0x0, 0x0, 0x1f, 0xe0, 0x0, 0x0, 0x7, 0xf8, 0x0, 0x0, 0x0, 0xfe, 0x0, 0x0, 0x0, 0x3f, 0xc0, 0x0, 0x0, 0x7, 0xf0, 0x0, 0x0, 0x1, 0xfc, 0x0, 0x0, 0x0, 0x7f, 0x0, 0x0, 0x0, 0x1f, 0xc0, 0x0, 0x0, 0x7, 0xf0, 0x0, 0x0, 0x1, 0xfc, 0x0, 0x0, - 0x0, 0x7f, 0x0, 0x0, 0x0, 0x1f, 0xff, 0x80, + 0x0, 0x7f, 0xfe, 0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, 0x7, 0xff, 0xe0, 0x0, 0x1, 0xff, 0xf8, 0x0, 0x0, 0x7f, 0xff, 0x0, 0x0, 0x3f, 0xdf, 0xc0, 0x0, 0xf, 0xe7, 0xf8, 0x0, 0x7, 0xf9, @@ -466,10 +466,10 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 878, .adv_w = 730, .box_w = 34, .box_h = 56, .ofs_x = 7, .ofs_y = 0}, {.bitmap_index = 1116, .adv_w = 730, .box_w = 34, .box_h = 57, .ofs_x = 6, .ofs_y = 0}, {.bitmap_index = 1359, .adv_w = 730, .box_w = 34, .box_h = 57, .ofs_x = 5, .ofs_y = -1}, - {.bitmap_index = 1602, .adv_w = 730, .box_w = 32, .box_h = 56, .ofs_x = 6, .ofs_y = 0}, + {.bitmap_index = 1602, .adv_w = 730, .box_w = 32, .box_h = 56, .ofs_x = 5, .ofs_y = 0}, {.bitmap_index = 1826, .adv_w = 730, .box_w = 32, .box_h = 57, .ofs_x = 7, .ofs_y = -1}, {.bitmap_index = 2054, .adv_w = 730, .box_w = 36, .box_h = 58, .ofs_x = 5, .ofs_y = -1}, - {.bitmap_index = 2315, .adv_w = 730, .box_w = 36, .box_h = 56, .ofs_x = 5, .ofs_y = 0}, + {.bitmap_index = 2315, .adv_w = 730, .box_w = 36, .box_h = 56, .ofs_x = 6, .ofs_y = 0}, {.bitmap_index = 2567, .adv_w = 730, .box_w = 36, .box_h = 58, .ofs_x = 5, .ofs_y = -1}, {.bitmap_index = 2828, .adv_w = 730, .box_w = 36, .box_h = 57, .ofs_x = 5, .ofs_y = 0}, {.bitmap_index = 3085, .adv_w = 730, .box_w = 13, .box_h = 44, .ofs_x = 16, .ofs_y = -1} @@ -541,7 +541,7 @@ lv_font_t jetbrains_mono_76 = { #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif -#if LV_VERSION_CHECK(7, 4, 0) +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 .underline_position = -12, .underline_thickness = 4, #endif diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index 6cd7aea..cc67532 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -32,9 +32,9 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xef, 0xdf, 0xbf, 0x7e, 0xfd, 0xc0, /* U+0023 "#" */ - 0x8, 0xc3, 0x10, 0x66, 0x3f, 0xf7, 0xfe, 0x23, - 0x4, 0x61, 0x88, 0x31, 0x1f, 0xfb, 0xff, 0x19, - 0x82, 0x30, 0xc4, 0x0, + 0x8, 0xc3, 0x18, 0x62, 0x3f, 0xf7, 0xfe, 0x23, + 0xc, 0x61, 0x88, 0xff, 0xdf, 0xf8, 0x8c, 0x11, + 0x86, 0x30, 0xc4, 0x0, /* U+0024 "$" */ 0x8, 0x2, 0x0, 0x81, 0xfc, 0x7f, 0xba, 0x7e, @@ -93,11 +93,11 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x8f, 0xc0, /* U+0031 "1" */ - 0x1e, 0x3f, 0x3b, 0x99, 0xc8, 0xe0, 0x70, 0x38, + 0x1e, 0x3f, 0x3f, 0x99, 0xc8, 0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x3, 0x81, 0xcf, 0xff, 0xfc, /* U+0032 "2" */ - 0x3e, 0x3f, 0xbc, 0xfc, 0x70, 0x38, 0x1c, 0x1c, + 0x3e, 0x3f, 0xbd, 0xfc, 0x70, 0x38, 0x1c, 0x1c, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0xf, 0xff, 0xfc, /* U+0033 "3" */ @@ -122,7 +122,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+0037 "7" */ 0xff, 0xff, 0xfe, 0x1f, 0x86, 0x3, 0x80, 0xe0, 0x30, 0x1c, 0x6, 0x3, 0x80, 0xc0, 0x70, 0x1c, - 0x6, 0x0, + 0xe, 0x0, /* U+0038 "8" */ 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xdc, 0xe3, @@ -157,7 +157,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x30, 0x30, 0x0, 0x0, 0x70, 0x70, /* U+0040 "@" */ - 0x1f, 0x7, 0xf9, 0xc3, 0x70, 0x3c, 0x7, 0x8f, + 0x1f, 0x7, 0xf9, 0xc3, 0x70, 0x3c, 0x7, 0x8e, 0xf3, 0xfe, 0x63, 0xcc, 0x79, 0x8f, 0x31, 0xe6, 0x3c, 0xff, 0x8e, 0xf8, 0x3, 0x80, 0x3e, 0x3, 0xc0, @@ -168,8 +168,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xf0, 0x30, /* U+0042 "B" */ - 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xcf, - 0xe3, 0xfc, 0xe3, 0xb8, 0x7e, 0x1f, 0x8f, 0xff, + 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xef, + 0xe3, 0xfc, 0xe3, 0xf8, 0x7e, 0x1f, 0x8f, 0xff, 0xbf, 0xc0, /* U+0043 "C" */ @@ -217,9 +217,9 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0xf, 0xff, 0xfc, /* U+004D "M" */ - 0xe1, 0xf8, 0x7f, 0x3f, 0xcf, 0xd2, 0xf7, 0xbd, - 0xef, 0x33, 0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, - 0xf0, 0x30, + 0xf3, 0xfc, 0xfd, 0x3f, 0xcf, 0xff, 0xff, 0xfe, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0x87, 0xe1, + 0xf8, 0x70, /* U+004E "N" */ 0xe1, 0xf0, 0xfc, 0x7e, 0x3f, 0x9e, 0xcf, 0x67, @@ -245,7 +245,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xb8, 0x70, /* U+0053 "S" */ - 0x3f, 0x1f, 0xee, 0x3f, 0x87, 0xe0, 0x3c, 0x7, + 0x3f, 0x1f, 0xee, 0x3f, 0x87, 0xe0, 0x3e, 0x7, 0xf0, 0xfe, 0x3, 0xc0, 0x7e, 0x1f, 0xcf, 0x7f, 0x8f, 0xc0, @@ -260,7 +260,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+0056 "V" */ 0xc0, 0xf8, 0x7e, 0x1d, 0x86, 0x61, 0x9c, 0xe7, - 0x38, 0xcc, 0x33, 0xf, 0xc3, 0xf0, 0x78, 0x1e, + 0x38, 0xcc, 0x33, 0xe, 0xc3, 0xf0, 0x78, 0x1e, 0x7, 0x80, /* U+0057 "W" */ @@ -314,8 +314,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x7f, 0xf7, 0x70, /* U+0063 "c" */ - 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x7, 0x3, 0x81, - 0xc7, 0xe3, 0xbf, 0x8f, 0x80, + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, + 0x3, 0x87, 0xf3, 0xdf, 0xe3, 0xf0, /* U+0064 "d" */ 0x3, 0x81, 0xc0, 0xe7, 0x77, 0xff, 0x1f, 0x8f, @@ -382,12 +382,12 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xe, /* U+0072 "r" */ - 0xee, 0x7f, 0xb9, 0xfc, 0x7e, 0x3f, 0x3, 0x81, + 0xee, 0x7f, 0xb8, 0xfc, 0x7e, 0x3f, 0x3, 0x81, 0xc0, 0xe0, 0x70, 0x38, 0x0, /* U+0073 "s" */ 0x1f, 0x1f, 0xf7, 0x1d, 0xc0, 0x7c, 0xf, 0xe0, - 0x3c, 0x7, 0x71, 0xdf, 0xe3, 0xf0, + 0x3c, 0x7, 0x71, 0xdf, 0xf3, 0xf0, /* U+0074 "t" */ 0x1c, 0x7, 0x1, 0xc3, 0xff, 0xff, 0xc7, 0x1, @@ -399,12 +399,12 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc7, 0xe3, 0xbf, 0x8f, 0x80, /* U+0076 "v" */ - 0xe0, 0xf8, 0x76, 0x19, 0x86, 0x73, 0x8c, 0xc3, + 0xc0, 0xf8, 0x7e, 0x1d, 0x86, 0x73, 0x8c, 0xc3, 0x30, 0xfc, 0x1e, 0x7, 0x81, 0xe0, /* U+0077 "w" */ - 0xe6, 0x36, 0x66, 0x66, 0x66, 0xf6, 0x6f, 0x66, - 0x96, 0x69, 0x62, 0x94, 0x39, 0xc3, 0x9c, 0x39, + 0xc6, 0x36, 0x66, 0x66, 0x66, 0xf6, 0x6f, 0x66, + 0x96, 0x69, 0x62, 0x94, 0x29, 0x43, 0x9c, 0x39, 0xc0, /* U+0078 "x" */ @@ -412,7 +412,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xe0, 0xfc, 0x73, 0x9c, 0xee, 0x1c, /* U+0079 "y" */ - 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x73, 0x8c, 0xc3, + 0xe0, 0xf8, 0x76, 0x19, 0xce, 0x73, 0x8c, 0xc3, 0xf0, 0x7c, 0x1e, 0x7, 0x80, 0xe0, 0x30, 0x1c, 0x6, 0x3, 0x80, @@ -421,17 +421,17 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xe0, 0xe0, 0x7f, 0xff, 0xe0, /* U+007B "{" */ - 0x3, 0x87, 0xc3, 0x81, 0xc0, 0xe0, 0x70, 0x38, + 0x7, 0x87, 0xc3, 0x81, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0xfc, 0x7e, 0x3, 0x81, 0xc0, 0xe0, 0x70, - 0x38, 0x1c, 0xf, 0x81, 0xc0, + 0x30, 0x1c, 0xf, 0x83, 0xc0, /* U+007C "|" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, /* U+007D "}" */ - 0xf0, 0x3e, 0x1, 0xc0, 0x70, 0x1c, 0x7, 0x1, - 0xc0, 0x70, 0xf, 0xc3, 0xf1, 0xc0, 0x70, 0x1c, - 0x7, 0x1, 0xc0, 0x70, 0xf8, 0x3c, 0x0, + 0xf0, 0x7c, 0xe, 0x7, 0x3, 0x81, 0xc0, 0xe0, + 0x70, 0x1f, 0x8f, 0xce, 0x7, 0x3, 0x81, 0xc0, + 0x60, 0x70, 0xf8, 0x78, 0x0, /* U+007E "~" */ 0x78, 0xff, 0x3c, 0xcf, 0x3f, 0xc7, 0x80, @@ -447,8 +447,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xbf, 0xc0, /* U+0412 "В" */ - 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xcf, - 0xe3, 0xfc, 0xe3, 0xb8, 0x7e, 0x1f, 0x8f, 0xff, + 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xef, + 0xe3, 0xfc, 0xe3, 0xf8, 0x7e, 0x1f, 0x8f, 0xff, 0xbf, 0xc0, /* U+0413 "Г" */ @@ -470,9 +470,9 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x66, 0x66, 0x66, 0x6c, 0x63, /* U+0417 "З" */ - 0x1f, 0xf, 0xf3, 0xc7, 0x0, 0x60, 0x1c, 0x1e, - 0x3, 0xf0, 0xe, 0x0, 0xe0, 0x1f, 0x83, 0xf8, - 0xf7, 0xfc, 0x3e, 0x0, + 0x3f, 0x1f, 0xef, 0x1f, 0x87, 0x1, 0xc7, 0xc1, + 0xf8, 0xf, 0x1, 0xc0, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0x80, /* U+0418 "И" */ 0xc3, 0xe3, 0xf1, 0xf8, 0xfc, 0xde, 0x6f, 0x37, @@ -494,9 +494,9 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xf8, 0x70, /* U+041C "М" */ - 0xe1, 0xf8, 0x7f, 0x3f, 0xcf, 0xd2, 0xf7, 0xbd, - 0xef, 0x33, 0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, - 0xf0, 0x30, + 0xf3, 0xfc, 0xfd, 0x3f, 0xcf, 0xff, 0xff, 0xfe, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0x87, 0xe1, + 0xf8, 0x70, /* U+041D "Н" */ 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0xff, @@ -546,7 +546,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xff, 0xf0, 0x1c, 0x7, 0x1, 0xc0, /* U+0427 "Ч" */ - 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0xce, + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, 0xff, 0x3f, 0x81, 0xc0, 0xe0, 0x70, 0x38, 0x1c, /* U+0428 "Ш" */ @@ -593,8 +593,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x1f, 0x87, 0xe3, 0xff, 0xf3, 0xdc, /* U+0431 "б" */ - 0x1f, 0x3f, 0x9c, 0x1c, 0xe, 0xe7, 0xfb, 0x8f, - 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, + 0x1f, 0x3f, 0x9c, 0x1c, 0xe, 0xe7, 0xfb, 0x9f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfe, 0xf7, 0xf1, 0xf0, /* U+0432 "в" */ 0xff, 0x3f, 0xee, 0x3b, 0x8e, 0xfe, 0x3f, 0xee, @@ -619,7 +619,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x70, /* U+0437 "з" */ - 0x3f, 0x1f, 0xfe, 0x1c, 0x7, 0x1f, 0x87, 0xe0, + 0x3f, 0x1f, 0xfe, 0x1c, 0x7, 0x1f, 0x7, 0xe0, 0x1c, 0x7, 0xe1, 0xdf, 0xe3, 0xf0, /* U+0438 "и" */ @@ -632,8 +632,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc7, 0xc3, /* U+043A "к" */ - 0xe1, 0xf8, 0xee, 0x33, 0x9c, 0xfe, 0x3f, 0x8e, - 0x73, 0x9c, 0xe3, 0xb8, 0x6e, 0x1c, + 0xe1, 0xf8, 0xee, 0x3b, 0x9c, 0xfe, 0x3f, 0x8e, + 0x73, 0x8c, 0xe3, 0xb8, 0x6e, 0x1c, /* U+043B "л" */ 0x3f, 0xcf, 0xf3, 0x9c, 0xe7, 0x39, 0xce, 0x73, @@ -644,7 +644,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xef, 0x33, 0xc0, 0xf0, 0x3c, 0xc, /* U+043D "н" */ - 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0xff, 0xff, + 0xe3, 0xf1, 0xf8, 0xfc, 0x7f, 0xff, 0xff, 0x8f, 0xc7, 0xe3, 0xf1, 0xf8, 0xe0, /* U+043E "о" */ @@ -661,15 +661,15 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x80, /* U+0441 "с" */ - 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x7, 0x3, 0x81, - 0xc7, 0xe3, 0xbf, 0x8f, 0x80, + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, + 0x3, 0x87, 0xf3, 0xdf, 0xe3, 0xf0, /* U+0442 "т" */ 0xff, 0xff, 0xf0, 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, /* U+0443 "у" */ - 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x73, 0x8c, 0xc3, + 0xe0, 0xf8, 0x76, 0x19, 0xce, 0x73, 0x8c, 0xc3, 0xf0, 0x7c, 0x1e, 0x7, 0x80, 0xe0, 0x30, 0x1c, 0x6, 0x3, 0x80, @@ -688,7 +688,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc0, 0x70, /* U+0447 "ч" */ - 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3b, 0xfc, 0xfe, + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0xfd, 0xfe, 0x7, 0x3, 0x81, 0xc0, 0xe0, /* U+0448 "ш" */ @@ -714,8 +714,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x1f, 0x87, 0xe1, 0xff, 0xef, 0xf0, /* U+044D "э" */ - 0x3e, 0x3f, 0xb8, 0xe0, 0x70, 0xf8, 0x7c, 0xf, - 0xc7, 0xe7, 0xbf, 0x8f, 0x80, + 0x1f, 0x1f, 0xe6, 0x3c, 0x7, 0xf, 0xc3, 0xf0, + 0x1d, 0x87, 0x73, 0xdf, 0xe1, 0xf0, /* U+044E "ю" */ 0xc7, 0xb3, 0xfc, 0xcf, 0x33, 0xfc, 0xff, 0x3c, @@ -1123,139 +1123,139 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 975, .adv_w = 192, .box_w = 5, .box_h = 3, .ofs_x = 3, .ofs_y = 13}, {.bitmap_index = 977, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, {.bitmap_index = 991, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1007, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1020, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1036, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1049, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1067, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, - {.bitmap_index = 1084, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1100, .adv_w = 192, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1120, .adv_w = 192, .box_w = 8, .box_h = 19, .ofs_x = 1, .ofs_y = -4}, - {.bitmap_index = 1139, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1157, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1177, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1191, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1204, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1217, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 2, .ofs_y = -4}, - {.bitmap_index = 1234, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, - {.bitmap_index = 1251, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1264, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1278, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1296, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1309, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1323, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1340, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1354, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, - {.bitmap_index = 1373, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1386, .adv_w = 192, .box_w = 9, .box_h = 18, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 1407, .adv_w = 192, .box_w = 3, .box_h = 18, .ofs_x = 5, .ofs_y = -2}, - {.bitmap_index = 1414, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 1437, .adv_w = 192, .box_w = 10, .box_h = 5, .ofs_x = 1, .ofs_y = 5}, - {.bitmap_index = 1444, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1462, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1480, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1498, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1514, .adv_w = 192, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1538, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1554, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1575, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1595, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1611, .adv_w = 192, .box_w = 9, .box_h = 19, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1633, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1651, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1669, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1687, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1703, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1719, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1735, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1753, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1771, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1789, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1807, .adv_w = 192, .box_w = 10, .box_h = 16, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 1827, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1845, .adv_w = 192, .box_w = 10, .box_h = 17, .ofs_x = 2, .ofs_y = -3}, - {.bitmap_index = 1867, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1883, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1901, .adv_w = 192, .box_w = 11, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 1923, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1944, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1962, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1980, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1996, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2014, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2032, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2046, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2062, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2076, .adv_w = 192, .box_w = 8, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2087, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 2107, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2120, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2137, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2151, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2164, .adv_w = 192, .box_w = 9, .box_h = 16, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2182, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2196, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2210, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2224, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2237, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2250, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2263, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 2, .ofs_y = -4}, - {.bitmap_index = 2280, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2293, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2307, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, - {.bitmap_index = 2326, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -4}, - {.bitmap_index = 2349, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2363, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = -3}, - {.bitmap_index = 2381, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2394, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2408, .adv_w = 192, .box_w = 11, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 2426, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2443, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2457, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 2471, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2484, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2498, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2511, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 2561, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 2610, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 2658, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 2708, .adv_w = 240, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2737, .adv_w = 360, .box_w = 23, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 2792, .adv_w = 280, .box_w = 18, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 2831, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 2874, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 2902, .adv_w = 280, .box_w = 18, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 2950, .adv_w = 280, .box_w = 18, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 2989, .adv_w = 280, .box_w = 18, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3028, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 3056, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3104, .adv_w = 360, .box_w = 23, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3148, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3209, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3262, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3281, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3331, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3367, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3415, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3455, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3498, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3536, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3574, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3612, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3650, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3688, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3724, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 3762, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3791, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 3829, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3895, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3944, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3994, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4054, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4107, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4168, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4223, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4276, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} + {.bitmap_index = 1007, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1021, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1037, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1050, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1068, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1085, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1101, .adv_w = 192, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1121, .adv_w = 192, .box_w = 8, .box_h = 19, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1140, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1158, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1178, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1192, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1205, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1218, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 2, .ofs_y = -4}, + {.bitmap_index = 1235, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1252, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1265, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1279, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1297, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1310, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1324, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1341, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1355, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1374, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1387, .adv_w = 192, .box_w = 9, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 1408, .adv_w = 192, .box_w = 3, .box_h = 18, .ofs_x = 5, .ofs_y = -2}, + {.bitmap_index = 1415, .adv_w = 192, .box_w = 9, .box_h = 18, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 1436, .adv_w = 192, .box_w = 10, .box_h = 5, .ofs_x = 1, .ofs_y = 5}, + {.bitmap_index = 1443, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1461, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1479, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1497, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1513, .adv_w = 192, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 1537, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1553, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1574, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1592, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1608, .adv_w = 192, .box_w = 9, .box_h = 19, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1630, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1648, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1666, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1684, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1700, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1716, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1732, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1750, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1768, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1786, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1804, .adv_w = 192, .box_w = 10, .box_h = 16, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 1824, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1842, .adv_w = 192, .box_w = 10, .box_h = 17, .ofs_x = 2, .ofs_y = -3}, + {.bitmap_index = 1864, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1880, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1898, .adv_w = 192, .box_w = 11, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 1920, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1941, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1959, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1977, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1993, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2011, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2029, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2043, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2059, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2073, .adv_w = 192, .box_w = 8, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2084, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 2104, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2117, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2134, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2148, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2161, .adv_w = 192, .box_w = 9, .box_h = 16, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2179, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2193, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2207, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2221, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2234, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2247, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2260, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 2, .ofs_y = -4}, + {.bitmap_index = 2277, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2291, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2305, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 2324, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 2347, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2361, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = -3}, + {.bitmap_index = 2379, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2392, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2406, .adv_w = 192, .box_w = 11, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 2424, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2441, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2455, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2469, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2483, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2497, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2510, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2560, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2609, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2657, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2707, .adv_w = 240, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2736, .adv_w = 360, .box_w = 23, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 2791, .adv_w = 280, .box_w = 18, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2830, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2873, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 2901, .adv_w = 280, .box_w = 18, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2949, .adv_w = 280, .box_w = 18, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2988, .adv_w = 280, .box_w = 18, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3027, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 3055, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3103, .adv_w = 360, .box_w = 23, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3147, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3208, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3261, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3280, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3330, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3366, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3414, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3454, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3497, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3535, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3573, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3611, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3649, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3687, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3723, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 3761, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3790, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 3828, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3894, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3943, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3993, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4053, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4106, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4167, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4222, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4275, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} }; /*--------------------- diff --git a/src/displayapp/fonts/open_sans_light.c b/src/displayapp/fonts/open_sans_light.c index 15f0ddf..84b7869 100644 --- a/src/displayapp/fonts/open_sans_light.c +++ b/src/displayapp/fonts/open_sans_light.c @@ -1248,7 +1248,7 @@ lv_font_t open_sans_light = { #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif -#if LV_VERSION_CHECK(7, 4, 0) +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 .underline_position = -11, .underline_thickness = 7, #endif -- cgit v0.10.2 From 13c66dd54b6ffcd3ea529457c3d5a0864ca1bdae Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 27 Feb 2022 14:53:06 +0200 Subject: Further updates to font readme. diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index c8fb0d3..2e900d1 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -29,9 +29,9 @@ static constexpr const char* newSymbol = "\xEF\x86\x85"; * Size: 20 * Bpp: 1 bit-per-pixel * Do not enable font compression or horizontal subpixel rendering -* Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7e, 0x410-0x44f` +* Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0x20-0x7e, 0x410-0x44f` * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following - range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf072` + range: `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf072` * Fix an error in the font conversion. Replace the following: @@ -50,29 +50,44 @@ with (there are two changes: 7f -> 7e and f7 -> b7) - ### Medium font * Name: jetbrains_mono_42 * Size: 42 * Bpp: 1 bit-per-pixel * Do not enable font compression or horizontal subpixel rendering -* Load the file `JetBrainsMono-Regular.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x25, 0x30-0x3a` +* Load the file `JetBrainsMono-Regular.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0x25, 0x30-0x3a` ### Large font * Name: jetbrains_mono_76 * Size: 76 * Bpp: 1 bit-per-pixel * Do not enable font compression or horizontal subpixel rendering -* Load the file `JetBrainsMono-Regular.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x25, 0x2D, 0x2F, 0x30-0x3a` +* Load the file `JetBrainsMono-Regular.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0x25, 0x2D, 0x2F, 0x30-0x3a` + +### Digital watchface font + +* Name: jetbrains_mono_extrabold_compressed +* Size: 80 +* Bpp: 1 bit-per-pixel +* Do not enable font compression or horizontal subpixel rendering +* Load the file `JetBrainsMono-ExtraBold.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0x30-0x3a` ### PineTimeStyle font -* Name : open_sans_light -* Size : 150 -* Bpp : 1 bit-per-pixel +* Name: open_sans_light +* Size: 150 +* Bpp: 1 bit-per-pixel +* Do not enable font compression or horizontal subpixel rendering +* Load the file `open_sans_light.tff` (use the file in this repo to ensure the version matches) and specify the following symbols: `0123456789` + +### Symbols font (Used in QuickSettings for example) + +* Name: lv_font_sys_48 +* Size: 48 +* Bpp: 1 bit-per-pixel * Do not enable font compression or horizontal subpixel rendering -* Load the file `open_sans_light.tff` (use the file in this repo to ensure the version matches) and specify the following symbols : `0123456789` +* Load the file `icons_sys_48.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0xe902, 0xe904-0xe907, 0xe90b-0xe90c` #### Navigation font diff --git a/src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c b/src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c index c9917e4..ab0a5c4 100644 --- a/src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c +++ b/src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c @@ -1,11 +1,15 @@ -#include "lvgl/lvgl.h" - /******************************************************************************* * Size: 80 px * Bpp: 1 * Opts: ******************************************************************************/ +#ifdef LV_LVGL_H_INCLUDE_SIMPLE +#include "lvgl.h" +#else +#include "lvgl/lvgl.h" +#endif + #ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSED #define JETBRAINS_MONO_EXTRABOLD_COMPRESSED 1 #endif @@ -17,418 +21,412 @@ *----------------*/ /*Store the image of the glyphs*/ -static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { - /* U+30 "0" */ - 0x0, 0x1, 0xff, 0xc0, 0x0, 0x0, 0xf, 0xff, - 0xfe, 0x0, 0x0, 0x1f, 0xff, 0xff, 0xc0, 0x0, - 0x3f, 0xff, 0xff, 0xf8, 0x0, 0x3f, 0xff, 0xff, - 0xfe, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x3f, - 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xff, - 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, - 0xff, 0xff, 0xff, 0x1f, 0xff, 0xe0, 0x3f, 0xff, - 0xcf, 0xff, 0xc0, 0x7, 0xff, 0xe7, 0xff, 0xc0, - 0x1, 0xff, 0xf7, 0xff, 0xc0, 0x0, 0x7f, 0xff, - 0xff, 0xe0, 0x0, 0x3f, 0xff, 0xff, 0xe0, 0x0, - 0xf, 0xff, 0xff, 0xf0, 0x0, 0x7, 0xff, 0xff, - 0xf8, 0x0, 0x3, 0xff, 0xff, 0xfc, 0x0, 0x1, - 0xff, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0xff, - 0x0, 0x0, 0x7f, 0xff, 0xff, 0x80, 0x0, 0x3f, - 0xff, 0xff, 0xc0, 0x70, 0x1f, 0xff, 0xff, 0xe0, - 0x7c, 0xf, 0xff, 0xff, 0xf0, 0x7f, 0x7, 0xff, - 0xff, 0xf8, 0x3f, 0x83, 0xff, 0xff, 0xfc, 0x1f, - 0xc1, 0xff, 0xff, 0xfe, 0xf, 0xe0, 0xff, 0xff, - 0xff, 0x7, 0xf0, 0x7f, 0xff, 0xff, 0x83, 0xf8, - 0x3f, 0xff, 0xff, 0xc1, 0xfc, 0x1f, 0xff, 0xff, - 0xe0, 0xfe, 0xf, 0xff, 0xff, 0xf0, 0x7f, 0x7, - 0xff, 0xff, 0xf8, 0x3f, 0x83, 0xff, 0xff, 0xfc, - 0x1f, 0xc1, 0xff, 0xff, 0xfe, 0xf, 0xe0, 0xff, - 0xff, 0xff, 0x3, 0xe0, 0x7f, 0xff, 0xff, 0x80, - 0xe0, 0x3f, 0xff, 0xff, 0xc0, 0x0, 0x1f, 0xff, - 0xff, 0xe0, 0x0, 0xf, 0xff, 0xff, 0xf0, 0x0, - 0x7, 0xff, 0xff, 0xf8, 0x0, 0x3, 0xff, 0xff, - 0xfc, 0x0, 0x1, 0xff, 0xff, 0xfe, 0x0, 0x0, - 0xff, 0xff, 0xff, 0x80, 0x0, 0xff, 0xff, 0xff, - 0xc0, 0x0, 0x7f, 0xf9, 0xff, 0xf0, 0x0, 0x7f, - 0xfc, 0xff, 0xfc, 0x0, 0x7f, 0xfe, 0x7f, 0xff, - 0x80, 0xff, 0xfe, 0x1f, 0xff, 0xff, 0xff, 0xff, - 0x7, 0xff, 0xff, 0xff, 0xff, 0x3, 0xff, 0xff, - 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0x80, - 0x3f, 0xff, 0xff, 0xff, 0x80, 0xf, 0xff, 0xff, - 0xff, 0x80, 0x3, 0xff, 0xff, 0xff, 0x0, 0x0, - 0x7f, 0xff, 0xff, 0x0, 0x0, 0xf, 0xff, 0xfc, - 0x0, 0x0, 0x0, 0x7f, 0xf0, 0x0, 0x0, - - /* U+31 "1" */ - 0x0, 0x7, 0xff, 0xe0, 0x0, 0x0, 0xf, 0xff, - 0xe0, 0x0, 0x0, 0x3f, 0xff, 0xe0, 0x0, 0x0, - 0x7f, 0xff, 0xe0, 0x0, 0x1, 0xff, 0xff, 0xe0, - 0x0, 0x3, 0xff, 0xff, 0xe0, 0x0, 0x7, 0xff, - 0xff, 0xe0, 0x0, 0x1f, 0xff, 0xff, 0xe0, 0x0, - 0x3f, 0xff, 0xff, 0xe0, 0x0, 0x7f, 0xff, 0xff, - 0xe0, 0x0, 0x7f, 0xff, 0xff, 0xe0, 0x0, 0x7f, - 0xfd, 0xff, 0xe0, 0x0, 0x7f, 0xf9, 0xff, 0xe0, - 0x0, 0x7f, 0xf1, 0xff, 0xe0, 0x0, 0x7f, 0xe1, - 0xff, 0xe0, 0x0, 0x7f, 0x81, 0xff, 0xe0, 0x0, - 0x7f, 0x1, 0xff, 0xe0, 0x0, 0x7c, 0x1, 0xff, - 0xe0, 0x0, 0x78, 0x1, 0xff, 0xe0, 0x0, 0x60, - 0x1, 0xff, 0xe0, 0x0, 0x40, 0x1, 0xff, 0xe0, - 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, - 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, - 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, - 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, - 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, - 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, - 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, - 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, - 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, - 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, - 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, - 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, - 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, - 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, - 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, - 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x1, - 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+0030 "0" */ + 0x0, 0x3, 0xff, 0x80, 0x0, 0x0, 0x3f, 0xff, + 0xe0, 0x0, 0x1, 0xff, 0xff, 0xf0, 0x0, 0xf, + 0xff, 0xff, 0xf8, 0x0, 0x3f, 0xff, 0xff, 0xf8, + 0x0, 0xff, 0xff, 0xff, 0xf8, 0x3, 0xff, 0xff, + 0xff, 0xf8, 0xf, 0xff, 0xff, 0xff, 0xf8, 0x3f, + 0xff, 0xff, 0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, + 0xf1, 0xff, 0xfc, 0x7, 0xff, 0xf3, 0xff, 0xe0, + 0x3, 0xff, 0xe7, 0xff, 0x80, 0x3, 0xff, 0xdf, + 0xfe, 0x0, 0x3, 0xff, 0xff, 0xfc, 0x0, 0x3, + 0xff, 0xff, 0xf0, 0x0, 0x7, 0xff, 0xff, 0xe0, + 0x0, 0xf, 0xff, 0xff, 0xc0, 0x0, 0x1f, 0xff, + 0xff, 0x80, 0x0, 0x3f, 0xff, 0xff, 0x0, 0x0, + 0x7f, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0xfc, + 0x0, 0x1, 0xff, 0xff, 0xf8, 0x0, 0x3, 0xff, + 0xff, 0xf0, 0x0, 0x7, 0xff, 0xff, 0xe0, 0x7c, + 0xf, 0xff, 0xff, 0xc1, 0xfe, 0x1f, 0xff, 0xff, + 0x87, 0xfc, 0x3f, 0xff, 0xff, 0x1f, 0xfc, 0x7f, + 0xff, 0xfe, 0x3f, 0xf8, 0xff, 0xff, 0xfc, 0x7f, + 0xf1, 0xff, 0xff, 0xf8, 0xff, 0xe3, 0xff, 0xff, + 0xf1, 0xff, 0xc7, 0xff, 0xff, 0xe1, 0xff, 0xf, + 0xff, 0xff, 0xc1, 0xfc, 0x1f, 0xff, 0xff, 0x81, + 0xf0, 0x3f, 0xff, 0xff, 0x0, 0x0, 0x7f, 0xff, + 0xfe, 0x0, 0x0, 0xff, 0xff, 0xfc, 0x0, 0x1, + 0xff, 0xff, 0xf8, 0x0, 0x3, 0xff, 0xff, 0xf0, + 0x0, 0x7, 0xff, 0xff, 0xe0, 0x0, 0xf, 0xff, + 0xff, 0xc0, 0x0, 0x1f, 0xff, 0xff, 0x80, 0x0, + 0x3f, 0xff, 0xff, 0x0, 0x0, 0x7f, 0xff, 0xfe, + 0x0, 0x0, 0xff, 0xff, 0xfe, 0x0, 0x1, 0xff, + 0xff, 0xfc, 0x0, 0x7, 0xff, 0xbf, 0xfc, 0x0, + 0x1f, 0xfe, 0x7f, 0xfc, 0x0, 0x7f, 0xfc, 0xff, + 0xfe, 0x3, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, + 0xe1, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, + 0xff, 0xff, 0x1, 0xff, 0xff, 0xff, 0xfc, 0x1, + 0xff, 0xff, 0xff, 0xf0, 0x1, 0xff, 0xff, 0xff, + 0xc0, 0x1, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, + 0xff, 0xf8, 0x0, 0x0, 0x7f, 0xff, 0xc0, 0x0, + 0x0, 0x1f, 0xfc, 0x0, 0x0, + + /* U+0031 "1" */ + 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x3f, 0xff, + 0x80, 0x0, 0x1, 0xff, 0xfe, 0x0, 0x0, 0x1f, + 0xff, 0xf8, 0x0, 0x0, 0xff, 0xff, 0xe0, 0x0, + 0x7, 0xff, 0xff, 0x80, 0x0, 0x7f, 0xff, 0xfe, + 0x0, 0x3, 0xff, 0xff, 0xf8, 0x0, 0x3f, 0xff, + 0xff, 0xe0, 0x1, 0xff, 0xff, 0xff, 0x80, 0xf, + 0xff, 0xff, 0xfe, 0x0, 0x3f, 0xff, 0xff, 0xf8, + 0x0, 0xff, 0xfd, 0xff, 0xe0, 0x3, 0xff, 0xc7, + 0xff, 0x80, 0xf, 0xfe, 0x1f, 0xfe, 0x0, 0x3f, + 0xe0, 0x7f, 0xf8, 0x0, 0xff, 0x1, 0xff, 0xe0, + 0x3, 0xf8, 0x7, 0xff, 0x80, 0xf, 0x80, 0x1f, + 0xfe, 0x0, 0x3c, 0x0, 0x7f, 0xf8, 0x0, 0xe0, + 0x1, 0xff, 0xe0, 0x2, 0x0, 0x7, 0xff, 0x80, + 0x0, 0x0, 0x1f, 0xfe, 0x0, 0x0, 0x0, 0x7f, + 0xf8, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, + 0x7, 0xff, 0x80, 0x0, 0x0, 0x1f, 0xfe, 0x0, + 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x0, 0x1, 0xff, + 0xe0, 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, + 0x1f, 0xfe, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, + 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x7, 0xff, + 0x80, 0x0, 0x0, 0x1f, 0xfe, 0x0, 0x0, 0x0, + 0x7f, 0xf8, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, + 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, 0x1f, 0xfe, + 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x0, 0x1, + 0xff, 0xe0, 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, + 0x0, 0x1f, 0xfe, 0x0, 0x0, 0x0, 0x7f, 0xf8, + 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x7, + 0xff, 0x80, 0x0, 0x0, 0x1f, 0xfe, 0x0, 0x0, + 0x0, 0x7f, 0xf8, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, + 0xc0, - /* U+32 "2" */ - 0x0, 0x1, 0xff, 0xc0, 0x0, 0x0, 0xf, 0xff, - 0xfc, 0x0, 0x0, 0x1f, 0xff, 0xff, 0x80, 0x0, - 0x3f, 0xff, 0xff, 0xf0, 0x0, 0x3f, 0xff, 0xff, - 0xfc, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x0, 0x3f, - 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0xff, - 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, - 0xff, 0xff, 0xfe, 0x1f, 0xff, 0xe0, 0x7f, 0xff, - 0x8f, 0xff, 0xc0, 0xf, 0xff, 0xc7, 0xff, 0xc0, - 0x3, 0xff, 0xe7, 0xff, 0xc0, 0x0, 0xff, 0xfb, - 0xff, 0xc0, 0x0, 0x7f, 0xfd, 0xff, 0xe0, 0x0, - 0x1f, 0xfe, 0xff, 0xf0, 0x0, 0xf, 0xff, 0x0, - 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, 0x3, - 0xff, 0xc0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, - 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x0, 0xff, - 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x0, - 0x0, 0x7f, 0xfc, 0x0, 0x0, 0x0, 0x3f, 0xfe, - 0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, - 0x3f, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xff, 0x0, - 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, 0x3f, - 0xff, 0x80, 0x0, 0x0, 0x7f, 0xff, 0x80, 0x0, - 0x0, 0x7f, 0xff, 0x80, 0x0, 0x0, 0x7f, 0xff, - 0x80, 0x0, 0x0, 0x7f, 0xff, 0x80, 0x0, 0x0, - 0xff, 0xff, 0x80, 0x0, 0x0, 0xff, 0xff, 0x80, - 0x0, 0x0, 0xff, 0xff, 0x80, 0x0, 0x0, 0xff, - 0xff, 0x80, 0x0, 0x1, 0xff, 0xff, 0x0, 0x0, - 0x1, 0xff, 0xff, 0x0, 0x0, 0x1, 0xff, 0xff, - 0x0, 0x0, 0x1, 0xff, 0xfe, 0x0, 0x0, 0x3, - 0xff, 0xfe, 0x0, 0x0, 0x3, 0xff, 0xfe, 0x0, - 0x0, 0x3, 0xff, 0xfc, 0x0, 0x0, 0x3, 0xff, - 0xfc, 0x0, 0x0, 0x1, 0xff, 0xf0, 0x0, 0x0, - 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, - 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, - 0xdf, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, - 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xfb, - 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, - 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, + /* U+0032 "2" */ + 0x0, 0x1, 0xff, 0x80, 0x0, 0x0, 0x3f, 0xff, + 0xe0, 0x0, 0x1, 0xff, 0xff, 0xf8, 0x0, 0xf, + 0xff, 0xff, 0xf8, 0x0, 0x3f, 0xff, 0xff, 0xf8, + 0x0, 0xff, 0xff, 0xff, 0xfc, 0x3, 0xff, 0xff, + 0xff, 0xf8, 0xf, 0xff, 0xff, 0xff, 0xf8, 0x1f, + 0xff, 0xff, 0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xfc, + 0xf, 0xff, 0xe7, 0xff, 0xe0, 0xf, 0xff, 0xcf, + 0xff, 0x80, 0xf, 0xff, 0xff, 0xfe, 0x0, 0xf, + 0xff, 0xff, 0xfc, 0x0, 0x1f, 0xff, 0xff, 0xf0, + 0x0, 0x1f, 0xff, 0xff, 0xe0, 0x0, 0x3f, 0xff, + 0xff, 0xc0, 0x0, 0x7f, 0xf8, 0x0, 0x0, 0x0, + 0xff, 0xf0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, + 0x0, 0x3, 0xff, 0xc0, 0x0, 0x0, 0xf, 0xff, + 0x0, 0x0, 0x0, 0x1f, 0xfe, 0x0, 0x0, 0x0, + 0x7f, 0xfc, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, + 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0xf, 0xff, + 0xc0, 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, + 0xff, 0xfc, 0x0, 0x0, 0x3, 0xff, 0xf8, 0x0, + 0x0, 0xf, 0xff, 0xe0, 0x0, 0x0, 0x3f, 0xff, + 0x80, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0x3, + 0xff, 0xfc, 0x0, 0x0, 0xf, 0xff, 0xf0, 0x0, + 0x0, 0x3f, 0xff, 0xc0, 0x0, 0x0, 0xff, 0xff, + 0x0, 0x0, 0x3, 0xff, 0xfc, 0x0, 0x0, 0xf, + 0xff, 0xf0, 0x0, 0x0, 0x3f, 0xff, 0xc0, 0x0, + 0x0, 0xff, 0xff, 0x0, 0x0, 0x3, 0xff, 0xf8, + 0x0, 0x0, 0xf, 0xff, 0xe0, 0x0, 0x0, 0x3f, + 0xff, 0x80, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, + 0x3, 0xff, 0xf8, 0x0, 0x0, 0xf, 0xff, 0xe0, + 0x0, 0x0, 0x3f, 0xff, 0x80, 0x0, 0x0, 0xff, + 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, + 0xfb, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, + 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, - 0xff, 0xc0, + 0xff, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xfb, + 0xff, 0xff, 0xff, 0xff, 0xf0, - /* U+33 "3" */ - 0x1f, 0xff, 0xff, 0xff, 0xfe, 0xf, 0xff, 0xff, - 0xff, 0xff, 0x7, 0xff, 0xff, 0xff, 0xff, 0x83, - 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, - 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, + /* U+0033 "3" */ + 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xff, + 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xe0, 0xff, + 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, + 0x83, 0xff, 0xff, 0xff, 0xff, 0x7, 0xff, 0xff, + 0xff, 0xfe, 0xf, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, - 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0xf, 0xff, - 0xff, 0x8f, 0xff, 0x0, 0x0, 0x0, 0xf, 0xff, - 0x80, 0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, 0x0, - 0x1f, 0xff, 0x80, 0x0, 0x0, 0x3f, 0xff, 0x80, - 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, 0x3f, - 0xff, 0x0, 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, - 0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xfe, - 0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, - 0x3f, 0xfe, 0x0, 0x0, 0x0, 0x3f, 0xfc, 0x0, - 0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, 0x0, 0xf, - 0xff, 0xf8, 0x0, 0x0, 0x7, 0xff, 0xff, 0x0, - 0x0, 0x3, 0xff, 0xff, 0xe0, 0x0, 0x1, 0xff, - 0xff, 0xf8, 0x0, 0x0, 0xff, 0xff, 0xfe, 0x0, - 0x0, 0x7f, 0xff, 0xff, 0x80, 0x0, 0x3f, 0xff, - 0xff, 0xe0, 0x0, 0x1f, 0xff, 0xff, 0xf0, 0x0, - 0xf, 0xff, 0xff, 0xfc, 0x0, 0x0, 0x0, 0xff, - 0xfe, 0x0, 0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, - 0x0, 0x7, 0xff, 0xc0, 0x0, 0x0, 0x1, 0xff, - 0xe0, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, - 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0x1f, 0xfe, - 0x0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, - 0x7, 0xff, 0x80, 0x0, 0x0, 0x3, 0xff, 0xc0, - 0x0, 0x0, 0x1, 0xff, 0xff, 0xfe, 0x0, 0x0, - 0xff, 0xff, 0xff, 0x80, 0x0, 0xff, 0xff, 0xff, - 0xc0, 0x0, 0x7f, 0xf9, 0xff, 0xf0, 0x0, 0x7f, - 0xfc, 0xff, 0xfc, 0x0, 0x7f, 0xfe, 0x7f, 0xff, - 0x80, 0xff, 0xfe, 0x1f, 0xff, 0xff, 0xff, 0xff, - 0xf, 0xff, 0xff, 0xff, 0xff, 0x3, 0xff, 0xff, - 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0x80, - 0x3f, 0xff, 0xff, 0xff, 0x80, 0xf, 0xff, 0xff, - 0xff, 0x80, 0x3, 0xff, 0xff, 0xff, 0x0, 0x0, - 0x7f, 0xff, 0xff, 0x0, 0x0, 0xf, 0xff, 0xfc, - 0x0, 0x0, 0x0, 0x7f, 0xf0, 0x0, 0x0, + 0xf0, 0x0, 0x0, 0x3, 0xff, 0xc0, 0x0, 0x0, + 0xf, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xfc, 0x0, + 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x3, 0xff, + 0xc0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, + 0x7f, 0xf8, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, + 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, 0x1f, 0xfe, + 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x0, 0x1, + 0xff, 0xf8, 0x0, 0x0, 0x3, 0xff, 0xfe, 0x0, + 0x0, 0x7, 0xff, 0xff, 0x0, 0x0, 0xf, 0xff, + 0xff, 0x80, 0x0, 0x1f, 0xff, 0xff, 0x80, 0x0, + 0x3f, 0xff, 0xff, 0x80, 0x0, 0x7f, 0xff, 0xff, + 0x80, 0x0, 0xff, 0xff, 0xff, 0x80, 0x1, 0xff, + 0xff, 0xff, 0x0, 0x3, 0xff, 0xff, 0xff, 0x0, + 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x7f, + 0xfc, 0x0, 0x0, 0x0, 0x7f, 0xfc, 0x0, 0x0, + 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0xff, 0xf0, + 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x3, + 0xff, 0xc0, 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, + 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, 0x1f, 0xfe, + 0x0, 0x0, 0x0, 0x3f, 0xff, 0xff, 0xc0, 0x0, + 0x7f, 0xff, 0xff, 0x80, 0x0, 0xff, 0xff, 0xff, + 0x0, 0x1, 0xff, 0xff, 0xff, 0x0, 0x7, 0xff, + 0xff, 0xfe, 0x0, 0xf, 0xff, 0xbf, 0xfe, 0x0, + 0x3f, 0xfe, 0x7f, 0xff, 0x1, 0xff, 0xfc, 0xff, + 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, + 0xe0, 0xff, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, + 0xff, 0xff, 0x1, 0xff, 0xff, 0xff, 0xfc, 0x1, + 0xff, 0xff, 0xff, 0xf0, 0x0, 0xff, 0xff, 0xff, + 0x80, 0x0, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x7f, + 0xff, 0xf0, 0x0, 0x0, 0xf, 0xfe, 0x0, 0x0, - /* U+34 "4" */ + /* U+0034 "4" */ 0x0, 0x0, 0x3, 0xff, 0xf0, 0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, 0x0, 0x7f, 0xfc, 0x0, 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x1f, 0xff, 0x80, - 0x0, 0x0, 0xff, 0xfc, 0x0, 0x0, 0x3, 0xff, - 0xe0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, - 0xff, 0xfc, 0x0, 0x0, 0x7, 0xff, 0xe0, 0x0, + 0x0, 0x0, 0x7f, 0xfc, 0x0, 0x0, 0x3, 0xff, + 0xe0, 0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, 0x0, + 0xff, 0xfc, 0x0, 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, 0xff, 0xfc, - 0x0, 0x0, 0x7, 0xff, 0xe0, 0x0, 0x0, 0x3f, - 0xff, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, - 0x7, 0xff, 0xe0, 0x0, 0x0, 0x3f, 0xff, 0x0, + 0x0, 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x1f, + 0xff, 0x0, 0x0, 0x0, 0xff, 0xfc, 0x0, 0x0, + 0x7, 0xff, 0xe0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x7, 0xff, - 0xc0, 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, 0x1, - 0xff, 0xf8, 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, - 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x1, 0xff, 0xf8, - 0x0, 0x0, 0xf, 0xff, 0xc0, 0x0, 0x0, 0x3f, - 0xfe, 0x0, 0xff, 0xf1, 0xff, 0xf0, 0x3, 0xff, - 0xcf, 0xff, 0xc0, 0xf, 0xff, 0x7f, 0xfe, 0x0, - 0x3f, 0xfd, 0xff, 0xf0, 0x0, 0xff, 0xff, 0xff, + 0xe0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, + 0xff, 0xf8, 0x0, 0x0, 0x7, 0xff, 0xe0, 0x0, + 0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, 0xff, 0xf8, + 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, 0x0, 0x3f, + 0xff, 0x0, 0xff, 0xf0, 0xff, 0xf8, 0x3, 0xff, + 0xc7, 0xff, 0xc0, 0xf, 0xff, 0x3f, 0xff, 0x0, + 0x3f, 0xfd, 0xff, 0xf8, 0x0, 0xff, 0xf7, 0xff, 0xc0, 0x3, 0xff, 0xff, 0xfe, 0x0, 0xf, 0xff, - 0xff, 0xf0, 0x0, 0x3f, 0xff, 0xff, 0x80, 0x0, + 0xff, 0xf8, 0x0, 0x3f, 0xff, 0xff, 0xc0, 0x0, 0xff, 0xff, 0xfe, 0x0, 0x3, 0xff, 0xff, 0xf8, 0x0, 0xf, 0xff, 0xff, 0xe0, 0x0, 0x3f, 0xff, + 0xff, 0x80, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, - 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, 0x3f, + 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x3, 0xff, 0xc0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x3, 0xff, 0xc0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xfc, 0x0, - 0x0, 0x0, 0xff, 0xf0, + 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x3, 0xff, + 0xc0, - /* U+35 "5" */ - 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x1f, 0xff, 0xff, - 0xff, 0xff, 0xf, 0xff, 0xff, 0xff, 0xff, 0x87, - 0xff, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xff, - 0xff, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, - 0xff, 0xff, 0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, - 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x1f, 0xff, - 0xff, 0xff, 0xff, 0xf, 0xff, 0x0, 0x0, 0x0, - 0x7, 0xff, 0x80, 0x0, 0x0, 0x3, 0xff, 0xc0, - 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x0, - 0xff, 0xf0, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, - 0x0, 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0x1f, - 0xfe, 0x0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, - 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, 0x3, 0xff, - 0xc0, 0x7f, 0x80, 0x1, 0xff, 0xe1, 0xff, 0xf8, - 0x0, 0xff, 0xf1, 0xff, 0xff, 0x0, 0x7f, 0xf9, - 0xff, 0xff, 0xc0, 0x3f, 0xfd, 0xff, 0xff, 0xf0, - 0x1f, 0xff, 0xff, 0xff, 0xfc, 0xf, 0xff, 0xff, - 0xff, 0xff, 0x7, 0xff, 0xff, 0xff, 0xff, 0xc3, - 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xfc, 0x7, - 0xff, 0xf8, 0xff, 0xf8, 0x0, 0xff, 0xfc, 0x0, - 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, 0xf, - 0xff, 0x80, 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, - 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x0, 0xff, - 0xf0, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x0, - 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0x1f, 0xfe, - 0x0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, - 0x7, 0xff, 0x80, 0x0, 0x0, 0x3, 0xff, 0xc0, - 0x0, 0x0, 0x1, 0xff, 0xff, 0xff, 0x0, 0x1, - 0xff, 0xff, 0xff, 0x80, 0x0, 0xff, 0xfb, 0xff, - 0xe0, 0x0, 0xff, 0xf9, 0xff, 0xf8, 0x0, 0xff, - 0xfc, 0xff, 0xff, 0x81, 0xff, 0xfe, 0x3f, 0xff, - 0xff, 0xff, 0xfe, 0x1f, 0xff, 0xff, 0xff, 0xff, - 0x7, 0xff, 0xff, 0xff, 0xff, 0x1, 0xff, 0xff, - 0xff, 0xff, 0x0, 0x7f, 0xff, 0xff, 0xff, 0x0, - 0x1f, 0xff, 0xff, 0xff, 0x0, 0x7, 0xff, 0xff, - 0xff, 0x0, 0x0, 0xff, 0xff, 0xfe, 0x0, 0x0, - 0x1f, 0xff, 0xfc, 0x0, 0x0, 0x0, 0xff, 0xe0, - 0x0, 0x0, + /* U+0035 "5" */ + 0x7f, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, + 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, + 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xf1, + 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, + 0xff, 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, + 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xc7, + 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0x0, 0x0, + 0x0, 0x7f, 0xf8, 0x0, 0x0, 0x1, 0xff, 0xe0, + 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, 0x1f, + 0xfe, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x0, + 0x1, 0xff, 0xe0, 0x0, 0x0, 0x7, 0xff, 0x80, + 0x0, 0x0, 0x1f, 0xfe, 0x0, 0x0, 0x0, 0x7f, + 0xf8, 0x1f, 0xf0, 0x1, 0xff, 0xe1, 0xff, 0xf0, + 0x7, 0xff, 0x9f, 0xff, 0xf0, 0x1f, 0xfe, 0xff, + 0xff, 0xe0, 0x7f, 0xfb, 0xff, 0xff, 0xc1, 0xff, + 0xff, 0xff, 0xff, 0x87, 0xff, 0xff, 0xff, 0xff, + 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, + 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, + 0xf0, 0x3f, 0xff, 0x9f, 0xff, 0x0, 0x3f, 0xfe, + 0x7f, 0xf8, 0x0, 0x7f, 0xfc, 0x0, 0x0, 0x1, + 0xff, 0xf0, 0x0, 0x0, 0x3, 0xff, 0xc0, 0x0, + 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xfc, + 0x0, 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x3, + 0xff, 0xc0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, + 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0xff, 0xf0, + 0x0, 0x0, 0x3, 0xff, 0xc0, 0x0, 0x0, 0xf, + 0xff, 0xff, 0xf0, 0x0, 0x3f, 0xff, 0xff, 0xc0, + 0x0, 0xff, 0xff, 0xff, 0x0, 0x7, 0xff, 0xff, + 0xfe, 0x0, 0x1f, 0xfe, 0xff, 0xfc, 0x0, 0xff, + 0xf9, 0xff, 0xfc, 0xf, 0xff, 0xe7, 0xff, 0xff, + 0xff, 0xff, 0xf, 0xff, 0xff, 0xff, 0xfc, 0x3f, + 0xff, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xff, + 0x80, 0xff, 0xff, 0xff, 0xfc, 0x1, 0xff, 0xff, + 0xff, 0xe0, 0x3, 0xff, 0xff, 0xfe, 0x0, 0x3, + 0xff, 0xff, 0xf0, 0x0, 0x3, 0xff, 0xff, 0x0, + 0x0, 0x1, 0xff, 0xc0, 0x0, - /* U+36 "6" */ - 0x0, 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0x7, - 0xff, 0xe0, 0x0, 0x0, 0x3, 0xff, 0xf0, 0x0, - 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x7f, - 0xfe, 0x0, 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, - 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0x7, 0xff, - 0xc0, 0x0, 0x0, 0x3, 0xff, 0xf0, 0x0, 0x0, + /* U+0036 "6" */ + 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, 0x1f, + 0xff, 0x0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, + 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0xf, 0xff, + 0x80, 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, + 0x7, 0xff, 0xc0, 0x0, 0x0, 0x7, 0xff, 0xc0, + 0x0, 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x3, + 0xff, 0xe0, 0x0, 0x0, 0x1, 0xff, 0xf0, 0x0, + 0x0, 0x1, 0xff, 0xf0, 0x0, 0x0, 0x0, 0xff, + 0xf0, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xfc, - 0x0, 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, - 0xf, 0xff, 0x80, 0x0, 0x0, 0x7, 0xff, 0xc0, - 0x0, 0x0, 0x3, 0xff, 0xf0, 0x0, 0x0, 0x1, - 0xff, 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xfc, 0x0, - 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, 0xf, - 0xff, 0x80, 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, - 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x0, 0xff, - 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xfc, 0x3f, 0xc0, - 0x0, 0x1f, 0xfe, 0x3f, 0xfe, 0x0, 0xf, 0xff, - 0xbf, 0xff, 0xe0, 0x3, 0xff, 0xdf, 0xff, 0xfc, - 0x1, 0xff, 0xef, 0xff, 0xff, 0x80, 0x7f, 0xff, - 0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xfe, - 0xf, 0xff, 0xff, 0xff, 0xff, 0x87, 0xff, 0xff, - 0xff, 0xff, 0xf1, 0xff, 0xff, 0x3, 0xff, 0xfc, - 0x7f, 0xff, 0x0, 0x3f, 0xff, 0x9f, 0xff, 0x0, - 0x3, 0xff, 0xef, 0xff, 0xc0, 0x0, 0xff, 0xfb, - 0xff, 0xe0, 0x0, 0x1f, 0xff, 0xff, 0xf8, 0x0, - 0x7, 0xff, 0xff, 0xfc, 0x0, 0x0, 0xff, 0xff, - 0xff, 0x0, 0x0, 0x3f, 0xff, 0xff, 0xc0, 0x0, - 0xf, 0xff, 0xff, 0xf0, 0x0, 0x3, 0xff, 0xff, - 0xfc, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, - 0x3f, 0xff, 0xff, 0xe0, 0x0, 0x1f, 0xff, 0x7f, - 0xf8, 0x0, 0x7, 0xff, 0xdf, 0xfe, 0x0, 0x3, - 0xff, 0xe7, 0xff, 0xc0, 0x0, 0xff, 0xf9, 0xff, - 0xfc, 0x0, 0xff, 0xfe, 0x3f, 0xff, 0xc0, 0xff, - 0xff, 0xf, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, - 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xff, - 0xf0, 0x7, 0xff, 0xff, 0xff, 0xf8, 0x0, 0xff, - 0xff, 0xff, 0xfe, 0x0, 0x1f, 0xff, 0xff, 0xfe, - 0x0, 0x3, 0xff, 0xff, 0xff, 0x0, 0x0, 0x3f, - 0xff, 0xff, 0x0, 0x0, 0x3, 0xff, 0xff, 0x0, - 0x0, 0x0, 0xf, 0xfc, 0x0, 0x0, - - /* U+37 "7" */ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x0, 0x0, 0x0, 0x7f, 0xfc, 0x0, 0x0, 0x0, + 0x3f, 0xfc, 0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, + 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, 0x1f, + 0xff, 0x0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, + 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0xf, 0xff, + 0x87, 0xf8, 0x0, 0x7, 0xff, 0x8f, 0xff, 0x0, + 0x7, 0xff, 0xcf, 0xff, 0xe0, 0x3, 0xff, 0xdf, + 0xff, 0xf8, 0x3, 0xff, 0xef, 0xff, 0xfe, 0x1, + 0xff, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, + 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x7f, + 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0x81, 0xff, + 0xff, 0x3f, 0xff, 0x0, 0x3f, 0xff, 0x9f, 0xff, + 0x0, 0x7, 0xff, 0xdf, 0xff, 0x80, 0x3, 0xff, + 0xef, 0xff, 0x80, 0x0, 0xff, 0xff, 0xff, 0xc0, + 0x0, 0x7f, 0xff, 0xff, 0xc0, 0x0, 0x1f, 0xff, + 0xff, 0xe0, 0x0, 0xf, 0xff, 0xff, 0xf0, 0x0, + 0x7, 0xff, 0xff, 0xf8, 0x0, 0x3, 0xff, 0xff, + 0xfc, 0x0, 0x1, 0xff, 0xff, 0xfe, 0x0, 0x0, + 0xff, 0xff, 0xff, 0x80, 0x0, 0xff, 0xfb, 0xff, + 0xc0, 0x0, 0x7f, 0xfd, 0xff, 0xf0, 0x0, 0x7f, + 0xfc, 0xff, 0xf8, 0x0, 0x3f, 0xfe, 0x3f, 0xfe, + 0x0, 0x3f, 0xff, 0x1f, 0xff, 0xc0, 0x7f, 0xff, + 0x7, 0xff, 0xff, 0xff, 0xff, 0x83, 0xff, 0xff, + 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0x80, + 0x3f, 0xff, 0xff, 0xff, 0xc0, 0xf, 0xff, 0xff, + 0xff, 0xc0, 0x3, 0xff, 0xff, 0xff, 0x80, 0x0, + 0xff, 0xff, 0xff, 0x80, 0x0, 0x1f, 0xff, 0xff, + 0x0, 0x0, 0x3, 0xff, 0xfe, 0x0, 0x0, 0x0, + 0x3f, 0xf8, 0x0, 0x0, + + /* U+0037 "7" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xe0, 0x0, 0xf, 0xff, 0xff, 0xe0, 0x0, 0x1f, - 0xfe, 0xff, 0xe0, 0x0, 0x1f, 0xfe, 0xff, 0xe0, - 0x0, 0x3f, 0xfc, 0xff, 0xe0, 0x0, 0x3f, 0xfc, - 0xff, 0xe0, 0x0, 0x7f, 0xf8, 0xff, 0xe0, 0x0, - 0x7f, 0xf8, 0xff, 0xe0, 0x0, 0xff, 0xf8, 0xff, - 0xe0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x1, 0xff, - 0xf0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, - 0x3, 0xff, 0xe0, 0x0, 0x0, 0x3, 0xff, 0xc0, - 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, 0x0, 0x7, - 0xff, 0x80, 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, - 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0xf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfc, 0x0, 0x3, 0xff, + 0xff, 0xfe, 0x0, 0x1, 0xff, 0xef, 0xff, 0x0, + 0x1, 0xff, 0xf7, 0xff, 0x80, 0x0, 0xff, 0xf3, + 0xff, 0xc0, 0x0, 0xff, 0xf9, 0xff, 0xe0, 0x0, + 0x7f, 0xfc, 0xff, 0xf0, 0x0, 0x7f, 0xfc, 0x7f, + 0xf8, 0x0, 0x3f, 0xfe, 0x3f, 0xfc, 0x0, 0x3f, + 0xfe, 0x1f, 0xfe, 0x0, 0x1f, 0xff, 0x0, 0x0, + 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, 0xf, 0xff, + 0x80, 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, + 0x7, 0xff, 0xc0, 0x0, 0x0, 0x3, 0xff, 0xe0, + 0x0, 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x1, + 0xff, 0xf0, 0x0, 0x0, 0x1, 0xff, 0xf0, 0x0, + 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0xff, + 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xfc, 0x0, 0x0, + 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, - 0x1f, 0xfe, 0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, - 0x0, 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x0, 0x7f, - 0xfc, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x0, - 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0xff, 0xf8, - 0x0, 0x0, 0x1, 0xff, 0xf0, 0x0, 0x0, 0x1, - 0xff, 0xf0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, + 0x1f, 0xff, 0x0, 0x0, 0x0, 0xf, 0xff, 0x80, + 0x0, 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0x7, + 0xff, 0xc0, 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, 0x0, 0x3, 0xff, 0xe0, 0x0, 0x0, 0x3, 0xff, - 0xc0, 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, 0x0, - 0x7, 0xff, 0x80, 0x0, 0x0, 0xf, 0xff, 0x80, - 0x0, 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0x1f, - 0xff, 0x0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, - 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, 0x3f, 0xfe, + 0xe0, 0x0, 0x0, 0x1, 0xff, 0xf0, 0x0, 0x0, + 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xfc, 0x0, 0x0, 0x0, - 0x7f, 0xfc, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, - 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0xff, - 0xf8, 0x0, 0x0, 0x1, 0xff, 0xf0, 0x0, 0x0, - 0x1, 0xff, 0xf0, 0x0, 0x0, 0x3, 0xff, 0xe0, + 0x7f, 0xfc, 0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, + 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0, 0x1f, + 0xff, 0x0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, + 0x0, 0xf, 0xff, 0x80, 0x0, 0x0, 0xf, 0xff, + 0xc0, 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, 0x0, + 0x3, 0xff, 0xe0, 0x0, 0x0, 0x3, 0xff, 0xe0, + 0x0, 0x0, 0x1, 0xff, 0xf0, 0x0, 0x0, 0x1, + 0xff, 0xf0, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, - /* U+38 "8" */ - 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, 0x7, 0xff, - 0xff, 0x80, 0x0, 0x7, 0xff, 0xff, 0xf8, 0x0, - 0x7, 0xff, 0xff, 0xff, 0x80, 0x3, 0xff, 0xff, - 0xff, 0xf0, 0x1, 0xff, 0xff, 0xff, 0xfe, 0x0, - 0xff, 0xff, 0xff, 0xff, 0xc0, 0x7f, 0xff, 0xff, - 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0xf, - 0xff, 0xe0, 0x3f, 0xff, 0xc3, 0xff, 0xe0, 0x3, - 0xff, 0xf0, 0xff, 0xf0, 0x0, 0x7f, 0xfc, 0x7f, - 0xf8, 0x0, 0xf, 0xff, 0x9f, 0xfe, 0x0, 0x3, - 0xff, 0xe7, 0xff, 0x0, 0x0, 0x7f, 0xf9, 0xff, - 0xc0, 0x0, 0x1f, 0xfe, 0x7f, 0xf0, 0x0, 0x7, - 0xff, 0x9f, 0xfc, 0x0, 0x1, 0xff, 0xe7, 0xff, - 0x0, 0x0, 0x7f, 0xf9, 0xff, 0xc0, 0x0, 0x1f, - 0xfe, 0x3f, 0xf8, 0x0, 0xf, 0xff, 0xf, 0xfe, - 0x0, 0x3, 0xff, 0xc3, 0xff, 0xc0, 0x1, 0xff, - 0xe0, 0x7f, 0xf8, 0x0, 0xff, 0xf8, 0xf, 0xff, - 0x80, 0xff, 0xfc, 0x1, 0xff, 0xff, 0xff, 0xfe, - 0x0, 0x3f, 0xff, 0xff, 0xff, 0x0, 0x7, 0xff, - 0xff, 0xff, 0x0, 0x0, 0x7f, 0xff, 0xff, 0x0, - 0x0, 0x3, 0xff, 0xfe, 0x0, 0x0, 0x7, 0xff, - 0xff, 0xf0, 0x0, 0x7, 0xff, 0xff, 0xff, 0x80, - 0x7, 0xff, 0xff, 0xff, 0xf0, 0x3, 0xff, 0xff, - 0xff, 0xff, 0x1, 0xff, 0xf8, 0xf, 0xff, 0xe0, - 0xff, 0xf8, 0x0, 0x7f, 0xf8, 0x3f, 0xfc, 0x0, - 0xf, 0xff, 0x1f, 0xfe, 0x0, 0x1, 0xff, 0xe7, - 0xff, 0x80, 0x0, 0x7f, 0xfb, 0xff, 0xc0, 0x0, - 0xf, 0xfe, 0xff, 0xf0, 0x0, 0x3, 0xff, 0xff, - 0xfc, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, - 0x3f, 0xff, 0xff, 0xc0, 0x0, 0xf, 0xff, 0xff, - 0xf0, 0x0, 0x3, 0xff, 0xff, 0xfe, 0x0, 0x1, - 0xff, 0xff, 0xff, 0x80, 0x0, 0x7f, 0xff, 0xff, - 0xf0, 0x0, 0x3f, 0xff, 0x7f, 0xfe, 0x0, 0x1f, - 0xff, 0x9f, 0xff, 0xe0, 0x3f, 0xff, 0xe3, 0xff, - 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, - 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0x3, 0xff, - 0xff, 0xff, 0xff, 0x0, 0x7f, 0xff, 0xff, 0xff, - 0x80, 0xf, 0xff, 0xff, 0xff, 0xc0, 0x1, 0xff, - 0xff, 0xff, 0xe0, 0x0, 0x1f, 0xff, 0xff, 0xe0, - 0x0, 0x1, 0xff, 0xff, 0xe0, 0x0, 0x0, 0x7, - 0xff, 0x80, 0x0, - - /* U+39 "9" */ - 0x0, 0x0, 0xff, 0xc0, 0x0, 0x0, 0x3, 0xff, - 0xff, 0x0, 0x0, 0x3, 0xff, 0xff, 0xf0, 0x0, - 0x3, 0xff, 0xff, 0xff, 0x0, 0x1, 0xff, 0xff, - 0xff, 0xe0, 0x1, 0xff, 0xff, 0xff, 0xfc, 0x0, - 0x7f, 0xff, 0xff, 0xff, 0x80, 0x3f, 0xff, 0xff, - 0xff, 0xf0, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0xf, - 0xff, 0xff, 0xff, 0xff, 0x83, 0xff, 0xfc, 0xf, - 0xff, 0xf1, 0xff, 0xf8, 0x0, 0xff, 0xfc, 0x7f, - 0xfc, 0x0, 0xf, 0xff, 0x9f, 0xff, 0x0, 0x3, - 0xff, 0xef, 0xff, 0x80, 0x0, 0x7f, 0xfb, 0xff, - 0xe0, 0x0, 0x1f, 0xff, 0xff, 0xf0, 0x0, 0x3, - 0xff, 0xff, 0xfc, 0x0, 0x0, 0xff, 0xff, 0xff, - 0x0, 0x0, 0x3f, 0xff, 0xff, 0xc0, 0x0, 0xf, - 0xff, 0xff, 0xf0, 0x0, 0x3, 0xff, 0xff, 0xfc, - 0x0, 0x0, 0xff, 0xff, 0xff, 0x80, 0x0, 0x7f, - 0xff, 0xff, 0xe0, 0x0, 0x1f, 0xff, 0x7f, 0xf8, - 0x0, 0xf, 0xff, 0xdf, 0xff, 0x0, 0x3, 0xff, - 0xe7, 0xff, 0xf0, 0x3, 0xff, 0xf8, 0xff, 0xff, - 0x3, 0xff, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, - 0x87, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, - 0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xf8, - 0x7, 0xff, 0xff, 0xdf, 0xfe, 0x0, 0xff, 0xff, - 0xef, 0xff, 0x80, 0x1f, 0xff, 0xf7, 0xff, 0xc0, - 0x1, 0xff, 0xf1, 0xff, 0xf0, 0x0, 0xf, 0xf0, + /* U+0038 "8" */ + 0x0, 0x1, 0xff, 0x80, 0x0, 0x0, 0xf, 0xff, + 0xfc, 0x0, 0x0, 0x1f, 0xff, 0xff, 0x80, 0x0, + 0x1f, 0xff, 0xff, 0xf0, 0x0, 0x3f, 0xff, 0xff, + 0xfc, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x0, 0x3f, + 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0xff, + 0xf0, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, + 0xff, 0xff, 0xfe, 0xf, 0xff, 0xe0, 0x7f, 0xff, + 0x7, 0xff, 0xc0, 0xf, 0xff, 0x87, 0xff, 0xc0, + 0x3, 0xff, 0xe3, 0xff, 0xe0, 0x1, 0xff, 0xf1, + 0xff, 0xe0, 0x0, 0x7f, 0xf8, 0xff, 0xf0, 0x0, + 0x3f, 0xfc, 0x7f, 0xf8, 0x0, 0x1f, 0xfe, 0x3f, + 0xfc, 0x0, 0xf, 0xff, 0x1f, 0xfe, 0x0, 0x7, + 0xff, 0x8f, 0xff, 0x80, 0x7, 0xff, 0xc3, 0xff, + 0xc0, 0x3, 0xff, 0xc1, 0xff, 0xf0, 0x3, 0xff, + 0xe0, 0x7f, 0xfc, 0x3, 0xff, 0xe0, 0x3f, 0xff, + 0x3, 0xff, 0xf0, 0xf, 0xff, 0xe7, 0xff, 0xf0, + 0x3, 0xff, 0xff, 0xff, 0xf0, 0x0, 0xff, 0xff, + 0xff, 0xf0, 0x0, 0x1f, 0xff, 0xff, 0xf0, 0x0, + 0x7, 0xff, 0xff, 0xf0, 0x0, 0x1, 0xff, 0xff, + 0xf0, 0x0, 0x3, 0xff, 0xff, 0xfc, 0x0, 0x3, + 0xff, 0xff, 0xff, 0x80, 0x3, 0xff, 0xff, 0xff, + 0xe0, 0x3, 0xff, 0xff, 0xff, 0xf8, 0x3, 0xff, + 0xf0, 0xff, 0xfe, 0x3, 0xff, 0xf0, 0x1f, 0xff, + 0x83, 0xff, 0xe0, 0x7, 0xff, 0xe3, 0xff, 0xe0, + 0x1, 0xff, 0xf1, 0xff, 0xe0, 0x0, 0x7f, 0xfc, + 0xff, 0xf0, 0x0, 0x1f, 0xfe, 0xff, 0xf0, 0x0, + 0x7, 0xff, 0xff, 0xf8, 0x0, 0x3, 0xff, 0xff, + 0xfc, 0x0, 0x1, 0xff, 0xff, 0xfe, 0x0, 0x0, + 0xff, 0xff, 0xff, 0x0, 0x0, 0x7f, 0xff, 0xff, + 0xc0, 0x0, 0x7f, 0xff, 0xff, 0xe0, 0x0, 0x3f, + 0xff, 0xff, 0xf8, 0x0, 0x3f, 0xff, 0x7f, 0xfe, + 0x0, 0x3f, 0xff, 0x3f, 0xff, 0xc0, 0x7f, 0xff, + 0x9f, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, + 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xc0, + 0x7f, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, + 0xff, 0xe0, 0x7, 0xff, 0xff, 0xff, 0xe0, 0x1, + 0xff, 0xff, 0xff, 0xc0, 0x0, 0x3f, 0xff, 0xff, + 0x80, 0x0, 0x7, 0xff, 0xff, 0x0, 0x0, 0x0, + 0x3f, 0xf8, 0x0, 0x0, + + /* U+0039 "9" */ + 0x0, 0x1, 0xff, 0x80, 0x0, 0x0, 0x7, 0xff, + 0xfc, 0x0, 0x0, 0xf, 0xff, 0xff, 0x80, 0x0, + 0x1f, 0xff, 0xff, 0xf0, 0x0, 0x1f, 0xff, 0xff, + 0xfc, 0x0, 0x1f, 0xff, 0xff, 0xff, 0x0, 0x1f, + 0xff, 0xff, 0xff, 0xc0, 0x1f, 0xff, 0xff, 0xff, + 0xf0, 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, + 0xff, 0xff, 0xfe, 0xf, 0xff, 0xf0, 0x7f, 0xff, + 0x8f, 0xff, 0xe0, 0xf, 0xff, 0xc7, 0xff, 0xc0, + 0x1, 0xff, 0xf3, 0xff, 0xe0, 0x0, 0xff, 0xfb, + 0xff, 0xe0, 0x0, 0x3f, 0xfd, 0xff, 0xf0, 0x0, + 0x1f, 0xff, 0xff, 0xf0, 0x0, 0x7, 0xff, 0xff, + 0xf8, 0x0, 0x3, 0xff, 0xff, 0xfc, 0x0, 0x1, + 0xff, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0xff, + 0x0, 0x0, 0x7f, 0xff, 0xff, 0x80, 0x0, 0x3f, + 0xff, 0xff, 0xe0, 0x0, 0x3f, 0xff, 0xff, 0xf0, + 0x0, 0x1f, 0xff, 0x7f, 0xfc, 0x0, 0x1f, 0xff, + 0x3f, 0xfe, 0x0, 0xf, 0xff, 0x9f, 0xff, 0xc0, + 0x1f, 0xff, 0xc7, 0xff, 0xf8, 0x3f, 0xff, 0xe3, + 0xff, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, + 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x1f, + 0xff, 0xff, 0xff, 0xf8, 0x7, 0xff, 0xff, 0xbf, + 0xfc, 0x1, 0xff, 0xff, 0xbf, 0xfc, 0x0, 0x7f, + 0xff, 0xbf, 0xfe, 0x0, 0xf, 0xff, 0x1f, 0xfe, + 0x0, 0x1, 0xfe, 0x1f, 0xff, 0x0, 0x0, 0x0, + 0xf, 0xff, 0x0, 0x0, 0x0, 0xf, 0xff, 0x80, + 0x0, 0x0, 0x7, 0xff, 0x80, 0x0, 0x0, 0x7, + 0xff, 0xc0, 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, + 0x0, 0x3, 0xff, 0xc0, 0x0, 0x0, 0x3, 0xff, + 0xe0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0, + 0x1, 0xff, 0xf0, 0x0, 0x0, 0x0, 0xff, 0xf0, + 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xfc, 0x0, - 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, 0xf, - 0xff, 0x80, 0x0, 0x0, 0x7, 0xff, 0xe0, 0x0, - 0x0, 0x1, 0xff, 0xf0, 0x0, 0x0, 0x0, 0xff, - 0xf8, 0x0, 0x0, 0x0, 0x7f, 0xfe, 0x0, 0x0, - 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, 0xf, 0xff, - 0x80, 0x0, 0x0, 0x7, 0xff, 0xe0, 0x0, 0x0, - 0x1, 0xff, 0xf0, 0x0, 0x0, 0x0, 0xff, 0xf8, - 0x0, 0x0, 0x0, 0x7f, 0xfe, 0x0, 0x0, 0x0, - 0x1f, 0xff, 0x0, 0x0, 0x0, 0xf, 0xff, 0x80, - 0x0, 0x0, 0x7, 0xff, 0xe0, 0x0, 0x0, 0x3, - 0xff, 0xf0, 0x0, 0x0, 0x0, 0xff, 0xf8, 0x0, - 0x0, 0x0, 0x7f, 0xfe, 0x0, 0x0, 0x0, 0x3f, - 0xff, 0x0, 0x0, 0x0, 0xf, 0xff, 0x80, 0x0, - 0x0, 0x7, 0xff, 0xe0, 0x0, 0x0, + 0x0, 0x0, 0x7f, 0xfc, 0x0, 0x0, 0x0, 0x3f, + 0xfe, 0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, + 0x0, 0x1f, 0xfe, 0x0, 0x0, 0x0, 0x1f, 0xff, + 0x0, 0x0, 0x0, 0x1f, 0xff, 0x0, 0x0, 0x0, + 0xf, 0xff, 0x80, 0x0, 0x0, 0xf, 0xff, 0x80, + 0x0, 0x0, 0x7, 0xff, 0xc0, 0x0, 0x0, 0x7, + 0xff, 0xc0, 0x0, 0x0, - /* U+3A ":" */ + /* U+003A ":" */ 0x7, 0xe0, 0x1f, 0xf8, 0x3f, 0xfc, 0x7f, 0xfe, - 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, - 0x7f, 0xfe, 0x3f, 0xfc, 0x1f, 0xf8, 0x7, 0xe0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0x3f, 0xfc, + 0x1f, 0xf8, 0x7, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x7, 0xe0, 0x1f, 0xf8, - 0x3f, 0xfc, 0x7f, 0xfe, 0x7f, 0xfe, 0xff, 0xff, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x7, 0xe0, 0x1f, 0xf8, 0x3f, 0xfc, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x7f, 0xfe, 0x7f, 0xfe, 0x3f, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0x3f, 0xfc, 0x1f, 0xf8, 0x7, 0xe0 }; @@ -439,17 +437,17 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 768, .box_w = 41, .box_h = 59, .ofs_x = 4, .ofs_y = -1}, - {.bitmap_index = 303, .adv_w = 768, .box_w = 40, .box_h = 58, .ofs_x = 6, .ofs_y = 0}, - {.bitmap_index = 593, .adv_w = 768, .box_w = 41, .box_h = 58, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 891, .adv_w = 768, .box_w = 41, .box_h = 59, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 1194, .adv_w = 768, .box_w = 38, .box_h = 58, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 1470, .adv_w = 768, .box_w = 41, .box_h = 58, .ofs_x = 4, .ofs_y = -1}, - {.bitmap_index = 1768, .adv_w = 768, .box_w = 42, .box_h = 59, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 2078, .adv_w = 768, .box_w = 40, .box_h = 58, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 2368, .adv_w = 768, .box_w = 42, .box_h = 60, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 2683, .adv_w = 768, .box_w = 42, .box_h = 59, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 2993, .adv_w = 768, .box_w = 16, .box_h = 46, .ofs_x = 16, .ofs_y = -1} + {.bitmap_index = 0, .adv_w = 768, .box_w = 39, .box_h = 60, .ofs_x = 5, .ofs_y = -1}, + {.bitmap_index = 293, .adv_w = 768, .box_w = 38, .box_h = 59, .ofs_x = 6, .ofs_y = 0}, + {.bitmap_index = 574, .adv_w = 768, .box_w = 39, .box_h = 60, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 867, .adv_w = 768, .box_w = 39, .box_h = 59, .ofs_x = 4, .ofs_y = -1}, + {.bitmap_index = 1155, .adv_w = 768, .box_w = 38, .box_h = 59, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 1436, .adv_w = 768, .box_w = 38, .box_h = 60, .ofs_x = 5, .ofs_y = -1}, + {.bitmap_index = 1721, .adv_w = 768, .box_w = 41, .box_h = 60, .ofs_x = 4, .ofs_y = -1}, + {.bitmap_index = 2029, .adv_w = 768, .box_w = 41, .box_h = 58, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 2327, .adv_w = 768, .box_w = 41, .box_h = 60, .ofs_x = 4, .ofs_y = -1}, + {.bitmap_index = 2635, .adv_w = 768, .box_w = 41, .box_h = 60, .ofs_x = 4, .ofs_y = -1}, + {.bitmap_index = 2943, .adv_w = 768, .box_w = 16, .box_h = 46, .ofs_x = 16, .ofs_y = -1} }; /*--------------------- @@ -473,9 +471,14 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = * ALL CUSTOM DATA *--------------------*/ +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else static lv_font_fmt_txt_dsc_t font_dsc = { - .glyph_bitmap = gylph_bitmap, +#endif + .glyph_bitmap = glyph_bitmap, .glyph_dsc = glyph_dsc, .cmaps = cmaps, .kern_dsc = NULL, @@ -483,7 +486,10 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .cmap_num = 1, .bpp = 1, .kern_classes = 0, - .bitmap_format = 0 + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; @@ -492,16 +498,26 @@ static lv_font_fmt_txt_dsc_t font_dsc = { *----------------*/ /*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t jetbrains_mono_extrabold_compressed = { +#else lv_font_t jetbrains_mono_extrabold_compressed = { +#endif .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 60, /*The maximum line height required by the font*/ + .line_height = 61, /*The maximum line height required by the font*/ .base_line = 1, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = -12, + .underline_thickness = 4, +#endif .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if JETBRAINS_MONO_EXTRABOLD_COMPRESSED*/ diff --git a/src/displayapp/fonts/lv_font_sys_48.c b/src/displayapp/fonts/lv_font_sys_48.c index 19f3ec2..ca007e3 100644 --- a/src/displayapp/fonts/lv_font_sys_48.c +++ b/src/displayapp/fonts/lv_font_sys_48.c @@ -311,7 +311,7 @@ lv_font_t lv_font_sys_48 = { #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif -#if LV_VERSION_CHECK(7, 4, 0) +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 .underline_position = 0, .underline_thickness = 0, #endif -- cgit v0.10.2 From 04d21dcd932c7e75b2d45314b2f68d9ba91c5d68 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 27 Feb 2022 15:02:02 +0200 Subject: Add ExtraBold font ttf diff --git a/src/displayapp/fonts/JetBrainsMono-ExtraBold.ttf b/src/displayapp/fonts/JetBrainsMono-ExtraBold.ttf new file mode 100644 index 0000000..f85a85b Binary files /dev/null and b/src/displayapp/fonts/JetBrainsMono-ExtraBold.ttf differ -- cgit v0.10.2 From 61a9a97e267799f76c64279887a9845d4760a77c Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Tue, 1 Mar 2022 01:09:48 +0200 Subject: Update navigation font readme section diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index 2e900d1..7e6203f 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -59,6 +59,7 @@ with * Load the file `JetBrainsMono-Regular.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0x25, 0x30-0x3a` ### Large font + * Name: jetbrains_mono_76 * Size: 76 * Bpp: 1 bit-per-pixel @@ -87,17 +88,12 @@ with * Size: 48 * Bpp: 1 bit-per-pixel * Do not enable font compression or horizontal subpixel rendering -* Load the file `icons_sys_48.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0xe902, 0xe904-0xe907, 0xe90b-0xe90c` - -#### Navigation font +* Load the file `icons_sys_48.tff` and specify the following range: `0xe902, 0xe904-0xe907, 0xe90b-0xe90c` -To create the navigtion.ttf I use the web app [icomoon](https://icomoon.io/app) -this app can import the svg files from the folder *src/displayapp/icons/navigation/unique* and create a ttf file the -project for the site is *lv_font_navi_80.json* you can import it to add or remove icons +### Navigation font -You can also use the online LVGL tool to create the .c +`navigtion.ttf` is created with the web app [icomoon](https://icomoon.io/app) by importing the svg files from `src/displayapp/icons/navigation/unique` and generating the font. `lv_font_navi_80.json` is a project file for the site, which you can import to add or remove icons. -ttf file : navigation.ttf name : lv_font_navi_80 size : 80px Bpp : 2 bit-per-pixel range : 0xe900-0xe929 +This font must be generated with the `lv_font_conv` tool, which has additional options not available in the online converter. -$lv_font_conv --font navigation.ttf -r '0xe900-0xe929' --size 80 --format lvgl --bpp 2 --no-prefilter -o -lv_font_navi_80.c +`lv_font_conv --font navigation.ttf -r '0xe900-0xe929' --size 80 --format lvgl --bpp 2 -o lv_font_navi_80.c` diff --git a/src/displayapp/fonts/lv_font_navi_80.c b/src/displayapp/fonts/lv_font_navi_80.c index d5a8400..8fd3979 100644 --- a/src/displayapp/fonts/lv_font_navi_80.c +++ b/src/displayapp/fonts/lv_font_navi_80.c @@ -2623,7 +2623,7 @@ lv_font_t lv_font_navi_80 = { #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif -#if LV_VERSION_CHECK(7, 4, 0) +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 .underline_position = 0, .underline_thickness = 0, #endif -- cgit v0.10.2 From 7e0b053b38d0491eb4ee666be34d0ea2ab029d19 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 8 Mar 2022 21:28:57 +0100 Subject: CI: lv_sim: initialize libpng submodule for WITH_PNG=ON screenshot InfiniSim PR https://github.com/InfiniTimeOrg/InfiniSim/pull/10 adds support for screenshots in png/bmp format using `libpng` submodule. This new submodule must be added to the lv_sim workflow as well. diff --git a/.github/workflows/lv_sim.yml b/.github/workflows/lv_sim.yml index a3479f0..59ee7b3 100644 --- a/.github/workflows/lv_sim.yml +++ b/.github/workflows/lv_sim.yml @@ -48,7 +48,7 @@ jobs: - name: Get InfiniSim repo run: | git clone https://github.com/InfiniTimeOrg/InfiniSim.git --depth 1 --branch main - git -C InfiniSim submodule update --init lv_drivers + git -C InfiniSim submodule update --init lv_drivers libpng ######################################################################################### # CMake -- cgit v0.10.2 From f47b04ffd0ee401381f18cfedd716d492b4c7db8 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 8 Mar 2022 23:10:06 +0100 Subject: Fix SettingChimes cbOption array size There are 3 options, but the array-size is set to 2. This leads to memory corruption in the initialization of the SettingChimes screen when assigning the third option object pointer. Found in https://github.com/InfiniTimeOrg/InfiniSim/issues/11 diff --git a/src/displayapp/screens/settings/SettingChimes.h b/src/displayapp/screens/settings/SettingChimes.h index 653f87f..a251e95 100644 --- a/src/displayapp/screens/settings/SettingChimes.h +++ b/src/displayapp/screens/settings/SettingChimes.h @@ -20,7 +20,7 @@ namespace Pinetime { private: Controllers::Settings& settingsController; uint8_t optionsTotal; - lv_obj_t* cbOption[2]; + lv_obj_t* cbOption[3]; }; } } -- cgit v0.10.2 From 0933d60b1627df18c5615c610b8e26a685901b44 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 13 Mar 2022 21:58:53 +0100 Subject: Music: fix warning about overridden function Clang warns on `OnTouchEvent()` function, which is overridden, but is missing the `override` keyword ``` In file included from InfiniTime/src/displayapp/screens/Music.cpp:18: InfiniTime/src/displayapp/screens/Music.h:43:14: warning: 'OnTouchEvent' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] bool OnTouchEvent(TouchEvents event); ^ ``` diff --git a/src/displayapp/screens/Music.h b/src/displayapp/screens/Music.h index 35f7bab..27b2d3d 100644 --- a/src/displayapp/screens/Music.h +++ b/src/displayapp/screens/Music.h @@ -40,7 +40,7 @@ namespace Pinetime { void OnObjectEvent(lv_obj_t* obj, lv_event_t event); private: - bool OnTouchEvent(TouchEvents event); + bool OnTouchEvent(TouchEvents event) override; void UpdateLength(); -- cgit v0.10.2 From 51716898aa00ea2d38dfe38d28a33b4ffbdf22ff Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 13 Mar 2022 22:03:29 +0100 Subject: Twos: fix warning about extra paranthesis We have a comparison like `if (( a == b ))`, which is a parenthesis too much, which generates the following warning ``` InfiniTime/src/displayapp/screens/Twos.cpp:133:35: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ InfiniTime/src/displayapp/screens/Twos.cpp:133:35: note: remove extraneous parentheses around the comparison to silence this warning if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) { ~ ^ ~ ``` diff --git a/src/displayapp/screens/Twos.cpp b/src/displayapp/screens/Twos.cpp index b15332f..6d67585 100644 --- a/src/displayapp/screens/Twos.cpp +++ b/src/displayapp/screens/Twos.cpp @@ -130,7 +130,7 @@ bool Twos::placeNewTile() { } bool Twos::tryMerge(TwosTile grid[][4], int& newRow, int& newCol, int oldRow, int oldCol) { - if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) { + if (grid[newRow][newCol].value == grid[oldRow][oldCol].value) { if ((newCol != oldCol) || (newRow != oldRow)) { if (!grid[newRow][newCol].merged) { unsigned int newVal = grid[oldRow][oldCol].value *= 2; -- cgit v0.10.2 From db41d9081a61b2370a4633568a9cb01bc948a5ab Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 14 Mar 2022 20:28:51 +0100 Subject: DateTimeController: make possible functions const MonthShortToString and DayOfWeekShortToString don't change the underlying object. Those are just getters and can be declared `const`. diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index e0d1243..3bfbdc7 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -108,11 +108,11 @@ void DateTime::UpdateTime(uint32_t systickCounter) { } } -const char* DateTime::MonthShortToString() { +const char* DateTime::MonthShortToString() const { return MonthsString[static_cast(month)]; } -const char* DateTime::DayOfWeekShortToString() { +const char* DateTime::DayOfWeekShortToString() const { return DaysStringShort[static_cast(dayOfWeek)]; } diff --git a/src/components/datetime/DateTimeController.h b/src/components/datetime/DateTimeController.h index 6e5ee3c..00bbc2e 100644 --- a/src/components/datetime/DateTimeController.h +++ b/src/components/datetime/DateTimeController.h @@ -61,8 +61,8 @@ namespace Pinetime { return second; } - const char* MonthShortToString(); - const char* DayOfWeekShortToString(); + const char* MonthShortToString() const; + const char* DayOfWeekShortToString() const; static const char* MonthShortToStringLow(Months month); std::chrono::time_point CurrentDateTime() const { -- cgit v0.10.2 From bebc072e78145af69aacb1c2c9549da8653b7b0c Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 14 Mar 2022 20:55:20 +0100 Subject: WatchFaceAnalog: const ref to dateTimeController The clock app only reads from the dateTimeController, never modifies it. diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index a18eb29..3377d39 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -74,7 +74,7 @@ namespace Pinetime { lv_obj_t* batteryIcon; lv_obj_t* notificationIcon; - Controllers::DateTime& dateTimeController; + const Controllers::DateTime& dateTimeController; Controllers::Battery& batteryController; Controllers::Ble& bleController; Controllers::NotificationManager& notificationManager; -- cgit v0.10.2 From 1379b7902fca8628614af358bac7d546cc94efdc Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 14 Mar 2022 20:33:14 +0100 Subject: WatchFaceAnalog: local date/time variables Use local date and time variables. No need to store them in the object. diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index f1b9144..6104281 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -137,9 +137,9 @@ WatchFaceAnalog::~WatchFaceAnalog() { } void WatchFaceAnalog::UpdateClock() { - hour = dateTimeController.Hours(); - minute = dateTimeController.Minutes(); - second = dateTimeController.Seconds(); + uint8_t hour = dateTimeController.Hours(); + uint8_t minute = dateTimeController.Minutes(); + uint8_t second = dateTimeController.Seconds(); if (sMinute != minute) { auto const angle = minute * 6; @@ -214,9 +214,9 @@ void WatchFaceAnalog::Refresh() { currentDateTime = dateTimeController.CurrentDateTime(); if (currentDateTime.IsUpdated()) { - month = dateTimeController.Month(); - day = dateTimeController.Day(); - dayOfWeek = dateTimeController.DayOfWeek(); + Pinetime::Controllers::DateTime::Months month = dateTimeController.Month(); + uint8_t day = dateTimeController.Day(); + Pinetime::Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek(); UpdateClock(); diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index a18eb29..9412d73 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -35,13 +35,6 @@ namespace Pinetime { private: uint8_t sHour, sMinute, sSecond; - uint8_t hour; - uint8_t minute; - uint8_t second; - - Pinetime::Controllers::DateTime::Months month; - uint8_t day; - Pinetime::Controllers::DateTime::Days dayOfWeek; Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; -- cgit v0.10.2 From df61907073fab7d4c2f9595c7771e894a3841b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Mon, 14 Mar 2022 20:44:19 +0100 Subject: Limit the size of the track and album name received by MusicService. This should work around this bug : https://github.com/InfiniTimeOrg/InfiniTime/issues/825 and prevent heap over-allocation. diff --git a/src/components/ble/MusicService.cpp b/src/components/ble/MusicService.cpp index 3457ce4..7b74ac2 100644 --- a/src/components/ble/MusicService.cpp +++ b/src/components/ble/MusicService.cpp @@ -47,6 +47,8 @@ namespace { constexpr ble_uuid128_t msRepeatCharUuid {CharUuid(0x0b, 0x00)}; constexpr ble_uuid128_t msShuffleCharUuid {CharUuid(0x0c, 0x00)}; + constexpr uint8_t MaxStringSize {40}; + int MusicCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt, void* arg) { return static_cast(arg)->OnCommand(conn_handle, attr_handle, ctxt); } @@ -125,6 +127,11 @@ void Pinetime::Controllers::MusicService::Init() { int Pinetime::Controllers::MusicService::OnCommand(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt) { if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { size_t notifSize = OS_MBUF_PKTLEN(ctxt->om); + + if(notifSize > MaxStringSize) { + notifSize = MaxStringSize; + } + char data[notifSize + 1]; data[notifSize] = '\0'; os_mbuf_copydata(ctxt->om, 0, notifSize, data); -- cgit v0.10.2 From f973f1c12c5f82ddacfdaca29fbe1043d94313ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Mon, 14 Mar 2022 21:03:08 +0100 Subject: Add missing space in if expression. diff --git a/src/components/ble/MusicService.cpp b/src/components/ble/MusicService.cpp index 7b74ac2..0e53b9c 100644 --- a/src/components/ble/MusicService.cpp +++ b/src/components/ble/MusicService.cpp @@ -128,7 +128,7 @@ int Pinetime::Controllers::MusicService::OnCommand(uint16_t conn_handle, uint16_ if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { size_t notifSize = OS_MBUF_PKTLEN(ctxt->om); - if(notifSize > MaxStringSize) { + if (notifSize > MaxStringSize) { notifSize = MaxStringSize; } -- cgit v0.10.2 From 88197b66328ab8cbecc199c91d1ce1e1688ade83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Thu, 17 Mar 2022 21:15:05 +0100 Subject: Music app : when title/track name are truncated, add an ellipsis at the end of the strings. diff --git a/src/components/ble/MusicService.cpp b/src/components/ble/MusicService.cpp index 0e53b9c..c99aa1e 100644 --- a/src/components/ble/MusicService.cpp +++ b/src/components/ble/MusicService.cpp @@ -17,6 +17,7 @@ */ #include "components/ble/MusicService.h" #include "systemtask/SystemTask.h" +#include namespace { // 0000yyxx-78fc-48fe-8e23-433b3a1942d0 @@ -127,14 +128,21 @@ void Pinetime::Controllers::MusicService::Init() { int Pinetime::Controllers::MusicService::OnCommand(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt) { if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { size_t notifSize = OS_MBUF_PKTLEN(ctxt->om); - + size_t bufferSize = notifSize; if (notifSize > MaxStringSize) { - notifSize = MaxStringSize; + bufferSize = MaxStringSize; + } + + char data[bufferSize + 1]; + os_mbuf_copydata(ctxt->om, 0, bufferSize, data); + + if (notifSize > bufferSize) { + data[bufferSize-1] = '.'; + data[bufferSize-2] = '.'; + data[bufferSize-3] = '.'; } + data[bufferSize] = '\0'; - char data[notifSize + 1]; - data[notifSize] = '\0'; - os_mbuf_copydata(ctxt->om, 0, notifSize, data); char* s = &data[0]; if (ble_uuid_cmp(ctxt->chr->uuid, &msArtistCharUuid.u) == 0) { artistName = s; -- cgit v0.10.2 From f1194a5f74fa7e02805940a39489210783b94878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Mon, 14 Mar 2022 20:54:04 +0100 Subject: In current configuration, the timer task (the one from FreeRTOS) has the lowest priority (0). Both display and system tasks are also set on priority 0. In cases where any other task takes too much time to execute (it can happen in Display Task, see https://github.com/InfiniTimeOrg/InfiniTime/issues/825), the timer task does not have the opportunity to run fast enough to detect and debounce presses on the button. This commit sets the following priorities: - [0] : Display Task - [1] : Timer and System tasks - [2] : BLE Host - [3] : BLE LL This way, we ensure that button presses will always be detected, even if the rendering of the display takes a huge amount of time. diff --git a/src/FreeRTOSConfig.h b/src/FreeRTOSConfig.h index adbbc8f..5462b93 100644 --- a/src/FreeRTOSConfig.h +++ b/src/FreeRTOSConfig.h @@ -60,7 +60,7 @@ #define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG 0 /* See into vPortSuppressTicksAndSleep source code for explanation */ #define configCPU_CLOCK_HZ (SystemCoreClock) #define configTICK_RATE_HZ 1024 -#define configMAX_PRIORITIES (3) +#define configMAX_PRIORITIES (4) #define configMINIMAL_STACK_SIZE (120) #define configTOTAL_HEAP_SIZE (1024 * 17) #define configMAX_TASK_NAME_LEN (4) @@ -93,7 +93,7 @@ /* Software timer definitions. */ #define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY (0) +#define configTIMER_TASK_PRIORITY (1) #define configTIMER_QUEUE_LENGTH 32 #define configTIMER_TASK_STACK_DEPTH (300) diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 1e45fac..77cf411 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -107,7 +107,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, void SystemTask::Start() { systemTasksMsgQueue = xQueueCreate(10, 1); - if (pdPASS != xTaskCreate(SystemTask::Process, "MAIN", 350, this, 0, &taskHandle)) { + if (pdPASS != xTaskCreate(SystemTask::Process, "MAIN", 350, this, 1, &taskHandle)) { APP_ERROR_HANDLER(NRF_ERROR_NO_MEM); } } -- cgit v0.10.2 From cd1f218dd8710f61238307a9fa5b0d11e229bffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Mon, 14 Mar 2022 21:54:13 +0100 Subject: Fix priorities of BLE tasks diff --git a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c index b990278..205831a 100644 --- a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c +++ b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c @@ -38,7 +38,7 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * since it has compatible prototype. */ xTaskCreate(nimble_port_ll_task_func, "ll", configMINIMAL_STACK_SIZE + 200, - NULL, configMAX_PRIORITIES - 1, &ll_task_h); + NULL, 3, &ll_task_h); #endif /* @@ -47,5 +47,5 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * default queue it is just easier to make separate task which does this. */ xTaskCreate(host_task_fn, "ble", configMINIMAL_STACK_SIZE + 600, - NULL, tskIDLE_PRIORITY + 1, &host_task_h); + NULL, 2, &host_task_h); } -- cgit v0.10.2 From a8b7fbe48b4a86238f38ed0f084b277b44c428fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Thu, 17 Mar 2022 21:22:59 +0100 Subject: New changes according to the review : Priority 0 for display, 1 for system, timer and ble host, and 2 for ble LL diff --git a/src/FreeRTOSConfig.h b/src/FreeRTOSConfig.h index 5462b93..263d803 100644 --- a/src/FreeRTOSConfig.h +++ b/src/FreeRTOSConfig.h @@ -60,7 +60,7 @@ #define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG 0 /* See into vPortSuppressTicksAndSleep source code for explanation */ #define configCPU_CLOCK_HZ (SystemCoreClock) #define configTICK_RATE_HZ 1024 -#define configMAX_PRIORITIES (4) +#define configMAX_PRIORITIES (3) #define configMINIMAL_STACK_SIZE (120) #define configTOTAL_HEAP_SIZE (1024 * 17) #define configMAX_TASK_NAME_LEN (4) diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index 0be7c0f..10eb429 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -77,6 +77,7 @@ int GAPEventCallback(struct ble_gap_event* event, void* arg) { void NimbleController::Init() { while (!ble_hs_synced()) { + vTaskDelay(10); } nptr = this; diff --git a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c index 205831a..49834db 100644 --- a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c +++ b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c @@ -38,7 +38,7 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * since it has compatible prototype. */ xTaskCreate(nimble_port_ll_task_func, "ll", configMINIMAL_STACK_SIZE + 200, - NULL, 3, &ll_task_h); + NULL, 2, &ll_task_h); #endif /* @@ -47,5 +47,5 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * default queue it is just easier to make separate task which does this. */ xTaskCreate(host_task_fn, "ble", configMINIMAL_STACK_SIZE + 600, - NULL, 2, &host_task_h); + NULL, 1, &host_task_h); } -- cgit v0.10.2 From 4761fcb63a55749c5e46c5fe6bb53ae25b4716c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 27 Mar 2022 20:29:52 +0200 Subject: DisplayApp : Call the event handler of the current app before loading the new one. This way, we ensure that lv_task_handler() is called before sending event to the newly loaded app. diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index fdc6376..c842956 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -306,14 +306,14 @@ void DisplayApp::Refresh() { } } + if (touchHandler.IsTouching()) { + currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY()); + } + if (nextApp != Apps::None) { LoadApp(nextApp, nextDirection); nextApp = Apps::None; } - - if (touchHandler.IsTouching()) { - currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY()); - } } void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction) { -- cgit v0.10.2 From 8f436e1d74ffdd497c68dc2f34f6a67e430a1932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 27 Mar 2022 20:21:44 +0200 Subject: Timer App : add background label to ensure that the app will be displayed correctly after a full refresh (HW scrolling transition). Code cleaning and rename methods. diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index c842956..f6d2747 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -207,7 +207,7 @@ void DisplayApp::Refresh() { case Messages::TimerDone: if (currentApp == Apps::Timer) { auto* timer = static_cast(currentScreen.get()); - timer->setDone(); + timer->SetDone(); } else { LoadApp(Apps::Timer, DisplayApp::FullRefreshDirections::Down); } diff --git a/src/displayapp/screens/Timer.cpp b/src/displayapp/screens/Timer.cpp index a5e4019..5cd496c 100644 --- a/src/displayapp/screens/Timer.cpp +++ b/src/displayapp/screens/Timer.cpp @@ -1,5 +1,4 @@ #include "displayapp/screens/Timer.h" - #include "displayapp/screens/Screen.h" #include "displayapp/screens/Symbols.h" #include @@ -7,11 +6,11 @@ using namespace Pinetime::Applications::Screens; static void btnEventHandler(lv_obj_t* obj, lv_event_t event) { - Timer* screen = static_cast(obj->user_data); + auto* screen = static_cast(obj->user_data); screen->OnButtonEvent(obj, event); } -void Timer::createButtons() { +void Timer::CreateButtons() { btnMinutesUp = lv_btn_create(lv_scr_act(), nullptr); btnMinutesUp->user_data = this; lv_obj_set_event_cb(btnMinutesUp, btnEventHandler); @@ -51,6 +50,12 @@ void Timer::createButtons() { Timer::Timer(DisplayApp* app, Controllers::TimerController& timerController) : Screen(app), running {true}, timerController {timerController} { + backgroundLabel = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_click(backgroundLabel, true); + lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); + lv_obj_set_size(backgroundLabel, 240, 240); + lv_obj_set_pos(backgroundLabel, 0, 0); + lv_label_set_text(backgroundLabel, ""); time = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76); @@ -71,7 +76,7 @@ Timer::Timer(DisplayApp* app, Controllers::TimerController& timerController) lv_label_set_text(txtPlayPause, Symbols::pause); } else { lv_label_set_text(txtPlayPause, Symbols::play); - createButtons(); + CreateButtons(); } taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); @@ -98,7 +103,7 @@ void Timer::OnButtonEvent(lv_obj_t* obj, lv_event_t event) { minutesToSet = seconds / 60; secondsToSet = seconds % 60; timerController.StopTimer(); - createButtons(); + CreateButtons(); } else if (secondsToSet + minutesToSet > 0) { lv_label_set_text(txtPlayPause, Symbols::pause); @@ -152,10 +157,10 @@ void Timer::OnButtonEvent(lv_obj_t* obj, lv_event_t event) { } } -void Timer::setDone() { +void Timer::SetDone() { lv_label_set_text(time, "00:00"); lv_label_set_text(txtPlayPause, Symbols::play); secondsToSet = 0; minutesToSet = 0; - createButtons(); + CreateButtons(); } diff --git a/src/displayapp/screens/Timer.h b/src/displayapp/screens/Timer.h index 23c8734..93e84c8 100644 --- a/src/displayapp/screens/Timer.h +++ b/src/displayapp/screens/Timer.h @@ -8,32 +8,35 @@ #include "components/timer/TimerController.h" namespace Pinetime::Applications::Screens { - class Timer : public Screen { public: enum class Modes { Normal, Done }; Timer(DisplayApp* app, Controllers::TimerController& timerController); - ~Timer() override; - void Refresh() override; - - void setDone(); - + void SetDone(); void OnButtonEvent(lv_obj_t* obj, lv_event_t event); private: + void CreateButtons(); bool running; uint8_t secondsToSet = 0; uint8_t minutesToSet = 0; Controllers::TimerController& timerController; - - void createButtons(); - - lv_obj_t *time, *msecTime, *btnPlayPause, *txtPlayPause, *btnMinutesUp, *btnMinutesDown, *btnSecondsUp, *btnSecondsDown, *txtMUp, - *txtMDown, *txtSUp, *txtSDown; - + lv_obj_t* backgroundLabel; + lv_obj_t* time; + lv_obj_t* msecTime; + lv_obj_t* btnPlayPause; + lv_obj_t* txtPlayPause; + lv_obj_t* btnMinutesUp; + lv_obj_t* btnMinutesDown; + lv_obj_t* btnSecondsUp; + lv_obj_t* btnSecondsDown; + lv_obj_t* txtMUp; + lv_obj_t* txtMDown; + lv_obj_t* txtSUp; + lv_obj_t* txtSDown; lv_task_t* taskRefresh; }; } -- cgit v0.10.2 From 78365548f70d9a6ef9a040d8e0039e640e386dc3 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 2 Apr 2022 16:03:20 +0300 Subject: Replace airplane mode with a bluetooth toggle diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ff0c9b0..077546a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -449,7 +449,7 @@ list(APPEND SOURCE_FILES displayapp/screens/settings/SettingSetTime.cpp displayapp/screens/settings/SettingChimes.cpp displayapp/screens/settings/SettingShakeThreshold.cpp - displayapp/screens/settings/SettingAirplaneMode.cpp + displayapp/screens/settings/SettingBluetooth.cpp ## Watch faces displayapp/icons/bg_clock.c diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 24a8260..44a1a85 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -237,7 +237,7 @@ namespace Pinetime { uint8_t appMenu = 0; uint8_t settingsMenu = 0; - /* airplaneMode is intentionally not saved with the other watch settings and initialized + /* ble state is intentionally not saved with the other watch settings and initialized * to off (false) on every boot because we always want ble to be enabled on startup */ bool bleRadioEnabled = true; diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index dc9e625..8aad953 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -38,7 +38,7 @@ namespace Pinetime { SettingSetTime, SettingChimes, SettingShakeThreshold, - SettingAirplaneMode, + SettingBluetooth, Error }; } diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index f6d2747..9ce29da 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -49,7 +49,7 @@ #include "displayapp/screens/settings/SettingSetTime.h" #include "displayapp/screens/settings/SettingChimes.h" #include "displayapp/screens/settings/SettingShakeThreshold.h" -#include "displayapp/screens/settings/SettingAirplaneMode.h" +#include "displayapp/screens/settings/SettingBluetooth.h" #include "libs/lv_conf.h" @@ -434,8 +434,8 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) currentScreen = std::make_unique(this, settingsController, motionController, *systemTask); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; - case Apps::SettingAirplaneMode: - currentScreen = std::make_unique(this, settingsController); + case Apps::SettingBluetooth: + currentScreen = std::make_unique(this, settingsController); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; case Apps::BatteryInfo: diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index 7e6203f..c7a8e2b 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -31,7 +31,7 @@ static constexpr const char* newSymbol = "\xEF\x86\x85"; * Do not enable font compression or horizontal subpixel rendering * Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0x20-0x7e, 0x410-0x44f` * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following - range: `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf072` + range: `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015` * Fix an error in the font conversion. Replace the following: diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index cc67532..5c40d49 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -840,16 +840,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xf8, 0xf, 0x80, 0xf8, 0x3e, 0x0, 0xff, 0xf0, 0x0, 0x3f, 0x80, 0x0, - /* U+F072 "" */ - 0x1, 0xc0, 0x0, 0x7, 0xc0, 0x0, 0x7, 0x80, - 0x0, 0xf, 0x80, 0x0, 0x1f, 0x0, 0x0, 0x1f, - 0x0, 0x38, 0x3e, 0x0, 0x78, 0x7e, 0x0, 0x7f, - 0xff, 0xe0, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xf3, - 0xff, 0xff, 0xe7, 0xff, 0xff, 0xdf, 0xff, 0xfc, - 0x3c, 0x3f, 0x0, 0x70, 0x7c, 0x0, 0x1, 0xf0, - 0x0, 0x3, 0xe0, 0x0, 0x7, 0x80, 0x0, 0xf, - 0x0, 0x0, 0x1c, 0x0, 0x0, - /* U+F095 "" */ 0x0, 0x0, 0x0, 0x0, 0x3e, 0x0, 0x7, 0xf0, 0x0, 0x7f, 0x0, 0x7, 0xf0, 0x0, 0xff, 0x0, @@ -1230,32 +1220,31 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 3027, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, {.bitmap_index = 3055, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 3103, .adv_w = 360, .box_w = 23, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3147, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3208, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3261, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3280, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3330, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3366, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3414, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3454, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3497, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3535, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3573, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3611, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3649, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3687, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3723, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 3761, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3790, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 3828, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3894, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3943, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3993, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4053, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4106, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4167, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4222, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4275, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} + {.bitmap_index = 3147, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3200, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3219, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3269, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3305, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3353, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3393, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3436, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3474, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3512, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3550, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3588, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3626, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3662, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 3700, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3729, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 3767, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3833, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3882, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3932, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3992, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4045, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4106, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4161, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4214, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} }; /*--------------------- @@ -1264,11 +1253,10 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { static const uint16_t unicode_list_2[] = { 0x0, 0x14, 0x16, 0x23, 0x26, 0x27, 0x28, 0x39, - 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x71, - 0x94, 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, - 0x240, 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, - 0x3dc, 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, - 0x6a8 + 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x94, + 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, 0x240, + 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, 0x3dc, + 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, 0x6a8 }; /*Collect the unicode lists and glyph_id offsets*/ @@ -1284,7 +1272,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = }, { .range_start = 61441, .range_length = 1705, .glyph_id_start = 160, - .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 41, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 40, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; diff --git a/src/displayapp/screens/BleIcon.cpp b/src/displayapp/screens/BleIcon.cpp index 019f803..780a14c 100644 --- a/src/displayapp/screens/BleIcon.cpp +++ b/src/displayapp/screens/BleIcon.cpp @@ -2,11 +2,7 @@ #include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; -const char* BleIcon::GetIcon(bool isRadioEnabled, bool isConnected) { - if(!isRadioEnabled) { - return Symbols::airplane; - } - +const char* BleIcon::GetIcon(bool isConnected) { if (isConnected) { return Symbols::bluetooth; } diff --git a/src/displayapp/screens/BleIcon.h b/src/displayapp/screens/BleIcon.h index d32dfad..d9a4654 100644 --- a/src/displayapp/screens/BleIcon.h +++ b/src/displayapp/screens/BleIcon.h @@ -7,7 +7,7 @@ namespace Pinetime { namespace Screens { class BleIcon { public: - static const char* GetIcon(bool isRadioEnabled, bool isConnected); + static const char* GetIcon(bool isConnected); }; } } diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index 44bf47a..e807289 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -345,11 +345,10 @@ void PineTimeStyle::SetBatteryIcon() { void PineTimeStyle::AlignIcons() { - bool isBleIconVisible = IsBleIconVisible(bleRadioEnabled.Get(), bleState.Get()); - if (notificationState.Get() && isBleIconVisible) { + if (notificationState.Get() && bleState.Get()) { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25); lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25); - } else if (notificationState.Get() && !isBleIconVisible) { + } else if (notificationState.Get() && !bleState.Get()) { lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); } else { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); @@ -375,7 +374,7 @@ void PineTimeStyle::Refresh() { bleState = bleController.IsConnected(); bleRadioEnabled = bleController.IsRadioEnabled(); if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) { - lv_label_set_text(bleIcon, BleIcon::GetIcon(bleRadioEnabled.Get(), bleState.Get())); + lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get())); AlignIcons(); } diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index 5ba8f95..e68a7af 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -44,7 +44,6 @@ namespace Pinetime { static constexpr const char* chartLine = "\xEF\x88\x81"; static constexpr const char* eye = "\xEF\x81\xAE"; static constexpr const char* home = "\xEF\x80\x95"; - static constexpr const char* airplane = "\xEF\x81\xB2"; // lv_font_sys_48.c static constexpr const char* settings = "\xEE\xA4\x82"; // e902 diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 59bde83..6a91488 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -121,7 +121,7 @@ void WatchFaceDigital::Refresh() { bleState = bleController.IsConnected(); bleRadioEnabled = bleController.IsRadioEnabled(); if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) { - lv_label_set_text(bleIcon, BleIcon::GetIcon(bleRadioEnabled.Get(), bleState.Get())); + lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get())); } lv_obj_realign(batteryIcon); lv_obj_realign(batteryPlug); diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.cpp b/src/displayapp/screens/settings/SettingAirplaneMode.cpp deleted file mode 100644 index 8517278..0000000 --- a/src/displayapp/screens/settings/SettingAirplaneMode.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "displayapp/screens/settings/SettingAirplaneMode.h" -#include -#include "displayapp/DisplayApp.h" -#include "displayapp/Messages.h" -#include "displayapp/screens/Styles.h" -#include "displayapp/screens/Screen.h" -#include "displayapp/screens/Symbols.h" - -using namespace Pinetime::Applications::Screens; - -namespace { - static void OnAirplaneModeEnabledEvent(lv_obj_t* obj, lv_event_t event) { - auto* screen = static_cast(obj->user_data); - screen->OnAirplaneModeEnabled(obj, event); - } - - static void OnAirplaneModeDisabledEvent(lv_obj_t* obj, lv_event_t event) { - auto* screen = static_cast(obj->user_data); - screen->OnAirplaneModeDisabled(obj, event); - } -} - -SettingAirplaneMode::SettingAirplaneMode(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) - : Screen(app), settingsController {settingsController} { - - lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr); - - lv_obj_set_style_local_bg_opa(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP); - lv_obj_set_style_local_pad_all(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 10); - lv_obj_set_style_local_pad_inner(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5); - lv_obj_set_style_local_border_width(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0); - - lv_obj_set_pos(container1, 10, 60); - lv_obj_set_width(container1, LV_HOR_RES - 20); - lv_obj_set_height(container1, LV_VER_RES - 50); - lv_cont_set_layout(container1, LV_LAYOUT_COLUMN_LEFT); - - lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_static(title, "Airplane mode"); - lv_label_set_align(title, LV_LABEL_ALIGN_CENTER); - lv_obj_align(title, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 15, 15); - - lv_obj_t* icon = lv_label_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_text_color(icon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); - lv_label_set_text_static(icon, Symbols::airplane); - lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER); - lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0); - - cbEnabled = lv_checkbox_create(container1, nullptr); - lv_checkbox_set_text(cbEnabled, " Enable"); - cbEnabled->user_data = this; - lv_obj_set_event_cb(cbEnabled, OnAirplaneModeEnabledEvent); - SetRadioButtonStyle(cbEnabled); - - cbDisabled = lv_checkbox_create(container1, nullptr); - lv_checkbox_set_text(cbDisabled, " Disable"); - cbDisabled->user_data = this; - lv_obj_set_event_cb(cbDisabled, OnAirplaneModeDisabledEvent); - SetRadioButtonStyle(cbDisabled); - - if (settingsController.GetBleRadioEnabled()) { - lv_checkbox_set_checked(cbDisabled, true); - priorMode = true; - } else { - lv_checkbox_set_checked(cbEnabled, true); - priorMode = false; - } -} - -SettingAirplaneMode::~SettingAirplaneMode() { - lv_obj_clean(lv_scr_act()); - // Do not call SaveSettings - see src/components/settings/Settings.h - if (priorMode != settingsController.GetBleRadioEnabled()) { - app->PushMessage(Pinetime::Applications::Display::Messages::BleRadioEnableToggle); - } -} - -void SettingAirplaneMode::OnAirplaneModeEnabled(lv_obj_t* object, lv_event_t event) { - if (event == LV_EVENT_VALUE_CHANGED) { - lv_checkbox_set_checked(cbEnabled, true); - lv_checkbox_set_checked(cbDisabled, false); - settingsController.SetBleRadioEnabled(false); - } -} - -void SettingAirplaneMode::OnAirplaneModeDisabled(lv_obj_t* object, lv_event_t event) { - if (event == LV_EVENT_VALUE_CHANGED) { - lv_checkbox_set_checked(cbEnabled, false); - lv_checkbox_set_checked(cbDisabled, true); - settingsController.SetBleRadioEnabled(true); - } -} - diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.h b/src/displayapp/screens/settings/SettingAirplaneMode.h deleted file mode 100644 index b3478c6..0000000 --- a/src/displayapp/screens/settings/SettingAirplaneMode.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "components/settings/Settings.h" -#include "displayapp/screens/Screen.h" - -namespace Pinetime { - - namespace Applications { - namespace Screens { - - class SettingAirplaneMode : public Screen { - public: - SettingAirplaneMode(DisplayApp* app, Pinetime::Controllers::Settings& settingsController); - ~SettingAirplaneMode() override; - - void OnAirplaneModeEnabled(lv_obj_t* object, lv_event_t event); - void OnAirplaneModeDisabled(lv_obj_t* object, lv_event_t event); - - private: - Controllers::Settings& settingsController; - lv_obj_t* cbEnabled; - lv_obj_t* cbDisabled; - bool priorMode; - }; - } - } -} diff --git a/src/displayapp/screens/settings/SettingBluetooth.cpp b/src/displayapp/screens/settings/SettingBluetooth.cpp new file mode 100644 index 0000000..ab1af22 --- /dev/null +++ b/src/displayapp/screens/settings/SettingBluetooth.cpp @@ -0,0 +1,93 @@ +#include "displayapp/screens/settings/SettingBluetooth.h" +#include +#include "displayapp/DisplayApp.h" +#include "displayapp/Messages.h" +#include "displayapp/screens/Styles.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/Symbols.h" + +using namespace Pinetime::Applications::Screens; + +namespace { + static void OnBluetoothDisabledEvent(lv_obj_t* obj, lv_event_t event) { + auto* screen = static_cast(obj->user_data); + screen->OnBluetoothDisabled(obj, event); + } + + static void OnBluetoothEnabledEvent(lv_obj_t* obj, lv_event_t event) { + auto* screen = static_cast(obj->user_data); + screen->OnBluetoothEnabled(obj, event); + } +} + +SettingBluetooth::SettingBluetooth(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) + : Screen(app), settingsController {settingsController} { + + lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr); + + lv_obj_set_style_local_bg_opa(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP); + lv_obj_set_style_local_pad_all(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 10); + lv_obj_set_style_local_pad_inner(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5); + lv_obj_set_style_local_border_width(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0); + + lv_obj_set_pos(container1, 10, 60); + lv_obj_set_width(container1, LV_HOR_RES - 20); + lv_obj_set_height(container1, LV_VER_RES - 50); + lv_cont_set_layout(container1, LV_LAYOUT_COLUMN_LEFT); + + lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(title, "Bluetooth"); + lv_label_set_align(title, LV_LABEL_ALIGN_CENTER); + lv_obj_align(title, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 15, 15); + + lv_obj_t* icon = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_text_color(icon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); + lv_label_set_text_static(icon, Symbols::bluetooth); + lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER); + lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0); + + cbEnabled = lv_checkbox_create(container1, nullptr); + lv_checkbox_set_text(cbEnabled, " Enabled"); + cbEnabled->user_data = this; + lv_obj_set_event_cb(cbEnabled, OnBluetoothEnabledEvent); + SetRadioButtonStyle(cbEnabled); + + cbDisabled = lv_checkbox_create(container1, nullptr); + lv_checkbox_set_text(cbDisabled, " Disabled"); + cbDisabled->user_data = this; + lv_obj_set_event_cb(cbDisabled, OnBluetoothDisabledEvent); + SetRadioButtonStyle(cbDisabled); + + if (settingsController.GetBleRadioEnabled()) { + lv_checkbox_set_checked(cbEnabled, true); + priorMode = true; + } else { + lv_checkbox_set_checked(cbDisabled, true); + priorMode = false; + } +} + +SettingBluetooth::~SettingBluetooth() { + lv_obj_clean(lv_scr_act()); + // Do not call SaveSettings - see src/components/settings/Settings.h + if (priorMode != settingsController.GetBleRadioEnabled()) { + app->PushMessage(Pinetime::Applications::Display::Messages::BleRadioEnableToggle); + } +} + +void SettingBluetooth::OnBluetoothDisabled(lv_obj_t* object, lv_event_t event) { + if (event == LV_EVENT_VALUE_CHANGED) { + lv_checkbox_set_checked(cbEnabled, false); + lv_checkbox_set_checked(cbDisabled, true); + settingsController.SetBleRadioEnabled(false); + } +} + +void SettingBluetooth::OnBluetoothEnabled(lv_obj_t* object, lv_event_t event) { + if (event == LV_EVENT_VALUE_CHANGED) { + lv_checkbox_set_checked(cbEnabled, true); + lv_checkbox_set_checked(cbDisabled, false); + settingsController.SetBleRadioEnabled(true); + } +} + diff --git a/src/displayapp/screens/settings/SettingBluetooth.h b/src/displayapp/screens/settings/SettingBluetooth.h new file mode 100644 index 0000000..12bb459 --- /dev/null +++ b/src/displayapp/screens/settings/SettingBluetooth.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include +#include + +#include "components/settings/Settings.h" +#include "displayapp/screens/Screen.h" + +namespace Pinetime { + + namespace Applications { + namespace Screens { + + class SettingBluetooth : public Screen { + public: + SettingBluetooth(DisplayApp* app, Pinetime::Controllers::Settings& settingsController); + ~SettingBluetooth() override; + + void OnBluetoothEnabled(lv_obj_t* object, lv_event_t event); + void OnBluetoothDisabled(lv_obj_t* object, lv_event_t event); + + private: + Controllers::Settings& settingsController; + lv_obj_t* cbEnabled; + lv_obj_t* cbDisabled; + bool priorMode; + }; + } + } +} diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index dce0c07..bc7efcc 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -64,7 +64,7 @@ std::unique_ptr Settings::CreateScreen3() { {Symbols::clock, "Chimes", Apps::SettingChimes}, {Symbols::tachometer, "Shake Calib.", Apps::SettingShakeThreshold}, {Symbols::check, "Firmware", Apps::FirmwareValidation}, - {Symbols::airplane, "Airplane mode", Apps::SettingAirplaneMode} + {Symbols::bluetooth, "Bluetooth", Apps::SettingBluetooth} }}; return std::make_unique(2, 4, app, settingsController, applications); -- cgit v0.10.2 From b498e1d633522eed975d78b04508834b7a79befe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sat, 2 Apr 2022 16:31:39 +0200 Subject: Set version to 1.9.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8846531..55b68bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(pinetime VERSION 1.8.0 LANGUAGES C CXX ASM) +project(pinetime VERSION 1.9.0 LANGUAGES C CXX ASM) set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 14) -- cgit v0.10.2