From 6c86d1d9d706706fcb6f214aba8259e61ed68755 Mon Sep 17 00:00:00 2001 From: Avamander Date: Fri, 2 Oct 2020 22:16:48 +0300 Subject: Fixed all the includes that were broken due to the renames --- README.md | 2 +- src/CMakeLists.txt | 120 ++-- src/components/Battery/BatteryController.cpp | 48 -- src/components/Battery/BatteryController.h | 27 - src/components/Ble/AlertNotificationClient.cpp | 145 ---- src/components/Ble/AlertNotificationClient.h | 81 --- src/components/Ble/AlertNotificationService.cpp | 80 --- src/components/Ble/AlertNotificationService.h | 39 -- src/components/Ble/BatteryInformationService.cpp | 62 -- src/components/Ble/BatteryInformationService.h | 40 -- src/components/Ble/BleController.cpp | 31 - src/components/Ble/BleController.h | 45 -- src/components/Ble/CurrentTimeClient.cpp | 77 --- src/components/Ble/CurrentTimeClient.h | 55 -- src/components/Ble/CurrentTimeService.cpp | 86 --- src/components/Ble/CurrentTimeService.h | 48 -- src/components/Ble/DeviceInformationService.cpp | 116 ---- src/components/Ble/DeviceInformationService.h | 76 -- src/components/Ble/DfuService.cpp | 440 ------------ src/components/Ble/DfuService.h | 161 ----- src/components/Ble/ImmediateAlertService.cpp | 76 -- src/components/Ble/ImmediateAlertService.h | 46 -- src/components/Ble/MusicService.cpp | 129 ---- src/components/Ble/MusicService.h | 92 --- src/components/Ble/NimbleController.cpp | 337 --------- src/components/Ble/NimbleController.h | 75 -- src/components/Ble/NotificationManager.cpp | 30 - src/components/Ble/NotificationManager.h | 29 - src/components/Brightness/BrightnessController.cpp | 70 -- src/components/Brightness/BrightnessController.h | 28 - src/components/DateTime/DateTimeController.cpp | 66 -- src/components/DateTime/DateTimeController.h | 39 -- .../FirmwareValidator/FirmwareValidator.cpp | 20 - .../FirmwareValidator/FirmwareValidator.h | 18 - src/components/Gfx/Gfx.cpp | 207 ------ src/components/Gfx/Gfx.h | 60 -- src/components/battery/BatteryController.cpp | 48 ++ src/components/battery/BatteryController.h | 27 + src/components/ble/AlertNotificationClient.cpp | 145 ++++ src/components/ble/AlertNotificationClient.h | 81 +++ src/components/ble/AlertNotificationService.cpp | 80 +++ src/components/ble/AlertNotificationService.h | 39 ++ src/components/ble/BatteryInformationService.cpp | 62 ++ src/components/ble/BatteryInformationService.h | 40 ++ src/components/ble/BleController.cpp | 31 + src/components/ble/BleController.h | 45 ++ src/components/ble/CurrentTimeClient.cpp | 77 +++ src/components/ble/CurrentTimeClient.h | 56 ++ src/components/ble/CurrentTimeService.cpp | 86 +++ src/components/ble/CurrentTimeService.h | 49 ++ src/components/ble/DeviceInformationService.cpp | 116 ++++ src/components/ble/DeviceInformationService.h | 76 ++ src/components/ble/DfuService.cpp | 441 ++++++++++++ src/components/ble/DfuService.h | 161 +++++ src/components/ble/ImmediateAlertService.cpp | 76 ++ src/components/ble/ImmediateAlertService.h | 46 ++ src/components/ble/MusicService.cpp | 129 ++++ src/components/ble/MusicService.h | 92 +++ src/components/ble/NimbleController.cpp | 337 +++++++++ src/components/ble/NimbleController.h | 76 ++ src/components/ble/NotificationManager.cpp | 30 + src/components/ble/NotificationManager.h | 29 + src/components/brightness/BrightnessController.cpp | 70 ++ src/components/brightness/BrightnessController.h | 28 + src/components/datetime/DateTimeController.cpp | 66 ++ src/components/datetime/DateTimeController.h | 39 ++ .../firmwarevalidator/FirmwareValidator.cpp | 20 + .../firmwarevalidator/FirmwareValidator.h | 18 + src/components/gfx/Gfx.cpp | 207 ++++++ src/components/gfx/Gfx.h | 60 ++ src/displayapp/DisplayApp.cpp | 31 +- src/displayapp/DisplayApp.h | 20 +- src/displayapp/Fonts/Readme.md | 23 - src/displayapp/Fonts/jetbrains_mono_bold_20.c | 766 --------------------- .../Fonts/jetbrains_mono_extrabold_compressed.c | 507 -------------- src/displayapp/Icons/battery/os_battery_005.c | 56 -- src/displayapp/Icons/battery/os_battery_005.png | Bin 1540 -> 0 bytes src/displayapp/Icons/battery/os_battery_010.c | 58 -- src/displayapp/Icons/battery/os_battery_010.png | Bin 1859 -> 0 bytes src/displayapp/Icons/battery/os_battery_020.c | 58 -- src/displayapp/Icons/battery/os_battery_020.png | Bin 1558 -> 0 bytes src/displayapp/Icons/battery/os_battery_030.c | 58 -- src/displayapp/Icons/battery/os_battery_030.png | Bin 1553 -> 0 bytes src/displayapp/Icons/battery/os_battery_040.c | 56 -- src/displayapp/Icons/battery/os_battery_040.png | Bin 1542 -> 0 bytes src/displayapp/Icons/battery/os_battery_050.c | 56 -- src/displayapp/Icons/battery/os_battery_050.png | Bin 1539 -> 0 bytes src/displayapp/Icons/battery/os_battery_060.c | 56 -- src/displayapp/Icons/battery/os_battery_060.png | Bin 1543 -> 0 bytes src/displayapp/Icons/battery/os_battery_070.c | 56 -- src/displayapp/Icons/battery/os_battery_070.png | Bin 1545 -> 0 bytes src/displayapp/Icons/battery/os_battery_080.c | 56 -- src/displayapp/Icons/battery/os_battery_080.png | Bin 1549 -> 0 bytes src/displayapp/Icons/battery/os_battery_090.c | 56 -- src/displayapp/Icons/battery/os_battery_090.png | Bin 1554 -> 0 bytes src/displayapp/Icons/battery/os_battery_100.c | 58 -- src/displayapp/Icons/battery/os_battery_100.png | Bin 1574 -> 0 bytes src/displayapp/Icons/battery/os_battery_error.c | 58 -- src/displayapp/Icons/battery/os_battery_error.png | Bin 2128 -> 0 bytes .../Icons/battery/os_batterycharging_005.c | 56 -- .../Icons/battery/os_batterycharging_005.png | Bin 1952 -> 0 bytes .../Icons/battery/os_batterycharging_010.c | 58 -- .../Icons/battery/os_batterycharging_010.png | Bin 1983 -> 0 bytes .../Icons/battery/os_batterycharging_020.c | 58 -- .../Icons/battery/os_batterycharging_020.png | Bin 1982 -> 0 bytes .../Icons/battery/os_batterycharging_030.c | 58 -- .../Icons/battery/os_batterycharging_030.png | Bin 1997 -> 0 bytes .../Icons/battery/os_batterycharging_040.c | 56 -- .../Icons/battery/os_batterycharging_040.png | Bin 1993 -> 0 bytes .../Icons/battery/os_batterycharging_050.c | 56 -- .../Icons/battery/os_batterycharging_050.png | Bin 2036 -> 0 bytes .../Icons/battery/os_batterycharging_060.c | 56 -- .../Icons/battery/os_batterycharging_060.png | Bin 2035 -> 0 bytes .../Icons/battery/os_batterycharging_070.c | 56 -- .../Icons/battery/os_batterycharging_070.png | Bin 2035 -> 0 bytes .../Icons/battery/os_batterycharging_080.c | 58 -- .../Icons/battery/os_batterycharging_080.png | Bin 2087 -> 0 bytes .../Icons/battery/os_batterycharging_090.c | 58 -- .../Icons/battery/os_batterycharging_090.png | Bin 2100 -> 0 bytes .../Icons/battery/os_batterycharging_100.c | 56 -- .../Icons/battery/os_batterycharging_100.png | Bin 1919 -> 0 bytes .../Icons/bluetooth/ck_os_bt_connected.png | Bin 2237 -> 0 bytes .../Icons/bluetooth/ck_os_bt_disconnected.png | Bin 2441 -> 0 bytes src/displayapp/Icons/bluetooth/os_bt_connected.c | 56 -- src/displayapp/Icons/bluetooth/os_bt_connected.png | Bin 2237 -> 0 bytes .../Icons/bluetooth/os_bt_disconnected.c | 58 -- .../Icons/bluetooth/os_bt_disconnected.png | Bin 2441 -> 0 bytes src/displayapp/fonts/Readme.md | 23 + src/displayapp/fonts/jetbrains_mono_bold_20.c | 766 +++++++++++++++++++++ .../fonts/jetbrains_mono_extrabold_compressed.c | 507 ++++++++++++++ src/displayapp/icons/battery/os_battery_005.c | 56 ++ src/displayapp/icons/battery/os_battery_005.png | Bin 0 -> 1540 bytes src/displayapp/icons/battery/os_battery_010.c | 58 ++ src/displayapp/icons/battery/os_battery_010.png | Bin 0 -> 1859 bytes src/displayapp/icons/battery/os_battery_020.c | 58 ++ src/displayapp/icons/battery/os_battery_020.png | Bin 0 -> 1558 bytes src/displayapp/icons/battery/os_battery_030.c | 58 ++ src/displayapp/icons/battery/os_battery_030.png | Bin 0 -> 1553 bytes src/displayapp/icons/battery/os_battery_040.c | 56 ++ src/displayapp/icons/battery/os_battery_040.png | Bin 0 -> 1542 bytes src/displayapp/icons/battery/os_battery_050.c | 56 ++ src/displayapp/icons/battery/os_battery_050.png | Bin 0 -> 1539 bytes src/displayapp/icons/battery/os_battery_060.c | 56 ++ src/displayapp/icons/battery/os_battery_060.png | Bin 0 -> 1543 bytes src/displayapp/icons/battery/os_battery_070.c | 56 ++ src/displayapp/icons/battery/os_battery_070.png | Bin 0 -> 1545 bytes src/displayapp/icons/battery/os_battery_080.c | 56 ++ src/displayapp/icons/battery/os_battery_080.png | Bin 0 -> 1549 bytes src/displayapp/icons/battery/os_battery_090.c | 56 ++ src/displayapp/icons/battery/os_battery_090.png | Bin 0 -> 1554 bytes src/displayapp/icons/battery/os_battery_100.c | 58 ++ src/displayapp/icons/battery/os_battery_100.png | Bin 0 -> 1574 bytes src/displayapp/icons/battery/os_battery_error.c | 58 ++ src/displayapp/icons/battery/os_battery_error.png | Bin 0 -> 2128 bytes .../icons/battery/os_batterycharging_005.c | 56 ++ .../icons/battery/os_batterycharging_005.png | Bin 0 -> 1952 bytes .../icons/battery/os_batterycharging_010.c | 58 ++ .../icons/battery/os_batterycharging_010.png | Bin 0 -> 1983 bytes .../icons/battery/os_batterycharging_020.c | 58 ++ .../icons/battery/os_batterycharging_020.png | Bin 0 -> 1982 bytes .../icons/battery/os_batterycharging_030.c | 58 ++ .../icons/battery/os_batterycharging_030.png | Bin 0 -> 1997 bytes .../icons/battery/os_batterycharging_040.c | 56 ++ .../icons/battery/os_batterycharging_040.png | Bin 0 -> 1993 bytes .../icons/battery/os_batterycharging_050.c | 56 ++ .../icons/battery/os_batterycharging_050.png | Bin 0 -> 2036 bytes .../icons/battery/os_batterycharging_060.c | 56 ++ .../icons/battery/os_batterycharging_060.png | Bin 0 -> 2035 bytes .../icons/battery/os_batterycharging_070.c | 56 ++ .../icons/battery/os_batterycharging_070.png | Bin 0 -> 2035 bytes .../icons/battery/os_batterycharging_080.c | 58 ++ .../icons/battery/os_batterycharging_080.png | Bin 0 -> 2087 bytes .../icons/battery/os_batterycharging_090.c | 58 ++ .../icons/battery/os_batterycharging_090.png | Bin 0 -> 2100 bytes .../icons/battery/os_batterycharging_100.c | 56 ++ .../icons/battery/os_batterycharging_100.png | Bin 0 -> 1919 bytes .../icons/bluetooth/ck_os_bt_connected.png | Bin 0 -> 2237 bytes .../icons/bluetooth/ck_os_bt_disconnected.png | Bin 0 -> 2441 bytes src/displayapp/icons/bluetooth/os_bt_connected.c | 56 ++ src/displayapp/icons/bluetooth/os_bt_connected.png | Bin 0 -> 2237 bytes .../icons/bluetooth/os_bt_disconnected.c | 58 ++ .../icons/bluetooth/os_bt_disconnected.png | Bin 0 -> 2441 bytes src/displayapp/screens/ApplicationList.cpp | 2 +- src/displayapp/screens/ApplicationList.h | 5 +- src/displayapp/screens/Brightness.h | 2 +- src/displayapp/screens/Clock.cpp | 3 +- src/displayapp/screens/Clock.h | 5 +- src/displayapp/screens/FirmwareUpdate.h | 3 +- src/displayapp/screens/FirmwareValidation.cpp | 2 +- src/displayapp/screens/InfiniPaint.h | 2 +- src/displayapp/screens/Music.h | 11 +- src/displayapp/screens/ScreenList.h | 2 +- src/displayapp/screens/SystemInfo.cpp | 2 +- src/displayapp/screens/SystemInfo.h | 5 +- src/displayapp/screens/Tile.cpp | 3 +- src/displayapp/screens/Tile.h | 2 +- src/main.cpp | 24 +- src/systemtask/SystemTask.cpp | 6 +- src/systemtask/SystemTask.h | 9 +- 199 files changed, 5836 insertions(+), 5823 deletions(-) delete mode 100644 src/components/Battery/BatteryController.cpp delete mode 100644 src/components/Battery/BatteryController.h delete mode 100644 src/components/Ble/AlertNotificationClient.cpp delete mode 100644 src/components/Ble/AlertNotificationClient.h delete mode 100644 src/components/Ble/AlertNotificationService.cpp delete mode 100644 src/components/Ble/AlertNotificationService.h delete mode 100644 src/components/Ble/BatteryInformationService.cpp delete mode 100644 src/components/Ble/BatteryInformationService.h delete mode 100644 src/components/Ble/BleController.cpp delete mode 100644 src/components/Ble/BleController.h delete mode 100644 src/components/Ble/CurrentTimeClient.cpp delete mode 100644 src/components/Ble/CurrentTimeClient.h delete mode 100644 src/components/Ble/CurrentTimeService.cpp delete mode 100644 src/components/Ble/CurrentTimeService.h delete mode 100644 src/components/Ble/DeviceInformationService.cpp delete mode 100644 src/components/Ble/DeviceInformationService.h delete mode 100644 src/components/Ble/DfuService.cpp delete mode 100644 src/components/Ble/DfuService.h delete mode 100644 src/components/Ble/ImmediateAlertService.cpp delete mode 100644 src/components/Ble/ImmediateAlertService.h delete mode 100644 src/components/Ble/MusicService.cpp delete mode 100644 src/components/Ble/MusicService.h delete mode 100644 src/components/Ble/NimbleController.cpp delete mode 100644 src/components/Ble/NimbleController.h delete mode 100644 src/components/Ble/NotificationManager.cpp delete mode 100644 src/components/Ble/NotificationManager.h delete mode 100644 src/components/Brightness/BrightnessController.cpp delete mode 100644 src/components/Brightness/BrightnessController.h delete mode 100644 src/components/DateTime/DateTimeController.cpp delete mode 100644 src/components/DateTime/DateTimeController.h delete mode 100644 src/components/FirmwareValidator/FirmwareValidator.cpp delete mode 100644 src/components/FirmwareValidator/FirmwareValidator.h delete mode 100644 src/components/Gfx/Gfx.cpp delete mode 100644 src/components/Gfx/Gfx.h create mode 100644 src/components/battery/BatteryController.cpp create mode 100644 src/components/battery/BatteryController.h create mode 100644 src/components/ble/AlertNotificationClient.cpp create mode 100644 src/components/ble/AlertNotificationClient.h create mode 100644 src/components/ble/AlertNotificationService.cpp create mode 100644 src/components/ble/AlertNotificationService.h create mode 100644 src/components/ble/BatteryInformationService.cpp create mode 100644 src/components/ble/BatteryInformationService.h create mode 100644 src/components/ble/BleController.cpp create mode 100644 src/components/ble/BleController.h create mode 100644 src/components/ble/CurrentTimeClient.cpp create mode 100644 src/components/ble/CurrentTimeClient.h create mode 100644 src/components/ble/CurrentTimeService.cpp create mode 100644 src/components/ble/CurrentTimeService.h create mode 100644 src/components/ble/DeviceInformationService.cpp create mode 100644 src/components/ble/DeviceInformationService.h create mode 100644 src/components/ble/DfuService.cpp create mode 100644 src/components/ble/DfuService.h create mode 100644 src/components/ble/ImmediateAlertService.cpp create mode 100644 src/components/ble/ImmediateAlertService.h create mode 100644 src/components/ble/MusicService.cpp create mode 100644 src/components/ble/MusicService.h create mode 100644 src/components/ble/NimbleController.cpp create mode 100644 src/components/ble/NimbleController.h create mode 100644 src/components/ble/NotificationManager.cpp create mode 100644 src/components/ble/NotificationManager.h create mode 100644 src/components/brightness/BrightnessController.cpp create mode 100644 src/components/brightness/BrightnessController.h create mode 100644 src/components/datetime/DateTimeController.cpp create mode 100644 src/components/datetime/DateTimeController.h create mode 100644 src/components/firmwarevalidator/FirmwareValidator.cpp create mode 100644 src/components/firmwarevalidator/FirmwareValidator.h create mode 100644 src/components/gfx/Gfx.cpp create mode 100644 src/components/gfx/Gfx.h delete mode 100644 src/displayapp/Fonts/Readme.md delete mode 100644 src/displayapp/Fonts/jetbrains_mono_bold_20.c delete mode 100644 src/displayapp/Fonts/jetbrains_mono_extrabold_compressed.c delete mode 100644 src/displayapp/Icons/battery/os_battery_005.c delete mode 100644 src/displayapp/Icons/battery/os_battery_005.png delete mode 100644 src/displayapp/Icons/battery/os_battery_010.c delete mode 100644 src/displayapp/Icons/battery/os_battery_010.png delete mode 100644 src/displayapp/Icons/battery/os_battery_020.c delete mode 100644 src/displayapp/Icons/battery/os_battery_020.png delete mode 100644 src/displayapp/Icons/battery/os_battery_030.c delete mode 100644 src/displayapp/Icons/battery/os_battery_030.png delete mode 100644 src/displayapp/Icons/battery/os_battery_040.c delete mode 100644 src/displayapp/Icons/battery/os_battery_040.png delete mode 100644 src/displayapp/Icons/battery/os_battery_050.c delete mode 100644 src/displayapp/Icons/battery/os_battery_050.png delete mode 100644 src/displayapp/Icons/battery/os_battery_060.c delete mode 100644 src/displayapp/Icons/battery/os_battery_060.png delete mode 100644 src/displayapp/Icons/battery/os_battery_070.c delete mode 100644 src/displayapp/Icons/battery/os_battery_070.png delete mode 100644 src/displayapp/Icons/battery/os_battery_080.c delete mode 100644 src/displayapp/Icons/battery/os_battery_080.png delete mode 100644 src/displayapp/Icons/battery/os_battery_090.c delete mode 100644 src/displayapp/Icons/battery/os_battery_090.png delete mode 100644 src/displayapp/Icons/battery/os_battery_100.c delete mode 100644 src/displayapp/Icons/battery/os_battery_100.png delete mode 100644 src/displayapp/Icons/battery/os_battery_error.c delete mode 100644 src/displayapp/Icons/battery/os_battery_error.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_005.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_005.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_010.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_010.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_020.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_020.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_030.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_030.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_040.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_040.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_050.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_050.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_060.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_060.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_070.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_070.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_080.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_080.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_090.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_090.png delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_100.c delete mode 100644 src/displayapp/Icons/battery/os_batterycharging_100.png delete mode 100644 src/displayapp/Icons/bluetooth/ck_os_bt_connected.png delete mode 100644 src/displayapp/Icons/bluetooth/ck_os_bt_disconnected.png delete mode 100644 src/displayapp/Icons/bluetooth/os_bt_connected.c delete mode 100644 src/displayapp/Icons/bluetooth/os_bt_connected.png delete mode 100644 src/displayapp/Icons/bluetooth/os_bt_disconnected.c delete mode 100644 src/displayapp/Icons/bluetooth/os_bt_disconnected.png create mode 100644 src/displayapp/fonts/Readme.md create mode 100644 src/displayapp/fonts/jetbrains_mono_bold_20.c create mode 100644 src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c create mode 100644 src/displayapp/icons/battery/os_battery_005.c create mode 100644 src/displayapp/icons/battery/os_battery_005.png create mode 100644 src/displayapp/icons/battery/os_battery_010.c create mode 100644 src/displayapp/icons/battery/os_battery_010.png create mode 100644 src/displayapp/icons/battery/os_battery_020.c create mode 100644 src/displayapp/icons/battery/os_battery_020.png create mode 100644 src/displayapp/icons/battery/os_battery_030.c create mode 100644 src/displayapp/icons/battery/os_battery_030.png create mode 100644 src/displayapp/icons/battery/os_battery_040.c create mode 100644 src/displayapp/icons/battery/os_battery_040.png create mode 100644 src/displayapp/icons/battery/os_battery_050.c create mode 100644 src/displayapp/icons/battery/os_battery_050.png create mode 100644 src/displayapp/icons/battery/os_battery_060.c create mode 100644 src/displayapp/icons/battery/os_battery_060.png create mode 100644 src/displayapp/icons/battery/os_battery_070.c create mode 100644 src/displayapp/icons/battery/os_battery_070.png create mode 100644 src/displayapp/icons/battery/os_battery_080.c create mode 100644 src/displayapp/icons/battery/os_battery_080.png create mode 100644 src/displayapp/icons/battery/os_battery_090.c create mode 100644 src/displayapp/icons/battery/os_battery_090.png create mode 100644 src/displayapp/icons/battery/os_battery_100.c create mode 100644 src/displayapp/icons/battery/os_battery_100.png create mode 100644 src/displayapp/icons/battery/os_battery_error.c create mode 100644 src/displayapp/icons/battery/os_battery_error.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_005.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_005.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_010.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_010.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_020.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_020.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_030.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_030.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_040.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_040.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_050.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_050.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_060.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_060.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_070.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_070.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_080.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_080.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_090.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_090.png create mode 100644 src/displayapp/icons/battery/os_batterycharging_100.c create mode 100644 src/displayapp/icons/battery/os_batterycharging_100.png create mode 100644 src/displayapp/icons/bluetooth/ck_os_bt_connected.png create mode 100644 src/displayapp/icons/bluetooth/ck_os_bt_disconnected.png create mode 100644 src/displayapp/icons/bluetooth/os_bt_connected.c create mode 100644 src/displayapp/icons/bluetooth/os_bt_connected.png create mode 100644 src/displayapp/icons/bluetooth/os_bt_disconnected.c create mode 100644 src/displayapp/icons/bluetooth/os_bt_disconnected.png diff --git a/README.md b/README.md index 3a1b7b56..a3a589f7 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ As of now, here is the list of achievements of this project: ## Documentation ### Develop - - [Generate the fonts and symbols](src/DisplayApp/Fonts/Readme.md) + - [Generate the fonts and symbols](src/displayapp/fonts/Readme.md) ### Build, flash and debug - [Project branches](doc/branches.md) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d03e904..2f38ec58 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -292,33 +292,33 @@ set(LVGL_SRC ) list(APPEND IMAGE_FILES - displayapp/Icons/battery/os_battery_error.c - displayapp/Icons/battery/os_battery_100.c - displayapp/Icons/battery/os_battery_090.c - displayapp/Icons/battery/os_battery_080.c - displayapp/Icons/battery/os_battery_070.c - displayapp/Icons/battery/os_battery_060.c - displayapp/Icons/battery/os_battery_050.c - displayapp/Icons/battery/os_battery_040.c - displayapp/Icons/battery/os_battery_030.c - displayapp/Icons/battery/os_battery_020.c - displayapp/Icons/battery/os_battery_010.c - displayapp/Icons/battery/os_battery_005.c - - displayapp/Icons/battery/os_batterycharging_100.c - displayapp/Icons/battery/os_batterycharging_090.c - displayapp/Icons/battery/os_batterycharging_080.c - displayapp/Icons/battery/os_batterycharging_070.c - displayapp/Icons/battery/os_batterycharging_060.c - displayapp/Icons/battery/os_batterycharging_050.c - displayapp/Icons/battery/os_batterycharging_040.c - displayapp/Icons/battery/os_batterycharging_030.c - displayapp/Icons/battery/os_batterycharging_020.c - displayapp/Icons/battery/os_batterycharging_010.c - displayapp/Icons/battery/os_batterycharging_005.c - - displayapp/Icons/bluetooth/os_bt_connected.c - displayapp/Icons/bluetooth/os_bt_disconnected.c + displayapp/icons/battery/os_battery_error.c + displayapp/icons/battery/os_battery_100.c + displayapp/icons/battery/os_battery_090.c + displayapp/icons/battery/os_battery_080.c + displayapp/icons/battery/os_battery_070.c + displayapp/icons/battery/os_battery_060.c + displayapp/icons/battery/os_battery_050.c + displayapp/icons/battery/os_battery_040.c + displayapp/icons/battery/os_battery_030.c + displayapp/icons/battery/os_battery_020.c + displayapp/icons/battery/os_battery_010.c + displayapp/icons/battery/os_battery_005.c + + displayapp/icons/battery/os_batterycharging_100.c + displayapp/icons/battery/os_batterycharging_090.c + displayapp/icons/battery/os_batterycharging_080.c + displayapp/icons/battery/os_batterycharging_070.c + displayapp/icons/battery/os_batterycharging_060.c + displayapp/icons/battery/os_batterycharging_050.c + displayapp/icons/battery/os_batterycharging_040.c + displayapp/icons/battery/os_batterycharging_030.c + displayapp/icons/battery/os_batterycharging_020.c + displayapp/icons/battery/os_batterycharging_010.c + displayapp/icons/battery/os_batterycharging_005.c + + displayapp/icons/bluetooth/os_bt_connected.c + displayapp/icons/bluetooth/os_bt_disconnected.c ) list(APPEND SOURCE_FILES @@ -349,30 +349,30 @@ list(APPEND SOURCE_FILES drivers/Watchdog.cpp drivers/DebugPins.cpp drivers/InternalFlash.cpp - components/Battery/BatteryController.cpp - components/Ble/BleController.cpp - components/Ble/NotificationManager.cpp - components/DateTime/DateTimeController.cpp - components/Brightness/BrightnessController.cpp - components/Ble/NimbleController.cpp - components/Ble/DeviceInformationService.cpp - components/Ble/CurrentTimeClient.cpp - components/Ble/AlertNotificationClient.cpp - components/Ble/DfuService.cpp - components/Ble/CurrentTimeService.cpp - components/Ble/AlertNotificationService.cpp - components/Ble/MusicService.cpp - components/Ble/BatteryInformationService.cpp - components/Ble/ImmediateAlertService.cpp - components/FirmwareValidator/FirmwareValidator.cpp + components/battery/BatteryController.cpp + components/ble/BleController.cpp + components/ble/NotificationManager.cpp + components/datetime/DateTimeController.cpp + components/brightness/BrightnessController.cpp + components/ble/NimbleController.cpp + components/ble/DeviceInformationService.cpp + components/ble/CurrentTimeClient.cpp + components/ble/AlertNotificationClient.cpp + components/ble/DfuService.cpp + components/ble/CurrentTimeService.cpp + components/ble/AlertNotificationService.cpp + components/ble/MusicService.cpp + components/ble/BatteryInformationService.cpp + components/ble/ImmediateAlertService.cpp + components/firmwarevalidator/FirmwareValidator.cpp drivers/Cst816s.cpp FreeRTOS/port.c FreeRTOS/port_cmsis_systick.c FreeRTOS/port_cmsis.c displayapp/LittleVgl.cpp - displayapp/Fonts/jetbrains_mono_extrabold_compressed.c - displayapp/Fonts/jetbrains_mono_bold_20.c + displayapp/fonts/jetbrains_mono_extrabold_compressed.c + displayapp/fonts/jetbrains_mono_bold_20.c systemtask/SystemTask.cpp drivers/TwiMaster.cpp @@ -389,9 +389,9 @@ list(APPEND GRAPHICS_SOURCE_FILES drivers/Spi.cpp logging/NrfLogger.cpp - components/Gfx/Gfx.cpp + components/gfx/Gfx.cpp drivers/St7789.cpp - components/Brightness/BrightnessController.cpp + components/brightness/BrightnessController.cpp graphics.cpp ) @@ -426,19 +426,19 @@ set(INCLUDE_FILES drivers/Watchdog.h drivers/DebugPins.h drivers/InternalFlash.h - components/Battery/BatteryController.h - components/Ble/BleController.h - components/Ble/NotificationManager.h - components/DateTime/DateTimeController.h - components/Brightness/BrightnessController.h - components/Ble/NimbleController.h - components/Ble/DeviceInformationService.h - components/Ble/CurrentTimeClient.h - components/Ble/AlertNotificationClient.h - components/Ble/DfuService.h - components/FirmwareValidator/FirmwareValidator.h - components/Ble/BatteryInformationService.h - components/Ble/ImmediateAlertService.h + components/battery/BatteryController.h + components/ble/BleController.h + components/ble/NotificationManager.h + components/datetime/DateTimeController.h + components/brightness/BrightnessController.h + components/ble/NimbleController.h + components/ble/DeviceInformationService.h + components/ble/CurrentTimeClient.h + components/ble/AlertNotificationClient.h + components/ble/DfuService.h + components/firmwarevalidator/FirmwareValidator.h + components/ble/BatteryInformationService.h + components/ble/ImmediateAlertService.h drivers/Cst816s.h FreeRTOS/portmacro.h FreeRTOS/portmacro_cmsis.h diff --git a/src/components/Battery/BatteryController.cpp b/src/components/Battery/BatteryController.cpp deleted file mode 100644 index 571efae6..00000000 --- a/src/components/Battery/BatteryController.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include -#include -#include -#include "BatteryController.h" - -using namespace Pinetime::Controllers; - -void Battery::Init() { - nrf_gpio_cfg_input(chargingPin, (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pullup); - nrf_gpio_cfg_input(powerPresentPin, (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pullup); - - nrfx_saadc_config_t adcConfig = NRFX_SAADC_DEFAULT_CONFIG; - nrfx_saadc_init(&adcConfig, SaadcEventHandler); - nrf_saadc_channel_config_t adcChannelConfig = { - .resistor_p = NRF_SAADC_RESISTOR_DISABLED, - .resistor_n = NRF_SAADC_RESISTOR_DISABLED, - .gain = NRF_SAADC_GAIN1_5, - .reference = NRF_SAADC_REFERENCE_INTERNAL, - .acq_time = NRF_SAADC_ACQTIME_3US, - .mode = NRF_SAADC_MODE_SINGLE_ENDED, - .burst = NRF_SAADC_BURST_DISABLED, - .pin_p = batteryVoltageAdcInput, - .pin_n = NRF_SAADC_INPUT_DISABLED - }; - nrfx_saadc_channel_init(0, &adcChannelConfig); -} - -void Battery::Update() { - isCharging = !nrf_gpio_pin_read(chargingPin); - isPowerPresent = !nrf_gpio_pin_read(powerPresentPin); - - nrf_saadc_value_t value = 0; - nrfx_saadc_sample_convert(0, &value); - - // see https://forum.pine64.org/showthread.php?tid=8147 - voltage = (value * 2.0f) / (1024/3.0f); - percentRemaining = ((voltage - 3.55f)*100.0f)*3.9f; - percentRemaining = std::max(percentRemaining, 0.0f); - percentRemaining = std::min(percentRemaining, 100.0f); - -// NRF_LOG_INFO("BATTERY " NRF_LOG_FLOAT_MARKER " %% - " NRF_LOG_FLOAT_MARKER " v", NRF_LOG_FLOAT(percentRemaining), NRF_LOG_FLOAT(voltage)); -// NRF_LOG_INFO("POWER Charging : %d - Power : %d", isCharging, isPowerPresent); -} - -void Battery::SaadcEventHandler(nrfx_saadc_evt_t const * event) { - -} \ No newline at end of file diff --git a/src/components/Battery/BatteryController.h b/src/components/Battery/BatteryController.h deleted file mode 100644 index f07648a9..00000000 --- a/src/components/Battery/BatteryController.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once -#include - - -namespace Pinetime { - namespace Controllers { - class Battery { - public: - void Init(); - void Update(); - float PercentRemaining() const { return percentRemaining; } - float Voltage() const { return voltage; } - bool IsCharging() const { return isCharging; } - bool IsPowerPresent() const { return isPowerPresent; } - - private: - static constexpr uint32_t chargingPin = 12; - static constexpr uint32_t powerPresentPin = 19; - static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7; - static void SaadcEventHandler(nrfx_saadc_evt_t const * p_event); - float percentRemaining = 0.0f; - float voltage = 0.0f; - bool isCharging = false; - bool isPowerPresent = false; - }; - } -} \ No newline at end of file diff --git a/src/components/Ble/AlertNotificationClient.cpp b/src/components/Ble/AlertNotificationClient.cpp deleted file mode 100644 index 3e4b495f..00000000 --- a/src/components/Ble/AlertNotificationClient.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include -#include "NotificationManager.h" - -#include "AlertNotificationClient.h" - - -using namespace Pinetime::Controllers; -constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid; - -constexpr ble_uuid16_t AlertNotificationClient::supportedNewAlertCategoryUuid; -constexpr ble_uuid16_t AlertNotificationClient::supportedUnreadAlertCategoryUuid ; -constexpr ble_uuid16_t AlertNotificationClient::newAlertUuid; -constexpr ble_uuid16_t AlertNotificationClient::unreadAlertStatusUuid; -constexpr ble_uuid16_t AlertNotificationClient::controlPointUuid; - -int Pinetime::Controllers::NewAlertSubcribeCallback(uint16_t conn_handle, - const struct ble_gatt_error *error, - struct ble_gatt_attr *attr, - void *arg) { - auto client = static_cast(arg); - return client->OnNewAlertSubcribe(conn_handle, error, attr); -} - -AlertNotificationClient::AlertNotificationClient(Pinetime::System::SystemTask& systemTask, - Pinetime::Controllers::NotificationManager& notificationManager) : - systemTask{systemTask}, notificationManager{notificationManager}{ - -} - -bool AlertNotificationClient::OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service) { - if(service == nullptr && error->status == BLE_HS_EDONE) { - NRF_LOG_INFO("ANS Discovery complete"); - return true; - } - - if(service != nullptr && ble_uuid_cmp(((ble_uuid_t*)&ansServiceUuid), &service->uuid.u) == 0) { - NRF_LOG_INFO("ANS discovered : 0x%x", service->start_handle); - ansStartHandle = service->start_handle; - ansEndHandle = service->end_handle; - isDiscovered = true; - } - return false; -} - -int AlertNotificationClient::OnCharacteristicsDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, - const ble_gatt_chr *characteristic) { - if(error->status != 0 && error->status != BLE_HS_EDONE) { - NRF_LOG_INFO("ANS Characteristic discovery ERROR"); - return 0; - } - - if(characteristic == nullptr && error->status == BLE_HS_EDONE) { - NRF_LOG_INFO("ANS Characteristic discovery complete"); - } else { - if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&supportedNewAlertCategoryUuid), &characteristic->uuid.u) == 0) { - NRF_LOG_INFO("ANS Characteristic discovered : supportedNewAlertCategoryUuid"); - supportedNewAlertCategoryHandle = characteristic->val_handle; - } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&supportedUnreadAlertCategoryUuid), &characteristic->uuid.u) == 0) { - NRF_LOG_INFO("ANS Characteristic discovered : supportedUnreadAlertCategoryUuid"); - supportedUnreadAlertCategoryHandle = characteristic->val_handle; - } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&newAlertUuid), &characteristic->uuid.u) == 0) { - NRF_LOG_INFO("ANS Characteristic discovered : newAlertUuid"); - newAlertHandle = characteristic->val_handle; - newAlertDefHandle = characteristic->def_handle; - } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&unreadAlertStatusUuid), &characteristic->uuid.u) == 0) { - NRF_LOG_INFO("ANS Characteristic discovered : unreadAlertStatusUuid"); - unreadAlertStatusHandle = characteristic->val_handle; - } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&controlPointUuid), &characteristic->uuid.u) == 0) { - NRF_LOG_INFO("ANS Characteristic discovered : controlPointUuid"); - controlPointHandle = characteristic->val_handle; - }else - NRF_LOG_INFO("ANS Characteristic discovered : 0x%x", characteristic->val_handle); - } - return 0; -} - -int AlertNotificationClient::OnNewAlertSubcribe(uint16_t connectionHandle, const ble_gatt_error *error, - ble_gatt_attr *attribute) { - if(error->status == 0) { - NRF_LOG_INFO("ANS New alert subscribe OK"); - } else { - NRF_LOG_INFO("ANS New alert subscribe ERROR"); - } - - return 0; -} - -int AlertNotificationClient::OnDescriptorDiscoveryEventCallback(uint16_t connectionHandle, const ble_gatt_error *error, - uint16_t characteristicValueHandle, - const ble_gatt_dsc *descriptor) { - if(error->status == 0) { - if(characteristicValueHandle == newAlertHandle && ble_uuid_cmp(((ble_uuid_t*)&newAlertUuid), &descriptor->uuid.u)) { - if(newAlertDescriptorHandle == 0) { - NRF_LOG_INFO("ANS Descriptor discovered : %d", descriptor->handle); - newAlertDescriptorHandle = descriptor->handle; - uint8_t value[2]; - value[0] = 1; - value[1] = 0; - ble_gattc_write_flat(connectionHandle, newAlertDescriptorHandle, value, sizeof(value), NewAlertSubcribeCallback, this); - } - } - } - return 0; -} - -void AlertNotificationClient::OnNotification(ble_gap_event *event) { - if(event->notify_rx.attr_handle == newAlertHandle) { - // TODO implement this with more memory safety (and constexpr) - static const size_t maxBufferSize{21}; - static const size_t maxMessageSize{18}; - size_t bufferSize = min(OS_MBUF_PKTLEN(event->notify_rx.om), maxBufferSize); - - uint8_t data[bufferSize]; - os_mbuf_copydata(event->notify_rx.om, 0, bufferSize, data); - - char *s = (char *) &data[3]; - auto messageSize = min(maxMessageSize, (bufferSize-3)); - - for (uint i = 0; i < messageSize-1; i++) { - if (s[i] == 0x00) { - s[i] = 0x0A; - } - } - s[messageSize-1] = '\0'; - - notificationManager.Push(Pinetime::Controllers::NotificationManager::Categories::SimpleAlert, s, messageSize); - systemTask.PushMessage(Pinetime::System::SystemTask::Messages::OnNewNotification); - } -} - -bool AlertNotificationClient::IsDiscovered() const { - return isDiscovered; -} - -uint16_t AlertNotificationClient::StartHandle() const { - return ansStartHandle; -} - -uint16_t AlertNotificationClient::EndHandle() const { - return ansEndHandle; -} - -uint16_t AlertNotificationClient::NewAlerthandle() const { - return newAlertHandle; -} diff --git a/src/components/Ble/AlertNotificationClient.h b/src/components/Ble/AlertNotificationClient.h deleted file mode 100644 index ca4f4e94..00000000 --- a/src/components/Ble/AlertNotificationClient.h +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once - -#include -#include -#include - - -namespace Pinetime { - namespace Controllers { - int NewAlertSubcribeCallback(uint16_t conn_handle, - const struct ble_gatt_error *error, - struct ble_gatt_attr *attr, - void *arg); - - class AlertNotificationClient { - public: - explicit AlertNotificationClient(Pinetime::System::SystemTask &systemTask, - Pinetime::Controllers::NotificationManager ¬ificationManager); - - bool OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service); - int OnCharacteristicsDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, - const ble_gatt_chr *characteristic); - int OnNewAlertSubcribe(uint16_t connectionHandle, const ble_gatt_error *error, ble_gatt_attr *attribute); - int OnDescriptorDiscoveryEventCallback(uint16_t connectionHandle, const ble_gatt_error *error, - uint16_t characteristicValueHandle, const ble_gatt_dsc *descriptor); - void OnNotification(ble_gap_event *event); - bool IsDiscovered() const; - uint16_t StartHandle() const; - uint16_t EndHandle() const; - - static constexpr const ble_uuid16_t &Uuid() { return ansServiceUuid; } - - uint16_t NewAlerthandle() const; - private: - static constexpr uint16_t ansServiceId{0x1811}; - static constexpr uint16_t supportedNewAlertCategoryId = 0x2a47; - static constexpr uint16_t supportedUnreadAlertCategoryId = 0x2a48; - static constexpr uint16_t newAlertId = 0x2a46; - static constexpr uint16_t unreadAlertStatusId = 0x2a45; - static constexpr uint16_t controlPointId = 0x2a44; - - static constexpr ble_uuid16_t ansServiceUuid{ - .u {.type = BLE_UUID_TYPE_16}, - .value = ansServiceId - }; - static constexpr ble_uuid16_t supportedNewAlertCategoryUuid{ - .u {.type = BLE_UUID_TYPE_16}, - .value = supportedNewAlertCategoryId - }; - static constexpr ble_uuid16_t supportedUnreadAlertCategoryUuid{ - .u {.type = BLE_UUID_TYPE_16}, - .value = supportedUnreadAlertCategoryId - }; - static constexpr ble_uuid16_t newAlertUuid{ - .u {.type = BLE_UUID_TYPE_16}, - .value = newAlertId - }; - static constexpr ble_uuid16_t unreadAlertStatusUuid{ - .u {.type = BLE_UUID_TYPE_16}, - .value = unreadAlertStatusId - }; - static constexpr ble_uuid16_t controlPointUuid{ - .u {.type = BLE_UUID_TYPE_16}, - .value = controlPointId - }; - - uint16_t ansStartHandle; - uint16_t ansEndHandle; - uint16_t supportedNewAlertCategoryHandle; - uint16_t supportedUnreadAlertCategoryHandle; - uint16_t newAlertHandle; - uint16_t newAlertDescriptorHandle = 0; - uint16_t newAlertDefHandle; - uint16_t unreadAlertStatusHandle; - uint16_t controlPointHandle; - bool isDiscovered = false; - Pinetime::System::SystemTask &systemTask; - Pinetime::Controllers::NotificationManager ¬ificationManager; - }; - } -} \ No newline at end of file diff --git a/src/components/Ble/AlertNotificationService.cpp b/src/components/Ble/AlertNotificationService.cpp deleted file mode 100644 index ce2f7dd7..00000000 --- a/src/components/Ble/AlertNotificationService.cpp +++ /dev/null @@ -1,80 +0,0 @@ - -#include -#include "NotificationManager.h" -#include - -#include "AlertNotificationService.h" -#include - -using namespace Pinetime::Controllers; - -constexpr ble_uuid16_t AlertNotificationService::ansUuid; -constexpr ble_uuid16_t AlertNotificationService::ansCharUuid; - - -int AlertNotificationCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { - auto anService = static_cast(arg); - return anService->OnAlert(conn_handle, attr_handle, ctxt); -} - -void AlertNotificationService::Init() { - int res; - res = ble_gatts_count_cfg(serviceDefinition); - ASSERT(res == 0); - - res = ble_gatts_add_svcs(serviceDefinition); - ASSERT(res == 0); -} - -AlertNotificationService::AlertNotificationService ( System::SystemTask& systemTask, NotificationManager& notificationManager ) - : characteristicDefinition{ - { - .uuid = (ble_uuid_t *) &ansCharUuid, - .access_cb = AlertNotificationCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE - }, - { - 0 - } - }, - serviceDefinition{ - { - /* Device Information Service */ - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t *) &ansUuid, - .characteristics = characteristicDefinition - }, - { - 0 - }, - }, m_systemTask{systemTask}, m_notificationManager{notificationManager} { -} - -int AlertNotificationService::OnAlert(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt) { - - if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { - // TODO implement this with more memory safety (and constexpr) - static const size_t maxBufferSize{21}; - static const size_t maxMessageSize{18}; - size_t bufferSize = min(OS_MBUF_PKTLEN(ctxt->om), maxBufferSize); - - uint8_t data[bufferSize]; - os_mbuf_copydata(ctxt->om, 0, bufferSize, data); - - char *s = (char *) &data[3]; - auto messageSize = min(maxMessageSize, (bufferSize-3)); - - for (uint i = 0; i < messageSize-1; i++) { - if (s[i] == 0x00) { - s[i] = 0x0A; - } - } - s[messageSize-1] = '\0'; - - m_notificationManager.Push(Pinetime::Controllers::NotificationManager::Categories::SimpleAlert, s, messageSize); - m_systemTask.PushMessage(Pinetime::System::SystemTask::Messages::OnNewNotification); - } - return 0; -} diff --git a/src/components/Ble/AlertNotificationService.h b/src/components/Ble/AlertNotificationService.h deleted file mode 100644 index 53cb44cc..00000000 --- a/src/components/Ble/AlertNotificationService.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once -#include -#include -#include - -namespace Pinetime { - namespace Controllers { - class AlertNotificationService { - public: - AlertNotificationService(Pinetime::System::SystemTask &systemTask, - Pinetime::Controllers::NotificationManager ¬ificationManager); - void Init(); - - int OnAlert(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt); - - - private: - static constexpr uint16_t ansId {0x1811}; - static constexpr uint16_t ansCharId {0x2a46}; - - static constexpr ble_uuid16_t ansUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = ansId - }; - - static constexpr ble_uuid16_t ansCharUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = ansCharId - }; - - struct ble_gatt_chr_def characteristicDefinition[2]; - struct ble_gatt_svc_def serviceDefinition[2]; - - Pinetime::System::SystemTask &m_systemTask; - NotificationManager &m_notificationManager; - }; - } -} diff --git a/src/components/Ble/BatteryInformationService.cpp b/src/components/Ble/BatteryInformationService.cpp deleted file mode 100644 index c86830b8..00000000 --- a/src/components/Ble/BatteryInformationService.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "BatteryInformationService.h" -#include "../Battery/BatteryController.h" - -using namespace Pinetime::Controllers; - -constexpr ble_uuid16_t BatteryInformationService::batteryInformationServiceUuid; -constexpr ble_uuid16_t BatteryInformationService::batteryLevelUuid; - - - -int BatteryInformationServiceCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { - auto* batteryInformationService = static_cast(arg); - return batteryInformationService->OnBatteryServiceRequested(conn_handle, attr_handle, ctxt); -} - -BatteryInformationService::BatteryInformationService(Controllers::Battery& batteryController) : - batteryController{batteryController}, - characteristicDefinition{ - { - .uuid = (ble_uuid_t *) &batteryLevelUuid, - .access_cb = BatteryInformationServiceCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - .val_handle = &batteryLevelHandle - }, - { - 0 - } - }, - serviceDefinition{ - { - /* Device Information Service */ - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t *) &batteryInformationServiceUuid, - .characteristics = characteristicDefinition - }, - { - 0 - }, - }{ - -} - -void BatteryInformationService::Init() { - int res = 0; - res = ble_gatts_count_cfg(serviceDefinition); - ASSERT(res == 0); - - res = ble_gatts_add_svcs(serviceDefinition); - ASSERT(res == 0); -} - -int BatteryInformationService::OnBatteryServiceRequested(uint16_t connectionHandle, uint16_t attributeHandle, - ble_gatt_access_ctxt *context) { - if(attributeHandle == batteryLevelHandle) { - NRF_LOG_INFO("BATTERY : handle = %d", batteryLevelHandle); - static uint8_t batteryValue = batteryController.PercentRemaining(); - int res = os_mbuf_append(context->om, &batteryValue, 1); - return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; - } - return 0; -} \ No newline at end of file diff --git a/src/components/Ble/BatteryInformationService.h b/src/components/Ble/BatteryInformationService.h deleted file mode 100644 index 74b2222c..00000000 --- a/src/components/Ble/BatteryInformationService.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -#include - -namespace Pinetime { - namespace System { - class SystemTask; - } - namespace Controllers { - class Battery; - class BatteryInformationService { - public: - BatteryInformationService(Controllers::Battery& batteryController); - void Init(); - - int - OnBatteryServiceRequested(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); - - private: - Controllers::Battery& batteryController; - static constexpr uint16_t batteryInformationServiceId {0x180F}; - static constexpr uint16_t batteryLevelId {0x2A19}; - - static constexpr ble_uuid16_t batteryInformationServiceUuid { - .u {.type = BLE_UUID_TYPE_16}, - .value = batteryInformationServiceId - }; - - static constexpr ble_uuid16_t batteryLevelUuid { - .u {.type = BLE_UUID_TYPE_16}, - .value = batteryLevelId - }; - - struct ble_gatt_chr_def characteristicDefinition[3]; - struct ble_gatt_svc_def serviceDefinition[2]; - - uint16_t batteryLevelHandle; - - }; - } -} diff --git a/src/components/Ble/BleController.cpp b/src/components/Ble/BleController.cpp deleted file mode 100644 index 2b396e12..00000000 --- a/src/components/Ble/BleController.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include "BleController.h" - -using namespace Pinetime::Controllers; - -void Ble::Connect() { - isConnected = true; -} - -void Ble::Disconnect() { - isConnected = false; -} - -void Ble::StartFirmwareUpdate() { - isFirmwareUpdating = true; -} - -void Ble::StopFirmwareUpdate() { - isFirmwareUpdating = false; -} - -void Ble::FirmwareUpdateTotalBytes(uint32_t totalBytes) { - firmwareUpdateTotalBytes = totalBytes; -} - -void Ble::FirmwareUpdateCurrentBytes(uint32_t currentBytes) { - firmwareUpdateCurrentBytes = currentBytes; -} - - diff --git a/src/components/Ble/BleController.h b/src/components/Ble/BleController.h deleted file mode 100644 index 3f52ea25..00000000 --- a/src/components/Ble/BleController.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace Pinetime { - namespace Controllers { - class Ble { - public: - using BleAddress = std::array; - enum class FirmwareUpdateStates {Idle, Running, Validated, Error}; - enum class AddressTypes { Public, Random }; - - Ble() = default; - bool IsConnected() const {return isConnected;} - void Connect(); - void Disconnect(); - - void StartFirmwareUpdate(); - void StopFirmwareUpdate(); - void FirmwareUpdateTotalBytes(uint32_t totalBytes); - void FirmwareUpdateCurrentBytes(uint32_t currentBytes); - void State(FirmwareUpdateStates state) { firmwareUpdateState = state; } - - bool IsFirmwareUpdating() const { return isFirmwareUpdating; } - uint32_t FirmwareUpdateTotalBytes() const { return firmwareUpdateTotalBytes; } - uint32_t FirmwareUpdateCurrentBytes() const { return firmwareUpdateCurrentBytes; } - FirmwareUpdateStates State() const { return firmwareUpdateState; } - - void Address(BleAddress&& addr) { address = addr; } - const BleAddress& Address() const { return address; } - void AddressType(AddressTypes t) { addressType = t;} - private: - bool isConnected = false; - bool isFirmwareUpdating = false; - uint32_t firmwareUpdateTotalBytes = 0; - uint32_t firmwareUpdateCurrentBytes = 0; - FirmwareUpdateStates firmwareUpdateState = FirmwareUpdateStates::Idle; - BleAddress address; - AddressTypes addressType; - - }; - } -} \ No newline at end of file diff --git a/src/components/Ble/CurrentTimeClient.cpp b/src/components/Ble/CurrentTimeClient.cpp deleted file mode 100644 index 7a225f4b..00000000 --- a/src/components/Ble/CurrentTimeClient.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include "CurrentTimeClient.h" - -using namespace Pinetime::Controllers; - -constexpr ble_uuid16_t CurrentTimeClient::ctsServiceUuid; -constexpr ble_uuid16_t CurrentTimeClient::currentTimeCharacteristicUuid; - -CurrentTimeClient::CurrentTimeClient(DateTime& dateTimeController) : dateTimeController{dateTimeController} { - -} - -void CurrentTimeClient::Init() { - -} - -bool CurrentTimeClient::OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service) { - if(service == nullptr && error->status == BLE_HS_EDONE) { - NRF_LOG_INFO("CTS Discovery complete"); - return true; - } - - if(service != nullptr && ble_uuid_cmp(((ble_uuid_t*)&ctsServiceUuid), &service->uuid.u) == 0) { - NRF_LOG_INFO("CTS discovered : 0x%x", service->start_handle); - isDiscovered = true; - ctsStartHandle = service->start_handle; - ctsEndHandle = service->end_handle; - return false; - } - return false; -} - -int CurrentTimeClient::OnCharacteristicDiscoveryEvent(uint16_t conn_handle, const ble_gatt_error *error, - const ble_gatt_chr *characteristic) { - if(characteristic == nullptr && error->status == BLE_HS_EDONE) { - NRF_LOG_INFO("CTS Characteristic discovery complete"); - return 0; - } - - if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)¤tTimeCharacteristicUuid), &characteristic->uuid.u) == 0) { - NRF_LOG_INFO("CTS Characteristic discovered : 0x%x", characteristic->val_handle); - currentTimeHandle = characteristic->val_handle; - } - return 0; -} - -int CurrentTimeClient::OnCurrentTimeReadResult(uint16_t conn_handle, const ble_gatt_error *error, const ble_gatt_attr *attribute) { - if(error->status == 0) { - // TODO check that attribute->handle equals the handle discovered in OnCharacteristicDiscoveryEvent - CtsData result; - os_mbuf_copydata(attribute->om, 0, sizeof(CtsData), &result); - NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", result.year, - result.month, result.dayofmonth, - result.hour, result.minute, result.second); - dateTimeController.SetTime(result.year, result.month, result.dayofmonth, - 0, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG)); - } else { - NRF_LOG_INFO("Error retrieving current time: %d", error->status); - } - return 0; -} - -bool CurrentTimeClient::IsDiscovered() const { - return isDiscovered; -} - -uint16_t CurrentTimeClient::StartHandle() const { - return ctsStartHandle; -} - -uint16_t CurrentTimeClient::EndHandle() const { - return ctsEndHandle; -} - -uint16_t CurrentTimeClient::CurrentTimeHandle() const { - return currentTimeHandle; -} \ No newline at end of file diff --git a/src/components/Ble/CurrentTimeClient.h b/src/components/Ble/CurrentTimeClient.h deleted file mode 100644 index fabcdaca..00000000 --- a/src/components/Ble/CurrentTimeClient.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once -#include -#include -#include -#include - -namespace Pinetime { - namespace Controllers { - - class CurrentTimeClient { - public: - explicit CurrentTimeClient(DateTime& dateTimeController); - void Init(); - bool OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service); - int OnCharacteristicDiscoveryEvent(uint16_t conn_handle, const ble_gatt_error *error, - const ble_gatt_chr *characteristic); - int OnCurrentTimeReadResult(uint16_t conn_handle, const ble_gatt_error *error, const ble_gatt_attr *attribute); - bool IsDiscovered() const; - uint16_t StartHandle() const; - uint16_t EndHandle() const; - uint16_t CurrentTimeHandle() const; - static constexpr const ble_uuid16_t* Uuid() { return &CurrentTimeClient::ctsServiceUuid; } - static constexpr const ble_uuid16_t* CurrentTimeCharacteristicUuid() { return &CurrentTimeClient::currentTimeCharacteristicUuid; } - private: - typedef struct __attribute__((packed)) { - uint16_t year; - uint8_t month; - uint8_t dayofmonth; - uint8_t hour; - uint8_t minute; - uint8_t second; - uint8_t millis; - uint8_t reason; - } CtsData; - - static constexpr uint16_t ctsServiceId {0x1805}; - static constexpr uint16_t currentTimeCharacteristicId {0x2a2b}; - - static constexpr ble_uuid16_t ctsServiceUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = ctsServiceId - }; - static constexpr ble_uuid16_t currentTimeCharacteristicUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = currentTimeCharacteristicId - }; - - uint16_t currentTimeHandle; - DateTime& dateTimeController; - bool isDiscovered = false; - uint16_t ctsStartHandle; - uint16_t ctsEndHandle; - }; - } -} \ No newline at end of file diff --git a/src/components/Ble/CurrentTimeService.cpp b/src/components/Ble/CurrentTimeService.cpp deleted file mode 100644 index 3a6264e2..00000000 --- a/src/components/Ble/CurrentTimeService.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "CurrentTimeService.h" -#include - -using namespace Pinetime::Controllers; - -constexpr ble_uuid16_t CurrentTimeService::ctsUuid; -constexpr ble_uuid16_t CurrentTimeService::ctChrUuid; - - -int CTSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { - auto cts = static_cast(arg); - return cts->OnTimeAccessed(conn_handle, attr_handle, ctxt); -} - -void CurrentTimeService::Init() { - int res; - res = ble_gatts_count_cfg(serviceDefinition); - ASSERT(res == 0); - - res = ble_gatts_add_svcs(serviceDefinition); - ASSERT(res == 0); -} - - -int CurrentTimeService::OnTimeAccessed(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt) { - - NRF_LOG_INFO("Setting time..."); - - if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { - CtsData result; - os_mbuf_copydata(ctxt->om, 0, sizeof(CtsData), &result); - - NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", result.year, - result.month, result.dayofmonth, - result.hour, result.minute, result.second); - - m_dateTimeController.SetTime(result.year, result.month, result.dayofmonth, - 0, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG)); - - } else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) { - CtsData currentDateTime; - currentDateTime.year = m_dateTimeController.Year(); - currentDateTime.month = static_cast(m_dateTimeController.Month()); - currentDateTime.dayofmonth = m_dateTimeController.Day(); - currentDateTime.hour = m_dateTimeController.Hours(); - currentDateTime.minute = m_dateTimeController.Minutes(); - currentDateTime.second = m_dateTimeController.Seconds(); - currentDateTime.millis = 0; - - - int res = os_mbuf_append(ctxt->om, ¤tDateTime, sizeof(CtsData)); - return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; - - } - - return 0; -} - -CurrentTimeService::CurrentTimeService(DateTime &dateTimeController) : - characteristicDefinition{ - { - .uuid = (ble_uuid_t *) &ctChrUuid, - .access_cb = CTSCallback, - - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ - }, - { - 0 - } - }, - serviceDefinition{ - { - /* Device Information Service */ - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t *) &ctsUuid, - .characteristics = characteristicDefinition - }, - { - 0 - }, - }, m_dateTimeController{dateTimeController} { - -} - diff --git a/src/components/Ble/CurrentTimeService.h b/src/components/Ble/CurrentTimeService.h deleted file mode 100644 index 58bc5ba6..00000000 --- a/src/components/Ble/CurrentTimeService.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once -#include -#include -#include -#include - -namespace Pinetime { - namespace Controllers { - class CurrentTimeService { - public: - CurrentTimeService(DateTime &dateTimeController); - void Init(); - - int OnTimeAccessed(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt); - - private: - static constexpr uint16_t ctsId {0x1805}; - static constexpr uint16_t ctsCharId {0x2a2b}; - - static constexpr ble_uuid16_t ctsUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = ctsId - }; - - static constexpr ble_uuid16_t ctChrUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = ctsCharId - }; - - struct ble_gatt_chr_def characteristicDefinition[2]; - struct ble_gatt_svc_def serviceDefinition[2]; - - typedef struct __attribute__((packed)) { - uint16_t year; - uint8_t month; - uint8_t dayofmonth; - uint8_t hour; - uint8_t minute; - uint8_t second; - uint8_t millis; - uint8_t reason; - } CtsData; - - DateTime &m_dateTimeController; - }; - } -} diff --git a/src/components/Ble/DeviceInformationService.cpp b/src/components/Ble/DeviceInformationService.cpp deleted file mode 100644 index 406db1cf..00000000 --- a/src/components/Ble/DeviceInformationService.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "DeviceInformationService.h" - -using namespace Pinetime::Controllers; - -constexpr ble_uuid16_t DeviceInformationService::manufacturerNameUuid; -constexpr ble_uuid16_t DeviceInformationService::modelNumberUuid; -constexpr ble_uuid16_t DeviceInformationService::serialNumberUuid; -constexpr ble_uuid16_t DeviceInformationService::fwRevisionUuid; -constexpr ble_uuid16_t DeviceInformationService::deviceInfoUuid; -constexpr ble_uuid16_t DeviceInformationService::hwRevisionUuid; -constexpr ble_uuid16_t DeviceInformationService::swRevisionUuid; - - -int DeviceInformationCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { - auto deviceInformationService = static_cast(arg); - return deviceInformationService->OnDeviceInfoRequested(conn_handle, attr_handle, ctxt); -} - -void DeviceInformationService::Init() { - int res = 0; - res = ble_gatts_count_cfg(serviceDefinition); - ASSERT(res == 0); - - res = ble_gatts_add_svcs(serviceDefinition); - ASSERT(res == 0); -} - - -int DeviceInformationService::OnDeviceInfoRequested(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt) { - const char *str; - - switch (ble_uuid_u16(ctxt->chr->uuid)) { - case manufacturerNameId: - str = manufacturerName; - break; - case modelNumberId: - str = modelNumber; - break; - case serialNumberId: - str = serialNumber; - break; - case fwRevisionId: - str = fwRevision; - break; - case hwRevisionId: - str = hwRevision; - break; - case swRevisionId: - str = swRevision; - break; - default: - return BLE_ATT_ERR_UNLIKELY; - } - - int res = os_mbuf_append(ctxt->om, str, strlen(str)); - return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; -} - -DeviceInformationService::DeviceInformationService() : - characteristicDefinition{ - { - .uuid = (ble_uuid_t *) &manufacturerNameUuid, - .access_cb = DeviceInformationCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - }, - { - .uuid = (ble_uuid_t *) &modelNumberUuid, - .access_cb = DeviceInformationCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - }, - { - .uuid = (ble_uuid_t *) &serialNumberUuid, - .access_cb = DeviceInformationCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - }, - { - .uuid = (ble_uuid_t *) &fwRevisionUuid, - .access_cb = DeviceInformationCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - }, - { - .uuid = (ble_uuid_t *) &hwRevisionUuid, - .access_cb = DeviceInformationCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - }, - { - .uuid = (ble_uuid_t *) &swRevisionUuid, - .access_cb = DeviceInformationCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - }, - { - 0 - } - }, - serviceDefinition{ - { - /* Device Information Service */ - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t *) &deviceInfoUuid, - .characteristics = characteristicDefinition - }, - { - 0 - }, - } - { - -} - diff --git a/src/components/Ble/DeviceInformationService.h b/src/components/Ble/DeviceInformationService.h deleted file mode 100644 index 25ab8402..00000000 --- a/src/components/Ble/DeviceInformationService.h +++ /dev/null @@ -1,76 +0,0 @@ -#pragma once -#include -#include - -#include -#include - -namespace Pinetime { - namespace Controllers { - class DeviceInformationService { - public: - DeviceInformationService(); - void Init(); - - int OnDeviceInfoRequested(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt); - - private: - static constexpr uint16_t deviceInfoId {0x180a}; - static constexpr uint16_t manufacturerNameId {0x2a29}; - static constexpr uint16_t modelNumberId {0x2a24}; - static constexpr uint16_t serialNumberId {0x2a25}; - static constexpr uint16_t fwRevisionId {0x2a26}; - static constexpr uint16_t hwRevisionId {0x2a27}; - static constexpr uint16_t swRevisionId {0x2a28}; - - static constexpr const char* manufacturerName = "PINE64"; - static constexpr const char* modelNumber = "PineTime"; - static constexpr const char* hwRevision = "1.0.0"; - static constexpr const char* serialNumber = "0"; - static constexpr const char* fwRevision = Version::VersionString(); - static constexpr const char* swRevision = "InfiniTime"; - - - static constexpr ble_uuid16_t deviceInfoUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = deviceInfoId - }; - - static constexpr ble_uuid16_t manufacturerNameUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = manufacturerNameId - }; - - static constexpr ble_uuid16_t modelNumberUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = modelNumberId - }; - - static constexpr ble_uuid16_t serialNumberUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = serialNumberId - }; - - static constexpr ble_uuid16_t fwRevisionUuid { - .u { .type = BLE_UUID_TYPE_16 }, - .value = fwRevisionId - }; - - static constexpr ble_uuid16_t hwRevisionUuid { - .u {.type = BLE_UUID_TYPE_16}, - .value = hwRevisionId - }; - - static constexpr ble_uuid16_t swRevisionUuid { - .u {.type = BLE_UUID_TYPE_16}, - .value = swRevisionId - }; - - struct ble_gatt_chr_def characteristicDefinition[7]; - struct ble_gatt_svc_def serviceDefinition[2]; - - - }; - } -} \ No newline at end of file diff --git a/src/components/Ble/DfuService.cpp b/src/components/Ble/DfuService.cpp deleted file mode 100644 index fcbefdd0..00000000 --- a/src/components/Ble/DfuService.cpp +++ /dev/null @@ -1,440 +0,0 @@ -#include -#include -#include -#include "DfuService.h" - -using namespace Pinetime::Controllers; - -constexpr ble_uuid128_t DfuService::serviceUuid; -constexpr ble_uuid128_t DfuService::controlPointCharacteristicUuid; -constexpr ble_uuid128_t DfuService::revisionCharacteristicUuid; -constexpr ble_uuid128_t DfuService::packetCharacteristicUuid; - -int DfuServiceCallback(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt, void *arg) { - auto dfuService = static_cast(arg); - return dfuService->OnServiceData(conn_handle, attr_handle, ctxt); -} - -void NotificationTimerCallback(TimerHandle_t xTimer) { - auto notificationManager = static_cast(pvTimerGetTimerID(xTimer)); - notificationManager->OnNotificationTimer(); -} - -void TimeoutTimerCallback(TimerHandle_t xTimer) { - auto dfuService = static_cast(pvTimerGetTimerID(xTimer)); - dfuService->OnTimeout(); -} - -DfuService::DfuService(Pinetime::System::SystemTask &systemTask, Pinetime::Controllers::Ble &bleController, - Pinetime::Drivers::SpiNorFlash &spiNorFlash) : - systemTask{systemTask}, - bleController{bleController}, - dfuImage{spiNorFlash}, - characteristicDefinition{ - { - .uuid = (ble_uuid_t *) &packetCharacteristicUuid, - .access_cb = DfuServiceCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE_NO_RSP, - .val_handle = nullptr, - }, - { - .uuid = (ble_uuid_t *) &controlPointCharacteristicUuid, - .access_cb = DfuServiceCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_NOTIFY, - .val_handle = nullptr, - }, - { - .uuid = (ble_uuid_t *) &revisionCharacteristicUuid, - .access_cb = DfuServiceCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_READ, - .val_handle = &revision, - - }, - { - 0 - } - - }, - serviceDefinition{ - { - /* Device Information Service */ - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t *) &serviceUuid, - .characteristics = characteristicDefinition - }, - { - 0 - }, - } { - timeoutTimer = xTimerCreate ("notificationTimer", 10000, pdFALSE, this, TimeoutTimerCallback); -} - -void DfuService::Init() { - int res; - res = ble_gatts_count_cfg(serviceDefinition); - ASSERT(res == 0); - - res = ble_gatts_add_svcs(serviceDefinition); - ASSERT(res == 0); -} - -int DfuService::OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context) { - if(bleController.IsFirmwareUpdating()){ - xTimerStart(timeoutTimer, 0); - } - - - ble_gatts_find_chr((ble_uuid_t *) &serviceUuid, (ble_uuid_t *) &packetCharacteristicUuid, nullptr, - &packetCharacteristicHandle); - ble_gatts_find_chr((ble_uuid_t *) &serviceUuid, (ble_uuid_t *) &controlPointCharacteristicUuid, nullptr, - &controlPointCharacteristicHandle); - ble_gatts_find_chr((ble_uuid_t *) &serviceUuid, (ble_uuid_t *) &revisionCharacteristicUuid, nullptr, - &revisionCharacteristicHandle); - - if (attributeHandle == packetCharacteristicHandle) { - if (context->op == BLE_GATT_ACCESS_OP_WRITE_CHR) - return WritePacketHandler(connectionHandle, context->om); - else return 0; - } else if (attributeHandle == controlPointCharacteristicHandle) { - if (context->op == BLE_GATT_ACCESS_OP_WRITE_CHR) - return ControlPointHandler(connectionHandle, context->om); - else return 0; - } else if (attributeHandle == revisionCharacteristicHandle) { - if (context->op == BLE_GATT_ACCESS_OP_READ_CHR) - return SendDfuRevision(context->om); - else return 0; - } else { - NRF_LOG_INFO("[DFU] Unknown Characteristic : %d", attributeHandle); - return 0; - } -} - -int DfuService::SendDfuRevision(os_mbuf *om) const { - int res = os_mbuf_append(om, &revision, sizeof(revision)); - return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; -} - -int DfuService::WritePacketHandler(uint16_t connectionHandle, os_mbuf *om) { - switch (state) { - case States::Start: { - softdeviceSize = om->om_data[0] + (om->om_data[1] << 8) + (om->om_data[2] << 16) + (om->om_data[3] << 24); - bootloaderSize = om->om_data[4] + (om->om_data[5] << 8) + (om->om_data[6] << 16) + (om->om_data[7] << 24); - applicationSize = om->om_data[8] + (om->om_data[9] << 8) + (om->om_data[10] << 16) + (om->om_data[11] << 24); - bleController.FirmwareUpdateTotalBytes(applicationSize); - NRF_LOG_INFO("[DFU] -> Start data received : SD size : %d, BT size : %d, app size : %d", softdeviceSize, - bootloaderSize, applicationSize); - - dfuImage.Erase(); - - uint8_t data[]{16, 1, 1}; - notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 3); - state = States::Init; - } - return 0; - case States::Init: { - uint16_t deviceType = om->om_data[0] + (om->om_data[1] << 8); - uint16_t deviceRevision = om->om_data[2] + (om->om_data[3] << 8); - uint32_t applicationVersion = - om->om_data[4] + (om->om_data[5] << 8) + (om->om_data[6] << 16) + (om->om_data[7] << 24); - uint16_t softdeviceArrayLength = om->om_data[8] + (om->om_data[9] << 8); - uint16_t sd[softdeviceArrayLength]; - for (int i = 0; i < softdeviceArrayLength; i++) { - sd[i] = om->om_data[10 + (i * 2)] + (om->om_data[10 + (i * 2) + 1] << 8); - } - expectedCrc = - om->om_data[10 + (softdeviceArrayLength * 2)] + (om->om_data[10 + (softdeviceArrayLength * 2) + 1] << 8); - - NRF_LOG_INFO( - "[DFU] -> Init data received : deviceType = %d, deviceRevision = %d, applicationVersion = %d, nb SD = %d, First SD = %d, CRC = %u", - deviceType, deviceRevision, applicationVersion, softdeviceArrayLength, sd[0], expectedCrc); - - return 0; - } - - case States::Data: { - nbPacketReceived++; - dfuImage.Append(om->om_data, om->om_len); - bytesReceived += om->om_len; - bleController.FirmwareUpdateCurrentBytes(bytesReceived); - - if ((nbPacketReceived % nbPacketsToNotify) == 0 && bytesReceived != applicationSize) { - uint8_t data[5]{static_cast(Opcodes::PacketReceiptNotification), - (uint8_t) (bytesReceived & 0x000000FFu), (uint8_t) (bytesReceived >> 8u), - (uint8_t) (bytesReceived >> 16u), (uint8_t) (bytesReceived >> 24u)}; - NRF_LOG_INFO("[DFU] -> Send packet notification: %d bytes received", bytesReceived); - notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 5); - } - if (dfuImage.IsComplete()) { - uint8_t data[3]{static_cast(Opcodes::Response), - static_cast(Opcodes::ReceiveFirmwareImage), - static_cast(ErrorCodes::NoError)}; - NRF_LOG_INFO("[DFU] -> Send packet notification : all bytes received!"); - notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 3); - state = States::Validate; - } - } - return 0; - default: - // Invalid state - return 0; - } - return 0; -} - -int DfuService::ControlPointHandler(uint16_t connectionHandle, os_mbuf *om) { - auto opcode = static_cast(om->om_data[0]); - NRF_LOG_INFO("[DFU] -> ControlPointHandler"); - - switch (opcode) { - case Opcodes::StartDFU: { - if (state != States::Idle && state != States::Start) { - NRF_LOG_INFO("[DFU] -> Start DFU requested, but we are not in Idle state"); - return 0; - } - if (state == States::Start) { - NRF_LOG_INFO("[DFU] -> Start DFU requested, but we are already in Start state"); - return 0; - } - auto imageType = static_cast(om->om_data[1]); - if (imageType == ImageTypes::Application) { - NRF_LOG_INFO("[DFU] -> Start DFU, mode = Application"); - state = States::Start; - bleController.StartFirmwareUpdate(); - bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Running); - bleController.FirmwareUpdateTotalBytes(0xffffffffu); - bleController.FirmwareUpdateCurrentBytes(0); - systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleFirmwareUpdateStarted); - return 0; - } else { - NRF_LOG_INFO("[DFU] -> Start DFU, mode %d not supported!", imageType); - return 0; - } - } - break; - case Opcodes::InitDFUParameters: { - if (state != States::Init) { - NRF_LOG_INFO("[DFU] -> Init DFU requested, but we are not in Init state"); - return 0; - } - bool isInitComplete = (om->om_data[1] != 0); - NRF_LOG_INFO("[DFU] -> Init DFU parameters %s", isInitComplete ? " complete" : " not complete"); - - if (isInitComplete) { - uint8_t data[3] { - static_cast(Opcodes::Response), - static_cast(Opcodes::InitDFUParameters), - (isInitComplete ? uint8_t{1} : uint8_t{0}) - }; - notificationManager.AsyncSend(connectionHandle, controlPointCharacteristicHandle, data, 3); - return 0; - } - } - return 0; - case Opcodes::PacketReceiptNotificationRequest: - nbPacketsToNotify = om->om_data[1]; - NRF_LOG_INFO("[DFU] -> Receive Packet Notification Request, nb packet = %d", nbPacketsToNotify); - return 0; - case Opcodes::ReceiveFirmwareImage: - if (state != States::Init) { - NRF_LOG_INFO("[DFU] -> Receive firmware image requested, but we are not in Start Init"); - return 0; - } - // TODO the chunk size is dependant of the implementation of the host application... - dfuImage.Init(20, applicationSize, expectedCrc); - NRF_LOG_INFO("[DFU] -> Starting receive firmware"); - state = States::Data; - return 0; - case Opcodes::ValidateFirmware: { - if (state != States::Validate) { - NRF_LOG_INFO("[DFU] -> Validate firmware image requested, but we are not in Data state %d", state); - return 0; - } - - NRF_LOG_INFO("[DFU] -> Validate firmware image requested -- %d", connectionHandle); - - if(dfuImage.Validate()){ - state = States::Validated; - bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Validated); - NRF_LOG_INFO("Image OK"); - - uint8_t data[3] { - static_cast(Opcodes::Response), - static_cast(Opcodes::ValidateFirmware), - static_cast(ErrorCodes::NoError) - }; - notificationManager.AsyncSend(connectionHandle, controlPointCharacteristicHandle, data, 3); - } else { - bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Error); - NRF_LOG_INFO("Image Error : bad CRC"); - - uint8_t data[3] { - static_cast(Opcodes::Response), - static_cast(Opcodes::ValidateFirmware), - static_cast(ErrorCodes::CrcError) - }; - notificationManager.AsyncSend(connectionHandle, controlPointCharacteristicHandle, data, 3); - } - - return 0; - } - case Opcodes::ActivateImageAndReset: - if (state != States::Validated) { - NRF_LOG_INFO("[DFU] -> Activate image and reset requested, but we are not in Validated state"); - return 0; - } - NRF_LOG_INFO("[DFU] -> Activate image and reset!"); - bleController.StopFirmwareUpdate(); - systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleFirmwareUpdateFinished); - Reset(); - bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Validated); - return 0; - default: - return 0; - } -} - -void DfuService::OnTimeout() { - Reset(); -} - -void DfuService::Reset() { - state = States::Idle; - nbPacketsToNotify = 0; - nbPacketReceived = 0; - bytesReceived = 0; - softdeviceSize = 0; - bootloaderSize = 0; - applicationSize = 0; - expectedCrc = 0; - notificationManager.Reset(); - bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Error); - bleController.StopFirmwareUpdate(); - systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleFirmwareUpdateFinished); -} - -DfuService::NotificationManager::NotificationManager() { - timer = xTimerCreate ("notificationTimer", 1000, pdFALSE, this, NotificationTimerCallback); -} - -bool DfuService::NotificationManager::AsyncSend(uint16_t connection, uint16_t charactHandle, uint8_t *data, size_t s) { - if(size != 0 || s > 10) - return false; - - connectionHandle = connection; - characteristicHandle = charactHandle; - size = s; - std::memcpy(buffer, data, size); - xTimerStart(timer, 0); - return true; -} - -void DfuService::NotificationManager::OnNotificationTimer() { - if(size > 0) { - Send(connectionHandle, characteristicHandle, buffer, size); - size = 0; - } -} - -void DfuService::NotificationManager::Send(uint16_t connection, uint16_t charactHandle, const uint8_t *data, const size_t s) { - auto *om = ble_hs_mbuf_from_flat(data, s); - auto ret = ble_gattc_notify_custom(connection, charactHandle, om); - ASSERT(ret == 0); -} - -void DfuService::NotificationManager::Reset() { - connectionHandle = 0; - characteristicHandle = 0; - size = 0; - xTimerStop(timer, 0); -} - -void DfuService::DfuImage::Init(size_t chunkSize, size_t totalSize, uint16_t expectedCrc) { - if(chunkSize != 20) return; - this->chunkSize = chunkSize; - this->totalSize = totalSize; - this->expectedCrc = expectedCrc; - this->ready = true; -} - -void DfuService::DfuImage::Append(uint8_t *data, size_t size) { - if(!ready) return; - ASSERT(size <= 20); - - std::memcpy(tempBuffer + bufferWriteIndex, data, size); - bufferWriteIndex += size; - - if(bufferWriteIndex == bufferSize) { - spiNorFlash.Write(writeOffset + totalWriteIndex, tempBuffer, bufferWriteIndex); - totalWriteIndex += bufferWriteIndex; - bufferWriteIndex = 0; - } - - if(bufferWriteIndex > 0 && totalWriteIndex + bufferWriteIndex == totalSize) { - spiNorFlash.Write(writeOffset + totalWriteIndex, tempBuffer, bufferWriteIndex); - totalWriteIndex += bufferWriteIndex; - if (totalSize < maxSize) - WriteMagicNumber(); - } -} - -void DfuService::DfuImage::WriteMagicNumber() { - uint32_t magic[4] = { // TODO When this variable is a static constexpr, the values written to the memory are not correct. Why? - 0xf395c277, - 0x7fefd260, - 0x0f505235, - 0x8079b62c, - }; - - uint32_t offset = writeOffset + (maxSize - (4 * sizeof(uint32_t))); - spiNorFlash.Write(offset, reinterpret_cast(magic), 4 * sizeof(uint32_t)); -} - -void DfuService::DfuImage::Erase() { - for (size_t erased = 0; erased < maxSize; erased += 0x1000) { - spiNorFlash.SectorErase(writeOffset + erased); - } -} - -bool DfuService::DfuImage::Validate() { - uint32_t chunkSize = 200; - size_t currentOffset = 0; - uint16_t crc = 0; - - bool first = true; - while (currentOffset < totalSize) { - uint32_t readSize = (totalSize - currentOffset) > chunkSize ? chunkSize : (totalSize - currentOffset); - - spiNorFlash.Read(writeOffset + currentOffset, tempBuffer, readSize); - if (first) { - crc = ComputeCrc(tempBuffer, readSize, NULL); - first = false; - } else - crc = ComputeCrc(tempBuffer, readSize, &crc); - currentOffset += readSize; - } - - return (crc == expectedCrc); -} - -uint16_t DfuService::DfuImage::ComputeCrc(uint8_t const *p_data, uint32_t size, uint16_t const *p_crc) { - uint16_t crc = (p_crc == NULL) ? 0xFFFF : *p_crc; - - for (uint32_t i = 0; i < size; i++) { - crc = (uint8_t) (crc >> 8) | (crc << 8); - crc ^= p_data[i]; - crc ^= (uint8_t) (crc & 0xFF) >> 4; - crc ^= (crc << 8) << 4; - crc ^= ((crc & 0xFF) << 4) << 1; - } - - return crc; -} - -bool DfuService::DfuImage::IsComplete() { - if(!ready) return false; - return totalWriteIndex == totalSize; -} diff --git a/src/components/Ble/DfuService.h b/src/components/Ble/DfuService.h deleted file mode 100644 index d7ba460c..00000000 --- a/src/components/Ble/DfuService.h +++ /dev/null @@ -1,161 +0,0 @@ -#pragma once - -#include -#include - -#include - -namespace Pinetime { - namespace System { - class SystemTask; - } - namespace Drivers { - class SpiNorFlash; - } - namespace Controllers { - class Ble; - - class DfuService { - public: - DfuService(Pinetime::System::SystemTask &systemTask, Pinetime::Controllers::Ble &bleController, - Pinetime::Drivers::SpiNorFlash &spiNorFlash); - void Init(); - int OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); - void OnTimeout(); - void Reset(); - - class NotificationManager { - public: - NotificationManager(); - bool AsyncSend(uint16_t connection, uint16_t charactHandle, uint8_t *data, size_t size); - void Send(uint16_t connection, uint16_t characteristicHandle, const uint8_t *data, const size_t s); - private: - TimerHandle_t timer; - uint16_t connectionHandle = 0; - uint16_t characteristicHandle = 0; - size_t size = 0; - uint8_t buffer[10]; - public: - void OnNotificationTimer(); - void Reset(); - }; - class DfuImage { - public: - DfuImage(Pinetime::Drivers::SpiNorFlash& spiNorFlash) : spiNorFlash{spiNorFlash} {} - void Init(size_t chunkSize, size_t totalSize, uint16_t expectedCrc); - void Erase(); - void Append(uint8_t* data, size_t size); - bool Validate(); - bool IsComplete(); - - private: - Pinetime::Drivers::SpiNorFlash& spiNorFlash; - static constexpr size_t bufferSize = 200; - bool ready = false; - size_t chunkSize = 0; - size_t totalSize = 0; - size_t maxSize = 475136; - size_t bufferWriteIndex = 0; - size_t totalWriteIndex = 0; - static constexpr size_t writeOffset = 0x40000; - uint8_t tempBuffer[bufferSize]; - uint16_t expectedCrc = 0; - - void WriteMagicNumber(); - uint16_t ComputeCrc(uint8_t const *p_data, uint32_t size, uint16_t const *p_crc); - - }; - - private: - Pinetime::System::SystemTask &systemTask; - Pinetime::Controllers::Ble &bleController; - DfuImage dfuImage; - NotificationManager notificationManager; - - static constexpr uint16_t dfuServiceId{0x1530}; - static constexpr uint16_t packetCharacteristicId{0x1532}; - static constexpr uint16_t controlPointCharacteristicId{0x1531}; - static constexpr uint16_t revisionCharacteristicId{0x1534}; - - uint16_t revision{0x0008}; - - static constexpr ble_uuid128_t serviceUuid{ - .u {.type = BLE_UUID_TYPE_128}, - .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, - 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00} - }; - - static constexpr ble_uuid128_t packetCharacteristicUuid{ - .u {.type = BLE_UUID_TYPE_128}, - .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, - 0xDE, 0xEF, 0x12, 0x12, 0x32, 0x15, 0x00, 0x00} - }; - - static constexpr ble_uuid128_t controlPointCharacteristicUuid{ - .u {.type = BLE_UUID_TYPE_128}, - .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, - 0xDE, 0xEF, 0x12, 0x12, 0x31, 0x15, 0x00, 0x00} - }; - - static constexpr ble_uuid128_t revisionCharacteristicUuid{ - .u {.type = BLE_UUID_TYPE_128}, - .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, - 0xDE, 0xEF, 0x12, 0x12, 0x34, 0x15, 0x00, 0x00} - }; - - struct ble_gatt_chr_def characteristicDefinition[4]; - struct ble_gatt_svc_def serviceDefinition[2]; - uint16_t packetCharacteristicHandle; - uint16_t controlPointCharacteristicHandle; - uint16_t revisionCharacteristicHandle; - - enum class States : uint8_t { - Idle, Init, Start, Data, Validate, Validated - }; - States state = States::Idle; - - enum class ImageTypes : uint8_t { - NoImage = 0x00, - SoftDevice = 0x01, - Bootloader = 0x02, - SoftDeviceAndBootloader = 0x03, - Application = 0x04 - }; - - enum class Opcodes : uint8_t { - StartDFU = 0x01, - InitDFUParameters = 0x02, - ReceiveFirmwareImage = 0x03, - ValidateFirmware = 0x04, - ActivateImageAndReset = 0x05, - PacketReceiptNotificationRequest = 0x08, - Response = 0x10, - PacketReceiptNotification = 0x11 - }; - - enum class ErrorCodes { - NoError = 0x01, - InvalidState = 0x02, - NotSupported = 0x03, - DataSizeExceedsLimits = 0x04, - CrcError = 0x05, - OperationFailed = 0x06 - }; - - uint8_t nbPacketsToNotify = 0; - uint32_t nbPacketReceived = 0; - uint32_t bytesReceived = 0; - - uint32_t softdeviceSize = 0; - uint32_t bootloaderSize = 0; - uint32_t applicationSize = 0; - uint16_t expectedCrc = 0; - - int SendDfuRevision(os_mbuf *om) const; - int WritePacketHandler(uint16_t connectionHandle, os_mbuf *om); - int ControlPointHandler(uint16_t connectionHandle, os_mbuf *om); - - TimerHandle_t timeoutTimer; - }; - } -} \ No newline at end of file diff --git a/src/components/Ble/ImmediateAlertService.cpp b/src/components/Ble/ImmediateAlertService.cpp deleted file mode 100644 index d2c4cffb..00000000 --- a/src/components/Ble/ImmediateAlertService.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "ImmediateAlertService.h" -#include -#include "AlertNotificationService.h" - -using namespace Pinetime::Controllers; - -constexpr ble_uuid16_t ImmediateAlertService::immediateAlertServiceUuid; -constexpr ble_uuid16_t ImmediateAlertService::alertLevelUuid; - -namespace { - int AlertLevelCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { - auto *immediateAlertService = static_cast(arg); - return immediateAlertService->OnAlertLevelChanged(conn_handle, attr_handle, ctxt); - } - - const char* ToString(ImmediateAlertService::Levels level) { - switch (level) { - case ImmediateAlertService::Levels::NoAlert: return "Alert : None"; - case ImmediateAlertService::Levels::HighAlert: return "Alert : High"; - case ImmediateAlertService::Levels::MildAlert: return "Alert : Mild"; - default: return ""; - } - } -} - -ImmediateAlertService::ImmediateAlertService(Pinetime::System::SystemTask &systemTask, - Pinetime::Controllers::NotificationManager ¬ificationManager) : - systemTask{systemTask}, - notificationManager{notificationManager}, - characteristicDefinition{ - { - .uuid = (ble_uuid_t *) &alertLevelUuid, - .access_cb = AlertLevelCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE_NO_RSP, - .val_handle = &alertLevelHandle - }, - { - 0 - } - }, - serviceDefinition{ - { - /* Device Information Service */ - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t *) &immediateAlertServiceUuid, - .characteristics = characteristicDefinition - }, - { - 0 - }, - }{ - -} - -void ImmediateAlertService::Init() { - int res = 0; - res = ble_gatts_count_cfg(serviceDefinition); - ASSERT(res == 0); - - res = ble_gatts_add_svcs(serviceDefinition); - ASSERT(res == 0); -} - -int ImmediateAlertService::OnAlertLevelChanged(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context) { - if(attributeHandle == alertLevelHandle) { - if(context->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { - auto alertLevel = static_cast(context->om->om_data[0]); - auto* alertString = ToString(alertLevel); - notificationManager.Push(Pinetime::Controllers::NotificationManager::Categories::SimpleAlert, alertString, strlen(alertString)); - systemTask.PushMessage(Pinetime::System::SystemTask::Messages::OnNewNotification); - } - } - - return 0; -} \ No newline at end of file diff --git a/src/components/Ble/ImmediateAlertService.h b/src/components/Ble/ImmediateAlertService.h deleted file mode 100644 index c42846c4..00000000 --- a/src/components/Ble/ImmediateAlertService.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once -#include - -namespace Pinetime { - namespace System { - class SystemTask; - } - namespace Controllers { - class NotificationManager; - class ImmediateAlertService { - public: - enum class Levels : uint8_t { - NoAlert = 0, - MildAlert = 1, - HighAlert = 2 - }; - - ImmediateAlertService(Pinetime::System::SystemTask &systemTask, - Pinetime::Controllers::NotificationManager ¬ificationManager); - void Init(); - int OnAlertLevelChanged(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); - - private: - Pinetime::System::SystemTask& systemTask; - NotificationManager& notificationManager; - - static constexpr uint16_t immediateAlertServiceId {0x1802}; - static constexpr uint16_t alertLevelId {0x2A06}; - - static constexpr ble_uuid16_t immediateAlertServiceUuid { - .u {.type = BLE_UUID_TYPE_16}, - .value = immediateAlertServiceId - }; - - static constexpr ble_uuid16_t alertLevelUuid { - .u {.type = BLE_UUID_TYPE_16}, - .value = alertLevelId - }; - - struct ble_gatt_chr_def characteristicDefinition[3]; - struct ble_gatt_svc_def serviceDefinition[2]; - - uint16_t alertLevelHandle; - }; - } -} diff --git a/src/components/Ble/MusicService.cpp b/src/components/Ble/MusicService.cpp deleted file mode 100644 index b5fa5356..00000000 --- a/src/components/Ble/MusicService.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include -#include "MusicService.h" - -int MSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { - auto musicService = static_cast(arg); - return musicService->OnCommand(conn_handle, attr_handle, ctxt); -} - -Pinetime::Controllers::MusicService::MusicService(Pinetime::System::SystemTask &system) : m_system(system) -{ - msUuid.value[11] = msId[0]; - msUuid.value[12] = msId[1]; - msEventCharUuid.value[11] = msEventCharId[0]; - msEventCharUuid.value[12] = msEventCharId[1]; - msStatusCharUuid.value[11] = msStatusCharId[0]; - msStatusCharUuid.value[12] = msStatusCharId[1]; - msTrackCharUuid.value[11] = msTrackCharId[0]; - msTrackCharUuid.value[12] = msTrackCharId[1]; - msArtistCharUuid.value[11] = msArtistCharId[0]; - msArtistCharUuid.value[12] = msArtistCharId[1]; - msAlbumCharUuid.value[11] = msAlbumCharId[0]; - msAlbumCharUuid.value[12] = msAlbumCharId[1]; - - characteristicDefinition[0] = { .uuid = (ble_uuid_t*)(&msEventCharUuid), - .access_cb = MSCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_NOTIFY, - .val_handle = &m_eventHandle - }; - characteristicDefinition[1] = { .uuid = (ble_uuid_t*)(&msStatusCharUuid), - .access_cb = MSCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ - }; - characteristicDefinition[2] = { .uuid = (ble_uuid_t*)(&msTrackCharUuid), - .access_cb = MSCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ - }; - characteristicDefinition[3] = { .uuid = (ble_uuid_t*)(&msArtistCharUuid), - .access_cb = MSCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ - }; - characteristicDefinition[4] = { .uuid = (ble_uuid_t*)(&msAlbumCharUuid), - .access_cb = MSCallback, - .arg = this, - .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ - }; - characteristicDefinition[5] = {0}; - - serviceDefinition[0] = { - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t *) &msUuid, - .characteristics = characteristicDefinition - }; - serviceDefinition[1] = {0}; - - m_artist = "Waiting for"; - m_album = ""; - m_track = "track information..."; -} - -void Pinetime::Controllers::MusicService::Init() -{ - int res = 0; - res = ble_gatts_count_cfg(serviceDefinition); - ASSERT(res == 0); - - res = ble_gatts_add_svcs(serviceDefinition); - ASSERT(res == 0); -} - -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); - uint8_t data[notifSize + 1]; - data[notifSize] = '\0'; - os_mbuf_copydata(ctxt->om, 0, notifSize, data); - char *s = (char *) &data[0]; - NRF_LOG_INFO("DATA : %s", s); - if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msArtistCharUuid) == 0) { - m_artist = s; - } else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msTrackCharUuid) == 0) { - m_track = s; - } else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msAlbumCharUuid) == 0) { - m_album = s; - } else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msStatusCharUuid) == 0) { - m_status = s[0]; - } - } - return 0; -} - -std::string Pinetime::Controllers::MusicService::album() -{ - return m_album; -} - -std::string Pinetime::Controllers::MusicService::artist() -{ - return m_artist; -} - -std::string Pinetime::Controllers::MusicService::track() -{ - return m_track; -} - -unsigned char Pinetime::Controllers::MusicService::status() -{ - return m_status; -} - -void Pinetime::Controllers::MusicService::event(char event) -{ - auto *om = ble_hs_mbuf_from_flat(&event, 1); - - uint16_t connectionHandle = m_system.nimble().connHandle(); - - if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) { - return; - } - - ble_gattc_notify_custom(connectionHandle, m_eventHandle, om); -} - diff --git a/src/components/Ble/MusicService.h b/src/components/Ble/MusicService.h deleted file mode 100644 index ab6db572..00000000 --- a/src/components/Ble/MusicService.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -//c7e50000-78fc-48fe-8e23-43b37a1942d0 -#define MUSIC_SERVICE_UUID_BASE {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x00, 0x00, 0xe5, 0xc7} - -namespace Pinetime { - namespace System { - class SystemTask; - } - namespace Controllers { - - class MusicService { - public: - MusicService(Pinetime::System::SystemTask &system); - void Init(); - int OnCommand(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt); - - std::string artist(); - std::string track(); - std::string album(); - unsigned char status(); - - void event(char event); - - static const char EVENT_MUSIC_OPEN = 0xe0; - static const char EVENT_MUSIC_PLAY = 0x00; - static const char EVENT_MUSIC_PAUSE = 0x01; - static const char EVENT_MUSIC_NEXT = 0x03; - static const char EVENT_MUSIC_PREV = 0x04; - static const char EVENT_MUSIC_VOLUP = 0x05; - static const char EVENT_MUSIC_VOLDOWN = 0x06; - static const char STATUS_MUSIC_PAUSED = 0x00; - static const char STATUS_MUSIC_PLAYING = 0x01; - - private: - static constexpr uint8_t msId[2] = {0x00, 0x01}; - static constexpr uint8_t msEventCharId[2] = {0x00, 0x02}; - static constexpr uint8_t msStatusCharId[2] = {0x00, 0x03}; - static constexpr uint8_t msArtistCharId[2] = {0x00, 0x04}; - static constexpr uint8_t msTrackCharId[2] = {0x00, 0x05}; - static constexpr uint8_t msAlbumCharId[2] = {0x00, 0x06}; - - ble_uuid128_t msUuid { - .u = { .type = BLE_UUID_TYPE_128 }, - .value = MUSIC_SERVICE_UUID_BASE - }; - - ble_uuid128_t msEventCharUuid { - .u = { .type = BLE_UUID_TYPE_128 }, - .value = MUSIC_SERVICE_UUID_BASE - }; - ble_uuid128_t msStatusCharUuid { - .u = { .type = BLE_UUID_TYPE_128 }, - .value = MUSIC_SERVICE_UUID_BASE - }; - ble_uuid128_t msArtistCharUuid { - .u = { .type = BLE_UUID_TYPE_128 }, - .value = MUSIC_SERVICE_UUID_BASE - }; - ble_uuid128_t msTrackCharUuid { - .u = { .type = BLE_UUID_TYPE_128 }, - .value = MUSIC_SERVICE_UUID_BASE - }; - ble_uuid128_t msAlbumCharUuid { - .u = { .type = BLE_UUID_TYPE_128 }, - .value = MUSIC_SERVICE_UUID_BASE - }; - - struct ble_gatt_chr_def characteristicDefinition[6]; - struct ble_gatt_svc_def serviceDefinition[2]; - - uint16_t m_eventHandle; - - std::string m_artist; - std::string m_album; - std::string m_track; - - unsigned char m_status; - - Pinetime::System::SystemTask& m_system; - - }; - } -} - diff --git a/src/components/Ble/NimbleController.cpp b/src/components/Ble/NimbleController.cpp deleted file mode 100644 index b13f9ce3..00000000 --- a/src/components/Ble/NimbleController.cpp +++ /dev/null @@ -1,337 +0,0 @@ - -#include - -#include -#include -#include - -#include "NimbleController.h" -#include "MusicService.h" -#include -#include -#include -#include -#include -#include - - - -using namespace Pinetime::Controllers; - -// TODO I'm not satisfied by how this code looks like (AlertNotificationClient and CurrentTimeClient must -// expose too much data, too many callbacks -> NimbleController -> CTS/ANS client. -// Let's try to improve this code (and keep it working!) - -NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask, - Pinetime::Controllers::Ble& bleController, - DateTime& dateTimeController, - Pinetime::Controllers::NotificationManager& notificationManager, - Controllers::Battery& batteryController, - Pinetime::Drivers::SpiNorFlash& spiNorFlash) : - systemTask{systemTask}, - bleController{bleController}, - dateTimeController{dateTimeController}, - notificationManager{notificationManager}, - spiNorFlash{spiNorFlash}, - dfuService{systemTask, bleController, spiNorFlash}, - currentTimeClient{dateTimeController}, - anService{systemTask, notificationManager}, - alertNotificationClient{systemTask, notificationManager}, - currentTimeService{dateTimeController}, - musicService{systemTask}, - batteryInformationService{batteryController}, - immediateAlertService{systemTask, notificationManager} { - -} - -int GAPEventCallback(struct ble_gap_event *event, void *arg) { - auto nimbleController = static_cast(arg); - return nimbleController->OnGAPEvent(event); -} - -int CurrentTimeCharacteristicDiscoveredCallback(uint16_t conn_handle, const struct ble_gatt_error *error, - const struct ble_gatt_chr *chr, void *arg) { - auto client = static_cast(arg); - return client->OnCTSCharacteristicDiscoveryEvent(conn_handle, error, chr); -} - -int AlertNotificationCharacteristicDiscoveredCallback(uint16_t conn_handle, const struct ble_gatt_error *error, - const struct ble_gatt_chr *chr, void *arg) { - auto client = static_cast(arg); - return client->OnANSCharacteristicDiscoveryEvent(conn_handle, error, chr); -} - -int CurrentTimeReadCallback(uint16_t conn_handle, const struct ble_gatt_error *error, - struct ble_gatt_attr *attr, void *arg) { - auto client = static_cast(arg); - return client->OnCurrentTimeReadResult(conn_handle, error, attr); -} - -int AlertNotificationDescriptorDiscoveryEventCallback(uint16_t conn_handle, - const struct ble_gatt_error *error, - uint16_t chr_val_handle, - const struct ble_gatt_dsc *dsc, - void *arg) { - auto client = static_cast(arg); - return client->OnANSDescriptorDiscoveryEventCallback(conn_handle, error, chr_val_handle, dsc); -} - -void NimbleController::Init() { - while (!ble_hs_synced()) {} - - ble_svc_gap_init(); - ble_svc_gatt_init(); - - deviceInformationService.Init(); - currentTimeClient.Init(); - currentTimeService.Init(); - musicService.Init(); - anService.Init(); - dfuService.Init(); - batteryInformationService.Init(); - immediateAlertService.Init(); - int res; - res = ble_hs_util_ensure_addr(0); - ASSERT(res == 0); - res = ble_hs_id_infer_auto(0, &addrType); - ASSERT(res == 0); - res = ble_svc_gap_device_name_set(deviceName); - ASSERT(res == 0); - Pinetime::Controllers::Ble::BleAddress address; - res = ble_hs_id_copy_addr(addrType, address.data(), nullptr); - ASSERT(res == 0); - bleController.AddressType((addrType == 0) ? Ble::AddressTypes::Public : Ble::AddressTypes::Random); - bleController.Address(std::move(address)); - - res = ble_gatts_start(); - ASSERT(res == 0); -} - -void NimbleController::StartAdvertising() { - if(ble_gap_adv_active()) return; - - ble_svc_gap_device_name_set(deviceName); - - /* set adv parameters */ - struct ble_gap_adv_params adv_params; - struct ble_hs_adv_fields fields; - /* advertising payload is split into advertising data and advertising - response, because all data cannot fit into single packet; name of device - is sent as response to scan request */ - struct ble_hs_adv_fields rsp_fields; - - /* fill all fields and parameters with zeros */ - memset(&adv_params, 0, sizeof(adv_params)); - memset(&fields, 0, sizeof(fields)); - memset(&rsp_fields, 0, sizeof(rsp_fields)); - - adv_params.conn_mode = BLE_GAP_CONN_MODE_UND; - adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN; - - fields.flags = BLE_HS_ADV_F_DISC_GEN | - BLE_HS_ADV_F_BREDR_UNSUP; -// fields.uuids128 = BLE_UUID128(BLE_UUID128_DECLARE( -// 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, -// 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff)); - fields.uuids128 = &dfuServiceUuid; - fields.num_uuids128 = 1; - fields.uuids128_is_complete = 1; - fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO; - - rsp_fields.name = (uint8_t *)deviceName; - rsp_fields.name_len = strlen(deviceName); - rsp_fields.name_is_complete = 1; - - ble_gap_adv_set_fields(&fields); -// ASSERT(res == 0); // TODO this one sometimes fails with error 22 (notsync) - - ble_gap_adv_rsp_set_fields(&rsp_fields); -// ASSERT(res == 0); - - ble_gap_adv_start(addrType, NULL, 180000, - &adv_params, GAPEventCallback, this); -// ASSERT(res == 0);// TODO I've disabled these ASSERT as they sometime asserts and reset the mcu. - // For now, the advertising is restarted as soon as it ends. There may be a race condition - // that prevent the advertising from restarting reliably. - // I remove the assert to prevent this uncesseray crash, but in the long term, the management of - // the advertising should be improve (better error handling, and advertise for 3 minutes after - // the application has been woken up, for example. -} - -int OnAllSvrDisco(uint16_t conn_handle, - const struct ble_gatt_error *error, - const struct ble_gatt_svc *service, - void *arg) { - auto nimbleController = static_cast(arg); - return nimbleController->OnDiscoveryEvent(conn_handle, error, service); - return 0; -} - -int NimbleController::OnGAPEvent(ble_gap_event *event) { - switch (event->type) { - case BLE_GAP_EVENT_ADV_COMPLETE: - NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE"); - NRF_LOG_INFO("advertise complete; reason=%dn status=%d", event->adv_complete.reason, event->connect.status); - break; - case BLE_GAP_EVENT_CONNECT: { - NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_CONNECT"); - - /* A new connection was established or a connection attempt failed. */ - NRF_LOG_INFO("connection %s; status=%d ", event->connect.status == 0 ? "established" : "failed", - event->connect.status); - - if (event->connect.status != 0) { - /* Connection failed; resume advertising. */ - StartAdvertising(); - bleController.Disconnect(); - } else { - bleController.Connect(); - systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleConnected); - connectionHandle = event->connect.conn_handle; - // Service discovery is deffered via systemtask - } - } - break; - case BLE_GAP_EVENT_DISCONNECT: - NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_DISCONNECT"); - NRF_LOG_INFO("disconnect; reason=%d", event->disconnect.reason); - - /* Connection terminated; resume advertising. */ - connectionHandle = BLE_HS_CONN_HANDLE_NONE; - bleController.Disconnect(); - StartAdvertising(); - break; - case BLE_GAP_EVENT_CONN_UPDATE: - NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_CONN_UPDATE"); - /* The central has updated the connection parameters. */ - NRF_LOG_INFO("connection updated; status=%d ", event->conn_update.status); - break; - case BLE_GAP_EVENT_ENC_CHANGE: - /* Encryption has been enabled or disabled for this connection. */ - NRF_LOG_INFO("encryption change event; status=%d ", event->enc_change.status); - return 0; - case BLE_GAP_EVENT_SUBSCRIBE: - NRF_LOG_INFO("subscribe event; conn_handle=%d attr_handle=%d " - "reason=%d prevn=%d curn=%d previ=%d curi=???\n", - event->subscribe.conn_handle, - event->subscribe.attr_handle, - event->subscribe.reason, - event->subscribe.prev_notify, - event->subscribe.cur_notify, - event->subscribe.prev_indicate); - return 0; - case BLE_GAP_EVENT_MTU: - NRF_LOG_INFO("mtu update event; conn_handle=%d cid=%d mtu=%d\n", - event->mtu.conn_handle, - event->mtu.channel_id, - event->mtu.value); - return 0; - - case BLE_GAP_EVENT_REPEAT_PAIRING: { - /* We already have a bond with the peer, but it is attempting to - * establish a new secure link. This app sacrifices security for - * convenience: just throw away the old bond and accept the new link. - */ - - /* Delete the old bond. */ - struct ble_gap_conn_desc desc; - ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); - ble_store_util_delete_peer(&desc.peer_id_addr); - - /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should - * continue with the pairing operation. - */ - } - return BLE_GAP_REPEAT_PAIRING_RETRY; - - case BLE_GAP_EVENT_NOTIFY_RX: { - /* Peer sent us a notification or indication. */ - size_t notifSize = OS_MBUF_PKTLEN(event->notify_rx.om); - - NRF_LOG_INFO("received %s; conn_handle=%d attr_handle=%d " - "attr_len=%d", - event->notify_rx.indication ? - "indication" : - "notification", - event->notify_rx.conn_handle, - event->notify_rx.attr_handle, - notifSize); - - alertNotificationClient.OnNotification(event); - return 0; - } - /* Attribute data is contained in event->notify_rx.attr_data. */ - - default: -// NRF_LOG_INFO("Advertising event : %d", event->type); - break; - } - return 0; -} - -int NimbleController::OnDiscoveryEvent(uint16_t i, const ble_gatt_error *error, const ble_gatt_svc *service) { - if(service == nullptr && error->status == BLE_HS_EDONE) { - NRF_LOG_INFO("Service Discovery complete"); - if(currentTimeClient.IsDiscovered()) { - ble_gattc_disc_all_chrs(connectionHandle, currentTimeClient.StartHandle(), currentTimeClient.EndHandle(), - CurrentTimeCharacteristicDiscoveredCallback, this); - - } else if(alertNotificationClient.IsDiscovered()) { - ble_gattc_disc_all_chrs(connectionHandle, alertNotificationClient.StartHandle(), alertNotificationClient.EndHandle(), - AlertNotificationCharacteristicDiscoveredCallback, this); - } - } - - alertNotificationClient.OnDiscoveryEvent(i, error, service); - currentTimeClient.OnDiscoveryEvent(i, error, service); - return 0; -} - -int NimbleController::OnCTSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, - const ble_gatt_chr *characteristic) { - if(characteristic == nullptr && error->status == BLE_HS_EDONE) { - NRF_LOG_INFO("CTS characteristic Discovery complete"); - ble_gattc_read(connectionHandle, currentTimeClient.CurrentTimeHandle(), CurrentTimeReadCallback, this); - return 0; - } - return currentTimeClient.OnCharacteristicDiscoveryEvent(connectionHandle, error, characteristic); -} - -int NimbleController::OnANSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, - const ble_gatt_chr *characteristic) { - if(characteristic == nullptr && error->status == BLE_HS_EDONE) { - NRF_LOG_INFO("ANS characteristic Discovery complete"); - ble_gattc_disc_all_dscs(connectionHandle, - alertNotificationClient.NewAlerthandle(), alertNotificationClient.EndHandle(), - AlertNotificationDescriptorDiscoveryEventCallback, this); - return 0; - } - return alertNotificationClient.OnCharacteristicsDiscoveryEvent(connectionHandle, error, characteristic); -} - -int NimbleController::OnCurrentTimeReadResult(uint16_t connectionHandle, const ble_gatt_error *error, ble_gatt_attr *attribute) { - currentTimeClient.OnCurrentTimeReadResult(connectionHandle, error, attribute); - - if (alertNotificationClient.IsDiscovered()) { - ble_gattc_disc_all_chrs(connectionHandle, alertNotificationClient.StartHandle(), - alertNotificationClient.EndHandle(), - AlertNotificationCharacteristicDiscoveredCallback, this); - } - return 0; -} - -int NimbleController::OnANSDescriptorDiscoveryEventCallback(uint16_t connectionHandle, const ble_gatt_error *error, - uint16_t characteristicValueHandle, - const ble_gatt_dsc *descriptor) { - return alertNotificationClient.OnDescriptorDiscoveryEventCallback(connectionHandle, error, characteristicValueHandle, descriptor); -} - -void NimbleController::StartDiscovery() { - ble_gattc_disc_all_svcs(connectionHandle, OnAllSvrDisco, this); -} - - -uint16_t NimbleController::connHandle() { - return connectionHandle; -} - diff --git a/src/components/Ble/NimbleController.h b/src/components/Ble/NimbleController.h deleted file mode 100644 index 89fa4250..00000000 --- a/src/components/Ble/NimbleController.h +++ /dev/null @@ -1,75 +0,0 @@ -#pragma once - -#include -#include "AlertNotificationService.h" -#include "AlertNotificationClient.h" -#include "DeviceInformationService.h" -#include "CurrentTimeClient.h" -#include "DfuService.h" -#include "CurrentTimeService.h" -#include "MusicService.h" -#include "BatteryInformationService.h" -#include "ImmediateAlertService.h" -#include - -namespace Pinetime { - namespace Drivers { - class SpiNorFlash; - } - namespace Controllers { - class DateTime; - - class NimbleController { - - public: - NimbleController(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::Ble& bleController, - DateTime& dateTimeController, Pinetime::Controllers::NotificationManager& notificationManager, - Controllers::Battery& batteryController, Pinetime::Drivers::SpiNorFlash& spiNorFlash); - void Init(); - void StartAdvertising(); - int OnGAPEvent(ble_gap_event *event); - - 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() {return musicService;}; - - uint16_t connHandle(); - - private: - static constexpr const char* deviceName = "InfiniTime"; - Pinetime::System::SystemTask& systemTask; - Pinetime::Controllers::Ble& bleController; - DateTime& dateTimeController; - Pinetime::Controllers::NotificationManager& notificationManager; - Pinetime::Drivers::SpiNorFlash& spiNorFlash; - Pinetime::Controllers::DfuService dfuService; - - DeviceInformationService deviceInformationService; - CurrentTimeClient currentTimeClient; - AlertNotificationService anService; - AlertNotificationClient alertNotificationClient; - CurrentTimeService currentTimeService; - MusicService musicService; - BatteryInformationService batteryInformationService; - ImmediateAlertService immediateAlertService; - - uint8_t addrType; // 1 = Random, 0 = PUBLIC - uint16_t connectionHandle = 0; - - ble_uuid128_t dfuServiceUuid { - .u { .type = BLE_UUID_TYPE_128}, - .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, - 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00} - }; - }; - } -} diff --git a/src/components/Ble/NotificationManager.cpp b/src/components/Ble/NotificationManager.cpp deleted file mode 100644 index 0aea0697..00000000 --- a/src/components/Ble/NotificationManager.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include "NotificationManager.h" - -using namespace Pinetime::Controllers; - -void NotificationManager::Push(Pinetime::Controllers::NotificationManager::Categories category, - const char *message, uint8_t currentMessageSize) { - // TODO handle edge cases on read/write index - auto checkedSize = std::min(currentMessageSize, uint8_t{18}); - auto& notif = notifications[writeIndex]; - std::memcpy(notif.message.data(), message, checkedSize); - notif.message[checkedSize] = '\0'; - notif.category = category; - - writeIndex = (writeIndex + 1 < TotalNbNotifications) ? writeIndex + 1 : 0; - if(!empty && writeIndex == readIndex) - readIndex = writeIndex + 1; -} - -NotificationManager::Notification Pinetime::Controllers::NotificationManager::Pop() { -// TODO handle edge cases on read/write index - NotificationManager::Notification notification = notifications[readIndex]; - - if(readIndex != writeIndex) { - readIndex = (readIndex + 1 < TotalNbNotifications) ? readIndex + 1 : 0; - } - - // TODO Check move optimization on return - return notification; -} diff --git a/src/components/Ble/NotificationManager.h b/src/components/Ble/NotificationManager.h deleted file mode 100644 index daa1571b..00000000 --- a/src/components/Ble/NotificationManager.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include - -namespace Pinetime { - namespace Controllers { - class NotificationManager { - public: - enum class Categories {Unknown, SimpleAlert, Email, News, IncomingCall, MissedCall, Sms, VoiceMail, Schedule, HighProriotyAlert, InstantMessage }; - static constexpr uint8_t MessageSize{18}; - - struct Notification { - std::array message; - Categories category = Categories::Unknown; - }; - - void Push(Categories category, const char* message, uint8_t messageSize); - Notification Pop(); - - - private: - static constexpr uint8_t TotalNbNotifications = 5; - std::array notifications; - uint8_t readIndex = 0; - uint8_t writeIndex = 0; - bool empty = true; - }; - } -} \ No newline at end of file diff --git a/src/components/Brightness/BrightnessController.cpp b/src/components/Brightness/BrightnessController.cpp deleted file mode 100644 index c8825d68..00000000 --- a/src/components/Brightness/BrightnessController.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include "BrightnessController.h" - -using namespace Pinetime::Controllers; - - -void BrightnessController::Init() { - nrf_gpio_cfg_output(pinLcdBacklight1); - nrf_gpio_cfg_output(pinLcdBacklight2); - nrf_gpio_cfg_output(pinLcdBacklight3); - Set(level); -} - -void BrightnessController::Set(BrightnessController::Levels level) { - this->level = level; - switch(level) { - default: - case Levels::High: - nrf_gpio_pin_clear(pinLcdBacklight1); - nrf_gpio_pin_clear(pinLcdBacklight2); - nrf_gpio_pin_clear(pinLcdBacklight3); - break; - case Levels::Medium: - nrf_gpio_pin_clear(pinLcdBacklight1); - nrf_gpio_pin_clear(pinLcdBacklight2); - nrf_gpio_pin_set(pinLcdBacklight3); - break; - case Levels::Low: - nrf_gpio_pin_clear(pinLcdBacklight1); - nrf_gpio_pin_set(pinLcdBacklight2); - nrf_gpio_pin_set(pinLcdBacklight3); - break; - case Levels::Off: - nrf_gpio_pin_set(pinLcdBacklight1); - nrf_gpio_pin_set(pinLcdBacklight2); - nrf_gpio_pin_set(pinLcdBacklight3); - break; - } -} - -void BrightnessController::Lower() { - switch(level) { - case Levels::High: Set(Levels::Medium); break; - case Levels::Medium: Set(Levels::Low); break; - case Levels::Low: Set(Levels::Off); break; - default: break; - } -} - -void BrightnessController::Higher() { - switch(level) { - case Levels::Off: Set(Levels::Low); break; - case Levels::Low: Set(Levels::Medium); break; - case Levels::Medium: Set(Levels::High); break; - default: break; - } -} - -BrightnessController::Levels BrightnessController::Level() const { - return level; -} - -void BrightnessController::Backup() { - backupLevel = level; -} - -void BrightnessController::Restore() { - Set(backupLevel); -} - diff --git a/src/components/Brightness/BrightnessController.h b/src/components/Brightness/BrightnessController.h deleted file mode 100644 index b8354ec0..00000000 --- a/src/components/Brightness/BrightnessController.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include - -namespace Pinetime { - namespace Controllers { - class BrightnessController { - public: - enum class Levels {Off, Low, Medium, High}; - void Init(); - - void Set(Levels level); - Levels Level() const; - void Lower(); - void Higher(); - - void Backup(); - void Restore(); - - private: - static constexpr uint8_t pinLcdBacklight1 = 14; - static constexpr uint8_t pinLcdBacklight2 = 22; - static constexpr uint8_t pinLcdBacklight3 = 23; - Levels level = Levels::High; - Levels backupLevel = Levels::High; - }; - } -} diff --git a/src/components/DateTime/DateTimeController.cpp b/src/components/DateTime/DateTimeController.cpp deleted file mode 100644 index 30d9c13f..00000000 --- a/src/components/DateTime/DateTimeController.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "DateTimeController.h" -#include -#include - -using namespace Pinetime::Controllers; - - -void DateTime::SetTime(uint16_t year, uint8_t month, uint8_t day, uint8_t dayOfWeek, uint8_t hour, uint8_t minute, - uint8_t second, uint32_t systickCounter) { - std::tm tm = { /* .tm_sec = */ second, - /* .tm_min = */ minute, - /* .tm_hour = */ hour, - /* .tm_mday = */ day, - /* .tm_mon = */ month - 1, - /* .tm_year = */ year - 1900, - }; - tm.tm_isdst = -1; // Use DST value from local time zone - currentDateTime = std::chrono::system_clock::from_time_t(std::mktime(&tm)); - - NRF_LOG_INFO("%d %d %d ", day, month, year); - NRF_LOG_INFO("%d %d %d ", hour, minute, second); - previousSystickCounter = systickCounter; - - 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); -} - -void DateTime::UpdateTime(uint32_t systickCounter) { - // Handle systick counter overflow - uint32_t systickDelta = 0; - if(systickCounter < previousSystickCounter) { - systickDelta = 0xffffff - previousSystickCounter; - systickDelta += systickCounter + 1; - } else { - systickDelta = systickCounter - previousSystickCounter; - } - - /* - * 1000 ms = 1024 ticks - */ - auto correctedDelta = systickDelta / 1024; - auto rest = (systickDelta - (correctedDelta*1024)); - if(systickCounter >= rest) { - previousSystickCounter = systickCounter - rest; - } else { - previousSystickCounter = 0xffffff - (rest - systickCounter); - } - - currentDateTime += std::chrono::seconds(correctedDelta); - uptime += std::chrono::seconds(correctedDelta); - - auto dp = date::floor(currentDateTime); - auto time = date::make_time(currentDateTime-dp); - auto yearMonthDay = date::year_month_day(dp); - - year = (int)yearMonthDay.year(); - month = static_cast((unsigned)yearMonthDay.month()); - day = (unsigned)yearMonthDay.day(); - dayOfWeek = static_cast(date::weekday(yearMonthDay).iso_encoding()); - - hour = time.hours().count(); - minute = time.minutes().count(); - second = time.seconds().count(); -} - diff --git a/src/components/DateTime/DateTimeController.h b/src/components/DateTime/DateTimeController.h deleted file mode 100644 index d6020745..00000000 --- a/src/components/DateTime/DateTimeController.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include -#include - -namespace Pinetime { - namespace Controllers { - class DateTime { - public: - enum class Days : uint8_t {Unknown, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; - enum class Months : uint8_t {Unknown, January, February, March, April, May, June, July, August, September, October, November, December}; - - void SetTime(uint16_t year, uint8_t month, uint8_t day, uint8_t dayOfWeek, uint8_t hour, uint8_t minute, uint8_t second, uint32_t systickCounter); - void UpdateTime(uint32_t systickCounter); - uint16_t Year() const { return year; } - Months Month() const { return month; } - uint8_t Day() const { return day; } - Days DayOfWeek() const { return dayOfWeek; } - uint8_t Hours() const { return hour; } - uint8_t Minutes() const { return minute; } - uint8_t Seconds() const { return second; } - - std::chrono::time_point CurrentDateTime() const { return currentDateTime; } - std::chrono::seconds Uptime() const { return uptime; } - private: - uint16_t year = 0; - Months month = Months::Unknown; - uint8_t day = 0; - Days dayOfWeek = Days::Unknown; - uint8_t hour = 0; - uint8_t minute = 0; - uint8_t second = 0; - - uint32_t previousSystickCounter = 0; - std::chrono::time_point currentDateTime; - std::chrono::seconds uptime {0}; - }; - } -} \ No newline at end of file diff --git a/src/components/FirmwareValidator/FirmwareValidator.cpp b/src/components/FirmwareValidator/FirmwareValidator.cpp deleted file mode 100644 index 244d5c06..00000000 --- a/src/components/FirmwareValidator/FirmwareValidator.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -#include "FirmwareValidator.h" - -using namespace Pinetime::Controllers; - -bool FirmwareValidator::IsValidated() const { - auto* imageOkPtr = reinterpret_cast(validBitAdress); - return (*imageOkPtr) == validBitValue; -} - -void FirmwareValidator::Validate() { - if(!IsValidated()) - Pinetime::Drivers::InternalFlash::WriteWord(validBitAdress, validBitValue); -} - -void FirmwareValidator::Reset() { - NVIC_SystemReset(); -} diff --git a/src/components/FirmwareValidator/FirmwareValidator.h b/src/components/FirmwareValidator/FirmwareValidator.h deleted file mode 100644 index aa576d88..00000000 --- a/src/components/FirmwareValidator/FirmwareValidator.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include - -namespace Pinetime { - namespace Controllers { - class FirmwareValidator { - public: - void Validate(); - bool IsValidated() const; - - void Reset(); - private: - static constexpr uint32_t validBitAdress {0x7BFE8}; - static constexpr uint32_t validBitValue {1}; - }; - } -} diff --git a/src/components/Gfx/Gfx.cpp b/src/components/Gfx/Gfx.cpp deleted file mode 100644 index 3c5dbfb7..00000000 --- a/src/components/Gfx/Gfx.cpp +++ /dev/null @@ -1,207 +0,0 @@ -#include -#include -#include -#include "Gfx.h" -#include "../../drivers/St7789.h" -using namespace Pinetime::Components; - -Gfx::Gfx(Pinetime::Drivers::St7789 &lcd) : lcd{lcd} { -} - -void Gfx::Init() { - -} - -void Gfx::ClearScreen() { - SetBackgroundColor(0x0000); - - state.remainingIterations = 240 + 1; - state.currentIteration = 0; - state.busy = true; - state.action = Action::FillRectangle; - state.taskToNotify = xTaskGetCurrentTaskHandle(); - - lcd.BeginDrawBuffer(0, 0, width, height); - lcd.NextDrawBuffer(reinterpret_cast(buffer), width * 2); - WaitTransfertFinished(); - -} - -void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t color) { - SetBackgroundColor(color); - - state.remainingIterations = h; - state.currentIteration = 0; - state.busy = true; - state.action = Action::FillRectangle; - state.color = color; - state.taskToNotify = xTaskGetCurrentTaskHandle(); - - lcd.BeginDrawBuffer(x, y, w, h); - lcd.NextDrawBuffer(reinterpret_cast(buffer), width * 2); - - WaitTransfertFinished(); -} - -void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b) { - state.remainingIterations = h; - state.currentIteration = 0; - state.busy = true; - state.action = Action::FillRectangle; - state.color = 0x00; - state.taskToNotify = xTaskGetCurrentTaskHandle(); - - lcd.BeginDrawBuffer(x, y, w, h); - lcd.NextDrawBuffer(reinterpret_cast(b), width * 2); - - WaitTransfertFinished(); -} - -void Gfx::DrawString(uint8_t x, uint8_t y, uint16_t color, const char *text, const FONT_INFO *p_font, bool wrap) { - if (y > (height - p_font->height)) { - // Not enough space to write even single char. - return; - } - - uint8_t current_x = x; - uint8_t current_y = y; - - for (size_t i = 0; text[i] != '\0'; i++) { - if (text[i] == '\n') { - current_x = x; - current_y += p_font->height + p_font->height / 10; - } else { - DrawChar(p_font, (uint8_t) text[i], ¤t_x, current_y, color); - } - - uint8_t char_idx = text[i] - p_font->startChar; - uint16_t char_width = text[i] == ' ' ? (p_font->height / 2) : p_font->charInfo[char_idx].widthBits; - - if (current_x > (width - char_width)) { - if (wrap) { - current_x = x; - current_y += p_font->height + p_font->height / 10; - } else { - break; - } - - if (y > (height - p_font->height)) { - break; - } - } - } -} - -void Gfx::DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint16_t color) { - uint8_t char_idx = c - font->startChar; - uint16_t bytes_in_line = CEIL_DIV(font->charInfo[char_idx].widthBits, 8); - uint16_t bg = 0x0000; - - if (c == ' ') { - *x += font->height / 2; - return; - } - - // Build first line - for (uint16_t j = 0; j < bytes_in_line; j++) { - for (uint8_t k = 0; k < 8; k++) { - if ((1 << (7 - k)) & font->data[font->charInfo[char_idx].offset + j]) { - buffer[(j*8)+k] = color; - } - else { - buffer[(j*8)+k] = bg; - } - } - } - - state.remainingIterations = font->height + 0; - state.currentIteration = 0; - state.busy = true; - state.action = Action::DrawChar; - state.font = const_cast(font); - state.character = c; - state.color = color; - state.taskToNotify = xTaskGetCurrentTaskHandle(); - - lcd.BeginDrawBuffer(*x, y, bytes_in_line*8, font->height); - lcd.NextDrawBuffer(reinterpret_cast(&buffer), bytes_in_line*8*2); - WaitTransfertFinished(); - - *x += font->charInfo[char_idx].widthBits + font->spacePixels; -} - -void Gfx::pixel_draw(uint8_t x, uint8_t y, uint16_t color) { - lcd.DrawPixel(x, y, color); -} - -void Gfx::Sleep() { - lcd.Sleep(); -} - -void Gfx::Wakeup() { - lcd.Wakeup(); -} - -void Gfx::SetBackgroundColor(uint16_t color) { - for(int i = 0; i < width; i++) { - buffer[i] = color; - } -} - -bool Gfx::GetNextBuffer(uint8_t **data, size_t &size) { - if(!state.busy) return false; - state.remainingIterations--; - if (state.remainingIterations == 0) { - state.busy = false; - NotifyEndOfTransfert(state.taskToNotify); - return false; - } - - if(state.action == Action::FillRectangle) { - *data = reinterpret_cast(buffer); - size = width * 2; - } else if(state.action == Action::DrawChar) { - uint16_t bg = 0x0000; - uint8_t char_idx = state.character - state.font->startChar; - uint16_t bytes_in_line = CEIL_DIV(state.font->charInfo[char_idx].widthBits, 8); - - for (uint16_t j = 0; j < bytes_in_line; j++) { - for (uint8_t k = 0; k < 8; k++) { - if ((1 << (7 - k)) & state.font->data[state.font->charInfo[char_idx].offset + ((state.currentIteration+1) * bytes_in_line) + j]) { - buffer[(j*8)+k] = state.color; - } - else { - buffer[(j*8)+k] = bg; - } - } - } - - *data = reinterpret_cast(buffer); - size = bytes_in_line*8*2; - } - - state.currentIteration++; - - return true; -} - -void Gfx::NotifyEndOfTransfert(TaskHandle_t task) { - if(task != nullptr) { - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - vTaskNotifyGiveFromISR(task, &xHigherPriorityTaskWoken); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - } -} - -void Gfx::WaitTransfertFinished() const { - ulTaskNotifyTake(pdTRUE, 500); -} - -void Gfx::SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines) { - lcd.VerticalScrollDefinition(topFixedLines, scrollLines, bottomFixedLines); -} - -void Gfx::SetScrollStartLine(uint16_t line) { - lcd.VerticalScrollStartAddress(line); -} - diff --git a/src/components/Gfx/Gfx.h b/src/components/Gfx/Gfx.h deleted file mode 100644 index 091f06f5..00000000 --- a/src/components/Gfx/Gfx.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - - -namespace Pinetime { - namespace Drivers { - class St7789; - } - namespace Components { - class Gfx : public Pinetime::Drivers::BufferProvider { - public: - explicit Gfx(Drivers::St7789& lcd); - void Init(); - void ClearScreen(); - void DrawString(uint8_t x, uint8_t y, uint16_t color, const char* text, const FONT_INFO *p_font, bool wrap); - void DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint16_t color); - void FillRectangle(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t color); - void FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b); - void SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines); - void SetScrollStartLine(uint16_t line); - - - void Sleep(); - void Wakeup(); - bool GetNextBuffer(uint8_t **buffer, size_t &size) override; - void pixel_draw(uint8_t x, uint8_t y, uint16_t color); - - - private: - static constexpr uint8_t width = 240; - static constexpr uint8_t height = 240; - - enum class Action { None, FillRectangle, DrawChar}; - struct State { - State() : busy{false}, action{Action::None}, remainingIterations{0}, currentIteration{0} {} - volatile bool busy; - volatile Action action; - volatile uint16_t remainingIterations; - volatile uint16_t currentIteration; - volatile FONT_INFO *font; - volatile uint16_t color; - volatile uint8_t character; - volatile TaskHandle_t taskToNotify = nullptr; - }; - - volatile State state; - - uint16_t buffer[width]; // 1 line buffer - Drivers::St7789& lcd; - - void SetBackgroundColor(uint16_t color); - void WaitTransfertFinished() const; - void NotifyEndOfTransfert(TaskHandle_t task); - }; - } -} diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp new file mode 100644 index 00000000..571efae6 --- /dev/null +++ b/src/components/battery/BatteryController.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include "BatteryController.h" + +using namespace Pinetime::Controllers; + +void Battery::Init() { + nrf_gpio_cfg_input(chargingPin, (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pullup); + nrf_gpio_cfg_input(powerPresentPin, (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pullup); + + nrfx_saadc_config_t adcConfig = NRFX_SAADC_DEFAULT_CONFIG; + nrfx_saadc_init(&adcConfig, SaadcEventHandler); + nrf_saadc_channel_config_t adcChannelConfig = { + .resistor_p = NRF_SAADC_RESISTOR_DISABLED, + .resistor_n = NRF_SAADC_RESISTOR_DISABLED, + .gain = NRF_SAADC_GAIN1_5, + .reference = NRF_SAADC_REFERENCE_INTERNAL, + .acq_time = NRF_SAADC_ACQTIME_3US, + .mode = NRF_SAADC_MODE_SINGLE_ENDED, + .burst = NRF_SAADC_BURST_DISABLED, + .pin_p = batteryVoltageAdcInput, + .pin_n = NRF_SAADC_INPUT_DISABLED + }; + nrfx_saadc_channel_init(0, &adcChannelConfig); +} + +void Battery::Update() { + isCharging = !nrf_gpio_pin_read(chargingPin); + isPowerPresent = !nrf_gpio_pin_read(powerPresentPin); + + nrf_saadc_value_t value = 0; + nrfx_saadc_sample_convert(0, &value); + + // see https://forum.pine64.org/showthread.php?tid=8147 + voltage = (value * 2.0f) / (1024/3.0f); + percentRemaining = ((voltage - 3.55f)*100.0f)*3.9f; + percentRemaining = std::max(percentRemaining, 0.0f); + percentRemaining = std::min(percentRemaining, 100.0f); + +// NRF_LOG_INFO("BATTERY " NRF_LOG_FLOAT_MARKER " %% - " NRF_LOG_FLOAT_MARKER " v", NRF_LOG_FLOAT(percentRemaining), NRF_LOG_FLOAT(voltage)); +// NRF_LOG_INFO("POWER Charging : %d - Power : %d", isCharging, isPowerPresent); +} + +void Battery::SaadcEventHandler(nrfx_saadc_evt_t const * event) { + +} \ No newline at end of file diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h new file mode 100644 index 00000000..f07648a9 --- /dev/null +++ b/src/components/battery/BatteryController.h @@ -0,0 +1,27 @@ +#pragma once +#include + + +namespace Pinetime { + namespace Controllers { + class Battery { + public: + void Init(); + void Update(); + float PercentRemaining() const { return percentRemaining; } + float Voltage() const { return voltage; } + bool IsCharging() const { return isCharging; } + bool IsPowerPresent() const { return isPowerPresent; } + + private: + static constexpr uint32_t chargingPin = 12; + static constexpr uint32_t powerPresentPin = 19; + static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7; + static void SaadcEventHandler(nrfx_saadc_evt_t const * p_event); + float percentRemaining = 0.0f; + float voltage = 0.0f; + bool isCharging = false; + bool isPowerPresent = false; + }; + } +} \ No newline at end of file diff --git a/src/components/ble/AlertNotificationClient.cpp b/src/components/ble/AlertNotificationClient.cpp new file mode 100644 index 00000000..ddc72967 --- /dev/null +++ b/src/components/ble/AlertNotificationClient.cpp @@ -0,0 +1,145 @@ +#include +#include "NotificationManager.h" + +#include "AlertNotificationClient.h" + + +using namespace Pinetime::Controllers; +constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid; + +constexpr ble_uuid16_t AlertNotificationClient::supportedNewAlertCategoryUuid; +constexpr ble_uuid16_t AlertNotificationClient::supportedUnreadAlertCategoryUuid ; +constexpr ble_uuid16_t AlertNotificationClient::newAlertUuid; +constexpr ble_uuid16_t AlertNotificationClient::unreadAlertStatusUuid; +constexpr ble_uuid16_t AlertNotificationClient::controlPointUuid; + +int Pinetime::Controllers::NewAlertSubcribeCallback(uint16_t conn_handle, + const struct ble_gatt_error *error, + struct ble_gatt_attr *attr, + void *arg) { + auto client = static_cast(arg); + return client->OnNewAlertSubcribe(conn_handle, error, attr); +} + +AlertNotificationClient::AlertNotificationClient(Pinetime::System::SystemTask& systemTask, + Pinetime::Controllers::NotificationManager& notificationManager) : + systemTask{systemTask}, notificationManager{notificationManager}{ + +} + +bool AlertNotificationClient::OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service) { + if(service == nullptr && error->status == BLE_HS_EDONE) { + NRF_LOG_INFO("ANS Discovery complete"); + return true; + } + + if(service != nullptr && ble_uuid_cmp(((ble_uuid_t*)&ansServiceUuid), &service->uuid.u) == 0) { + NRF_LOG_INFO("ANS discovered : 0x%x", service->start_handle); + ansStartHandle = service->start_handle; + ansEndHandle = service->end_handle; + isDiscovered = true; + } + return false; +} + +int AlertNotificationClient::OnCharacteristicsDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, + const ble_gatt_chr *characteristic) { + if(error->status != 0 && error->status != BLE_HS_EDONE) { + NRF_LOG_INFO("ANS Characteristic discovery ERROR"); + return 0; + } + + if(characteristic == nullptr && error->status == BLE_HS_EDONE) { + NRF_LOG_INFO("ANS Characteristic discovery complete"); + } else { + if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&supportedNewAlertCategoryUuid), &characteristic->uuid.u) == 0) { + NRF_LOG_INFO("ANS Characteristic discovered : supportedNewAlertCategoryUuid"); + supportedNewAlertCategoryHandle = characteristic->val_handle; + } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&supportedUnreadAlertCategoryUuid), &characteristic->uuid.u) == 0) { + NRF_LOG_INFO("ANS Characteristic discovered : supportedUnreadAlertCategoryUuid"); + supportedUnreadAlertCategoryHandle = characteristic->val_handle; + } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&newAlertUuid), &characteristic->uuid.u) == 0) { + NRF_LOG_INFO("ANS Characteristic discovered : newAlertUuid"); + newAlertHandle = characteristic->val_handle; + newAlertDefHandle = characteristic->def_handle; + } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&unreadAlertStatusUuid), &characteristic->uuid.u) == 0) { + NRF_LOG_INFO("ANS Characteristic discovered : unreadAlertStatusUuid"); + unreadAlertStatusHandle = characteristic->val_handle; + } else if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)&controlPointUuid), &characteristic->uuid.u) == 0) { + NRF_LOG_INFO("ANS Characteristic discovered : controlPointUuid"); + controlPointHandle = characteristic->val_handle; + }else + NRF_LOG_INFO("ANS Characteristic discovered : 0x%x", characteristic->val_handle); + } + return 0; +} + +int AlertNotificationClient::OnNewAlertSubcribe(uint16_t connectionHandle, const ble_gatt_error *error, + ble_gatt_attr *attribute) { + if(error->status == 0) { + NRF_LOG_INFO("ANS New alert subscribe OK"); + } else { + NRF_LOG_INFO("ANS New alert subscribe ERROR"); + } + + return 0; +} + +int AlertNotificationClient::OnDescriptorDiscoveryEventCallback(uint16_t connectionHandle, const ble_gatt_error *error, + uint16_t characteristicValueHandle, + const ble_gatt_dsc *descriptor) { + if(error->status == 0) { + if(characteristicValueHandle == newAlertHandle && ble_uuid_cmp(((ble_uuid_t*)&newAlertUuid), &descriptor->uuid.u)) { + if(newAlertDescriptorHandle == 0) { + NRF_LOG_INFO("ANS Descriptor discovered : %d", descriptor->handle); + newAlertDescriptorHandle = descriptor->handle; + uint8_t value[2]; + value[0] = 1; + value[1] = 0; + ble_gattc_write_flat(connectionHandle, newAlertDescriptorHandle, value, sizeof(value), NewAlertSubcribeCallback, this); + } + } + } + return 0; +} + +void AlertNotificationClient::OnNotification(ble_gap_event *event) { + if(event->notify_rx.attr_handle == newAlertHandle) { + // TODO implement this with more memory safety (and constexpr) + static const size_t maxBufferSize{21}; + static const size_t maxMessageSize{18}; + size_t bufferSize = min(OS_MBUF_PKTLEN(event->notify_rx.om), maxBufferSize); + + uint8_t data[bufferSize]; + os_mbuf_copydata(event->notify_rx.om, 0, bufferSize, data); + + char *s = (char *) &data[3]; + auto messageSize = min(maxMessageSize, (bufferSize-3)); + + for (uint i = 0; i < messageSize-1; i++) { + if (s[i] == 0x00) { + s[i] = 0x0A; + } + } + s[messageSize-1] = '\0'; + + notificationManager.Push(Pinetime::Controllers::NotificationManager::Categories::SimpleAlert, s, messageSize); + systemTask.PushMessage(Pinetime::System::SystemTask::Messages::OnNewNotification); + } +} + +bool AlertNotificationClient::IsDiscovered() const { + return isDiscovered; +} + +uint16_t AlertNotificationClient::StartHandle() const { + return ansStartHandle; +} + +uint16_t AlertNotificationClient::EndHandle() const { + return ansEndHandle; +} + +uint16_t AlertNotificationClient::NewAlerthandle() const { + return newAlertHandle; +} diff --git a/src/components/ble/AlertNotificationClient.h b/src/components/ble/AlertNotificationClient.h new file mode 100644 index 00000000..ca4f4e94 --- /dev/null +++ b/src/components/ble/AlertNotificationClient.h @@ -0,0 +1,81 @@ +#pragma once + +#include +#include +#include + + +namespace Pinetime { + namespace Controllers { + int NewAlertSubcribeCallback(uint16_t conn_handle, + const struct ble_gatt_error *error, + struct ble_gatt_attr *attr, + void *arg); + + class AlertNotificationClient { + public: + explicit AlertNotificationClient(Pinetime::System::SystemTask &systemTask, + Pinetime::Controllers::NotificationManager ¬ificationManager); + + bool OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service); + int OnCharacteristicsDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, + const ble_gatt_chr *characteristic); + int OnNewAlertSubcribe(uint16_t connectionHandle, const ble_gatt_error *error, ble_gatt_attr *attribute); + int OnDescriptorDiscoveryEventCallback(uint16_t connectionHandle, const ble_gatt_error *error, + uint16_t characteristicValueHandle, const ble_gatt_dsc *descriptor); + void OnNotification(ble_gap_event *event); + bool IsDiscovered() const; + uint16_t StartHandle() const; + uint16_t EndHandle() const; + + static constexpr const ble_uuid16_t &Uuid() { return ansServiceUuid; } + + uint16_t NewAlerthandle() const; + private: + static constexpr uint16_t ansServiceId{0x1811}; + static constexpr uint16_t supportedNewAlertCategoryId = 0x2a47; + static constexpr uint16_t supportedUnreadAlertCategoryId = 0x2a48; + static constexpr uint16_t newAlertId = 0x2a46; + static constexpr uint16_t unreadAlertStatusId = 0x2a45; + static constexpr uint16_t controlPointId = 0x2a44; + + static constexpr ble_uuid16_t ansServiceUuid{ + .u {.type = BLE_UUID_TYPE_16}, + .value = ansServiceId + }; + static constexpr ble_uuid16_t supportedNewAlertCategoryUuid{ + .u {.type = BLE_UUID_TYPE_16}, + .value = supportedNewAlertCategoryId + }; + static constexpr ble_uuid16_t supportedUnreadAlertCategoryUuid{ + .u {.type = BLE_UUID_TYPE_16}, + .value = supportedUnreadAlertCategoryId + }; + static constexpr ble_uuid16_t newAlertUuid{ + .u {.type = BLE_UUID_TYPE_16}, + .value = newAlertId + }; + static constexpr ble_uuid16_t unreadAlertStatusUuid{ + .u {.type = BLE_UUID_TYPE_16}, + .value = unreadAlertStatusId + }; + static constexpr ble_uuid16_t controlPointUuid{ + .u {.type = BLE_UUID_TYPE_16}, + .value = controlPointId + }; + + uint16_t ansStartHandle; + uint16_t ansEndHandle; + uint16_t supportedNewAlertCategoryHandle; + uint16_t supportedUnreadAlertCategoryHandle; + uint16_t newAlertHandle; + uint16_t newAlertDescriptorHandle = 0; + uint16_t newAlertDefHandle; + uint16_t unreadAlertStatusHandle; + uint16_t controlPointHandle; + bool isDiscovered = false; + Pinetime::System::SystemTask &systemTask; + Pinetime::Controllers::NotificationManager ¬ificationManager; + }; + } +} \ No newline at end of file diff --git a/src/components/ble/AlertNotificationService.cpp b/src/components/ble/AlertNotificationService.cpp new file mode 100644 index 00000000..9a9b535d --- /dev/null +++ b/src/components/ble/AlertNotificationService.cpp @@ -0,0 +1,80 @@ + +#include +#include "NotificationManager.h" +#include + +#include "AlertNotificationService.h" +#include + +using namespace Pinetime::Controllers; + +constexpr ble_uuid16_t AlertNotificationService::ansUuid; +constexpr ble_uuid16_t AlertNotificationService::ansCharUuid; + + +int AlertNotificationCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { + auto anService = static_cast(arg); + return anService->OnAlert(conn_handle, attr_handle, ctxt); +} + +void AlertNotificationService::Init() { + int res; + res = ble_gatts_count_cfg(serviceDefinition); + ASSERT(res == 0); + + res = ble_gatts_add_svcs(serviceDefinition); + ASSERT(res == 0); +} + +AlertNotificationService::AlertNotificationService ( System::SystemTask& systemTask, NotificationManager& notificationManager ) + : characteristicDefinition{ + { + .uuid = (ble_uuid_t *) &ansCharUuid, + .access_cb = AlertNotificationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE + }, + { + 0 + } + }, + serviceDefinition{ + { + /* Device Information Service */ + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = (ble_uuid_t *) &ansUuid, + .characteristics = characteristicDefinition + }, + { + 0 + }, + }, m_systemTask{systemTask}, m_notificationManager{notificationManager} { +} + +int AlertNotificationService::OnAlert(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt) { + + if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { + // TODO implement this with more memory safety (and constexpr) + static const size_t maxBufferSize{21}; + static const size_t maxMessageSize{18}; + size_t bufferSize = min(OS_MBUF_PKTLEN(ctxt->om), maxBufferSize); + + uint8_t data[bufferSize]; + os_mbuf_copydata(ctxt->om, 0, bufferSize, data); + + char *s = (char *) &data[3]; + auto messageSize = min(maxMessageSize, (bufferSize-3)); + + for (uint i = 0; i < messageSize-1; i++) { + if (s[i] == 0x00) { + s[i] = 0x0A; + } + } + s[messageSize-1] = '\0'; + + m_notificationManager.Push(Pinetime::Controllers::NotificationManager::Categories::SimpleAlert, s, messageSize); + m_systemTask.PushMessage(Pinetime::System::SystemTask::Messages::OnNewNotification); + } + return 0; +} diff --git a/src/components/ble/AlertNotificationService.h b/src/components/ble/AlertNotificationService.h new file mode 100644 index 00000000..53cb44cc --- /dev/null +++ b/src/components/ble/AlertNotificationService.h @@ -0,0 +1,39 @@ +#pragma once +#include +#include +#include + +namespace Pinetime { + namespace Controllers { + class AlertNotificationService { + public: + AlertNotificationService(Pinetime::System::SystemTask &systemTask, + Pinetime::Controllers::NotificationManager ¬ificationManager); + void Init(); + + int OnAlert(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt); + + + private: + static constexpr uint16_t ansId {0x1811}; + static constexpr uint16_t ansCharId {0x2a46}; + + static constexpr ble_uuid16_t ansUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = ansId + }; + + static constexpr ble_uuid16_t ansCharUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = ansCharId + }; + + struct ble_gatt_chr_def characteristicDefinition[2]; + struct ble_gatt_svc_def serviceDefinition[2]; + + Pinetime::System::SystemTask &m_systemTask; + NotificationManager &m_notificationManager; + }; + } +} diff --git a/src/components/ble/BatteryInformationService.cpp b/src/components/ble/BatteryInformationService.cpp new file mode 100644 index 00000000..f7d895c2 --- /dev/null +++ b/src/components/ble/BatteryInformationService.cpp @@ -0,0 +1,62 @@ +#include "BatteryInformationService.h" +#include "components/battery/BatteryController.h" + +using namespace Pinetime::Controllers; + +constexpr ble_uuid16_t BatteryInformationService::batteryInformationServiceUuid; +constexpr ble_uuid16_t BatteryInformationService::batteryLevelUuid; + + + +int BatteryInformationServiceCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { + auto* batteryInformationService = static_cast(arg); + return batteryInformationService->OnBatteryServiceRequested(conn_handle, attr_handle, ctxt); +} + +BatteryInformationService::BatteryInformationService(Controllers::Battery& batteryController) : + batteryController{batteryController}, + characteristicDefinition{ + { + .uuid = (ble_uuid_t *) &batteryLevelUuid, + .access_cb = BatteryInformationServiceCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + .val_handle = &batteryLevelHandle + }, + { + 0 + } + }, + serviceDefinition{ + { + /* Device Information Service */ + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = (ble_uuid_t *) &batteryInformationServiceUuid, + .characteristics = characteristicDefinition + }, + { + 0 + }, + }{ + +} + +void BatteryInformationService::Init() { + int res = 0; + res = ble_gatts_count_cfg(serviceDefinition); + ASSERT(res == 0); + + res = ble_gatts_add_svcs(serviceDefinition); + ASSERT(res == 0); +} + +int BatteryInformationService::OnBatteryServiceRequested(uint16_t connectionHandle, uint16_t attributeHandle, + ble_gatt_access_ctxt *context) { + if(attributeHandle == batteryLevelHandle) { + NRF_LOG_INFO("BATTERY : handle = %d", batteryLevelHandle); + static uint8_t batteryValue = batteryController.PercentRemaining(); + int res = os_mbuf_append(context->om, &batteryValue, 1); + return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; + } + return 0; +} \ No newline at end of file diff --git a/src/components/ble/BatteryInformationService.h b/src/components/ble/BatteryInformationService.h new file mode 100644 index 00000000..74b2222c --- /dev/null +++ b/src/components/ble/BatteryInformationService.h @@ -0,0 +1,40 @@ +#pragma once +#include + +namespace Pinetime { + namespace System { + class SystemTask; + } + namespace Controllers { + class Battery; + class BatteryInformationService { + public: + BatteryInformationService(Controllers::Battery& batteryController); + void Init(); + + int + OnBatteryServiceRequested(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); + + private: + Controllers::Battery& batteryController; + static constexpr uint16_t batteryInformationServiceId {0x180F}; + static constexpr uint16_t batteryLevelId {0x2A19}; + + static constexpr ble_uuid16_t batteryInformationServiceUuid { + .u {.type = BLE_UUID_TYPE_16}, + .value = batteryInformationServiceId + }; + + static constexpr ble_uuid16_t batteryLevelUuid { + .u {.type = BLE_UUID_TYPE_16}, + .value = batteryLevelId + }; + + struct ble_gatt_chr_def characteristicDefinition[3]; + struct ble_gatt_svc_def serviceDefinition[2]; + + uint16_t batteryLevelHandle; + + }; + } +} diff --git a/src/components/ble/BleController.cpp b/src/components/ble/BleController.cpp new file mode 100644 index 00000000..2b396e12 --- /dev/null +++ b/src/components/ble/BleController.cpp @@ -0,0 +1,31 @@ +#include +#include +#include "BleController.h" + +using namespace Pinetime::Controllers; + +void Ble::Connect() { + isConnected = true; +} + +void Ble::Disconnect() { + isConnected = false; +} + +void Ble::StartFirmwareUpdate() { + isFirmwareUpdating = true; +} + +void Ble::StopFirmwareUpdate() { + isFirmwareUpdating = false; +} + +void Ble::FirmwareUpdateTotalBytes(uint32_t totalBytes) { + firmwareUpdateTotalBytes = totalBytes; +} + +void Ble::FirmwareUpdateCurrentBytes(uint32_t currentBytes) { + firmwareUpdateCurrentBytes = currentBytes; +} + + diff --git a/src/components/ble/BleController.h b/src/components/ble/BleController.h new file mode 100644 index 00000000..3f52ea25 --- /dev/null +++ b/src/components/ble/BleController.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include +#include + +namespace Pinetime { + namespace Controllers { + class Ble { + public: + using BleAddress = std::array; + enum class FirmwareUpdateStates {Idle, Running, Validated, Error}; + enum class AddressTypes { Public, Random }; + + Ble() = default; + bool IsConnected() const {return isConnected;} + void Connect(); + void Disconnect(); + + void StartFirmwareUpdate(); + void StopFirmwareUpdate(); + void FirmwareUpdateTotalBytes(uint32_t totalBytes); + void FirmwareUpdateCurrentBytes(uint32_t currentBytes); + void State(FirmwareUpdateStates state) { firmwareUpdateState = state; } + + bool IsFirmwareUpdating() const { return isFirmwareUpdating; } + uint32_t FirmwareUpdateTotalBytes() const { return firmwareUpdateTotalBytes; } + uint32_t FirmwareUpdateCurrentBytes() const { return firmwareUpdateCurrentBytes; } + FirmwareUpdateStates State() const { return firmwareUpdateState; } + + void Address(BleAddress&& addr) { address = addr; } + const BleAddress& Address() const { return address; } + void AddressType(AddressTypes t) { addressType = t;} + private: + bool isConnected = false; + bool isFirmwareUpdating = false; + uint32_t firmwareUpdateTotalBytes = 0; + uint32_t firmwareUpdateCurrentBytes = 0; + FirmwareUpdateStates firmwareUpdateState = FirmwareUpdateStates::Idle; + BleAddress address; + AddressTypes addressType; + + }; + } +} \ No newline at end of file diff --git a/src/components/ble/CurrentTimeClient.cpp b/src/components/ble/CurrentTimeClient.cpp new file mode 100644 index 00000000..7a225f4b --- /dev/null +++ b/src/components/ble/CurrentTimeClient.cpp @@ -0,0 +1,77 @@ +#include +#include "CurrentTimeClient.h" + +using namespace Pinetime::Controllers; + +constexpr ble_uuid16_t CurrentTimeClient::ctsServiceUuid; +constexpr ble_uuid16_t CurrentTimeClient::currentTimeCharacteristicUuid; + +CurrentTimeClient::CurrentTimeClient(DateTime& dateTimeController) : dateTimeController{dateTimeController} { + +} + +void CurrentTimeClient::Init() { + +} + +bool CurrentTimeClient::OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service) { + if(service == nullptr && error->status == BLE_HS_EDONE) { + NRF_LOG_INFO("CTS Discovery complete"); + return true; + } + + if(service != nullptr && ble_uuid_cmp(((ble_uuid_t*)&ctsServiceUuid), &service->uuid.u) == 0) { + NRF_LOG_INFO("CTS discovered : 0x%x", service->start_handle); + isDiscovered = true; + ctsStartHandle = service->start_handle; + ctsEndHandle = service->end_handle; + return false; + } + return false; +} + +int CurrentTimeClient::OnCharacteristicDiscoveryEvent(uint16_t conn_handle, const ble_gatt_error *error, + const ble_gatt_chr *characteristic) { + if(characteristic == nullptr && error->status == BLE_HS_EDONE) { + NRF_LOG_INFO("CTS Characteristic discovery complete"); + return 0; + } + + if(characteristic != nullptr && ble_uuid_cmp(((ble_uuid_t*)¤tTimeCharacteristicUuid), &characteristic->uuid.u) == 0) { + NRF_LOG_INFO("CTS Characteristic discovered : 0x%x", characteristic->val_handle); + currentTimeHandle = characteristic->val_handle; + } + return 0; +} + +int CurrentTimeClient::OnCurrentTimeReadResult(uint16_t conn_handle, const ble_gatt_error *error, const ble_gatt_attr *attribute) { + if(error->status == 0) { + // TODO check that attribute->handle equals the handle discovered in OnCharacteristicDiscoveryEvent + CtsData result; + os_mbuf_copydata(attribute->om, 0, sizeof(CtsData), &result); + NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", result.year, + result.month, result.dayofmonth, + result.hour, result.minute, result.second); + dateTimeController.SetTime(result.year, result.month, result.dayofmonth, + 0, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG)); + } else { + NRF_LOG_INFO("Error retrieving current time: %d", error->status); + } + return 0; +} + +bool CurrentTimeClient::IsDiscovered() const { + return isDiscovered; +} + +uint16_t CurrentTimeClient::StartHandle() const { + return ctsStartHandle; +} + +uint16_t CurrentTimeClient::EndHandle() const { + return ctsEndHandle; +} + +uint16_t CurrentTimeClient::CurrentTimeHandle() const { + return currentTimeHandle; +} \ No newline at end of file diff --git a/src/components/ble/CurrentTimeClient.h b/src/components/ble/CurrentTimeClient.h new file mode 100644 index 00000000..639ec831 --- /dev/null +++ b/src/components/ble/CurrentTimeClient.h @@ -0,0 +1,56 @@ +#pragma once +#include +#include + +#include "components/datetime/DateTimeController.h" +#include + +namespace Pinetime { + namespace Controllers { + + class CurrentTimeClient { + public: + explicit CurrentTimeClient(DateTime& dateTimeController); + void Init(); + bool OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service); + int OnCharacteristicDiscoveryEvent(uint16_t conn_handle, const ble_gatt_error *error, + const ble_gatt_chr *characteristic); + int OnCurrentTimeReadResult(uint16_t conn_handle, const ble_gatt_error *error, const ble_gatt_attr *attribute); + bool IsDiscovered() const; + uint16_t StartHandle() const; + uint16_t EndHandle() const; + uint16_t CurrentTimeHandle() const; + static constexpr const ble_uuid16_t* Uuid() { return &CurrentTimeClient::ctsServiceUuid; } + static constexpr const ble_uuid16_t* CurrentTimeCharacteristicUuid() { return &CurrentTimeClient::currentTimeCharacteristicUuid; } + private: + typedef struct __attribute__((packed)) { + uint16_t year; + uint8_t month; + uint8_t dayofmonth; + uint8_t hour; + uint8_t minute; + uint8_t second; + uint8_t millis; + uint8_t reason; + } CtsData; + + static constexpr uint16_t ctsServiceId {0x1805}; + static constexpr uint16_t currentTimeCharacteristicId {0x2a2b}; + + static constexpr ble_uuid16_t ctsServiceUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = ctsServiceId + }; + static constexpr ble_uuid16_t currentTimeCharacteristicUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = currentTimeCharacteristicId + }; + + uint16_t currentTimeHandle; + DateTime& dateTimeController; + bool isDiscovered = false; + uint16_t ctsStartHandle; + uint16_t ctsEndHandle; + }; + } +} \ No newline at end of file diff --git a/src/components/ble/CurrentTimeService.cpp b/src/components/ble/CurrentTimeService.cpp new file mode 100644 index 00000000..3a6264e2 --- /dev/null +++ b/src/components/ble/CurrentTimeService.cpp @@ -0,0 +1,86 @@ +#include "CurrentTimeService.h" +#include + +using namespace Pinetime::Controllers; + +constexpr ble_uuid16_t CurrentTimeService::ctsUuid; +constexpr ble_uuid16_t CurrentTimeService::ctChrUuid; + + +int CTSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { + auto cts = static_cast(arg); + return cts->OnTimeAccessed(conn_handle, attr_handle, ctxt); +} + +void CurrentTimeService::Init() { + int res; + res = ble_gatts_count_cfg(serviceDefinition); + ASSERT(res == 0); + + res = ble_gatts_add_svcs(serviceDefinition); + ASSERT(res == 0); +} + + +int CurrentTimeService::OnTimeAccessed(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt) { + + NRF_LOG_INFO("Setting time..."); + + if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { + CtsData result; + os_mbuf_copydata(ctxt->om, 0, sizeof(CtsData), &result); + + NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", result.year, + result.month, result.dayofmonth, + result.hour, result.minute, result.second); + + m_dateTimeController.SetTime(result.year, result.month, result.dayofmonth, + 0, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG)); + + } else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) { + CtsData currentDateTime; + currentDateTime.year = m_dateTimeController.Year(); + currentDateTime.month = static_cast(m_dateTimeController.Month()); + currentDateTime.dayofmonth = m_dateTimeController.Day(); + currentDateTime.hour = m_dateTimeController.Hours(); + currentDateTime.minute = m_dateTimeController.Minutes(); + currentDateTime.second = m_dateTimeController.Seconds(); + currentDateTime.millis = 0; + + + int res = os_mbuf_append(ctxt->om, ¤tDateTime, sizeof(CtsData)); + return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; + + } + + return 0; +} + +CurrentTimeService::CurrentTimeService(DateTime &dateTimeController) : + characteristicDefinition{ + { + .uuid = (ble_uuid_t *) &ctChrUuid, + .access_cb = CTSCallback, + + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ + }, + { + 0 + } + }, + serviceDefinition{ + { + /* Device Information Service */ + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = (ble_uuid_t *) &ctsUuid, + .characteristics = characteristicDefinition + }, + { + 0 + }, + }, m_dateTimeController{dateTimeController} { + +} + diff --git a/src/components/ble/CurrentTimeService.h b/src/components/ble/CurrentTimeService.h new file mode 100644 index 00000000..a6be9647 --- /dev/null +++ b/src/components/ble/CurrentTimeService.h @@ -0,0 +1,49 @@ +#pragma once +#include +#include + +#include "components/datetime/DateTimeController.h" +#include + +namespace Pinetime { + namespace Controllers { + class CurrentTimeService { + public: + CurrentTimeService(DateTime &dateTimeController); + void Init(); + + int OnTimeAccessed(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt); + + private: + static constexpr uint16_t ctsId {0x1805}; + static constexpr uint16_t ctsCharId {0x2a2b}; + + static constexpr ble_uuid16_t ctsUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = ctsId + }; + + static constexpr ble_uuid16_t ctChrUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = ctsCharId + }; + + struct ble_gatt_chr_def characteristicDefinition[2]; + struct ble_gatt_svc_def serviceDefinition[2]; + + typedef struct __attribute__((packed)) { + uint16_t year; + uint8_t month; + uint8_t dayofmonth; + uint8_t hour; + uint8_t minute; + uint8_t second; + uint8_t millis; + uint8_t reason; + } CtsData; + + DateTime &m_dateTimeController; + }; + } +} diff --git a/src/components/ble/DeviceInformationService.cpp b/src/components/ble/DeviceInformationService.cpp new file mode 100644 index 00000000..406db1cf --- /dev/null +++ b/src/components/ble/DeviceInformationService.cpp @@ -0,0 +1,116 @@ +#include "DeviceInformationService.h" + +using namespace Pinetime::Controllers; + +constexpr ble_uuid16_t DeviceInformationService::manufacturerNameUuid; +constexpr ble_uuid16_t DeviceInformationService::modelNumberUuid; +constexpr ble_uuid16_t DeviceInformationService::serialNumberUuid; +constexpr ble_uuid16_t DeviceInformationService::fwRevisionUuid; +constexpr ble_uuid16_t DeviceInformationService::deviceInfoUuid; +constexpr ble_uuid16_t DeviceInformationService::hwRevisionUuid; +constexpr ble_uuid16_t DeviceInformationService::swRevisionUuid; + + +int DeviceInformationCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { + auto deviceInformationService = static_cast(arg); + return deviceInformationService->OnDeviceInfoRequested(conn_handle, attr_handle, ctxt); +} + +void DeviceInformationService::Init() { + int res = 0; + res = ble_gatts_count_cfg(serviceDefinition); + ASSERT(res == 0); + + res = ble_gatts_add_svcs(serviceDefinition); + ASSERT(res == 0); +} + + +int DeviceInformationService::OnDeviceInfoRequested(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt) { + const char *str; + + switch (ble_uuid_u16(ctxt->chr->uuid)) { + case manufacturerNameId: + str = manufacturerName; + break; + case modelNumberId: + str = modelNumber; + break; + case serialNumberId: + str = serialNumber; + break; + case fwRevisionId: + str = fwRevision; + break; + case hwRevisionId: + str = hwRevision; + break; + case swRevisionId: + str = swRevision; + break; + default: + return BLE_ATT_ERR_UNLIKELY; + } + + int res = os_mbuf_append(ctxt->om, str, strlen(str)); + return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; +} + +DeviceInformationService::DeviceInformationService() : + characteristicDefinition{ + { + .uuid = (ble_uuid_t *) &manufacturerNameUuid, + .access_cb = DeviceInformationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + }, + { + .uuid = (ble_uuid_t *) &modelNumberUuid, + .access_cb = DeviceInformationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + }, + { + .uuid = (ble_uuid_t *) &serialNumberUuid, + .access_cb = DeviceInformationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + }, + { + .uuid = (ble_uuid_t *) &fwRevisionUuid, + .access_cb = DeviceInformationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + }, + { + .uuid = (ble_uuid_t *) &hwRevisionUuid, + .access_cb = DeviceInformationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + }, + { + .uuid = (ble_uuid_t *) &swRevisionUuid, + .access_cb = DeviceInformationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + }, + { + 0 + } + }, + serviceDefinition{ + { + /* Device Information Service */ + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = (ble_uuid_t *) &deviceInfoUuid, + .characteristics = characteristicDefinition + }, + { + 0 + }, + } + { + +} + diff --git a/src/components/ble/DeviceInformationService.h b/src/components/ble/DeviceInformationService.h new file mode 100644 index 00000000..25ab8402 --- /dev/null +++ b/src/components/ble/DeviceInformationService.h @@ -0,0 +1,76 @@ +#pragma once +#include +#include + +#include +#include + +namespace Pinetime { + namespace Controllers { + class DeviceInformationService { + public: + DeviceInformationService(); + void Init(); + + int OnDeviceInfoRequested(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt); + + private: + static constexpr uint16_t deviceInfoId {0x180a}; + static constexpr uint16_t manufacturerNameId {0x2a29}; + static constexpr uint16_t modelNumberId {0x2a24}; + static constexpr uint16_t serialNumberId {0x2a25}; + static constexpr uint16_t fwRevisionId {0x2a26}; + static constexpr uint16_t hwRevisionId {0x2a27}; + static constexpr uint16_t swRevisionId {0x2a28}; + + static constexpr const char* manufacturerName = "PINE64"; + static constexpr const char* modelNumber = "PineTime"; + static constexpr const char* hwRevision = "1.0.0"; + static constexpr const char* serialNumber = "0"; + static constexpr const char* fwRevision = Version::VersionString(); + static constexpr const char* swRevision = "InfiniTime"; + + + static constexpr ble_uuid16_t deviceInfoUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = deviceInfoId + }; + + static constexpr ble_uuid16_t manufacturerNameUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = manufacturerNameId + }; + + static constexpr ble_uuid16_t modelNumberUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = modelNumberId + }; + + static constexpr ble_uuid16_t serialNumberUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = serialNumberId + }; + + static constexpr ble_uuid16_t fwRevisionUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = fwRevisionId + }; + + static constexpr ble_uuid16_t hwRevisionUuid { + .u {.type = BLE_UUID_TYPE_16}, + .value = hwRevisionId + }; + + static constexpr ble_uuid16_t swRevisionUuid { + .u {.type = BLE_UUID_TYPE_16}, + .value = swRevisionId + }; + + struct ble_gatt_chr_def characteristicDefinition[7]; + struct ble_gatt_svc_def serviceDefinition[2]; + + + }; + } +} \ No newline at end of file diff --git a/src/components/ble/DfuService.cpp b/src/components/ble/DfuService.cpp new file mode 100644 index 00000000..4dec5141 --- /dev/null +++ b/src/components/ble/DfuService.cpp @@ -0,0 +1,441 @@ +#include + +#include "components/ble/BleController.h" +#include "systemtask/SystemTask.h" +#include "DfuService.h" + +using namespace Pinetime::Controllers; + +constexpr ble_uuid128_t DfuService::serviceUuid; +constexpr ble_uuid128_t DfuService::controlPointCharacteristicUuid; +constexpr ble_uuid128_t DfuService::revisionCharacteristicUuid; +constexpr ble_uuid128_t DfuService::packetCharacteristicUuid; + +int DfuServiceCallback(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt, void *arg) { + auto dfuService = static_cast(arg); + return dfuService->OnServiceData(conn_handle, attr_handle, ctxt); +} + +void NotificationTimerCallback(TimerHandle_t xTimer) { + auto notificationManager = static_cast(pvTimerGetTimerID(xTimer)); + notificationManager->OnNotificationTimer(); +} + +void TimeoutTimerCallback(TimerHandle_t xTimer) { + auto dfuService = static_cast(pvTimerGetTimerID(xTimer)); + dfuService->OnTimeout(); +} + +DfuService::DfuService(Pinetime::System::SystemTask &systemTask, Pinetime::Controllers::Ble &bleController, + Pinetime::Drivers::SpiNorFlash &spiNorFlash) : + systemTask{systemTask}, + bleController{bleController}, + dfuImage{spiNorFlash}, + characteristicDefinition{ + { + .uuid = (ble_uuid_t *) &packetCharacteristicUuid, + .access_cb = DfuServiceCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE_NO_RSP, + .val_handle = nullptr, + }, + { + .uuid = (ble_uuid_t *) &controlPointCharacteristicUuid, + .access_cb = DfuServiceCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_NOTIFY, + .val_handle = nullptr, + }, + { + .uuid = (ble_uuid_t *) &revisionCharacteristicUuid, + .access_cb = DfuServiceCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + .val_handle = &revision, + + }, + { + 0 + } + + }, + serviceDefinition{ + { + /* Device Information Service */ + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = (ble_uuid_t *) &serviceUuid, + .characteristics = characteristicDefinition + }, + { + 0 + }, + } { + timeoutTimer = xTimerCreate ("notificationTimer", 10000, pdFALSE, this, TimeoutTimerCallback); +} + +void DfuService::Init() { + int res; + res = ble_gatts_count_cfg(serviceDefinition); + ASSERT(res == 0); + + res = ble_gatts_add_svcs(serviceDefinition); + ASSERT(res == 0); +} + +int DfuService::OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context) { + if(bleController.IsFirmwareUpdating()){ + xTimerStart(timeoutTimer, 0); + } + + + ble_gatts_find_chr((ble_uuid_t *) &serviceUuid, (ble_uuid_t *) &packetCharacteristicUuid, nullptr, + &packetCharacteristicHandle); + ble_gatts_find_chr((ble_uuid_t *) &serviceUuid, (ble_uuid_t *) &controlPointCharacteristicUuid, nullptr, + &controlPointCharacteristicHandle); + ble_gatts_find_chr((ble_uuid_t *) &serviceUuid, (ble_uuid_t *) &revisionCharacteristicUuid, nullptr, + &revisionCharacteristicHandle); + + if (attributeHandle == packetCharacteristicHandle) { + if (context->op == BLE_GATT_ACCESS_OP_WRITE_CHR) + return WritePacketHandler(connectionHandle, context->om); + else return 0; + } else if (attributeHandle == controlPointCharacteristicHandle) { + if (context->op == BLE_GATT_ACCESS_OP_WRITE_CHR) + return ControlPointHandler(connectionHandle, context->om); + else return 0; + } else if (attributeHandle == revisionCharacteristicHandle) { + if (context->op == BLE_GATT_ACCESS_OP_READ_CHR) + return SendDfuRevision(context->om); + else return 0; + } else { + NRF_LOG_INFO("[DFU] Unknown Characteristic : %d", attributeHandle); + return 0; + } +} + +int DfuService::SendDfuRevision(os_mbuf *om) const { + int res = os_mbuf_append(om, &revision, sizeof(revision)); + return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; +} + +int DfuService::WritePacketHandler(uint16_t connectionHandle, os_mbuf *om) { + switch (state) { + case States::Start: { + softdeviceSize = om->om_data[0] + (om->om_data[1] << 8) + (om->om_data[2] << 16) + (om->om_data[3] << 24); + bootloaderSize = om->om_data[4] + (om->om_data[5] << 8) + (om->om_data[6] << 16) + (om->om_data[7] << 24); + applicationSize = om->om_data[8] + (om->om_data[9] << 8) + (om->om_data[10] << 16) + (om->om_data[11] << 24); + bleController.FirmwareUpdateTotalBytes(applicationSize); + NRF_LOG_INFO("[DFU] -> Start data received : SD size : %d, BT size : %d, app size : %d", softdeviceSize, + bootloaderSize, applicationSize); + + dfuImage.Erase(); + + uint8_t data[]{16, 1, 1}; + notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 3); + state = States::Init; + } + return 0; + case States::Init: { + uint16_t deviceType = om->om_data[0] + (om->om_data[1] << 8); + uint16_t deviceRevision = om->om_data[2] + (om->om_data[3] << 8); + uint32_t applicationVersion = + om->om_data[4] + (om->om_data[5] << 8) + (om->om_data[6] << 16) + (om->om_data[7] << 24); + uint16_t softdeviceArrayLength = om->om_data[8] + (om->om_data[9] << 8); + uint16_t sd[softdeviceArrayLength]; + for (int i = 0; i < softdeviceArrayLength; i++) { + sd[i] = om->om_data[10 + (i * 2)] + (om->om_data[10 + (i * 2) + 1] << 8); + } + expectedCrc = + om->om_data[10 + (softdeviceArrayLength * 2)] + (om->om_data[10 + (softdeviceArrayLength * 2) + 1] << 8); + + NRF_LOG_INFO( + "[DFU] -> Init data received : deviceType = %d, deviceRevision = %d, applicationVersion = %d, nb SD = %d, First SD = %d, CRC = %u", + deviceType, deviceRevision, applicationVersion, softdeviceArrayLength, sd[0], expectedCrc); + + return 0; + } + + case States::Data: { + nbPacketReceived++; + dfuImage.Append(om->om_data, om->om_len); + bytesReceived += om->om_len; + bleController.FirmwareUpdateCurrentBytes(bytesReceived); + + if ((nbPacketReceived % nbPacketsToNotify) == 0 && bytesReceived != applicationSize) { + uint8_t data[5]{static_cast(Opcodes::PacketReceiptNotification), + (uint8_t) (bytesReceived & 0x000000FFu), (uint8_t) (bytesReceived >> 8u), + (uint8_t) (bytesReceived >> 16u), (uint8_t) (bytesReceived >> 24u)}; + NRF_LOG_INFO("[DFU] -> Send packet notification: %d bytes received", bytesReceived); + notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 5); + } + if (dfuImage.IsComplete()) { + uint8_t data[3]{static_cast(Opcodes::Response), + static_cast(Opcodes::ReceiveFirmwareImage), + static_cast(ErrorCodes::NoError)}; + NRF_LOG_INFO("[DFU] -> Send packet notification : all bytes received!"); + notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 3); + state = States::Validate; + } + } + return 0; + default: + // Invalid state + return 0; + } + return 0; +} + +int DfuService::ControlPointHandler(uint16_t connectionHandle, os_mbuf *om) { + auto opcode = static_cast(om->om_data[0]); + NRF_LOG_INFO("[DFU] -> ControlPointHandler"); + + switch (opcode) { + case Opcodes::StartDFU: { + if (state != States::Idle && state != States::Start) { + NRF_LOG_INFO("[DFU] -> Start DFU requested, but we are not in Idle state"); + return 0; + } + if (state == States::Start) { + NRF_LOG_INFO("[DFU] -> Start DFU requested, but we are already in Start state"); + return 0; + } + auto imageType = static_cast(om->om_data[1]); + if (imageType == ImageTypes::Application) { + NRF_LOG_INFO("[DFU] -> Start DFU, mode = Application"); + state = States::Start; + bleController.StartFirmwareUpdate(); + bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Running); + bleController.FirmwareUpdateTotalBytes(0xffffffffu); + bleController.FirmwareUpdateCurrentBytes(0); + systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleFirmwareUpdateStarted); + return 0; + } else { + NRF_LOG_INFO("[DFU] -> Start DFU, mode %d not supported!", imageType); + return 0; + } + } + break; + case Opcodes::InitDFUParameters: { + if (state != States::Init) { + NRF_LOG_INFO("[DFU] -> Init DFU requested, but we are not in Init state"); + return 0; + } + bool isInitComplete = (om->om_data[1] != 0); + NRF_LOG_INFO("[DFU] -> Init DFU parameters %s", isInitComplete ? " complete" : " not complete"); + + if (isInitComplete) { + uint8_t data[3] { + static_cast(Opcodes::Response), + static_cast(Opcodes::InitDFUParameters), + (isInitComplete ? uint8_t{1} : uint8_t{0}) + }; + notificationManager.AsyncSend(connectionHandle, controlPointCharacteristicHandle, data, 3); + return 0; + } + } + return 0; + case Opcodes::PacketReceiptNotificationRequest: + nbPacketsToNotify = om->om_data[1]; + NRF_LOG_INFO("[DFU] -> Receive Packet Notification Request, nb packet = %d", nbPacketsToNotify); + return 0; + case Opcodes::ReceiveFirmwareImage: + if (state != States::Init) { + NRF_LOG_INFO("[DFU] -> Receive firmware image requested, but we are not in Start Init"); + return 0; + } + // TODO the chunk size is dependant of the implementation of the host application... + dfuImage.Init(20, applicationSize, expectedCrc); + NRF_LOG_INFO("[DFU] -> Starting receive firmware"); + state = States::Data; + return 0; + case Opcodes::ValidateFirmware: { + if (state != States::Validate) { + NRF_LOG_INFO("[DFU] -> Validate firmware image requested, but we are not in Data state %d", state); + return 0; + } + + NRF_LOG_INFO("[DFU] -> Validate firmware image requested -- %d", connectionHandle); + + if(dfuImage.Validate()){ + state = States::Validated; + bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Validated); + NRF_LOG_INFO("Image OK"); + + uint8_t data[3] { + static_cast(Opcodes::Response), + static_cast(Opcodes::ValidateFirmware), + static_cast(ErrorCodes::NoError) + }; + notificationManager.AsyncSend(connectionHandle, controlPointCharacteristicHandle, data, 3); + } else { + bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Error); + NRF_LOG_INFO("Image Error : bad CRC"); + + uint8_t data[3] { + static_cast(Opcodes::Response), + static_cast(Opcodes::ValidateFirmware), + static_cast(ErrorCodes::CrcError) + }; + notificationManager.AsyncSend(connectionHandle, controlPointCharacteristicHandle, data, 3); + } + + return 0; + } + case Opcodes::ActivateImageAndReset: + if (state != States::Validated) { + NRF_LOG_INFO("[DFU] -> Activate image and reset requested, but we are not in Validated state"); + return 0; + } + NRF_LOG_INFO("[DFU] -> Activate image and reset!"); + bleController.StopFirmwareUpdate(); + systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleFirmwareUpdateFinished); + Reset(); + bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Validated); + return 0; + default: + return 0; + } +} + +void DfuService::OnTimeout() { + Reset(); +} + +void DfuService::Reset() { + state = States::Idle; + nbPacketsToNotify = 0; + nbPacketReceived = 0; + bytesReceived = 0; + softdeviceSize = 0; + bootloaderSize = 0; + applicationSize = 0; + expectedCrc = 0; + notificationManager.Reset(); + bleController.State(Pinetime::Controllers::Ble::FirmwareUpdateStates::Error); + bleController.StopFirmwareUpdate(); + systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleFirmwareUpdateFinished); +} + +DfuService::NotificationManager::NotificationManager() { + timer = xTimerCreate ("notificationTimer", 1000, pdFALSE, this, NotificationTimerCallback); +} + +bool DfuService::NotificationManager::AsyncSend(uint16_t connection, uint16_t charactHandle, uint8_t *data, size_t s) { + if(size != 0 || s > 10) + return false; + + connectionHandle = connection; + characteristicHandle = charactHandle; + size = s; + std::memcpy(buffer, data, size); + xTimerStart(timer, 0); + return true; +} + +void DfuService::NotificationManager::OnNotificationTimer() { + if(size > 0) { + Send(connectionHandle, characteristicHandle, buffer, size); + size = 0; + } +} + +void DfuService::NotificationManager::Send(uint16_t connection, uint16_t charactHandle, const uint8_t *data, const size_t s) { + auto *om = ble_hs_mbuf_from_flat(data, s); + auto ret = ble_gattc_notify_custom(connection, charactHandle, om); + ASSERT(ret == 0); +} + +void DfuService::NotificationManager::Reset() { + connectionHandle = 0; + characteristicHandle = 0; + size = 0; + xTimerStop(timer, 0); +} + +void DfuService::DfuImage::Init(size_t chunkSize, size_t totalSize, uint16_t expectedCrc) { + if(chunkSize != 20) return; + this->chunkSize = chunkSize; + this->totalSize = totalSize; + this->expectedCrc = expectedCrc; + this->ready = true; +} + +void DfuService::DfuImage::Append(uint8_t *data, size_t size) { + if(!ready) return; + ASSERT(size <= 20); + + std::memcpy(tempBuffer + bufferWriteIndex, data, size); + bufferWriteIndex += size; + + if(bufferWriteIndex == bufferSize) { + spiNorFlash.Write(writeOffset + totalWriteIndex, tempBuffer, bufferWriteIndex); + totalWriteIndex += bufferWriteIndex; + bufferWriteIndex = 0; + } + + if(bufferWriteIndex > 0 && totalWriteIndex + bufferWriteIndex == totalSize) { + spiNorFlash.Write(writeOffset + totalWriteIndex, tempBuffer, bufferWriteIndex); + totalWriteIndex += bufferWriteIndex; + if (totalSize < maxSize) + WriteMagicNumber(); + } +} + +void DfuService::DfuImage::WriteMagicNumber() { + uint32_t magic[4] = { // TODO When this variable is a static constexpr, the values written to the memory are not correct. Why? + 0xf395c277, + 0x7fefd260, + 0x0f505235, + 0x8079b62c, + }; + + uint32_t offset = writeOffset + (maxSize - (4 * sizeof(uint32_t))); + spiNorFlash.Write(offset, reinterpret_cast(magic), 4 * sizeof(uint32_t)); +} + +void DfuService::DfuImage::Erase() { + for (size_t erased = 0; erased < maxSize; erased += 0x1000) { + spiNorFlash.SectorErase(writeOffset + erased); + } +} + +bool DfuService::DfuImage::Validate() { + uint32_t chunkSize = 200; + size_t currentOffset = 0; + uint16_t crc = 0; + + bool first = true; + while (currentOffset < totalSize) { + uint32_t readSize = (totalSize - currentOffset) > chunkSize ? chunkSize : (totalSize - currentOffset); + + spiNorFlash.Read(writeOffset + currentOffset, tempBuffer, readSize); + if (first) { + crc = ComputeCrc(tempBuffer, readSize, NULL); + first = false; + } else + crc = ComputeCrc(tempBuffer, readSize, &crc); + currentOffset += readSize; + } + + return (crc == expectedCrc); +} + +uint16_t DfuService::DfuImage::ComputeCrc(uint8_t const *p_data, uint32_t size, uint16_t const *p_crc) { + uint16_t crc = (p_crc == NULL) ? 0xFFFF : *p_crc; + + for (uint32_t i = 0; i < size; i++) { + crc = (uint8_t) (crc >> 8) | (crc << 8); + crc ^= p_data[i]; + crc ^= (uint8_t) (crc & 0xFF) >> 4; + crc ^= (crc << 8) << 4; + crc ^= ((crc & 0xFF) << 4) << 1; + } + + return crc; +} + +bool DfuService::DfuImage::IsComplete() { + if(!ready) return false; + return totalWriteIndex == totalSize; +} diff --git a/src/components/ble/DfuService.h b/src/components/ble/DfuService.h new file mode 100644 index 00000000..d7ba460c --- /dev/null +++ b/src/components/ble/DfuService.h @@ -0,0 +1,161 @@ +#pragma once + +#include +#include + +#include + +namespace Pinetime { + namespace System { + class SystemTask; + } + namespace Drivers { + class SpiNorFlash; + } + namespace Controllers { + class Ble; + + class DfuService { + public: + DfuService(Pinetime::System::SystemTask &systemTask, Pinetime::Controllers::Ble &bleController, + Pinetime::Drivers::SpiNorFlash &spiNorFlash); + void Init(); + int OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); + void OnTimeout(); + void Reset(); + + class NotificationManager { + public: + NotificationManager(); + bool AsyncSend(uint16_t connection, uint16_t charactHandle, uint8_t *data, size_t size); + void Send(uint16_t connection, uint16_t characteristicHandle, const uint8_t *data, const size_t s); + private: + TimerHandle_t timer; + uint16_t connectionHandle = 0; + uint16_t characteristicHandle = 0; + size_t size = 0; + uint8_t buffer[10]; + public: + void OnNotificationTimer(); + void Reset(); + }; + class DfuImage { + public: + DfuImage(Pinetime::Drivers::SpiNorFlash& spiNorFlash) : spiNorFlash{spiNorFlash} {} + void Init(size_t chunkSize, size_t totalSize, uint16_t expectedCrc); + void Erase(); + void Append(uint8_t* data, size_t size); + bool Validate(); + bool IsComplete(); + + private: + Pinetime::Drivers::SpiNorFlash& spiNorFlash; + static constexpr size_t bufferSize = 200; + bool ready = false; + size_t chunkSize = 0; + size_t totalSize = 0; + size_t maxSize = 475136; + size_t bufferWriteIndex = 0; + size_t totalWriteIndex = 0; + static constexpr size_t writeOffset = 0x40000; + uint8_t tempBuffer[bufferSize]; + uint16_t expectedCrc = 0; + + void WriteMagicNumber(); + uint16_t ComputeCrc(uint8_t const *p_data, uint32_t size, uint16_t const *p_crc); + + }; + + private: + Pinetime::System::SystemTask &systemTask; + Pinetime::Controllers::Ble &bleController; + DfuImage dfuImage; + NotificationManager notificationManager; + + static constexpr uint16_t dfuServiceId{0x1530}; + static constexpr uint16_t packetCharacteristicId{0x1532}; + static constexpr uint16_t controlPointCharacteristicId{0x1531}; + static constexpr uint16_t revisionCharacteristicId{0x1534}; + + uint16_t revision{0x0008}; + + static constexpr ble_uuid128_t serviceUuid{ + .u {.type = BLE_UUID_TYPE_128}, + .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, + 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00} + }; + + static constexpr ble_uuid128_t packetCharacteristicUuid{ + .u {.type = BLE_UUID_TYPE_128}, + .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, + 0xDE, 0xEF, 0x12, 0x12, 0x32, 0x15, 0x00, 0x00} + }; + + static constexpr ble_uuid128_t controlPointCharacteristicUuid{ + .u {.type = BLE_UUID_TYPE_128}, + .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, + 0xDE, 0xEF, 0x12, 0x12, 0x31, 0x15, 0x00, 0x00} + }; + + static constexpr ble_uuid128_t revisionCharacteristicUuid{ + .u {.type = BLE_UUID_TYPE_128}, + .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, + 0xDE, 0xEF, 0x12, 0x12, 0x34, 0x15, 0x00, 0x00} + }; + + struct ble_gatt_chr_def characteristicDefinition[4]; + struct ble_gatt_svc_def serviceDefinition[2]; + uint16_t packetCharacteristicHandle; + uint16_t controlPointCharacteristicHandle; + uint16_t revisionCharacteristicHandle; + + enum class States : uint8_t { + Idle, Init, Start, Data, Validate, Validated + }; + States state = States::Idle; + + enum class ImageTypes : uint8_t { + NoImage = 0x00, + SoftDevice = 0x01, + Bootloader = 0x02, + SoftDeviceAndBootloader = 0x03, + Application = 0x04 + }; + + enum class Opcodes : uint8_t { + StartDFU = 0x01, + InitDFUParameters = 0x02, + ReceiveFirmwareImage = 0x03, + ValidateFirmware = 0x04, + ActivateImageAndReset = 0x05, + PacketReceiptNotificationRequest = 0x08, + Response = 0x10, + PacketReceiptNotification = 0x11 + }; + + enum class ErrorCodes { + NoError = 0x01, + InvalidState = 0x02, + NotSupported = 0x03, + DataSizeExceedsLimits = 0x04, + CrcError = 0x05, + OperationFailed = 0x06 + }; + + uint8_t nbPacketsToNotify = 0; + uint32_t nbPacketReceived = 0; + uint32_t bytesReceived = 0; + + uint32_t softdeviceSize = 0; + uint32_t bootloaderSize = 0; + uint32_t applicationSize = 0; + uint16_t expectedCrc = 0; + + int SendDfuRevision(os_mbuf *om) const; + int WritePacketHandler(uint16_t connectionHandle, os_mbuf *om); + int ControlPointHandler(uint16_t connectionHandle, os_mbuf *om); + + TimerHandle_t timeoutTimer; + }; + } +} \ No newline at end of file diff --git a/src/components/ble/ImmediateAlertService.cpp b/src/components/ble/ImmediateAlertService.cpp new file mode 100644 index 00000000..3b7f47bf --- /dev/null +++ b/src/components/ble/ImmediateAlertService.cpp @@ -0,0 +1,76 @@ +#include +#include "ImmediateAlertService.h" +#include "AlertNotificationService.h" + +using namespace Pinetime::Controllers; + +constexpr ble_uuid16_t ImmediateAlertService::immediateAlertServiceUuid; +constexpr ble_uuid16_t ImmediateAlertService::alertLevelUuid; + +namespace { + int AlertLevelCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { + auto *immediateAlertService = static_cast(arg); + return immediateAlertService->OnAlertLevelChanged(conn_handle, attr_handle, ctxt); + } + + const char* ToString(ImmediateAlertService::Levels level) { + switch (level) { + case ImmediateAlertService::Levels::NoAlert: return "Alert : None"; + case ImmediateAlertService::Levels::HighAlert: return "Alert : High"; + case ImmediateAlertService::Levels::MildAlert: return "Alert : Mild"; + default: return ""; + } + } +} + +ImmediateAlertService::ImmediateAlertService(Pinetime::System::SystemTask &systemTask, + Pinetime::Controllers::NotificationManager ¬ificationManager) : + systemTask{systemTask}, + notificationManager{notificationManager}, + characteristicDefinition{ + { + .uuid = (ble_uuid_t *) &alertLevelUuid, + .access_cb = AlertLevelCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE_NO_RSP, + .val_handle = &alertLevelHandle + }, + { + 0 + } + }, + serviceDefinition{ + { + /* Device Information Service */ + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = (ble_uuid_t *) &immediateAlertServiceUuid, + .characteristics = characteristicDefinition + }, + { + 0 + }, + }{ + +} + +void ImmediateAlertService::Init() { + int res = 0; + res = ble_gatts_count_cfg(serviceDefinition); + ASSERT(res == 0); + + res = ble_gatts_add_svcs(serviceDefinition); + ASSERT(res == 0); +} + +int ImmediateAlertService::OnAlertLevelChanged(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context) { + if(attributeHandle == alertLevelHandle) { + if(context->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { + auto alertLevel = static_cast(context->om->om_data[0]); + auto* alertString = ToString(alertLevel); + notificationManager.Push(Pinetime::Controllers::NotificationManager::Categories::SimpleAlert, alertString, strlen(alertString)); + systemTask.PushMessage(Pinetime::System::SystemTask::Messages::OnNewNotification); + } + } + + return 0; +} \ No newline at end of file diff --git a/src/components/ble/ImmediateAlertService.h b/src/components/ble/ImmediateAlertService.h new file mode 100644 index 00000000..c42846c4 --- /dev/null +++ b/src/components/ble/ImmediateAlertService.h @@ -0,0 +1,46 @@ +#pragma once +#include + +namespace Pinetime { + namespace System { + class SystemTask; + } + namespace Controllers { + class NotificationManager; + class ImmediateAlertService { + public: + enum class Levels : uint8_t { + NoAlert = 0, + MildAlert = 1, + HighAlert = 2 + }; + + ImmediateAlertService(Pinetime::System::SystemTask &systemTask, + Pinetime::Controllers::NotificationManager ¬ificationManager); + void Init(); + int OnAlertLevelChanged(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); + + private: + Pinetime::System::SystemTask& systemTask; + NotificationManager& notificationManager; + + static constexpr uint16_t immediateAlertServiceId {0x1802}; + static constexpr uint16_t alertLevelId {0x2A06}; + + static constexpr ble_uuid16_t immediateAlertServiceUuid { + .u {.type = BLE_UUID_TYPE_16}, + .value = immediateAlertServiceId + }; + + static constexpr ble_uuid16_t alertLevelUuid { + .u {.type = BLE_UUID_TYPE_16}, + .value = alertLevelId + }; + + struct ble_gatt_chr_def characteristicDefinition[3]; + struct ble_gatt_svc_def serviceDefinition[2]; + + uint16_t alertLevelHandle; + }; + } +} diff --git a/src/components/ble/MusicService.cpp b/src/components/ble/MusicService.cpp new file mode 100644 index 00000000..9105a8e6 --- /dev/null +++ b/src/components/ble/MusicService.cpp @@ -0,0 +1,129 @@ +#include +#include "MusicService.h" + +int MSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { + auto musicService = static_cast(arg); + return musicService->OnCommand(conn_handle, attr_handle, ctxt); +} + +Pinetime::Controllers::MusicService::MusicService(Pinetime::System::SystemTask &system) : m_system(system) +{ + msUuid.value[11] = msId[0]; + msUuid.value[12] = msId[1]; + msEventCharUuid.value[11] = msEventCharId[0]; + msEventCharUuid.value[12] = msEventCharId[1]; + msStatusCharUuid.value[11] = msStatusCharId[0]; + msStatusCharUuid.value[12] = msStatusCharId[1]; + msTrackCharUuid.value[11] = msTrackCharId[0]; + msTrackCharUuid.value[12] = msTrackCharId[1]; + msArtistCharUuid.value[11] = msArtistCharId[0]; + msArtistCharUuid.value[12] = msArtistCharId[1]; + msAlbumCharUuid.value[11] = msAlbumCharId[0]; + msAlbumCharUuid.value[12] = msAlbumCharId[1]; + + characteristicDefinition[0] = { .uuid = (ble_uuid_t*)(&msEventCharUuid), + .access_cb = MSCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_NOTIFY, + .val_handle = &m_eventHandle + }; + characteristicDefinition[1] = { .uuid = (ble_uuid_t*)(&msStatusCharUuid), + .access_cb = MSCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ + }; + characteristicDefinition[2] = { .uuid = (ble_uuid_t*)(&msTrackCharUuid), + .access_cb = MSCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ + }; + characteristicDefinition[3] = { .uuid = (ble_uuid_t*)(&msArtistCharUuid), + .access_cb = MSCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ + }; + characteristicDefinition[4] = { .uuid = (ble_uuid_t*)(&msAlbumCharUuid), + .access_cb = MSCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ + }; + characteristicDefinition[5] = {0}; + + serviceDefinition[0] = { + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = (ble_uuid_t *) &msUuid, + .characteristics = characteristicDefinition + }; + serviceDefinition[1] = {0}; + + m_artist = "Waiting for"; + m_album = ""; + m_track = "track information..."; +} + +void Pinetime::Controllers::MusicService::Init() +{ + int res = 0; + res = ble_gatts_count_cfg(serviceDefinition); + ASSERT(res == 0); + + res = ble_gatts_add_svcs(serviceDefinition); + ASSERT(res == 0); +} + +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); + uint8_t data[notifSize + 1]; + data[notifSize] = '\0'; + os_mbuf_copydata(ctxt->om, 0, notifSize, data); + char *s = (char *) &data[0]; + NRF_LOG_INFO("DATA : %s", s); + if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msArtistCharUuid) == 0) { + m_artist = s; + } else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msTrackCharUuid) == 0) { + m_track = s; + } else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msAlbumCharUuid) == 0) { + m_album = s; + } else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msStatusCharUuid) == 0) { + m_status = s[0]; + } + } + return 0; +} + +std::string Pinetime::Controllers::MusicService::album() +{ + return m_album; +} + +std::string Pinetime::Controllers::MusicService::artist() +{ + return m_artist; +} + +std::string Pinetime::Controllers::MusicService::track() +{ + return m_track; +} + +unsigned char Pinetime::Controllers::MusicService::status() +{ + return m_status; +} + +void Pinetime::Controllers::MusicService::event(char event) +{ + auto *om = ble_hs_mbuf_from_flat(&event, 1); + + uint16_t connectionHandle = m_system.nimble().connHandle(); + + if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) { + return; + } + + ble_gattc_notify_custom(connectionHandle, m_eventHandle, om); +} + diff --git a/src/components/ble/MusicService.h b/src/components/ble/MusicService.h new file mode 100644 index 00000000..ab6db572 --- /dev/null +++ b/src/components/ble/MusicService.h @@ -0,0 +1,92 @@ +#pragma once + +#include +#include +#include +#include +#include + +//c7e50000-78fc-48fe-8e23-43b37a1942d0 +#define MUSIC_SERVICE_UUID_BASE {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x00, 0x00, 0xe5, 0xc7} + +namespace Pinetime { + namespace System { + class SystemTask; + } + namespace Controllers { + + class MusicService { + public: + MusicService(Pinetime::System::SystemTask &system); + void Init(); + int OnCommand(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt); + + std::string artist(); + std::string track(); + std::string album(); + unsigned char status(); + + void event(char event); + + static const char EVENT_MUSIC_OPEN = 0xe0; + static const char EVENT_MUSIC_PLAY = 0x00; + static const char EVENT_MUSIC_PAUSE = 0x01; + static const char EVENT_MUSIC_NEXT = 0x03; + static const char EVENT_MUSIC_PREV = 0x04; + static const char EVENT_MUSIC_VOLUP = 0x05; + static const char EVENT_MUSIC_VOLDOWN = 0x06; + static const char STATUS_MUSIC_PAUSED = 0x00; + static const char STATUS_MUSIC_PLAYING = 0x01; + + private: + static constexpr uint8_t msId[2] = {0x00, 0x01}; + static constexpr uint8_t msEventCharId[2] = {0x00, 0x02}; + static constexpr uint8_t msStatusCharId[2] = {0x00, 0x03}; + static constexpr uint8_t msArtistCharId[2] = {0x00, 0x04}; + static constexpr uint8_t msTrackCharId[2] = {0x00, 0x05}; + static constexpr uint8_t msAlbumCharId[2] = {0x00, 0x06}; + + ble_uuid128_t msUuid { + .u = { .type = BLE_UUID_TYPE_128 }, + .value = MUSIC_SERVICE_UUID_BASE + }; + + ble_uuid128_t msEventCharUuid { + .u = { .type = BLE_UUID_TYPE_128 }, + .value = MUSIC_SERVICE_UUID_BASE + }; + ble_uuid128_t msStatusCharUuid { + .u = { .type = BLE_UUID_TYPE_128 }, + .value = MUSIC_SERVICE_UUID_BASE + }; + ble_uuid128_t msArtistCharUuid { + .u = { .type = BLE_UUID_TYPE_128 }, + .value = MUSIC_SERVICE_UUID_BASE + }; + ble_uuid128_t msTrackCharUuid { + .u = { .type = BLE_UUID_TYPE_128 }, + .value = MUSIC_SERVICE_UUID_BASE + }; + ble_uuid128_t msAlbumCharUuid { + .u = { .type = BLE_UUID_TYPE_128 }, + .value = MUSIC_SERVICE_UUID_BASE + }; + + struct ble_gatt_chr_def characteristicDefinition[6]; + struct ble_gatt_svc_def serviceDefinition[2]; + + uint16_t m_eventHandle; + + std::string m_artist; + std::string m_album; + std::string m_track; + + unsigned char m_status; + + Pinetime::System::SystemTask& m_system; + + }; + } +} + diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp new file mode 100644 index 00000000..022cc510 --- /dev/null +++ b/src/components/ble/NimbleController.cpp @@ -0,0 +1,337 @@ + +#include "components/datetime/DateTimeController.h" + +#include +#include "components/ble/NotificationManager.h" +#include + +#include "NimbleController.h" +#include "MusicService.h" +#include +#include +#include +#include +#include +#include + + + +using namespace Pinetime::Controllers; + +// TODO I'm not satisfied by how this code looks like (AlertNotificationClient and CurrentTimeClient must +// expose too much data, too many callbacks -> NimbleController -> CTS/ANS client. +// Let's try to improve this code (and keep it working!) + +NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask, + Pinetime::Controllers::Ble& bleController, + DateTime& dateTimeController, + Pinetime::Controllers::NotificationManager& notificationManager, + Controllers::Battery& batteryController, + Pinetime::Drivers::SpiNorFlash& spiNorFlash) : + systemTask{systemTask}, + bleController{bleController}, + dateTimeController{dateTimeController}, + notificationManager{notificationManager}, + spiNorFlash{spiNorFlash}, + dfuService{systemTask, bleController, spiNorFlash}, + currentTimeClient{dateTimeController}, + anService{systemTask, notificationManager}, + alertNotificationClient{systemTask, notificationManager}, + currentTimeService{dateTimeController}, + musicService{systemTask}, + batteryInformationService{batteryController}, + immediateAlertService{systemTask, notificationManager} { + +} + +int GAPEventCallback(struct ble_gap_event *event, void *arg) { + auto nimbleController = static_cast(arg); + return nimbleController->OnGAPEvent(event); +} + +int CurrentTimeCharacteristicDiscoveredCallback(uint16_t conn_handle, const struct ble_gatt_error *error, + const struct ble_gatt_chr *chr, void *arg) { + auto client = static_cast(arg); + return client->OnCTSCharacteristicDiscoveryEvent(conn_handle, error, chr); +} + +int AlertNotificationCharacteristicDiscoveredCallback(uint16_t conn_handle, const struct ble_gatt_error *error, + const struct ble_gatt_chr *chr, void *arg) { + auto client = static_cast(arg); + return client->OnANSCharacteristicDiscoveryEvent(conn_handle, error, chr); +} + +int CurrentTimeReadCallback(uint16_t conn_handle, const struct ble_gatt_error *error, + struct ble_gatt_attr *attr, void *arg) { + auto client = static_cast(arg); + return client->OnCurrentTimeReadResult(conn_handle, error, attr); +} + +int AlertNotificationDescriptorDiscoveryEventCallback(uint16_t conn_handle, + const struct ble_gatt_error *error, + uint16_t chr_val_handle, + const struct ble_gatt_dsc *dsc, + void *arg) { + auto client = static_cast(arg); + return client->OnANSDescriptorDiscoveryEventCallback(conn_handle, error, chr_val_handle, dsc); +} + +void NimbleController::Init() { + while (!ble_hs_synced()) {} + + ble_svc_gap_init(); + ble_svc_gatt_init(); + + deviceInformationService.Init(); + currentTimeClient.Init(); + currentTimeService.Init(); + musicService.Init(); + anService.Init(); + dfuService.Init(); + batteryInformationService.Init(); + immediateAlertService.Init(); + int res; + res = ble_hs_util_ensure_addr(0); + ASSERT(res == 0); + res = ble_hs_id_infer_auto(0, &addrType); + ASSERT(res == 0); + res = ble_svc_gap_device_name_set(deviceName); + ASSERT(res == 0); + Pinetime::Controllers::Ble::BleAddress address; + res = ble_hs_id_copy_addr(addrType, address.data(), nullptr); + ASSERT(res == 0); + bleController.AddressType((addrType == 0) ? Ble::AddressTypes::Public : Ble::AddressTypes::Random); + bleController.Address(std::move(address)); + + res = ble_gatts_start(); + ASSERT(res == 0); +} + +void NimbleController::StartAdvertising() { + if(ble_gap_adv_active()) return; + + ble_svc_gap_device_name_set(deviceName); + + /* set adv parameters */ + struct ble_gap_adv_params adv_params; + struct ble_hs_adv_fields fields; + /* advertising payload is split into advertising data and advertising + response, because all data cannot fit into single packet; name of device + is sent as response to scan request */ + struct ble_hs_adv_fields rsp_fields; + + /* fill all fields and parameters with zeros */ + memset(&adv_params, 0, sizeof(adv_params)); + memset(&fields, 0, sizeof(fields)); + memset(&rsp_fields, 0, sizeof(rsp_fields)); + + adv_params.conn_mode = BLE_GAP_CONN_MODE_UND; + adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN; + + fields.flags = BLE_HS_ADV_F_DISC_GEN | + BLE_HS_ADV_F_BREDR_UNSUP; +// fields.uuids128 = BLE_UUID128(BLE_UUID128_DECLARE( +// 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, +// 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff)); + fields.uuids128 = &dfuServiceUuid; + fields.num_uuids128 = 1; + fields.uuids128_is_complete = 1; + fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO; + + rsp_fields.name = (uint8_t *)deviceName; + rsp_fields.name_len = strlen(deviceName); + rsp_fields.name_is_complete = 1; + + ble_gap_adv_set_fields(&fields); +// ASSERT(res == 0); // TODO this one sometimes fails with error 22 (notsync) + + ble_gap_adv_rsp_set_fields(&rsp_fields); +// ASSERT(res == 0); + + ble_gap_adv_start(addrType, NULL, 180000, + &adv_params, GAPEventCallback, this); +// ASSERT(res == 0);// TODO I've disabled these ASSERT as they sometime asserts and reset the mcu. + // For now, the advertising is restarted as soon as it ends. There may be a race condition + // that prevent the advertising from restarting reliably. + // I remove the assert to prevent this uncesseray crash, but in the long term, the management of + // the advertising should be improve (better error handling, and advertise for 3 minutes after + // the application has been woken up, for example. +} + +int OnAllSvrDisco(uint16_t conn_handle, + const struct ble_gatt_error *error, + const struct ble_gatt_svc *service, + void *arg) { + auto nimbleController = static_cast(arg); + return nimbleController->OnDiscoveryEvent(conn_handle, error, service); + return 0; +} + +int NimbleController::OnGAPEvent(ble_gap_event *event) { + switch (event->type) { + case BLE_GAP_EVENT_ADV_COMPLETE: + NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE"); + NRF_LOG_INFO("advertise complete; reason=%dn status=%d", event->adv_complete.reason, event->connect.status); + break; + case BLE_GAP_EVENT_CONNECT: { + NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_CONNECT"); + + /* A new connection was established or a connection attempt failed. */ + NRF_LOG_INFO("connection %s; status=%d ", event->connect.status == 0 ? "established" : "failed", + event->connect.status); + + if (event->connect.status != 0) { + /* Connection failed; resume advertising. */ + StartAdvertising(); + bleController.Disconnect(); + } else { + bleController.Connect(); + systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleConnected); + connectionHandle = event->connect.conn_handle; + // Service discovery is deffered via systemtask + } + } + break; + case BLE_GAP_EVENT_DISCONNECT: + NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_DISCONNECT"); + NRF_LOG_INFO("disconnect; reason=%d", event->disconnect.reason); + + /* Connection terminated; resume advertising. */ + connectionHandle = BLE_HS_CONN_HANDLE_NONE; + bleController.Disconnect(); + StartAdvertising(); + break; + case BLE_GAP_EVENT_CONN_UPDATE: + NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_CONN_UPDATE"); + /* The central has updated the connection parameters. */ + NRF_LOG_INFO("connection updated; status=%d ", event->conn_update.status); + break; + case BLE_GAP_EVENT_ENC_CHANGE: + /* Encryption has been enabled or disabled for this connection. */ + NRF_LOG_INFO("encryption change event; status=%d ", event->enc_change.status); + return 0; + case BLE_GAP_EVENT_SUBSCRIBE: + NRF_LOG_INFO("subscribe event; conn_handle=%d attr_handle=%d " + "reason=%d prevn=%d curn=%d previ=%d curi=???\n", + event->subscribe.conn_handle, + event->subscribe.attr_handle, + event->subscribe.reason, + event->subscribe.prev_notify, + event->subscribe.cur_notify, + event->subscribe.prev_indicate); + return 0; + case BLE_GAP_EVENT_MTU: + NRF_LOG_INFO("mtu update event; conn_handle=%d cid=%d mtu=%d\n", + event->mtu.conn_handle, + event->mtu.channel_id, + event->mtu.value); + return 0; + + case BLE_GAP_EVENT_REPEAT_PAIRING: { + /* We already have a bond with the peer, but it is attempting to + * establish a new secure link. This app sacrifices security for + * convenience: just throw away the old bond and accept the new link. + */ + + /* Delete the old bond. */ + struct ble_gap_conn_desc desc; + ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); + ble_store_util_delete_peer(&desc.peer_id_addr); + + /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should + * continue with the pairing operation. + */ + } + return BLE_GAP_REPEAT_PAIRING_RETRY; + + case BLE_GAP_EVENT_NOTIFY_RX: { + /* Peer sent us a notification or indication. */ + size_t notifSize = OS_MBUF_PKTLEN(event->notify_rx.om); + + NRF_LOG_INFO("received %s; conn_handle=%d attr_handle=%d " + "attr_len=%d", + event->notify_rx.indication ? + "indication" : + "notification", + event->notify_rx.conn_handle, + event->notify_rx.attr_handle, + notifSize); + + alertNotificationClient.OnNotification(event); + return 0; + } + /* Attribute data is contained in event->notify_rx.attr_data. */ + + default: +// NRF_LOG_INFO("Advertising event : %d", event->type); + break; + } + return 0; +} + +int NimbleController::OnDiscoveryEvent(uint16_t i, const ble_gatt_error *error, const ble_gatt_svc *service) { + if(service == nullptr && error->status == BLE_HS_EDONE) { + NRF_LOG_INFO("Service Discovery complete"); + if(currentTimeClient.IsDiscovered()) { + ble_gattc_disc_all_chrs(connectionHandle, currentTimeClient.StartHandle(), currentTimeClient.EndHandle(), + CurrentTimeCharacteristicDiscoveredCallback, this); + + } else if(alertNotificationClient.IsDiscovered()) { + ble_gattc_disc_all_chrs(connectionHandle, alertNotificationClient.StartHandle(), alertNotificationClient.EndHandle(), + AlertNotificationCharacteristicDiscoveredCallback, this); + } + } + + alertNotificationClient.OnDiscoveryEvent(i, error, service); + currentTimeClient.OnDiscoveryEvent(i, error, service); + return 0; +} + +int NimbleController::OnCTSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, + const ble_gatt_chr *characteristic) { + if(characteristic == nullptr && error->status == BLE_HS_EDONE) { + NRF_LOG_INFO("CTS characteristic Discovery complete"); + ble_gattc_read(connectionHandle, currentTimeClient.CurrentTimeHandle(), CurrentTimeReadCallback, this); + return 0; + } + return currentTimeClient.OnCharacteristicDiscoveryEvent(connectionHandle, error, characteristic); +} + +int NimbleController::OnANSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, + const ble_gatt_chr *characteristic) { + if(characteristic == nullptr && error->status == BLE_HS_EDONE) { + NRF_LOG_INFO("ANS characteristic Discovery complete"); + ble_gattc_disc_all_dscs(connectionHandle, + alertNotificationClient.NewAlerthandle(), alertNotificationClient.EndHandle(), + AlertNotificationDescriptorDiscoveryEventCallback, this); + return 0; + } + return alertNotificationClient.OnCharacteristicsDiscoveryEvent(connectionHandle, error, characteristic); +} + +int NimbleController::OnCurrentTimeReadResult(uint16_t connectionHandle, const ble_gatt_error *error, ble_gatt_attr *attribute) { + currentTimeClient.OnCurrentTimeReadResult(connectionHandle, error, attribute); + + if (alertNotificationClient.IsDiscovered()) { + ble_gattc_disc_all_chrs(connectionHandle, alertNotificationClient.StartHandle(), + alertNotificationClient.EndHandle(), + AlertNotificationCharacteristicDiscoveredCallback, this); + } + return 0; +} + +int NimbleController::OnANSDescriptorDiscoveryEventCallback(uint16_t connectionHandle, const ble_gatt_error *error, + uint16_t characteristicValueHandle, + const ble_gatt_dsc *descriptor) { + return alertNotificationClient.OnDescriptorDiscoveryEventCallback(connectionHandle, error, characteristicValueHandle, descriptor); +} + +void NimbleController::StartDiscovery() { + ble_gattc_disc_all_svcs(connectionHandle, OnAllSvrDisco, this); +} + + +uint16_t NimbleController::connHandle() { + return connectionHandle; +} + diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h new file mode 100644 index 00000000..9d20caff --- /dev/null +++ b/src/components/ble/NimbleController.h @@ -0,0 +1,76 @@ +#pragma once + +#include + +#include "AlertNotificationService.h" +#include "AlertNotificationClient.h" +#include "DeviceInformationService.h" +#include "CurrentTimeClient.h" +#include "DfuService.h" +#include "CurrentTimeService.h" +#include "MusicService.h" +#include "BatteryInformationService.h" +#include "ImmediateAlertService.h" +#include + +namespace Pinetime { + namespace Drivers { + class SpiNorFlash; + } + namespace Controllers { + class DateTime; + + class NimbleController { + + public: + NimbleController(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::Ble& bleController, + DateTime& dateTimeController, Pinetime::Controllers::NotificationManager& notificationManager, + Controllers::Battery& batteryController, Pinetime::Drivers::SpiNorFlash& spiNorFlash); + void Init(); + void StartAdvertising(); + int OnGAPEvent(ble_gap_event *event); + + 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() {return musicService;}; + + uint16_t connHandle(); + + private: + static constexpr const char* deviceName = "InfiniTime"; + Pinetime::System::SystemTask& systemTask; + Pinetime::Controllers::Ble& bleController; + DateTime& dateTimeController; + Pinetime::Controllers::NotificationManager& notificationManager; + Pinetime::Drivers::SpiNorFlash& spiNorFlash; + Pinetime::Controllers::DfuService dfuService; + + DeviceInformationService deviceInformationService; + CurrentTimeClient currentTimeClient; + AlertNotificationService anService; + AlertNotificationClient alertNotificationClient; + CurrentTimeService currentTimeService; + MusicService musicService; + BatteryInformationService batteryInformationService; + ImmediateAlertService immediateAlertService; + + uint8_t addrType; // 1 = Random, 0 = PUBLIC + uint16_t connectionHandle = 0; + + ble_uuid128_t dfuServiceUuid { + .u { .type = BLE_UUID_TYPE_128}, + .value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, + 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00} + }; + }; + } +} diff --git a/src/components/ble/NotificationManager.cpp b/src/components/ble/NotificationManager.cpp new file mode 100644 index 00000000..0aea0697 --- /dev/null +++ b/src/components/ble/NotificationManager.cpp @@ -0,0 +1,30 @@ +#include +#include "NotificationManager.h" + +using namespace Pinetime::Controllers; + +void NotificationManager::Push(Pinetime::Controllers::NotificationManager::Categories category, + const char *message, uint8_t currentMessageSize) { + // TODO handle edge cases on read/write index + auto checkedSize = std::min(currentMessageSize, uint8_t{18}); + auto& notif = notifications[writeIndex]; + std::memcpy(notif.message.data(), message, checkedSize); + notif.message[checkedSize] = '\0'; + notif.category = category; + + writeIndex = (writeIndex + 1 < TotalNbNotifications) ? writeIndex + 1 : 0; + if(!empty && writeIndex == readIndex) + readIndex = writeIndex + 1; +} + +NotificationManager::Notification Pinetime::Controllers::NotificationManager::Pop() { +// TODO handle edge cases on read/write index + NotificationManager::Notification notification = notifications[readIndex]; + + if(readIndex != writeIndex) { + readIndex = (readIndex + 1 < TotalNbNotifications) ? readIndex + 1 : 0; + } + + // TODO Check move optimization on return + return notification; +} diff --git a/src/components/ble/NotificationManager.h b/src/components/ble/NotificationManager.h new file mode 100644 index 00000000..daa1571b --- /dev/null +++ b/src/components/ble/NotificationManager.h @@ -0,0 +1,29 @@ +#pragma once + +#include + +namespace Pinetime { + namespace Controllers { + class NotificationManager { + public: + enum class Categories {Unknown, SimpleAlert, Email, News, IncomingCall, MissedCall, Sms, VoiceMail, Schedule, HighProriotyAlert, InstantMessage }; + static constexpr uint8_t MessageSize{18}; + + struct Notification { + std::array message; + Categories category = Categories::Unknown; + }; + + void Push(Categories category, const char* message, uint8_t messageSize); + Notification Pop(); + + + private: + static constexpr uint8_t TotalNbNotifications = 5; + std::array notifications; + uint8_t readIndex = 0; + uint8_t writeIndex = 0; + bool empty = true; + }; + } +} \ No newline at end of file diff --git a/src/components/brightness/BrightnessController.cpp b/src/components/brightness/BrightnessController.cpp new file mode 100644 index 00000000..c8825d68 --- /dev/null +++ b/src/components/brightness/BrightnessController.cpp @@ -0,0 +1,70 @@ +#include +#include "BrightnessController.h" + +using namespace Pinetime::Controllers; + + +void BrightnessController::Init() { + nrf_gpio_cfg_output(pinLcdBacklight1); + nrf_gpio_cfg_output(pinLcdBacklight2); + nrf_gpio_cfg_output(pinLcdBacklight3); + Set(level); +} + +void BrightnessController::Set(BrightnessController::Levels level) { + this->level = level; + switch(level) { + default: + case Levels::High: + nrf_gpio_pin_clear(pinLcdBacklight1); + nrf_gpio_pin_clear(pinLcdBacklight2); + nrf_gpio_pin_clear(pinLcdBacklight3); + break; + case Levels::Medium: + nrf_gpio_pin_clear(pinLcdBacklight1); + nrf_gpio_pin_clear(pinLcdBacklight2); + nrf_gpio_pin_set(pinLcdBacklight3); + break; + case Levels::Low: + nrf_gpio_pin_clear(pinLcdBacklight1); + nrf_gpio_pin_set(pinLcdBacklight2); + nrf_gpio_pin_set(pinLcdBacklight3); + break; + case Levels::Off: + nrf_gpio_pin_set(pinLcdBacklight1); + nrf_gpio_pin_set(pinLcdBacklight2); + nrf_gpio_pin_set(pinLcdBacklight3); + break; + } +} + +void BrightnessController::Lower() { + switch(level) { + case Levels::High: Set(Levels::Medium); break; + case Levels::Medium: Set(Levels::Low); break; + case Levels::Low: Set(Levels::Off); break; + default: break; + } +} + +void BrightnessController::Higher() { + switch(level) { + case Levels::Off: Set(Levels::Low); break; + case Levels::Low: Set(Levels::Medium); break; + case Levels::Medium: Set(Levels::High); break; + default: break; + } +} + +BrightnessController::Levels BrightnessController::Level() const { + return level; +} + +void BrightnessController::Backup() { + backupLevel = level; +} + +void BrightnessController::Restore() { + Set(backupLevel); +} + diff --git a/src/components/brightness/BrightnessController.h b/src/components/brightness/BrightnessController.h new file mode 100644 index 00000000..b8354ec0 --- /dev/null +++ b/src/components/brightness/BrightnessController.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +namespace Pinetime { + namespace Controllers { + class BrightnessController { + public: + enum class Levels {Off, Low, Medium, High}; + void Init(); + + void Set(Levels level); + Levels Level() const; + void Lower(); + void Higher(); + + void Backup(); + void Restore(); + + private: + static constexpr uint8_t pinLcdBacklight1 = 14; + static constexpr uint8_t pinLcdBacklight2 = 22; + static constexpr uint8_t pinLcdBacklight3 = 23; + Levels level = Levels::High; + Levels backupLevel = Levels::High; + }; + } +} diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp new file mode 100644 index 00000000..30d9c13f --- /dev/null +++ b/src/components/datetime/DateTimeController.cpp @@ -0,0 +1,66 @@ +#include "DateTimeController.h" +#include +#include + +using namespace Pinetime::Controllers; + + +void DateTime::SetTime(uint16_t year, uint8_t month, uint8_t day, uint8_t dayOfWeek, uint8_t hour, uint8_t minute, + uint8_t second, uint32_t systickCounter) { + std::tm tm = { /* .tm_sec = */ second, + /* .tm_min = */ minute, + /* .tm_hour = */ hour, + /* .tm_mday = */ day, + /* .tm_mon = */ month - 1, + /* .tm_year = */ year - 1900, + }; + tm.tm_isdst = -1; // Use DST value from local time zone + currentDateTime = std::chrono::system_clock::from_time_t(std::mktime(&tm)); + + NRF_LOG_INFO("%d %d %d ", day, month, year); + NRF_LOG_INFO("%d %d %d ", hour, minute, second); + previousSystickCounter = systickCounter; + + 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); +} + +void DateTime::UpdateTime(uint32_t systickCounter) { + // Handle systick counter overflow + uint32_t systickDelta = 0; + if(systickCounter < previousSystickCounter) { + systickDelta = 0xffffff - previousSystickCounter; + systickDelta += systickCounter + 1; + } else { + systickDelta = systickCounter - previousSystickCounter; + } + + /* + * 1000 ms = 1024 ticks + */ + auto correctedDelta = systickDelta / 1024; + auto rest = (systickDelta - (correctedDelta*1024)); + if(systickCounter >= rest) { + previousSystickCounter = systickCounter - rest; + } else { + previousSystickCounter = 0xffffff - (rest - systickCounter); + } + + currentDateTime += std::chrono::seconds(correctedDelta); + uptime += std::chrono::seconds(correctedDelta); + + auto dp = date::floor(currentDateTime); + auto time = date::make_time(currentDateTime-dp); + auto yearMonthDay = date::year_month_day(dp); + + year = (int)yearMonthDay.year(); + month = static_cast((unsigned)yearMonthDay.month()); + day = (unsigned)yearMonthDay.day(); + dayOfWeek = static_cast(date::weekday(yearMonthDay).iso_encoding()); + + hour = time.hours().count(); + minute = time.minutes().count(); + second = time.seconds().count(); +} + diff --git a/src/components/datetime/DateTimeController.h b/src/components/datetime/DateTimeController.h new file mode 100644 index 00000000..d6020745 --- /dev/null +++ b/src/components/datetime/DateTimeController.h @@ -0,0 +1,39 @@ +#pragma once + +#include +#include + +namespace Pinetime { + namespace Controllers { + class DateTime { + public: + enum class Days : uint8_t {Unknown, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; + enum class Months : uint8_t {Unknown, January, February, March, April, May, June, July, August, September, October, November, December}; + + void SetTime(uint16_t year, uint8_t month, uint8_t day, uint8_t dayOfWeek, uint8_t hour, uint8_t minute, uint8_t second, uint32_t systickCounter); + void UpdateTime(uint32_t systickCounter); + uint16_t Year() const { return year; } + Months Month() const { return month; } + uint8_t Day() const { return day; } + Days DayOfWeek() const { return dayOfWeek; } + uint8_t Hours() const { return hour; } + uint8_t Minutes() const { return minute; } + uint8_t Seconds() const { return second; } + + std::chrono::time_point CurrentDateTime() const { return currentDateTime; } + std::chrono::seconds Uptime() const { return uptime; } + private: + uint16_t year = 0; + Months month = Months::Unknown; + uint8_t day = 0; + Days dayOfWeek = Days::Unknown; + uint8_t hour = 0; + uint8_t minute = 0; + uint8_t second = 0; + + uint32_t previousSystickCounter = 0; + std::chrono::time_point currentDateTime; + std::chrono::seconds uptime {0}; + }; + } +} \ No newline at end of file diff --git a/src/components/firmwarevalidator/FirmwareValidator.cpp b/src/components/firmwarevalidator/FirmwareValidator.cpp new file mode 100644 index 00000000..244d5c06 --- /dev/null +++ b/src/components/firmwarevalidator/FirmwareValidator.cpp @@ -0,0 +1,20 @@ +#include +#include + +#include "FirmwareValidator.h" + +using namespace Pinetime::Controllers; + +bool FirmwareValidator::IsValidated() const { + auto* imageOkPtr = reinterpret_cast(validBitAdress); + return (*imageOkPtr) == validBitValue; +} + +void FirmwareValidator::Validate() { + if(!IsValidated()) + Pinetime::Drivers::InternalFlash::WriteWord(validBitAdress, validBitValue); +} + +void FirmwareValidator::Reset() { + NVIC_SystemReset(); +} diff --git a/src/components/firmwarevalidator/FirmwareValidator.h b/src/components/firmwarevalidator/FirmwareValidator.h new file mode 100644 index 00000000..aa576d88 --- /dev/null +++ b/src/components/firmwarevalidator/FirmwareValidator.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace Pinetime { + namespace Controllers { + class FirmwareValidator { + public: + void Validate(); + bool IsValidated() const; + + void Reset(); + private: + static constexpr uint32_t validBitAdress {0x7BFE8}; + static constexpr uint32_t validBitValue {1}; + }; + } +} diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp new file mode 100644 index 00000000..3c5dbfb7 --- /dev/null +++ b/src/components/gfx/Gfx.cpp @@ -0,0 +1,207 @@ +#include +#include +#include +#include "Gfx.h" +#include "../../drivers/St7789.h" +using namespace Pinetime::Components; + +Gfx::Gfx(Pinetime::Drivers::St7789 &lcd) : lcd{lcd} { +} + +void Gfx::Init() { + +} + +void Gfx::ClearScreen() { + SetBackgroundColor(0x0000); + + state.remainingIterations = 240 + 1; + state.currentIteration = 0; + state.busy = true; + state.action = Action::FillRectangle; + state.taskToNotify = xTaskGetCurrentTaskHandle(); + + lcd.BeginDrawBuffer(0, 0, width, height); + lcd.NextDrawBuffer(reinterpret_cast(buffer), width * 2); + WaitTransfertFinished(); + +} + +void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t color) { + SetBackgroundColor(color); + + state.remainingIterations = h; + state.currentIteration = 0; + state.busy = true; + state.action = Action::FillRectangle; + state.color = color; + state.taskToNotify = xTaskGetCurrentTaskHandle(); + + lcd.BeginDrawBuffer(x, y, w, h); + lcd.NextDrawBuffer(reinterpret_cast(buffer), width * 2); + + WaitTransfertFinished(); +} + +void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b) { + state.remainingIterations = h; + state.currentIteration = 0; + state.busy = true; + state.action = Action::FillRectangle; + state.color = 0x00; + state.taskToNotify = xTaskGetCurrentTaskHandle(); + + lcd.BeginDrawBuffer(x, y, w, h); + lcd.NextDrawBuffer(reinterpret_cast(b), width * 2); + + WaitTransfertFinished(); +} + +void Gfx::DrawString(uint8_t x, uint8_t y, uint16_t color, const char *text, const FONT_INFO *p_font, bool wrap) { + if (y > (height - p_font->height)) { + // Not enough space to write even single char. + return; + } + + uint8_t current_x = x; + uint8_t current_y = y; + + for (size_t i = 0; text[i] != '\0'; i++) { + if (text[i] == '\n') { + current_x = x; + current_y += p_font->height + p_font->height / 10; + } else { + DrawChar(p_font, (uint8_t) text[i], ¤t_x, current_y, color); + } + + uint8_t char_idx = text[i] - p_font->startChar; + uint16_t char_width = text[i] == ' ' ? (p_font->height / 2) : p_font->charInfo[char_idx].widthBits; + + if (current_x > (width - char_width)) { + if (wrap) { + current_x = x; + current_y += p_font->height + p_font->height / 10; + } else { + break; + } + + if (y > (height - p_font->height)) { + break; + } + } + } +} + +void Gfx::DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint16_t color) { + uint8_t char_idx = c - font->startChar; + uint16_t bytes_in_line = CEIL_DIV(font->charInfo[char_idx].widthBits, 8); + uint16_t bg = 0x0000; + + if (c == ' ') { + *x += font->height / 2; + return; + } + + // Build first line + for (uint16_t j = 0; j < bytes_in_line; j++) { + for (uint8_t k = 0; k < 8; k++) { + if ((1 << (7 - k)) & font->data[font->charInfo[char_idx].offset + j]) { + buffer[(j*8)+k] = color; + } + else { + buffer[(j*8)+k] = bg; + } + } + } + + state.remainingIterations = font->height + 0; + state.currentIteration = 0; + state.busy = true; + state.action = Action::DrawChar; + state.font = const_cast(font); + state.character = c; + state.color = color; + state.taskToNotify = xTaskGetCurrentTaskHandle(); + + lcd.BeginDrawBuffer(*x, y, bytes_in_line*8, font->height); + lcd.NextDrawBuffer(reinterpret_cast(&buffer), bytes_in_line*8*2); + WaitTransfertFinished(); + + *x += font->charInfo[char_idx].widthBits + font->spacePixels; +} + +void Gfx::pixel_draw(uint8_t x, uint8_t y, uint16_t color) { + lcd.DrawPixel(x, y, color); +} + +void Gfx::Sleep() { + lcd.Sleep(); +} + +void Gfx::Wakeup() { + lcd.Wakeup(); +} + +void Gfx::SetBackgroundColor(uint16_t color) { + for(int i = 0; i < width; i++) { + buffer[i] = color; + } +} + +bool Gfx::GetNextBuffer(uint8_t **data, size_t &size) { + if(!state.busy) return false; + state.remainingIterations--; + if (state.remainingIterations == 0) { + state.busy = false; + NotifyEndOfTransfert(state.taskToNotify); + return false; + } + + if(state.action == Action::FillRectangle) { + *data = reinterpret_cast(buffer); + size = width * 2; + } else if(state.action == Action::DrawChar) { + uint16_t bg = 0x0000; + uint8_t char_idx = state.character - state.font->startChar; + uint16_t bytes_in_line = CEIL_DIV(state.font->charInfo[char_idx].widthBits, 8); + + for (uint16_t j = 0; j < bytes_in_line; j++) { + for (uint8_t k = 0; k < 8; k++) { + if ((1 << (7 - k)) & state.font->data[state.font->charInfo[char_idx].offset + ((state.currentIteration+1) * bytes_in_line) + j]) { + buffer[(j*8)+k] = state.color; + } + else { + buffer[(j*8)+k] = bg; + } + } + } + + *data = reinterpret_cast(buffer); + size = bytes_in_line*8*2; + } + + state.currentIteration++; + + return true; +} + +void Gfx::NotifyEndOfTransfert(TaskHandle_t task) { + if(task != nullptr) { + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + vTaskNotifyGiveFromISR(task, &xHigherPriorityTaskWoken); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); + } +} + +void Gfx::WaitTransfertFinished() const { + ulTaskNotifyTake(pdTRUE, 500); +} + +void Gfx::SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines) { + lcd.VerticalScrollDefinition(topFixedLines, scrollLines, bottomFixedLines); +} + +void Gfx::SetScrollStartLine(uint16_t line) { + lcd.VerticalScrollStartAddress(line); +} + diff --git a/src/components/gfx/Gfx.h b/src/components/gfx/Gfx.h new file mode 100644 index 00000000..091f06f5 --- /dev/null +++ b/src/components/gfx/Gfx.h @@ -0,0 +1,60 @@ +#pragma once +#include +#include +#include +#include +#include + + +namespace Pinetime { + namespace Drivers { + class St7789; + } + namespace Components { + class Gfx : public Pinetime::Drivers::BufferProvider { + public: + explicit Gfx(Drivers::St7789& lcd); + void Init(); + void ClearScreen(); + void DrawString(uint8_t x, uint8_t y, uint16_t color, const char* text, const FONT_INFO *p_font, bool wrap); + void DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint16_t color); + void FillRectangle(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t color); + void FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b); + void SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines); + void SetScrollStartLine(uint16_t line); + + + void Sleep(); + void Wakeup(); + bool GetNextBuffer(uint8_t **buffer, size_t &size) override; + void pixel_draw(uint8_t x, uint8_t y, uint16_t color); + + + private: + static constexpr uint8_t width = 240; + static constexpr uint8_t height = 240; + + enum class Action { None, FillRectangle, DrawChar}; + struct State { + State() : busy{false}, action{Action::None}, remainingIterations{0}, currentIteration{0} {} + volatile bool busy; + volatile Action action; + volatile uint16_t remainingIterations; + volatile uint16_t currentIteration; + volatile FONT_INFO *font; + volatile uint16_t color; + volatile uint8_t character; + volatile TaskHandle_t taskToNotify = nullptr; + }; + + volatile State state; + + uint16_t buffer[width]; // 1 line buffer + Drivers::St7789& lcd; + + void SetBackgroundColor(uint16_t color); + void WaitTransfertFinished() const; + void NotifyEndOfTransfert(TaskHandle_t task); + }; + } +} diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 46e81f1d..d65e4f92 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -1,24 +1,25 @@ +#include + #include "DisplayApp.h" #include #include #include #include #include -#include +#include "components/datetime/DateTimeController.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../SystemTask/SystemTask.h" +#include "displayapp/screens/Tile.h" +#include "displayapp/screens/Meter.h" +#include "displayapp/screens/Gauge.h" +#include "displayapp/screens/Brightness.h" +#include "displayapp/screens/SystemInfo.h" +#include "displayapp/screens/Music.h" +#include "components/ble/NotificationManager.h" +#include "displayapp/screens/FirmwareUpdate.h" +#include "displayapp/screens/ApplicationList.h" +#include "displayapp/screens/FirmwareValidation.h" +#include "displayapp/screens/InfiniPaint.h" +#include "systemtask/SystemTask.h" using namespace Pinetime::Applications; @@ -148,7 +149,7 @@ void DisplayApp::Refresh() { } } -// lvgl.SetFullRefresh(Components::LittleVgl::FullRefreshDirections::Down); +// lvgl.SetFullRefresh(components::LittleVgl::FullRefreshDirections::Down); // currentScreen.reset(nullptr); // if(toggle) { // currentScreen.reset(new Screens::Tile(this)); diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index 345e06d4..2a0efde3 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -3,21 +3,21 @@ #include #include #include -#include #include #include -#include -#include -#include -#include -#include "../drivers/Cst816s.h" +#include "components/gfx/Gfx.h" +#include "components/battery/BatteryController.h" +#include "components/brightness/BrightnessController.h" +#include "components/ble/BleController.h" +#include "components/datetime/DateTimeController.h" +#include "components/ble/NotificationManager.h" +#include "components/firmwarevalidator/FirmwareValidator.h" +#include "drivers/Cst816s.h" #include "LittleVgl.h" #include -#include +#include "displayapp/screens/Clock.h" +#include "displayapp/screens/Modal.h" #include -#include -#include -#include #include "TouchEvents.h" #include "Apps.h" diff --git a/src/displayapp/Fonts/Readme.md b/src/displayapp/Fonts/Readme.md deleted file mode 100644 index 7ebf2e23..00000000 --- a/src/displayapp/Fonts/Readme.md +++ /dev/null @@ -1,23 +0,0 @@ -#Fonts -* [Jetbrains Mono](https://www.jetbrains.com/fr-fr/lp/mono/) -* [Awesome font from LVGL](https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff) - -## 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.woff` and specify the following range : `0x20-0x7f` - * 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` - * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` - -Add new symbols: - * Browse the [cheatsheet](https://fontawesome.com/cheatsheet/free/solid) and find your new symbols - * For each symbol, add its hex code (0xf641 for the 'Ad' icon, for example) to the *Range* list - * Convert this hex value into a UTF-8 code using [this site](http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f185&mode=hex) - * Define the new symbols in `src/DisplayApp/Screens/Symbols.h`: -``` -static constex char* newSymbol = "\xEF\x86\x85"; -``` diff --git a/src/displayapp/Fonts/jetbrains_mono_bold_20.c b/src/displayapp/Fonts/jetbrains_mono_bold_20.c deleted file mode 100644 index 27ad0055..00000000 --- a/src/displayapp/Fonts/jetbrains_mono_bold_20.c +++ /dev/null @@ -1,766 +0,0 @@ -#include "lvgl/lvgl.h" - -/******************************************************************************* - * Size: 20 px - * Bpp: 1 - * Opts: - ******************************************************************************/ - -#ifndef JETBRAINS_MONO_BOLD_20 -#define JETBRAINS_MONO_BOLD_20 1 -#endif - -#if JETBRAINS_MONO_BOLD_20 - -/*----------------- - * BITMAPS - *----------------*/ - -/*Store the image of the glyphs*/ -static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { - /* U+20 " " */ - 0x0, - - /* U+21 "!" */ - 0xff, 0xff, 0xff, 0xe0, 0xf, 0xc0, - - /* U+22 "\"" */ - 0xef, 0xdf, 0xbf, 0x7e, 0xfd, 0xc0, - - /* U+23 "#" */ - 0x8, 0xc3, 0x10, 0x62, 0x3f, 0xf7, 0xfe, 0x23, - 0x4, 0x61, 0x88, 0x31, 0x1f, 0xfb, 0xff, 0x19, - 0x82, 0x30, 0xc4, 0x0, - - /* U+24 "$" */ - 0x8, 0x2, 0x1, 0xc1, 0xfe, 0xeb, 0xf2, 0x7c, - 0x83, 0xa0, 0x7c, 0xf, 0xc0, 0xf8, 0x27, 0x9, - 0xf2, 0x7f, 0xf9, 0xfc, 0x8, 0x2, 0x0, 0x80, - - /* U+25 "%" */ - 0x78, 0x1f, 0x83, 0x30, 0x66, 0x1f, 0xcc, 0xf2, - 0x1, 0x80, 0xde, 0x67, 0xf8, 0xcc, 0x19, 0x83, - 0x30, 0x7e, 0x7, 0x80, - - /* U+26 "&" */ - 0x1e, 0x7, 0xe1, 0xce, 0x38, 0x7, 0x0, 0x70, - 0x1e, 0x7, 0x66, 0xed, 0xdc, 0xf3, 0x9c, 0x73, - 0xcf, 0xfc, 0xf9, 0x80, - - /* U+27 "'" */ - 0xff, 0xff, 0xc0, - - /* U+28 "(" */ - 0x2, 0x1c, 0xfb, 0xc7, 0x1e, 0x38, 0x70, 0xe1, - 0xc3, 0x87, 0xe, 0x1c, 0x3c, 0x38, 0x38, 0x7c, - 0x38, - - /* U+29 ")" */ - 0x1, 0xc3, 0xc1, 0xc1, 0xc3, 0xc3, 0x87, 0xe, - 0x1c, 0x38, 0x70, 0xe1, 0xc7, 0x8e, 0x79, 0xe3, - 0x80, - - /* U+2A "*" */ - 0xc, 0x3, 0x8, 0xc7, 0xb7, 0x7f, 0x83, 0x1, - 0xe0, 0xcc, 0x73, 0x80, 0x0, - - /* U+2B "+" */ - 0x1c, 0x7, 0x1, 0xc3, 0xff, 0xff, 0xc7, 0x1, - 0xc0, 0x70, 0x1c, 0x0, - - /* U+2C "," */ - 0x7b, 0x9c, 0xce, 0x60, - - /* U+2D "-" */ - 0xff, 0xff, - - /* U+2E "." */ - 0x6f, 0xf6, - - /* U+2F "/" */ - 0x1, 0xc0, 0x60, 0x38, 0xe, 0x3, 0x1, 0xc0, - 0x70, 0x18, 0xe, 0x3, 0x1, 0xc0, 0x70, 0x18, - 0xe, 0x3, 0x80, 0xc0, 0x70, 0x18, 0xe, 0x0, - - /* U+30 "0" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xed, 0xfb, 0x7e, - 0xdf, 0xb7, 0xed, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x8f, 0x80, - - /* U+31 "1" */ - 0x3c, 0x3e, 0x3f, 0x13, 0x81, 0xc0, 0xe0, 0x70, - 0x38, 0x1c, 0xe, 0x7, 0x3, 0x8f, 0xff, 0xfc, - - /* U+32 "2" */ - 0x1f, 0x1f, 0xef, 0x3f, 0x87, 0x1, 0xc0, 0x70, - 0x38, 0x1e, 0xf, 0x7, 0x87, 0x83, 0xc0, 0xff, - 0xff, 0xf0, - - /* U+33 "3" */ - 0x7f, 0xdf, 0xf0, 0x3c, 0x1c, 0x1c, 0x7, 0xc1, - 0xf8, 0xf, 0x1, 0xc0, 0x7e, 0x1d, 0x8f, 0x7f, - 0x87, 0xc0, - - /* U+34 "4" */ - 0x7, 0x7, 0x3, 0x83, 0x83, 0x81, 0xc1, 0xcf, - 0xe7, 0xe3, 0xff, 0xff, 0xe0, 0x70, 0x38, 0x1c, - - /* U+35 "5" */ - 0xff, 0x7f, 0xb8, 0x1c, 0xe, 0x7, 0x73, 0xfd, - 0xcf, 0x3, 0x81, 0xc0, 0xfc, 0xff, 0xf1, 0xf0, - - /* U+36 "6" */ - 0x6, 0x3, 0x1, 0xc0, 0x60, 0x30, 0x1b, 0xc7, - 0xfb, 0xcf, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x87, 0x80, - - /* U+37 "7" */ - 0xff, 0xff, 0xfe, 0xb, 0x86, 0x1, 0x80, 0xc0, - 0x30, 0x18, 0x6, 0x3, 0x80, 0xc0, 0x70, 0x18, - 0xe, 0x0, - - /* U+38 "8" */ - 0x3e, 0x1f, 0xce, 0x3b, 0x6, 0xe3, 0x9f, 0xc7, - 0xf1, 0x8e, 0xc1, 0xf0, 0x7c, 0x1f, 0x8f, 0x7f, - 0x8f, 0x80, - - /* U+39 "9" */ - 0x1e, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, - 0x3d, 0xfe, 0x3d, 0x80, 0xc0, 0x60, 0x38, 0xc, - 0x6, 0x0, - - /* U+3A ":" */ - 0xff, 0x80, 0x0, 0xff, 0x80, - - /* U+3B ";" */ - 0x7b, 0xde, 0x0, 0x0, 0x0, 0x7b, 0x9c, 0xce, - 0x60, - - /* U+3C "<" */ - 0x0, 0x81, 0xc3, 0xe7, 0xcf, 0x6, 0x3, 0xc0, - 0x7c, 0xf, 0x81, 0xc0, 0x20, - - /* U+3D "=" */ - 0xff, 0xff, 0xc0, 0x0, 0x0, 0x7, 0xff, 0xfe, - - /* U+3E ">" */ - 0x0, 0x70, 0x3e, 0x7, 0xc0, 0xf8, 0xc, 0x1e, - 0x7c, 0xf8, 0x70, 0x20, 0x0, - - /* U+3F "?" */ - 0xfc, 0xfe, 0xf, 0x7, 0x7, 0xf, 0x3e, 0x3c, - 0x30, 0x30, 0x0, 0x0, 0x70, 0x70, - - /* U+40 "@" */ - 0x1f, 0x87, 0xf9, 0xc3, 0xf0, 0x3c, 0x77, 0x9f, - 0xf3, 0x1e, 0x63, 0xcc, 0x79, 0x8f, 0x31, 0xe7, - 0xfc, 0x77, 0xc0, 0x1c, 0x1, 0xf0, 0x1e, 0x0, - - /* U+41 "A" */ - 0xf, 0x0, 0xf0, 0xf, 0x1, 0xf8, 0x19, 0x81, - 0x98, 0x19, 0x83, 0x9c, 0x3f, 0xc3, 0xfc, 0x70, - 0xe7, 0xe, 0x60, 0x66, 0x6, - - /* U+42 "B" */ - 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xcf, - 0xe3, 0xfc, 0xe3, 0xb8, 0x7e, 0x1f, 0x8f, 0xff, - 0xbf, 0xc0, - - /* U+43 "C" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, - 0x3, 0x80, 0xe0, 0x38, 0xe, 0x1f, 0xcf, 0x7f, - 0x8f, 0xc0, - - /* U+44 "D" */ - 0xfe, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0x8f, 0xff, - 0xbf, 0x80, - - /* U+45 "E" */ - 0xff, 0xff, 0xf8, 0x1c, 0xe, 0x7, 0x3, 0xfd, - 0xfe, 0xe0, 0x70, 0x38, 0x1c, 0xf, 0xff, 0xfc, - - /* U+46 "F" */ - 0xff, 0xff, 0xf8, 0x1c, 0xe, 0x7, 0x3, 0xff, - 0xff, 0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x0, - - /* U+47 "G" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, - 0x7f, 0x9f, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x87, 0x80, - - /* U+48 "H" */ - 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0xff, - 0xff, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, - - /* U+49 "I" */ - 0xff, 0xff, 0xc7, 0x3, 0x81, 0xc0, 0xe0, 0x70, - 0x38, 0x1c, 0xe, 0x7, 0x3, 0x8f, 0xff, 0xfc, - - /* U+4A "J" */ - 0x3f, 0xcf, 0xf0, 0x1c, 0x7, 0x1, 0xc0, 0x70, - 0x1c, 0x7, 0x1, 0xc0, 0x7e, 0x1f, 0x8f, 0x7f, - 0x8f, 0xc0, - - /* U+4B "K" */ - 0xe1, 0xdc, 0x3b, 0x8e, 0x71, 0xce, 0x31, 0xce, - 0x3f, 0x87, 0xf0, 0xe7, 0x1c, 0x63, 0x8e, 0x70, - 0xce, 0x1d, 0xc3, 0x80, - - /* U+4C "L" */ - 0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x3, 0x81, - 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0xf, 0xff, 0xfc, - - /* U+4D "M" */ - 0xe1, 0xf8, 0x7f, 0x3f, 0xcf, 0xda, 0xf7, 0xbd, - 0xef, 0x33, 0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, - 0xf0, 0x30, - - /* U+4E "N" */ - 0xe1, 0xf0, 0xfc, 0x7e, 0x3d, 0x9e, 0xcf, 0x67, - 0x9b, 0xcd, 0xe6, 0xf1, 0xf8, 0xfc, 0x3e, 0x1c, - - /* U+4F "O" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x8f, 0x80, - - /* U+50 "P" */ - 0xff, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0xff, - 0xfb, 0xfc, 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, - 0x38, 0x0, - - /* U+51 "Q" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x8f, 0x80, 0x70, 0xe, 0x1, 0xc0, - - /* U+52 "R" */ - 0xff, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0xff, - 0xfb, 0xf8, 0xe6, 0x39, 0xce, 0x33, 0x8e, 0xe3, - 0xb8, 0x70, - - /* U+53 "S" */ - 0x3f, 0x1f, 0xee, 0x1f, 0x87, 0xe0, 0x3e, 0x7, - 0xf0, 0x7e, 0x3, 0xc0, 0x7e, 0x1f, 0xcf, 0x7f, - 0x8f, 0xc0, - - /* U+54 "T" */ - 0xff, 0xff, 0xf0, 0xe0, 0x38, 0xe, 0x3, 0x80, - 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, 0x38, 0xe, - 0x3, 0x80, - - /* U+55 "U" */ - 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, - 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, - - /* U+56 "V" */ - 0x60, 0x66, 0x6, 0x70, 0xe7, 0xe, 0x30, 0xc3, - 0xc, 0x39, 0xc1, 0x98, 0x19, 0x81, 0x98, 0x1f, - 0x80, 0xf0, 0xf, 0x0, 0xf0, - - /* U+57 "W" */ - 0xc6, 0x78, 0xcf, 0x39, 0xe7, 0x3e, 0xa6, 0xd6, - 0xda, 0xdb, 0x5b, 0x6b, 0x6d, 0x2d, 0xe7, 0x3c, - 0xe7, 0x9c, 0xe3, 0x80, - - /* U+58 "X" */ - 0xe1, 0xd8, 0x67, 0x38, 0xcc, 0x3f, 0x7, 0x81, - 0xe0, 0x78, 0x1e, 0xf, 0xc3, 0x31, 0xce, 0xe1, - 0xf8, 0x70, - - /* U+59 "Y" */ - 0xe0, 0xfc, 0x1d, 0xc7, 0x38, 0xe3, 0x98, 0x77, - 0x6, 0xc0, 0xf8, 0xe, 0x1, 0xc0, 0x38, 0x7, - 0x0, 0xe0, 0x1c, 0x0, - - /* U+5A "Z" */ - 0xff, 0xff, 0xc0, 0xe0, 0xe0, 0x60, 0x70, 0x70, - 0x38, 0x38, 0x38, 0x1c, 0x1c, 0xf, 0xff, 0xfc, - - /* U+5B "[" */ - 0xff, 0xfe, 0x38, 0xe3, 0x8e, 0x38, 0xe3, 0x8e, - 0x38, 0xe3, 0x8e, 0x38, 0xff, 0xf0, - - /* U+5C "\\" */ - 0xe0, 0x18, 0x7, 0x1, 0xc0, 0x30, 0xe, 0x3, - 0x80, 0x60, 0x1c, 0x3, 0x0, 0xe0, 0x38, 0x6, - 0x1, 0xc0, 0x70, 0xc, 0x3, 0x80, 0x60, 0x1c, - - /* U+5D "]" */ - 0xff, 0xf1, 0xc7, 0x1c, 0x71, 0xc7, 0x1c, 0x71, - 0xc7, 0x1c, 0x71, 0xc7, 0xff, 0xf0, - - /* U+5E "^" */ - 0xc, 0x7, 0x81, 0xe0, 0xfc, 0x33, 0x1c, 0xe6, - 0x19, 0x86, - - /* U+5F "_" */ - 0xff, 0xff, 0xf0, - - /* U+60 "`" */ - 0x63, 0x8e, - - /* U+61 "a" */ - 0x3f, 0x1f, 0xee, 0x1c, 0x7, 0x3f, 0xdf, 0xfe, - 0x1f, 0x87, 0xe3, 0xff, 0xf7, 0xdc, - - /* U+62 "b" */ - 0xe0, 0x38, 0xe, 0x3, 0xbc, 0xff, 0xbc, 0xfe, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0xff, - 0xbb, 0xc0, - - /* U+63 "c" */ - 0x3f, 0x1f, 0xef, 0x1f, 0x83, 0xe0, 0x38, 0xe, - 0x3, 0x87, 0xf1, 0xdf, 0xe3, 0xe0, - - /* U+64 "d" */ - 0x1, 0xc0, 0x70, 0x1c, 0xf7, 0x7f, 0xfc, 0xfe, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0xcf, 0x70, - - /* U+65 "e" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xff, 0xff, 0xfe, - 0x3, 0x80, 0xf1, 0xdf, 0xe3, 0xf0, - - /* U+66 "f" */ - 0xf, 0xc7, 0xf1, 0xc0, 0x70, 0xff, 0xff, 0xf1, - 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c, - 0x7, 0x0, - - /* U+67 "g" */ - 0x3d, 0xdf, 0xff, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0xcf, 0x7f, 0xcf, 0x70, 0x1c, 0xf, 0x3f, - 0x8f, 0xc0, - - /* U+68 "h" */ - 0xe0, 0x70, 0x38, 0x1d, 0xcf, 0xf7, 0x9f, 0x8f, - 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, - - /* U+69 "i" */ - 0x1c, 0x7, 0x0, 0x0, 0x0, 0xfc, 0x3f, 0x1, - 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c, - 0x3f, 0xff, 0xfc, - - /* U+6A "j" */ - 0x7, 0x7, 0x0, 0x0, 0x7f, 0x7f, 0x7, 0x7, - 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0xf, - 0xfe, 0xfc, - - /* U+6B "k" */ - 0xe0, 0x38, 0xe, 0x3, 0x87, 0xe1, 0xb8, 0xee, - 0x33, 0x9c, 0xfe, 0x3f, 0x8e, 0x73, 0x8e, 0xe3, - 0xb8, 0x70, - - /* U+6C "l" */ - 0xfe, 0x1f, 0xc0, 0x38, 0x7, 0x0, 0xe0, 0x1c, - 0x3, 0x80, 0x70, 0xe, 0x1, 0xc0, 0x38, 0x7, - 0x0, 0xfe, 0xf, 0xc0, - - /* U+6D "m" */ - 0xd9, 0xbf, 0xfc, 0xcf, 0x33, 0xcc, 0xf3, 0x3c, - 0xcf, 0x33, 0xcc, 0xf3, 0x3c, 0xcc, - - /* U+6E "n" */ - 0xee, 0x7f, 0xbc, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, - 0xc7, 0xe3, 0xf1, 0xf8, 0xe0, - - /* U+6F "o" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xf3, 0xdf, 0xe3, 0xf0, - - /* U+70 "p" */ - 0xef, 0x3f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xf3, 0xff, 0xee, 0xf3, 0x80, 0xe0, - 0x38, 0x0, - - /* U+71 "q" */ - 0x3d, 0xdf, 0xff, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xf3, 0xdf, 0xf3, 0xdc, 0x7, 0x1, - 0xc0, 0x70, - - /* U+72 "r" */ - 0xef, 0x3f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0xe, - 0x3, 0x80, 0xe0, 0x38, 0xe, 0x0, - - /* U+73 "s" */ - 0x3f, 0x3f, 0xee, 0x1f, 0x80, 0xfc, 0x1f, 0xe0, - 0x3c, 0x7, 0xe1, 0xff, 0xe3, 0xf0, - - /* U+74 "t" */ - 0x1c, 0x7, 0x1, 0xc3, 0xff, 0xff, 0xc7, 0x1, - 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0xf, - 0xc1, 0xf0, - - /* U+75 "u" */ - 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, - 0xc7, 0xe3, 0xbf, 0x8f, 0x80, - - /* U+76 "v" */ - 0xc0, 0xf8, 0x76, 0x19, 0x86, 0x73, 0x8c, 0xc3, - 0x30, 0xfc, 0x1e, 0x7, 0x81, 0xe0, - - /* U+77 "w" */ - 0xc6, 0x79, 0xcf, 0x39, 0xb5, 0x36, 0xa6, 0xd6, - 0xda, 0xdb, 0x4e, 0x79, 0xcf, 0x38, 0xc7, 0x0, - - /* U+78 "x" */ - 0xe1, 0xdc, 0xe3, 0x30, 0xfc, 0x1e, 0x7, 0x81, - 0xe0, 0xfc, 0x73, 0x9c, 0x6e, 0x1c, - - /* U+79 "y" */ - 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x33, 0x8e, 0xc3, - 0xf0, 0x7c, 0x1e, 0x3, 0x80, 0xc0, 0x70, 0x1c, - 0x6, 0x0, - - /* U+7A "z" */ - 0xff, 0xff, 0xc1, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, - 0xe0, 0xe0, 0x7f, 0xff, 0xe0, - - /* U+7B "{" */ - 0x7, 0x87, 0xc3, 0x81, 0xc0, 0xe0, 0x70, 0x38, - 0x1c, 0xfc, 0x7e, 0x3, 0x81, 0xc0, 0xe0, 0x70, - 0x38, 0x1c, 0xf, 0x83, 0xc0, - - /* U+7C "|" */ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, - - /* U+7D "}" */ - 0xf0, 0x3f, 0x1, 0xc0, 0x70, 0x1c, 0x7, 0x1, - 0xc0, 0x70, 0xf, 0xc3, 0xf1, 0xc0, 0x70, 0x1c, - 0x7, 0x1, 0xc0, 0x70, 0xf8, 0x3c, 0x0, - - /* U+7E "~" */ - 0x78, 0xff, 0x3c, 0xff, 0x1e, - - /* U+F001 "" */ - 0x0, 0x0, 0x70, 0x0, 0x7f, 0x0, 0x3f, 0xf0, - 0x1f, 0xff, 0x7, 0xff, 0xf0, 0x7f, 0xff, 0x7, - 0xfc, 0x70, 0x7e, 0x7, 0x7, 0x0, 0x70, 0x70, - 0x7, 0x7, 0x0, 0x70, 0x70, 0x7, 0x7, 0x0, - 0x70, 0x70, 0x7f, 0x7, 0xf, 0xf7, 0xf0, 0xff, - 0xff, 0x7, 0xef, 0xf0, 0x0, 0xff, 0x0, 0x3, - 0xc0, 0x0, - - /* U+F017 "" */ - 0x3, 0xf8, 0x1, 0xff, 0xc0, 0x7f, 0xfc, 0x1f, - 0xff, 0xc7, 0xf1, 0xfc, 0xfe, 0x3f, 0x9f, 0xc7, - 0xf7, 0xf8, 0xff, 0xff, 0x1f, 0xff, 0xe3, 0xff, - 0xfc, 0x3f, 0xff, 0x83, 0xff, 0xfc, 0x7e, 0xff, - 0xcf, 0x9f, 0xff, 0xf1, 0xff, 0xfc, 0x1f, 0xff, - 0x1, 0xff, 0xc0, 0x1f, 0xf0, 0x0, 0x70, 0x0, - - /* U+F03A "" */ - 0xf0, 0x0, 0xf, 0x3f, 0xff, 0xf3, 0xff, 0xff, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xf, 0x0, 0x0, 0xf3, 0xff, 0xff, 0x3f, - 0xff, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xf, 0x0, 0x0, 0xf3, 0xff, 0xff, 0x3f, 0xff, - 0xf0, 0x0, 0x0, - - /* U+F069 "" */ - 0x0, 0xe0, 0x0, 0x1c, 0x0, 0x3, 0x80, 0x0, - 0x70, 0x6, 0xe, 0xc, 0xf1, 0xc7, 0x9f, 0xbb, - 0xf1, 0xff, 0xfc, 0xf, 0xfe, 0x0, 0x7f, 0x0, - 0xf, 0xe0, 0x7, 0xff, 0x3, 0xff, 0xf8, 0xfd, - 0xdf, 0x9e, 0x38, 0xf3, 0x7, 0x6, 0x0, 0xe0, - 0x0, 0x1c, 0x0, 0x3, 0x80, 0x0, 0x70, 0x0, - - /* U+F129 "" */ - 0x3c, 0x7e, 0x7e, 0x7e, 0x3c, 0x0, 0x0, 0xfc, - 0xfc, 0xfc, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, - 0xff, 0xff, 0xff, - - /* U+F185 "" */ - 0x0, 0x60, 0x0, 0x6, 0x0, 0x0, 0xf0, 0x1, - 0xcf, 0x38, 0x1f, 0xff, 0x81, 0xf0, 0xf8, 0xc, - 0xf3, 0x1, 0xdf, 0xb8, 0x7b, 0xfd, 0xef, 0xbf, - 0xdf, 0x7b, 0xfd, 0xe1, 0x9f, 0x98, 0xc, 0xf3, - 0x0, 0xc0, 0x30, 0x1f, 0xf, 0x81, 0xff, 0xf8, - 0x1c, 0xf3, 0x80, 0xf, 0x0, 0x0, 0x60, 0x0, - 0x6, 0x0, - - /* U+F1E6 "" */ - 0x18, 0x30, 0x70, 0x70, 0xe0, 0xe1, 0xc1, 0xc3, - 0x83, 0x80, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x7f, - 0xfc, 0xff, 0xf9, 0xff, 0xf1, 0xff, 0xc3, 0xff, - 0x83, 0xfe, 0x3, 0xf8, 0x1, 0xc0, 0x3, 0x80, - 0x7, 0x0, 0xe, 0x0, - - /* U+F1FC "" */ - 0x0, 0x0, 0xf0, 0x0, 0x1f, 0x0, 0x3, 0xf0, - 0x0, 0x7e, 0x0, 0xf, 0xe0, 0x3, 0xfc, 0x0, - 0x7f, 0xc0, 0xf, 0xf8, 0x0, 0xff, 0x80, 0x1f, - 0xf0, 0x0, 0xfe, 0x0, 0xf, 0xe0, 0xe, 0x7c, - 0x1, 0xf8, 0x0, 0x9f, 0xc0, 0xf, 0xfc, 0x0, - 0x7f, 0xc0, 0x7, 0xf8, 0x0, 0x1f, 0x0, 0x0, - - /* U+F21E "" */ - 0x1e, 0x7, 0x83, 0xf9, 0xfe, 0x7f, 0xff, 0xef, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xfc, - 0xf7, 0xf7, 0xd6, 0x3e, 0x79, 0x6b, 0xe0, 0x34, - 0x80, 0x1f, 0x9f, 0x80, 0xf9, 0xf0, 0x7, 0xfe, - 0x0, 0x3f, 0xc0, 0x1, 0xf8, 0x0, 0xf, 0x0, - 0x0, 0x60, 0x0, - - /* U+F240 "" */ - 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, - 0x1, 0xfd, 0xff, 0xfe, 0xfe, 0xff, 0xff, 0x7f, - 0x7f, 0xff, 0x9f, 0xbf, 0xff, 0xcf, 0xdf, 0xff, - 0xe7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, - 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, - - /* U+F241 "" */ - 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, - 0x1, 0xfd, 0xff, 0xe0, 0xfe, 0xff, 0xf0, 0x7f, - 0x7f, 0xf8, 0x1f, 0xbf, 0xfc, 0xf, 0xdf, 0xfe, - 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, - 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, - - /* U+F242 "" */ - 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, - 0x1, 0xfd, 0xfe, 0x0, 0xfe, 0xff, 0x0, 0x7f, - 0x7f, 0x80, 0x1f, 0xbf, 0xc0, 0xf, 0xdf, 0xe0, - 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, - 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, - - /* U+F243 "" */ - 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, - 0x1, 0xfd, 0xf0, 0x0, 0xfe, 0xf8, 0x0, 0x7f, - 0x7c, 0x0, 0x1f, 0xbe, 0x0, 0xf, 0xdf, 0x0, - 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, - 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, - - /* U+F244 "" */ - 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, - 0x1, 0xfc, 0x0, 0x0, 0xfe, 0x0, 0x0, 0x7f, - 0x0, 0x0, 0x1f, 0x80, 0x0, 0xf, 0xc0, 0x0, - 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, - 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, - - /* U+F293 "" */ - 0x7, 0xe0, 0x3f, 0xe0, 0xfb, 0xe3, 0xf3, 0xe7, - 0xe3, 0xdf, 0xd3, 0xf9, 0xb3, 0xf9, 0x4f, 0xf8, - 0x3f, 0xf8, 0xff, 0xf1, 0xff, 0xc1, 0xff, 0x29, - 0xfc, 0xd9, 0xff, 0xa7, 0xbf, 0x1e, 0x7e, 0x7c, - 0x7d, 0xf0, 0x7f, 0xe0, 0x7f, 0x0, - - /* U+F294 "" */ - 0x0, 0x0, 0x80, 0x18, 0x3, 0x80, 0x78, 0x8d, - 0xb9, 0x9b, 0xb6, 0x3f, 0x83, 0xe0, 0x38, 0x7, - 0x81, 0xf8, 0x6d, 0x99, 0x9a, 0x36, 0x7, 0x80, - 0xe0, 0x18, 0x2, 0x0, 0x0, - - /* U+F3FD "" */ - 0x0, 0xfe, 0x0, 0x7, 0xff, 0x0, 0x3f, 0xbf, - 0x80, 0xfe, 0x2f, 0x83, 0xfe, 0xcf, 0x8f, 0x3f, - 0x27, 0x9e, 0x7e, 0x4f, 0x3f, 0xfc, 0xfe, 0xff, - 0xf3, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xcf, 0xff, - 0xfe, 0x3f, 0xfe, 0x78, 0x3c, 0xff, 0xf0, 0x7f, - 0xdf, 0xe0, 0xff, 0x3f, 0xff, 0xfe, 0x3f, 0xff, - 0xf8, - - /* U+F54B "" */ - 0x0, 0xf, 0xf8, 0x1, 0xdf, 0xff, 0x1, 0xef, - 0xff, 0xc0, 0xf7, 0xff, 0xf0, 0x7b, 0xff, 0xf8, - 0x1d, 0xff, 0xfc, 0x0, 0x1f, 0xfc, 0x0, 0x3, - 0xfc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x7, 0xf8, 0x0, 0xf, 0xfe, - 0x3, 0xbf, 0xff, 0x83, 0xdf, 0xff, 0xc1, 0xef, - 0xff, 0xe0, 0xf7, 0xff, 0xe0, 0x3b, 0xff, 0xe0, - 0x0, 0x7f, 0xc0, 0x0, - - /* U+F560 "" */ - 0x0, 0x0, 0x0, 0x0, 0x60, 0x0, 0xf, 0x0, - 0x1, 0xf0, 0x8, 0x3e, 0x1, 0xc7, 0xc4, 0x1e, - 0xf8, 0xe1, 0xff, 0x1f, 0xf, 0xe3, 0xf0, 0x7c, - 0x7e, 0x23, 0x8f, 0xc7, 0x11, 0xf8, 0xf8, 0x3f, - 0xf, 0xc7, 0xe0, 0x7e, 0xfc, 0x3, 0xff, 0x80, - 0x1f, 0xf0, 0x0, 0xfe, 0x0, 0x7, 0xc0, 0x0, - 0x38, 0x0, 0x1, 0x0, 0x0 -}; - - -/*--------------------- - * GLYPH DESCRIPTION - *--------------------*/ - -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 = 192, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1, .adv_w = 192, .box_w = 3, .box_h = 14, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 7, .adv_w = 192, .box_w = 7, .box_h = 6, .ofs_x = 3, .ofs_y = 8}, - {.bitmap_index = 13, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 33, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 57, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 77, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 97, .adv_w = 192, .box_w = 3, .box_h = 6, .ofs_x = 5, .ofs_y = 8}, - {.bitmap_index = 100, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 117, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 134, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 147, .adv_w = 192, .box_w = 10, .box_h = 9, .ofs_x = 1, .ofs_y = 2}, - {.bitmap_index = 159, .adv_w = 192, .box_w = 5, .box_h = 6, .ofs_x = 3, .ofs_y = -3}, - {.bitmap_index = 163, .adv_w = 192, .box_w = 8, .box_h = 2, .ofs_x = 2, .ofs_y = 5}, - {.bitmap_index = 165, .adv_w = 192, .box_w = 4, .box_h = 4, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 167, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 191, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 209, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 225, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 243, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 261, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 277, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 293, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 311, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 329, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 347, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 365, .adv_w = 192, .box_w = 3, .box_h = 11, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 370, .adv_w = 192, .box_w = 5, .box_h = 14, .ofs_x = 3, .ofs_y = -3}, - {.bitmap_index = 379, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, - {.bitmap_index = 392, .adv_w = 192, .box_w = 9, .box_h = 7, .ofs_x = 2, .ofs_y = 3}, - {.bitmap_index = 400, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, - {.bitmap_index = 413, .adv_w = 192, .box_w = 8, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 427, .adv_w = 192, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 451, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 472, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 490, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 508, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 526, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 542, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 558, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 576, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 592, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 608, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 626, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 646, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 662, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 680, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 696, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 714, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 732, .adv_w = 192, .box_w = 10, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 754, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 772, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 790, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 808, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 824, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 845, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 865, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 883, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 903, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 919, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 4, .ofs_y = -2}, - {.bitmap_index = 933, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 957, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 971, .adv_w = 192, .box_w = 10, .box_h = 8, .ofs_x = 1, .ofs_y = 6}, - {.bitmap_index = 981, .adv_w = 192, .box_w = 10, .box_h = 2, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 984, .adv_w = 192, .box_w = 5, .box_h = 3, .ofs_x = 3, .ofs_y = 13}, - {.bitmap_index = 986, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1000, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1018, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1032, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1050, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1064, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1082, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1100, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1116, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1135, .adv_w = 192, .box_w = 8, .box_h = 18, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1153, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1171, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1191, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .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 = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1232, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1250, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1268, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1282, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1296, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1314, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1327, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1341, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1357, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1371, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1389, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1402, .adv_w = 192, .box_w = 9, .box_h = 18, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 1423, .adv_w = 192, .box_w = 3, .box_h = 18, .ofs_x = 5, .ofs_y = -2}, - {.bitmap_index = 1430, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 1453, .adv_w = 192, .box_w = 10, .box_h = 4, .ofs_x = 1, .ofs_y = 5}, - {.bitmap_index = 1458, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1508, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1556, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 1599, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1647, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1666, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1716, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1752, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1800, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 1843, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1881, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1919, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1957, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1995, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 2033, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 2071, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 2100, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 2149, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 2209, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3} -}; - -/*--------------------- - * CHARACTER MAPPING - *--------------------*/ - -static const uint16_t unicode_list_1[] = { - 0x0, 0x16, 0x39, 0x68, 0x128, 0x184, 0x1e5, 0x1fb, - 0x21d, 0x23f, 0x240, 0x241, 0x242, 0x243, 0x292, 0x293, - 0x3fc, 0x54a, 0x55f -}; - -/*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 32, .range_length = 95, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - }, - { - .range_start = 61441, .range_length = 1376, .glyph_id_start = 96, - .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 19, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY - } -}; - - - -/*-------------------- - * ALL CUSTOM DATA - *--------------------*/ - -/*Store all the custom data of the font*/ -static lv_font_fmt_txt_dsc_t font_dsc = { - .glyph_bitmap = gylph_bitmap, - .glyph_dsc = glyph_dsc, - .cmaps = cmaps, - .kern_dsc = NULL, - .kern_scale = 0, - .cmap_num = 2, - .bpp = 1, - .kern_classes = 0, - .bitmap_format = 0 -}; - - -/*----------------- - * PUBLIC FONT - *----------------*/ - -/*Initialize a public general font descriptor*/ -lv_font_t jetbrains_mono_bold_20 = { - .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 = 21, /*The maximum line height required by the font*/ - .base_line = 3, /*Baseline measured from the bottom of the line*/ -#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) - .subpx = LV_FONT_SUBPX_NONE, -#endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ -}; - -#endif /*#if JETBRAINS_MONO_BOLD_20*/ - diff --git a/src/displayapp/Fonts/jetbrains_mono_extrabold_compressed.c b/src/displayapp/Fonts/jetbrains_mono_extrabold_compressed.c deleted file mode 100644 index c9917e40..00000000 --- a/src/displayapp/Fonts/jetbrains_mono_extrabold_compressed.c +++ /dev/null @@ -1,507 +0,0 @@ -#include "lvgl/lvgl.h" - -/******************************************************************************* - * Size: 80 px - * Bpp: 1 - * Opts: - ******************************************************************************/ - -#ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSED -#define JETBRAINS_MONO_EXTRABOLD_COMPRESSED 1 -#endif - -#if JETBRAINS_MONO_EXTRABOLD_COMPRESSED - -/*----------------- - * BITMAPS - *----------------*/ - -/*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, - 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, - - /* 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, - 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, - 0xff, 0xc0, - - /* 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, - 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, - - /* U+34 "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, 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, 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, - 0xc0, 0x3, 0xff, 0xff, 0xfe, 0x0, 0xf, 0xff, - 0xff, 0xf0, 0x0, 0x3f, 0xff, 0xff, 0x80, 0x0, - 0xff, 0xff, 0xfe, 0x0, 0x3, 0xff, 0xff, 0xf8, - 0x0, 0xf, 0xff, 0xff, 0xe0, 0x0, 0x3f, 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, - 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, - - /* 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+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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - - /* U+3A ":" */ - 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, - 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, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x7f, 0xfe, 0x7f, 0xfe, 0x3f, 0xfc, - 0x1f, 0xf8, 0x7, 0xe0 -}; - - -/*--------------------- - * GLYPH DESCRIPTION - *--------------------*/ - -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} -}; - -/*--------------------- - * CHARACTER MAPPING - *--------------------*/ - - - -/*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 48, .range_length = 11, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - } -}; - - - -/*-------------------- - * ALL CUSTOM DATA - *--------------------*/ - -/*Store all the custom data of the font*/ -static lv_font_fmt_txt_dsc_t font_dsc = { - .glyph_bitmap = gylph_bitmap, - .glyph_dsc = glyph_dsc, - .cmaps = cmaps, - .kern_dsc = NULL, - .kern_scale = 0, - .cmap_num = 1, - .bpp = 1, - .kern_classes = 0, - .bitmap_format = 0 -}; - - -/*----------------- - * PUBLIC FONT - *----------------*/ - -/*Initialize a public general font descriptor*/ -lv_font_t jetbrains_mono_extrabold_compressed = { - .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*/ - .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 - .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/Icons/battery/os_battery_005.c b/src/displayapp/Icons/battery/os_battery_005.c deleted file mode 100644 index 64832b5c..00000000 --- a/src/displayapp/Icons/battery/os_battery_005.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005 uint8_t ck_os_battery_005_map[] = { - 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ - - 0xfc, 0x00, 0x3f, - 0xf8, 0x00, 0x1f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0x00, 0xff, 0x00, - 0x00, 0xff, 0x00, - 0x00, 0xff, 0x00, - 0x00, 0xff, 0x00, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t ck_os_battery_005 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_battery_005_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_005.png b/src/displayapp/Icons/battery/os_battery_005.png deleted file mode 100644 index 963767be..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_005.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_010.c b/src/displayapp/Icons/battery/os_battery_010.c deleted file mode 100644 index f36b684b..00000000 --- a/src/displayapp/Icons/battery/os_battery_010.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010 uint8_t ck_os_battery_010_map[] = { - 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ - 0x04, 0x7a, 0xf4, 0xff, /*Color of index 2*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 3*/ - - 0x55, 0x5f, 0xff, 0xff, 0xf5, 0x55, 0x55, - 0x55, 0x7f, 0xff, 0xff, 0xfd, 0x55, 0x55, - 0x55, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, - 0x55, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, - 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, - 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, - 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, - 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xff, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xff, 0x55, 0x55, 0x6a, 0xaa, 0xaa, 0xa9, - 0xff, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0x50, 0x05, 0xaa, 0xaa, 0xaa, 0xaa, - 0xff, 0x50, 0x05, 0xaa, 0xaa, 0xaa, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0xff, 0xf5, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0xff, 0xf5, 0xaa, 0xa5, 0x5a, 0xaa, - 0xff, 0xff, 0xf5, 0xaa, 0xaa, 0xaa, 0xaa, - 0xff, 0xff, 0xf5, 0x6a, 0xaa, 0xaa, 0xa9, -}; - -const lv_img_dsc_t ck_os_battery_010 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 240, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_battery_010_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_010.png b/src/displayapp/Icons/battery/os_battery_010.png deleted file mode 100644 index 68a9f406..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_010.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_020.c b/src/displayapp/Icons/battery/os_battery_020.c deleted file mode 100644 index 3f648fb9..00000000 --- a/src/displayapp/Icons/battery/os_battery_020.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020 uint8_t ck_os_battery_020_map[] = { - 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, - 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, - 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, -}; - -const lv_img_dsc_t ck_os_battery_020 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 208, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_battery_020_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_020.png b/src/displayapp/Icons/battery/os_battery_020.png deleted file mode 100644 index 32eca651..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_020.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_030.c b/src/displayapp/Icons/battery/os_battery_030.c deleted file mode 100644 index 4d5719b7..00000000 --- a/src/displayapp/Icons/battery/os_battery_030.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_030 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_030 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_030 uint8_t ck_os_battery_030_map[] = { - 0x04, 0x7a, 0xf4, 0xff, /*Color of index 0*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, - 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, - 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, - 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, - 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, -}; - -const lv_img_dsc_t ck_os_battery_030 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 208, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_battery_030_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_030.png b/src/displayapp/Icons/battery/os_battery_030.png deleted file mode 100644 index aeb5eb1f..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_030.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_040.c b/src/displayapp/Icons/battery/os_battery_040.c deleted file mode 100644 index 0606fc35..00000000 --- a/src/displayapp/Icons/battery/os_battery_040.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_040 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_040 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_040 uint8_t ck_os_battery_040_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, - 0x07, 0xff, 0xe0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, -}; - -const lv_img_dsc_t ck_os_battery_040 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_battery_040_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_040.png b/src/displayapp/Icons/battery/os_battery_040.png deleted file mode 100644 index d84fda40..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_040.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_050.c b/src/displayapp/Icons/battery/os_battery_050.c deleted file mode 100644 index 8732dc7a..00000000 --- a/src/displayapp/Icons/battery/os_battery_050.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_050 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_050 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_050 uint8_t ck_os_battery_050_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, - 0x07, 0xff, 0xe0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, -}; - -const lv_img_dsc_t ck_os_battery_050 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_battery_050_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_050.png b/src/displayapp/Icons/battery/os_battery_050.png deleted file mode 100644 index 224d38d6..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_050.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_060.c b/src/displayapp/Icons/battery/os_battery_060.c deleted file mode 100644 index a65936bf..00000000 --- a/src/displayapp/Icons/battery/os_battery_060.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_060 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_060 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_060 uint8_t ck_os_battery_060_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, - 0x07, 0xff, 0xe0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, -}; - -const lv_img_dsc_t ck_os_battery_060 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_battery_060_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_060.png b/src/displayapp/Icons/battery/os_battery_060.png deleted file mode 100644 index e5e00eda..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_060.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_070.c b/src/displayapp/Icons/battery/os_battery_070.c deleted file mode 100644 index 949c0b8b..00000000 --- a/src/displayapp/Icons/battery/os_battery_070.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_070 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_070 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_070 uint8_t ck_os_battery_070_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, - 0x07, 0xff, 0xe0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, -}; - -const lv_img_dsc_t ck_os_battery_070 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_battery_070_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_070.png b/src/displayapp/Icons/battery/os_battery_070.png deleted file mode 100644 index dee969b8..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_070.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_080.c b/src/displayapp/Icons/battery/os_battery_080.c deleted file mode 100644 index f447370e..00000000 --- a/src/displayapp/Icons/battery/os_battery_080.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_080 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_080 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_080 uint8_t ck_os_battery_080_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, - 0x07, 0xff, 0xe0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, -}; - -const lv_img_dsc_t ck_os_battery_080 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_battery_080_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_080.png b/src/displayapp/Icons/battery/os_battery_080.png deleted file mode 100644 index 3b13fbb2..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_080.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_090.c b/src/displayapp/Icons/battery/os_battery_090.c deleted file mode 100644 index 6fa41b20..00000000 --- a/src/displayapp/Icons/battery/os_battery_090.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_090 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_090 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_090 uint8_t ck_os_battery_090_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, - 0x07, 0xff, 0xe0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, -}; - -const lv_img_dsc_t ck_os_battery_090 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_battery_090_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_090.png b/src/displayapp/Icons/battery/os_battery_090.png deleted file mode 100644 index d79f396b..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_090.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_100.c b/src/displayapp/Icons/battery/os_battery_100.c deleted file mode 100644 index 92cf9a41..00000000 --- a/src/displayapp/Icons/battery/os_battery_100.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_100 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_100 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_100 uint8_t ck_os_battery_100_map[] = { - 0x7c, 0xd2, 0x34, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0xaa, 0xa5, 0x55, 0x55, 0x5a, 0xaa, - 0xaa, 0x95, 0x55, 0x55, 0x56, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, -}; - -const lv_img_dsc_t ck_os_battery_100 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 208, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_battery_100_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_100.png b/src/displayapp/Icons/battery/os_battery_100.png deleted file mode 100644 index dd0d306f..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_100.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_battery_error.c b/src/displayapp/Icons/battery/os_battery_error.c deleted file mode 100644 index af6aba5d..00000000 --- a/src/displayapp/Icons/battery/os_battery_error.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_ERROR -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_ERROR -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_ERROR uint8_t ck_os_battery_error_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xc4, 0xc2, 0xc4, 0xff, /*Color of index 1*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0x00, 0x05, 0x55, 0x55, 0x50, 0x00, - 0x00, 0x15, 0x55, 0x55, 0x54, 0x00, - 0x00, 0x55, 0x55, 0x55, 0x55, 0x00, - 0x00, 0x55, 0x55, 0x55, 0x55, 0x00, - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, - 0x55, 0x54, 0x00, 0x00, 0x15, 0x55, - 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, - 0x55, 0x00, 0xaa, 0xaa, 0x00, 0x55, - 0x55, 0x02, 0xaa, 0xaa, 0x80, 0x55, - 0x55, 0x02, 0xaa, 0xaa, 0x80, 0x55, - 0x55, 0x0a, 0xa8, 0x2a, 0xa0, 0x55, - 0x55, 0x0a, 0xa0, 0x0a, 0xa0, 0x55, - 0x55, 0x00, 0x00, 0x0a, 0xa0, 0x55, - 0x55, 0x00, 0x00, 0x2a, 0xa0, 0x55, - 0x55, 0x00, 0x02, 0xaa, 0x80, 0x55, - 0x55, 0x00, 0x0a, 0xaa, 0x80, 0x55, - 0x55, 0x00, 0x0a, 0xaa, 0x00, 0x55, - 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, - 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, - 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, - 0x55, 0x00, 0x00, 0x00, 0x00, 0x55, - 0x55, 0x00, 0x00, 0x00, 0x00, 0x55, - 0x55, 0x00, 0x02, 0x80, 0x00, 0x55, - 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, - 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, - 0x55, 0x00, 0x02, 0x80, 0x00, 0x55, - 0x55, 0x55, 0x40, 0x01, 0x55, 0x55, - 0x55, 0x55, 0x50, 0x05, 0x55, 0x55, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, -}; - -const lv_img_dsc_t ck_os_battery_error = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 208, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_battery_error_map, -}; diff --git a/src/displayapp/Icons/battery/os_battery_error.png b/src/displayapp/Icons/battery/os_battery_error.png deleted file mode 100644 index 4c7632fe..00000000 Binary files a/src/displayapp/Icons/battery/os_battery_error.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_005.c b/src/displayapp/Icons/battery/os_batterycharging_005.c deleted file mode 100644 index 1b0c71df..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_005.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_005 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_005 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_005 uint8_t ck_os_batterycharging_005_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, 0x00, - 0x07, 0xff, 0xe0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x07, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x1f, 0x00, - 0xf0, 0x00, 0x3e, 0x00, - 0xf0, 0x00, 0x7e, 0x00, - 0xf0, 0x00, 0xfc, 0x00, - 0xf0, 0x01, 0xff, 0xf0, - 0xf0, 0x03, 0xff, 0xf0, - 0xf0, 0x03, 0xff, 0xf0, - 0xf0, 0x03, 0xff, 0xe0, - 0xf0, 0x00, 0x0f, 0xc0, - 0xf0, 0x00, 0x1f, 0x80, - 0xff, 0xff, 0x3f, 0x00, - 0xff, 0xff, 0x3e, 0x00, - 0xff, 0xff, 0x3c, 0x00, - 0xff, 0xff, 0x38, 0x00, -}; - -const lv_img_dsc_t ck_os_batterycharging_005 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 136, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_batterycharging_005_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_005.png b/src/displayapp/Icons/battery/os_batterycharging_005.png deleted file mode 100644 index f9545bc1..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_005.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_010.c b/src/displayapp/Icons/battery/os_batterycharging_010.c deleted file mode 100644 index 304c0184..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_010.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_010 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_010 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_010 uint8_t ck_os_batterycharging_010_map[] = { - 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, 0x55, - 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x6a, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x5a, 0xa9, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x6a, 0xa9, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0xaa, 0xa5, 0x55, - 0xaa, 0x55, 0x55, 0x56, 0xaa, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x5a, 0xaa, 0xaa, 0xaa, - 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, - 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xa9, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xa5, - 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x95, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xaa, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa9, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa5, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0x95, 0x55, -}; - -const lv_img_dsc_t ck_os_batterycharging_010 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 240, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_batterycharging_010_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_010.png b/src/displayapp/Icons/battery/os_batterycharging_010.png deleted file mode 100644 index 04d5f820..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_010.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_020.c b/src/displayapp/Icons/battery/os_batterycharging_020.c deleted file mode 100644 index 1721be15..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_020.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_020 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_020 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_020 uint8_t ck_os_batterycharging_020_map[] = { - 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, 0x55, - 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x6a, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x5a, 0xa9, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x6a, 0xa9, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0xaa, 0xa5, 0x55, - 0xaa, 0x55, 0x55, 0x56, 0xaa, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x5a, 0xaa, 0xaa, 0xaa, - 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, - 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xa9, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xa5, - 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x95, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xaa, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa9, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa5, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0x95, 0x55, -}; - -const lv_img_dsc_t ck_os_batterycharging_020 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 240, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_batterycharging_020_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_020.png b/src/displayapp/Icons/battery/os_batterycharging_020.png deleted file mode 100644 index 6416e1e6..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_020.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_030.c b/src/displayapp/Icons/battery/os_batterycharging_030.c deleted file mode 100644 index 83101fd9..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_030.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_030 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_030 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_030 uint8_t ck_os_batterycharging_030_map[] = { - 0x04, 0x7a, 0xf4, 0xff, /*Color of index 0*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, 0x55, - 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0x6a, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x5a, 0xa9, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0x6a, 0xa9, 0x55, - 0xaa, 0x55, 0x55, 0x55, 0xaa, 0xa5, 0x55, - 0xaa, 0x50, 0x00, 0x56, 0xaa, 0xaa, 0xaa, - 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, - 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, - 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xa9, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xa5, - 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x95, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xaa, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa9, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa5, 0x55, - 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0x95, 0x55, -}; - -const lv_img_dsc_t ck_os_batterycharging_030 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 240, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_batterycharging_030_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_030.png b/src/displayapp/Icons/battery/os_batterycharging_030.png deleted file mode 100644 index 96b44d2e..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_030.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_040.c b/src/displayapp/Icons/battery/os_batterycharging_040.c deleted file mode 100644 index 02af00e5..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_040.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_040 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_040 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_040 uint8_t ck_os_batterycharging_040_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, 0x00, - 0x07, 0xff, 0xe0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x07, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x1f, 0x00, - 0xf0, 0x00, 0x3e, 0x00, - 0xf3, 0xf8, 0x7e, 0x00, - 0xf3, 0xf0, 0xfc, 0x00, - 0xf3, 0xf1, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xe0, - 0xf0, 0x00, 0x0f, 0xc0, - 0xf0, 0x00, 0x1f, 0x80, - 0xff, 0xff, 0x3f, 0x00, - 0xff, 0xff, 0x3e, 0x00, - 0xff, 0xff, 0x3c, 0x00, - 0xff, 0xff, 0x38, 0x00, -}; - -const lv_img_dsc_t ck_os_batterycharging_040 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 136, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_batterycharging_040_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_040.png b/src/displayapp/Icons/battery/os_batterycharging_040.png deleted file mode 100644 index 5a42caf2..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_040.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_050.c b/src/displayapp/Icons/battery/os_batterycharging_050.c deleted file mode 100644 index d2eea829..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_050.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_050 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_050 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_050 uint8_t ck_os_batterycharging_050_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, 0x00, - 0x07, 0xff, 0xe0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x07, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf3, 0xfe, 0x1f, 0x00, - 0xf3, 0xfc, 0x3e, 0x00, - 0xf3, 0xf8, 0x7e, 0x00, - 0xf3, 0xf0, 0xfc, 0x00, - 0xf3, 0xf1, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xe0, - 0xf0, 0x00, 0x0f, 0xc0, - 0xf0, 0x00, 0x1f, 0x80, - 0xff, 0xff, 0x3f, 0x00, - 0xff, 0xff, 0x3e, 0x00, - 0xff, 0xff, 0x3c, 0x00, - 0xff, 0xff, 0x38, 0x00, -}; - -const lv_img_dsc_t ck_os_batterycharging_050 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 136, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_batterycharging_050_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_050.png b/src/displayapp/Icons/battery/os_batterycharging_050.png deleted file mode 100644 index ca0e04dd..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_050.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_060.c b/src/displayapp/Icons/battery/os_batterycharging_060.c deleted file mode 100644 index 05f8b975..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_060.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_060 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_060 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_060 uint8_t ck_os_batterycharging_060_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, 0x00, - 0x07, 0xff, 0xe0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x00, 0x00, - 0xf3, 0xff, 0x87, 0x00, - 0xf3, 0xff, 0x0f, 0x00, - 0xf3, 0xfe, 0x1f, 0x00, - 0xf3, 0xfc, 0x3e, 0x00, - 0xf3, 0xf8, 0x7e, 0x00, - 0xf3, 0xf0, 0xfc, 0x00, - 0xf3, 0xf1, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xe0, - 0xf0, 0x00, 0x0f, 0xc0, - 0xf0, 0x00, 0x1f, 0x80, - 0xff, 0xff, 0x3f, 0x00, - 0xff, 0xff, 0x3e, 0x00, - 0xff, 0xff, 0x3c, 0x00, - 0xff, 0xff, 0x38, 0x00, -}; - -const lv_img_dsc_t ck_os_batterycharging_060 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 136, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_batterycharging_060_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_060.png b/src/displayapp/Icons/battery/os_batterycharging_060.png deleted file mode 100644 index 2930068a..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_060.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_070.c b/src/displayapp/Icons/battery/os_batterycharging_070.c deleted file mode 100644 index ac3e319c..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_070.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_070 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_070 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_070 uint8_t ck_os_batterycharging_070_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, 0x00, - 0x07, 0xff, 0xe0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0x0f, 0xff, 0xf0, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xff, 0x00, 0xff, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf0, 0x00, 0x0f, 0x00, - 0xf3, 0xff, 0xc0, 0x00, - 0xf3, 0xff, 0xc0, 0x00, - 0xf3, 0xff, 0x87, 0x00, - 0xf3, 0xff, 0x0f, 0x00, - 0xf3, 0xfe, 0x1f, 0x00, - 0xf3, 0xfc, 0x3e, 0x00, - 0xf3, 0xf8, 0x7e, 0x00, - 0xf3, 0xf0, 0xfc, 0x00, - 0xf3, 0xf1, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xf0, - 0xf3, 0xf3, 0xff, 0xe0, - 0xf0, 0x00, 0x0f, 0xc0, - 0xf0, 0x00, 0x1f, 0x80, - 0xff, 0xff, 0x3f, 0x00, - 0xff, 0xff, 0x3e, 0x00, - 0xff, 0xff, 0x3c, 0x00, - 0xff, 0xff, 0x38, 0x00, -}; - -const lv_img_dsc_t ck_os_batterycharging_070 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 136, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_batterycharging_070_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_070.png b/src/displayapp/Icons/battery/os_batterycharging_070.png deleted file mode 100644 index 7d5f55d7..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_070.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_080.c b/src/displayapp/Icons/battery/os_batterycharging_080.c deleted file mode 100644 index cc1c1d23..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_080.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_080 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_080 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_080 uint8_t ck_os_batterycharging_080_map[] = { - 0x7c, 0xd2, 0x34, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0xaa, 0xa5, 0x55, 0x55, 0x5a, 0xaa, 0xaa, - 0xaa, 0x95, 0x55, 0x55, 0x56, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x2a, 0x95, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x02, 0xa9, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x0a, 0xa5, 0x56, 0xaa, - 0x55, 0xa0, 0x00, 0x2a, 0x95, 0x56, 0xaa, - 0x55, 0xa0, 0x00, 0xaa, 0x55, 0x5a, 0xaa, - 0x55, 0xa0, 0x00, 0xa9, 0x55, 0x55, 0x55, - 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, - 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, - 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x56, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x5a, - 0x55, 0xaa, 0xaa, 0xaa, 0xa9, 0x55, 0x6a, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x55, 0xaa, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x56, 0xaa, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x5a, 0xaa, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x6a, 0xaa, -}; - -const lv_img_dsc_t ck_os_batterycharging_080 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 240, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_batterycharging_080_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_080.png b/src/displayapp/Icons/battery/os_batterycharging_080.png deleted file mode 100644 index cce5052f..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_080.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_090.c b/src/displayapp/Icons/battery/os_batterycharging_090.c deleted file mode 100644 index 85e1c260..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_090.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_090 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_090 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_090 uint8_t ck_os_batterycharging_090_map[] = { - 0x7c, 0xd2, 0x34, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0xaa, 0xa5, 0x55, 0x55, 0x5a, 0xaa, 0xaa, - 0xaa, 0x95, 0x55, 0x55, 0x56, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, - 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0x2a, 0x95, 0xaa, - 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x02, 0xa9, 0x55, 0xaa, - 0x55, 0xa0, 0x00, 0x0a, 0xa5, 0x56, 0xaa, - 0x55, 0xa0, 0x00, 0x2a, 0x95, 0x56, 0xaa, - 0x55, 0xa0, 0x00, 0xaa, 0x55, 0x5a, 0xaa, - 0x55, 0xa0, 0x00, 0xa9, 0x55, 0x55, 0x55, - 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, - 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, - 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x56, - 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x5a, - 0x55, 0xaa, 0xaa, 0xaa, 0xa9, 0x55, 0x6a, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x55, 0xaa, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x56, 0xaa, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x5a, 0xaa, - 0x55, 0x55, 0x55, 0x55, 0xa5, 0x6a, 0xaa, -}; - -const lv_img_dsc_t ck_os_batterycharging_090 = { - .header.always_zero = 0, - .header.w = 28, - .header.h = 32, - .data_size = 240, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_batterycharging_090_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_090.png b/src/displayapp/Icons/battery/os_batterycharging_090.png deleted file mode 100644 index fc7b443d..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_090.png and /dev/null differ diff --git a/src/displayapp/Icons/battery/os_batterycharging_100.c b/src/displayapp/Icons/battery/os_batterycharging_100.c deleted file mode 100644 index 8dec0cb5..00000000 --- a/src/displayapp/Icons/battery/os_batterycharging_100.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_100 -#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_100 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_100 uint8_t ck_os_batterycharging_100_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x03, 0xff, 0xc0, - 0x07, 0xff, 0xe0, - 0x0f, 0xff, 0xf0, - 0x0f, 0xff, 0xf0, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x07, 0x0f, - 0xf0, 0x0f, 0x0f, - 0xf0, 0x1f, 0x0f, - 0xf0, 0x3e, 0x0f, - 0xf0, 0x7e, 0x0f, - 0xf0, 0xfc, 0x0f, - 0xf1, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0xcf, - 0xf3, 0xff, 0x8f, - 0xf0, 0x3f, 0x0f, - 0xf0, 0x7e, 0x0f, - 0xf0, 0x7c, 0x0f, - 0xf0, 0xf8, 0x0f, - 0xf0, 0xf0, 0x0f, - 0xf0, 0xe0, 0x0f, - 0xf0, 0x00, 0x0f, - 0xf0, 0x00, 0x0f, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, -}; - -const lv_img_dsc_t ck_os_batterycharging_100 = { - .header.always_zero = 0, - .header.w = 24, - .header.h = 32, - .data_size = 104, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_batterycharging_100_map, -}; diff --git a/src/displayapp/Icons/battery/os_batterycharging_100.png b/src/displayapp/Icons/battery/os_batterycharging_100.png deleted file mode 100644 index 7c8ce0c4..00000000 Binary files a/src/displayapp/Icons/battery/os_batterycharging_100.png and /dev/null differ diff --git a/src/displayapp/Icons/bluetooth/ck_os_bt_connected.png b/src/displayapp/Icons/bluetooth/ck_os_bt_connected.png deleted file mode 100644 index 53716115..00000000 Binary files a/src/displayapp/Icons/bluetooth/ck_os_bt_connected.png and /dev/null differ diff --git a/src/displayapp/Icons/bluetooth/ck_os_bt_disconnected.png b/src/displayapp/Icons/bluetooth/ck_os_bt_disconnected.png deleted file mode 100644 index 3275895d..00000000 Binary files a/src/displayapp/Icons/bluetooth/ck_os_bt_disconnected.png and /dev/null differ diff --git a/src/displayapp/Icons/bluetooth/os_bt_connected.c b/src/displayapp/Icons/bluetooth/os_bt_connected.c deleted file mode 100644 index d30dc9d0..00000000 --- a/src/displayapp/Icons/bluetooth/os_bt_connected.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BT_CONNECTED -#define LV_ATTRIBUTE_IMG_CK_OS_BT_CONNECTED -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BT_CONNECTED uint8_t ck_os_bt_connected_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ - - 0x00, 0x0e, 0x00, 0x00, - 0x00, 0x0f, 0x00, 0x00, - 0x00, 0x0f, 0x80, 0x00, - 0x00, 0x0f, 0xc0, 0x00, - 0x00, 0x0f, 0xe0, 0x00, - 0x00, 0x0f, 0xf0, 0x00, - 0x03, 0x8f, 0xf8, 0x00, - 0x03, 0xcf, 0x7c, 0x00, - 0x03, 0xef, 0x3e, 0x00, - 0x01, 0xff, 0x1f, 0x00, - 0x00, 0xff, 0x1f, 0x00, - 0x00, 0x7f, 0x3e, 0x00, - 0x00, 0x3f, 0x7c, 0x00, - 0x00, 0x1f, 0xf8, 0x00, - 0x00, 0x0f, 0xf0, 0x00, - 0x00, 0x0f, 0xe0, 0x00, - 0x00, 0x0f, 0xe0, 0x00, - 0x00, 0x0f, 0xf0, 0x00, - 0x00, 0x1f, 0xf8, 0x00, - 0x00, 0x3f, 0x7c, 0x00, - 0x00, 0x7f, 0x3e, 0x00, - 0x00, 0xff, 0x1f, 0x00, - 0x01, 0xff, 0x1f, 0x00, - 0x03, 0xef, 0x3e, 0x00, - 0x03, 0xcf, 0x7c, 0x00, - 0x03, 0x8f, 0xf8, 0x00, - 0x00, 0x0f, 0xf0, 0x00, - 0x00, 0x0f, 0xe0, 0x00, - 0x00, 0x0f, 0xc0, 0x00, - 0x00, 0x0f, 0x80, 0x00, - 0x00, 0x0f, 0x00, 0x00, - 0x00, 0x0e, 0x00, 0x00, -}; - -const lv_img_dsc_t ck_os_bt_connected = { - .header.always_zero = 0, - .header.w = 32, - .header.h = 32, - .data_size = 136, - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .data = ck_os_bt_connected_map, -}; diff --git a/src/displayapp/Icons/bluetooth/os_bt_connected.png b/src/displayapp/Icons/bluetooth/os_bt_connected.png deleted file mode 100644 index 53716115..00000000 Binary files a/src/displayapp/Icons/bluetooth/os_bt_connected.png and /dev/null differ diff --git a/src/displayapp/Icons/bluetooth/os_bt_disconnected.c b/src/displayapp/Icons/bluetooth/os_bt_disconnected.c deleted file mode 100644 index 930179b6..00000000 --- a/src/displayapp/Icons/bluetooth/os_bt_disconnected.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "lvgl/lvgl.h" - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CK_OS_BT_DISCONNECTED -#define LV_ATTRIBUTE_IMG_CK_OS_BT_DISCONNECTED -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BT_DISCONNECTED uint8_t ck_os_bt_disconnected_map[] = { - 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ - 0xc4, 0xc2, 0xc4, 0xff, /*Color of index 1*/ - 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ - 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ - - 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, - 0x0a, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, - 0x2a, 0x80, 0x00, 0x55, 0x40, 0x00, 0x00, 0x00, - 0x2a, 0xa0, 0x00, 0x55, 0x50, 0x00, 0x00, 0x00, - 0x0a, 0xa8, 0x00, 0x55, 0x54, 0x00, 0x00, 0x00, - 0x02, 0xaa, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, - 0x00, 0xaa, 0x80, 0x55, 0x55, 0x40, 0x00, 0x00, - 0x00, 0x2a, 0xa0, 0x55, 0x15, 0x50, 0x00, 0x00, - 0x00, 0x0a, 0xa8, 0x15, 0x05, 0x54, 0x00, 0x00, - 0x00, 0x02, 0xaa, 0x05, 0x01, 0x55, 0x00, 0x00, - 0x00, 0x00, 0xaa, 0x81, 0x01, 0x55, 0x00, 0x00, - 0x00, 0x00, 0x2a, 0xa0, 0x05, 0x54, 0x00, 0x00, - 0x00, 0x00, 0x0a, 0xa8, 0x15, 0x50, 0x00, 0x00, - 0x00, 0x00, 0x02, 0xaa, 0x05, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x2a, 0xa0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0a, 0xa8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x42, 0xaa, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x50, 0xaa, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x05, 0x54, 0x2a, 0xa0, 0x00, 0x00, - 0x00, 0x00, 0x15, 0x55, 0x0a, 0xa8, 0x00, 0x00, - 0x00, 0x00, 0x55, 0x55, 0x02, 0xaa, 0x00, 0x00, - 0x00, 0x01, 0x55, 0x55, 0x00, 0xaa, 0x80, 0x00, - 0x00, 0x05, 0x54, 0x55, 0x04, 0x2a, 0xa0, 0x00, - 0x00, 0x05, 0x50, 0x55, 0x15, 0x0a, 0xa8, 0x00, - 0x00, 0x05, 0x40, 0x55, 0x55, 0x42, 0xaa, 0x00, - 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0xaa, 0x80, - 0x00, 0x00, 0x00, 0x55, 0x54, 0x00, 0x2a, 0xa0, - 0x00, 0x00, 0x00, 0x55, 0x50, 0x00, 0x0a, 0xa8, - 0x00, 0x00, 0x00, 0x55, 0x40, 0x00, 0x02, 0xa8, - 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0xa0, - 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t ck_os_bt_disconnected = { - .header.always_zero = 0, - .header.w = 32, - .header.h = 32, - .data_size = 272, - .header.cf = LV_IMG_CF_INDEXED_2BIT, - .data = ck_os_bt_disconnected_map, -}; diff --git a/src/displayapp/Icons/bluetooth/os_bt_disconnected.png b/src/displayapp/Icons/bluetooth/os_bt_disconnected.png deleted file mode 100644 index 3275895d..00000000 Binary files a/src/displayapp/Icons/bluetooth/os_bt_disconnected.png and /dev/null differ diff --git a/src/displayapp/fonts/Readme.md b/src/displayapp/fonts/Readme.md new file mode 100644 index 00000000..7ebf2e23 --- /dev/null +++ b/src/displayapp/fonts/Readme.md @@ -0,0 +1,23 @@ +#Fonts +* [Jetbrains Mono](https://www.jetbrains.com/fr-fr/lp/mono/) +* [Awesome font from LVGL](https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff) + +## 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.woff` and specify the following range : `0x20-0x7f` + * 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` + * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` + +Add new symbols: + * Browse the [cheatsheet](https://fontawesome.com/cheatsheet/free/solid) and find your new symbols + * For each symbol, add its hex code (0xf641 for the 'Ad' icon, for example) to the *Range* list + * Convert this hex value into a UTF-8 code using [this site](http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f185&mode=hex) + * Define the new symbols in `src/DisplayApp/Screens/Symbols.h`: +``` +static constex char* newSymbol = "\xEF\x86\x85"; +``` diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c new file mode 100644 index 00000000..27ad0055 --- /dev/null +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -0,0 +1,766 @@ +#include "lvgl/lvgl.h" + +/******************************************************************************* + * Size: 20 px + * Bpp: 1 + * Opts: + ******************************************************************************/ + +#ifndef JETBRAINS_MONO_BOLD_20 +#define JETBRAINS_MONO_BOLD_20 1 +#endif + +#if JETBRAINS_MONO_BOLD_20 + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { + /* U+20 " " */ + 0x0, + + /* U+21 "!" */ + 0xff, 0xff, 0xff, 0xe0, 0xf, 0xc0, + + /* U+22 "\"" */ + 0xef, 0xdf, 0xbf, 0x7e, 0xfd, 0xc0, + + /* U+23 "#" */ + 0x8, 0xc3, 0x10, 0x62, 0x3f, 0xf7, 0xfe, 0x23, + 0x4, 0x61, 0x88, 0x31, 0x1f, 0xfb, 0xff, 0x19, + 0x82, 0x30, 0xc4, 0x0, + + /* U+24 "$" */ + 0x8, 0x2, 0x1, 0xc1, 0xfe, 0xeb, 0xf2, 0x7c, + 0x83, 0xa0, 0x7c, 0xf, 0xc0, 0xf8, 0x27, 0x9, + 0xf2, 0x7f, 0xf9, 0xfc, 0x8, 0x2, 0x0, 0x80, + + /* U+25 "%" */ + 0x78, 0x1f, 0x83, 0x30, 0x66, 0x1f, 0xcc, 0xf2, + 0x1, 0x80, 0xde, 0x67, 0xf8, 0xcc, 0x19, 0x83, + 0x30, 0x7e, 0x7, 0x80, + + /* U+26 "&" */ + 0x1e, 0x7, 0xe1, 0xce, 0x38, 0x7, 0x0, 0x70, + 0x1e, 0x7, 0x66, 0xed, 0xdc, 0xf3, 0x9c, 0x73, + 0xcf, 0xfc, 0xf9, 0x80, + + /* U+27 "'" */ + 0xff, 0xff, 0xc0, + + /* U+28 "(" */ + 0x2, 0x1c, 0xfb, 0xc7, 0x1e, 0x38, 0x70, 0xe1, + 0xc3, 0x87, 0xe, 0x1c, 0x3c, 0x38, 0x38, 0x7c, + 0x38, + + /* U+29 ")" */ + 0x1, 0xc3, 0xc1, 0xc1, 0xc3, 0xc3, 0x87, 0xe, + 0x1c, 0x38, 0x70, 0xe1, 0xc7, 0x8e, 0x79, 0xe3, + 0x80, + + /* U+2A "*" */ + 0xc, 0x3, 0x8, 0xc7, 0xb7, 0x7f, 0x83, 0x1, + 0xe0, 0xcc, 0x73, 0x80, 0x0, + + /* U+2B "+" */ + 0x1c, 0x7, 0x1, 0xc3, 0xff, 0xff, 0xc7, 0x1, + 0xc0, 0x70, 0x1c, 0x0, + + /* U+2C "," */ + 0x7b, 0x9c, 0xce, 0x60, + + /* U+2D "-" */ + 0xff, 0xff, + + /* U+2E "." */ + 0x6f, 0xf6, + + /* U+2F "/" */ + 0x1, 0xc0, 0x60, 0x38, 0xe, 0x3, 0x1, 0xc0, + 0x70, 0x18, 0xe, 0x3, 0x1, 0xc0, 0x70, 0x18, + 0xe, 0x3, 0x80, 0xc0, 0x70, 0x18, 0xe, 0x0, + + /* U+30 "0" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xed, 0xfb, 0x7e, + 0xdf, 0xb7, 0xed, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0x80, + + /* U+31 "1" */ + 0x3c, 0x3e, 0x3f, 0x13, 0x81, 0xc0, 0xe0, 0x70, + 0x38, 0x1c, 0xe, 0x7, 0x3, 0x8f, 0xff, 0xfc, + + /* U+32 "2" */ + 0x1f, 0x1f, 0xef, 0x3f, 0x87, 0x1, 0xc0, 0x70, + 0x38, 0x1e, 0xf, 0x7, 0x87, 0x83, 0xc0, 0xff, + 0xff, 0xf0, + + /* U+33 "3" */ + 0x7f, 0xdf, 0xf0, 0x3c, 0x1c, 0x1c, 0x7, 0xc1, + 0xf8, 0xf, 0x1, 0xc0, 0x7e, 0x1d, 0x8f, 0x7f, + 0x87, 0xc0, + + /* U+34 "4" */ + 0x7, 0x7, 0x3, 0x83, 0x83, 0x81, 0xc1, 0xcf, + 0xe7, 0xe3, 0xff, 0xff, 0xe0, 0x70, 0x38, 0x1c, + + /* U+35 "5" */ + 0xff, 0x7f, 0xb8, 0x1c, 0xe, 0x7, 0x73, 0xfd, + 0xcf, 0x3, 0x81, 0xc0, 0xfc, 0xff, 0xf1, 0xf0, + + /* U+36 "6" */ + 0x6, 0x3, 0x1, 0xc0, 0x60, 0x30, 0x1b, 0xc7, + 0xfb, 0xcf, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x87, 0x80, + + /* U+37 "7" */ + 0xff, 0xff, 0xfe, 0xb, 0x86, 0x1, 0x80, 0xc0, + 0x30, 0x18, 0x6, 0x3, 0x80, 0xc0, 0x70, 0x18, + 0xe, 0x0, + + /* U+38 "8" */ + 0x3e, 0x1f, 0xce, 0x3b, 0x6, 0xe3, 0x9f, 0xc7, + 0xf1, 0x8e, 0xc1, 0xf0, 0x7c, 0x1f, 0x8f, 0x7f, + 0x8f, 0x80, + + /* U+39 "9" */ + 0x1e, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, + 0x3d, 0xfe, 0x3d, 0x80, 0xc0, 0x60, 0x38, 0xc, + 0x6, 0x0, + + /* U+3A ":" */ + 0xff, 0x80, 0x0, 0xff, 0x80, + + /* U+3B ";" */ + 0x7b, 0xde, 0x0, 0x0, 0x0, 0x7b, 0x9c, 0xce, + 0x60, + + /* U+3C "<" */ + 0x0, 0x81, 0xc3, 0xe7, 0xcf, 0x6, 0x3, 0xc0, + 0x7c, 0xf, 0x81, 0xc0, 0x20, + + /* U+3D "=" */ + 0xff, 0xff, 0xc0, 0x0, 0x0, 0x7, 0xff, 0xfe, + + /* U+3E ">" */ + 0x0, 0x70, 0x3e, 0x7, 0xc0, 0xf8, 0xc, 0x1e, + 0x7c, 0xf8, 0x70, 0x20, 0x0, + + /* U+3F "?" */ + 0xfc, 0xfe, 0xf, 0x7, 0x7, 0xf, 0x3e, 0x3c, + 0x30, 0x30, 0x0, 0x0, 0x70, 0x70, + + /* U+40 "@" */ + 0x1f, 0x87, 0xf9, 0xc3, 0xf0, 0x3c, 0x77, 0x9f, + 0xf3, 0x1e, 0x63, 0xcc, 0x79, 0x8f, 0x31, 0xe7, + 0xfc, 0x77, 0xc0, 0x1c, 0x1, 0xf0, 0x1e, 0x0, + + /* U+41 "A" */ + 0xf, 0x0, 0xf0, 0xf, 0x1, 0xf8, 0x19, 0x81, + 0x98, 0x19, 0x83, 0x9c, 0x3f, 0xc3, 0xfc, 0x70, + 0xe7, 0xe, 0x60, 0x66, 0x6, + + /* U+42 "B" */ + 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xcf, + 0xe3, 0xfc, 0xe3, 0xb8, 0x7e, 0x1f, 0x8f, 0xff, + 0xbf, 0xc0, + + /* U+43 "C" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, + 0x3, 0x80, 0xe0, 0x38, 0xe, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, + + /* U+44 "D" */ + 0xfe, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0x8f, 0xff, + 0xbf, 0x80, + + /* U+45 "E" */ + 0xff, 0xff, 0xf8, 0x1c, 0xe, 0x7, 0x3, 0xfd, + 0xfe, 0xe0, 0x70, 0x38, 0x1c, 0xf, 0xff, 0xfc, + + /* U+46 "F" */ + 0xff, 0xff, 0xf8, 0x1c, 0xe, 0x7, 0x3, 0xff, + 0xff, 0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x0, + + /* U+47 "G" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, + 0x7f, 0x9f, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x87, 0x80, + + /* U+48 "H" */ + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0xff, + 0xff, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, + + /* U+49 "I" */ + 0xff, 0xff, 0xc7, 0x3, 0x81, 0xc0, 0xe0, 0x70, + 0x38, 0x1c, 0xe, 0x7, 0x3, 0x8f, 0xff, 0xfc, + + /* U+4A "J" */ + 0x3f, 0xcf, 0xf0, 0x1c, 0x7, 0x1, 0xc0, 0x70, + 0x1c, 0x7, 0x1, 0xc0, 0x7e, 0x1f, 0x8f, 0x7f, + 0x8f, 0xc0, + + /* U+4B "K" */ + 0xe1, 0xdc, 0x3b, 0x8e, 0x71, 0xce, 0x31, 0xce, + 0x3f, 0x87, 0xf0, 0xe7, 0x1c, 0x63, 0x8e, 0x70, + 0xce, 0x1d, 0xc3, 0x80, + + /* U+4C "L" */ + 0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x3, 0x81, + 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0xf, 0xff, 0xfc, + + /* U+4D "M" */ + 0xe1, 0xf8, 0x7f, 0x3f, 0xcf, 0xda, 0xf7, 0xbd, + 0xef, 0x33, 0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, + 0xf0, 0x30, + + /* U+4E "N" */ + 0xe1, 0xf0, 0xfc, 0x7e, 0x3d, 0x9e, 0xcf, 0x67, + 0x9b, 0xcd, 0xe6, 0xf1, 0xf8, 0xfc, 0x3e, 0x1c, + + /* U+4F "O" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0x80, + + /* U+50 "P" */ + 0xff, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0xff, + 0xfb, 0xfc, 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, + 0x38, 0x0, + + /* U+51 "Q" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0x80, 0x70, 0xe, 0x1, 0xc0, + + /* U+52 "R" */ + 0xff, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0xff, + 0xfb, 0xf8, 0xe6, 0x39, 0xce, 0x33, 0x8e, 0xe3, + 0xb8, 0x70, + + /* U+53 "S" */ + 0x3f, 0x1f, 0xee, 0x1f, 0x87, 0xe0, 0x3e, 0x7, + 0xf0, 0x7e, 0x3, 0xc0, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, + + /* U+54 "T" */ + 0xff, 0xff, 0xf0, 0xe0, 0x38, 0xe, 0x3, 0x80, + 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, 0x38, 0xe, + 0x3, 0x80, + + /* U+55 "U" */ + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, + + /* U+56 "V" */ + 0x60, 0x66, 0x6, 0x70, 0xe7, 0xe, 0x30, 0xc3, + 0xc, 0x39, 0xc1, 0x98, 0x19, 0x81, 0x98, 0x1f, + 0x80, 0xf0, 0xf, 0x0, 0xf0, + + /* U+57 "W" */ + 0xc6, 0x78, 0xcf, 0x39, 0xe7, 0x3e, 0xa6, 0xd6, + 0xda, 0xdb, 0x5b, 0x6b, 0x6d, 0x2d, 0xe7, 0x3c, + 0xe7, 0x9c, 0xe3, 0x80, + + /* U+58 "X" */ + 0xe1, 0xd8, 0x67, 0x38, 0xcc, 0x3f, 0x7, 0x81, + 0xe0, 0x78, 0x1e, 0xf, 0xc3, 0x31, 0xce, 0xe1, + 0xf8, 0x70, + + /* U+59 "Y" */ + 0xe0, 0xfc, 0x1d, 0xc7, 0x38, 0xe3, 0x98, 0x77, + 0x6, 0xc0, 0xf8, 0xe, 0x1, 0xc0, 0x38, 0x7, + 0x0, 0xe0, 0x1c, 0x0, + + /* U+5A "Z" */ + 0xff, 0xff, 0xc0, 0xe0, 0xe0, 0x60, 0x70, 0x70, + 0x38, 0x38, 0x38, 0x1c, 0x1c, 0xf, 0xff, 0xfc, + + /* U+5B "[" */ + 0xff, 0xfe, 0x38, 0xe3, 0x8e, 0x38, 0xe3, 0x8e, + 0x38, 0xe3, 0x8e, 0x38, 0xff, 0xf0, + + /* U+5C "\\" */ + 0xe0, 0x18, 0x7, 0x1, 0xc0, 0x30, 0xe, 0x3, + 0x80, 0x60, 0x1c, 0x3, 0x0, 0xe0, 0x38, 0x6, + 0x1, 0xc0, 0x70, 0xc, 0x3, 0x80, 0x60, 0x1c, + + /* U+5D "]" */ + 0xff, 0xf1, 0xc7, 0x1c, 0x71, 0xc7, 0x1c, 0x71, + 0xc7, 0x1c, 0x71, 0xc7, 0xff, 0xf0, + + /* U+5E "^" */ + 0xc, 0x7, 0x81, 0xe0, 0xfc, 0x33, 0x1c, 0xe6, + 0x19, 0x86, + + /* U+5F "_" */ + 0xff, 0xff, 0xf0, + + /* U+60 "`" */ + 0x63, 0x8e, + + /* U+61 "a" */ + 0x3f, 0x1f, 0xee, 0x1c, 0x7, 0x3f, 0xdf, 0xfe, + 0x1f, 0x87, 0xe3, 0xff, 0xf7, 0xdc, + + /* U+62 "b" */ + 0xe0, 0x38, 0xe, 0x3, 0xbc, 0xff, 0xbc, 0xfe, + 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0xff, + 0xbb, 0xc0, + + /* U+63 "c" */ + 0x3f, 0x1f, 0xef, 0x1f, 0x83, 0xe0, 0x38, 0xe, + 0x3, 0x87, 0xf1, 0xdf, 0xe3, 0xe0, + + /* U+64 "d" */ + 0x1, 0xc0, 0x70, 0x1c, 0xf7, 0x7f, 0xfc, 0xfe, + 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0xcf, 0x70, + + /* U+65 "e" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xff, 0xff, 0xfe, + 0x3, 0x80, 0xf1, 0xdf, 0xe3, 0xf0, + + /* U+66 "f" */ + 0xf, 0xc7, 0xf1, 0xc0, 0x70, 0xff, 0xff, 0xf1, + 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c, + 0x7, 0x0, + + /* U+67 "g" */ + 0x3d, 0xdf, 0xff, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0x1f, 0xcf, 0x7f, 0xcf, 0x70, 0x1c, 0xf, 0x3f, + 0x8f, 0xc0, + + /* U+68 "h" */ + 0xe0, 0x70, 0x38, 0x1d, 0xcf, 0xf7, 0x9f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, + + /* U+69 "i" */ + 0x1c, 0x7, 0x0, 0x0, 0x0, 0xfc, 0x3f, 0x1, + 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c, + 0x3f, 0xff, 0xfc, + + /* U+6A "j" */ + 0x7, 0x7, 0x0, 0x0, 0x7f, 0x7f, 0x7, 0x7, + 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0xf, + 0xfe, 0xfc, + + /* U+6B "k" */ + 0xe0, 0x38, 0xe, 0x3, 0x87, 0xe1, 0xb8, 0xee, + 0x33, 0x9c, 0xfe, 0x3f, 0x8e, 0x73, 0x8e, 0xe3, + 0xb8, 0x70, + + /* U+6C "l" */ + 0xfe, 0x1f, 0xc0, 0x38, 0x7, 0x0, 0xe0, 0x1c, + 0x3, 0x80, 0x70, 0xe, 0x1, 0xc0, 0x38, 0x7, + 0x0, 0xfe, 0xf, 0xc0, + + /* U+6D "m" */ + 0xd9, 0xbf, 0xfc, 0xcf, 0x33, 0xcc, 0xf3, 0x3c, + 0xcf, 0x33, 0xcc, 0xf3, 0x3c, 0xcc, + + /* U+6E "n" */ + 0xee, 0x7f, 0xbc, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xe0, + + /* U+6F "o" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0x1f, 0x87, 0xf3, 0xdf, 0xe3, 0xf0, + + /* U+70 "p" */ + 0xef, 0x3f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0x1f, 0x87, 0xf3, 0xff, 0xee, 0xf3, 0x80, 0xe0, + 0x38, 0x0, + + /* U+71 "q" */ + 0x3d, 0xdf, 0xff, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0x1f, 0x87, 0xf3, 0xdf, 0xf3, 0xdc, 0x7, 0x1, + 0xc0, 0x70, + + /* U+72 "r" */ + 0xef, 0x3f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0xe, + 0x3, 0x80, 0xe0, 0x38, 0xe, 0x0, + + /* U+73 "s" */ + 0x3f, 0x3f, 0xee, 0x1f, 0x80, 0xfc, 0x1f, 0xe0, + 0x3c, 0x7, 0xe1, 0xff, 0xe3, 0xf0, + + /* U+74 "t" */ + 0x1c, 0x7, 0x1, 0xc3, 0xff, 0xff, 0xc7, 0x1, + 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0xf, + 0xc1, 0xf0, + + /* U+75 "u" */ + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xbf, 0x8f, 0x80, + + /* U+76 "v" */ + 0xc0, 0xf8, 0x76, 0x19, 0x86, 0x73, 0x8c, 0xc3, + 0x30, 0xfc, 0x1e, 0x7, 0x81, 0xe0, + + /* U+77 "w" */ + 0xc6, 0x79, 0xcf, 0x39, 0xb5, 0x36, 0xa6, 0xd6, + 0xda, 0xdb, 0x4e, 0x79, 0xcf, 0x38, 0xc7, 0x0, + + /* U+78 "x" */ + 0xe1, 0xdc, 0xe3, 0x30, 0xfc, 0x1e, 0x7, 0x81, + 0xe0, 0xfc, 0x73, 0x9c, 0x6e, 0x1c, + + /* U+79 "y" */ + 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x33, 0x8e, 0xc3, + 0xf0, 0x7c, 0x1e, 0x3, 0x80, 0xc0, 0x70, 0x1c, + 0x6, 0x0, + + /* U+7A "z" */ + 0xff, 0xff, 0xc1, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, + 0xe0, 0xe0, 0x7f, 0xff, 0xe0, + + /* U+7B "{" */ + 0x7, 0x87, 0xc3, 0x81, 0xc0, 0xe0, 0x70, 0x38, + 0x1c, 0xfc, 0x7e, 0x3, 0x81, 0xc0, 0xe0, 0x70, + 0x38, 0x1c, 0xf, 0x83, 0xc0, + + /* U+7C "|" */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + + /* U+7D "}" */ + 0xf0, 0x3f, 0x1, 0xc0, 0x70, 0x1c, 0x7, 0x1, + 0xc0, 0x70, 0xf, 0xc3, 0xf1, 0xc0, 0x70, 0x1c, + 0x7, 0x1, 0xc0, 0x70, 0xf8, 0x3c, 0x0, + + /* U+7E "~" */ + 0x78, 0xff, 0x3c, 0xff, 0x1e, + + /* U+F001 "" */ + 0x0, 0x0, 0x70, 0x0, 0x7f, 0x0, 0x3f, 0xf0, + 0x1f, 0xff, 0x7, 0xff, 0xf0, 0x7f, 0xff, 0x7, + 0xfc, 0x70, 0x7e, 0x7, 0x7, 0x0, 0x70, 0x70, + 0x7, 0x7, 0x0, 0x70, 0x70, 0x7, 0x7, 0x0, + 0x70, 0x70, 0x7f, 0x7, 0xf, 0xf7, 0xf0, 0xff, + 0xff, 0x7, 0xef, 0xf0, 0x0, 0xff, 0x0, 0x3, + 0xc0, 0x0, + + /* U+F017 "" */ + 0x3, 0xf8, 0x1, 0xff, 0xc0, 0x7f, 0xfc, 0x1f, + 0xff, 0xc7, 0xf1, 0xfc, 0xfe, 0x3f, 0x9f, 0xc7, + 0xf7, 0xf8, 0xff, 0xff, 0x1f, 0xff, 0xe3, 0xff, + 0xfc, 0x3f, 0xff, 0x83, 0xff, 0xfc, 0x7e, 0xff, + 0xcf, 0x9f, 0xff, 0xf1, 0xff, 0xfc, 0x1f, 0xff, + 0x1, 0xff, 0xc0, 0x1f, 0xf0, 0x0, 0x70, 0x0, + + /* U+F03A "" */ + 0xf0, 0x0, 0xf, 0x3f, 0xff, 0xf3, 0xff, 0xff, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xf, 0x0, 0x0, 0xf3, 0xff, 0xff, 0x3f, + 0xff, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xf, 0x0, 0x0, 0xf3, 0xff, 0xff, 0x3f, 0xff, + 0xf0, 0x0, 0x0, + + /* U+F069 "" */ + 0x0, 0xe0, 0x0, 0x1c, 0x0, 0x3, 0x80, 0x0, + 0x70, 0x6, 0xe, 0xc, 0xf1, 0xc7, 0x9f, 0xbb, + 0xf1, 0xff, 0xfc, 0xf, 0xfe, 0x0, 0x7f, 0x0, + 0xf, 0xe0, 0x7, 0xff, 0x3, 0xff, 0xf8, 0xfd, + 0xdf, 0x9e, 0x38, 0xf3, 0x7, 0x6, 0x0, 0xe0, + 0x0, 0x1c, 0x0, 0x3, 0x80, 0x0, 0x70, 0x0, + + /* U+F129 "" */ + 0x3c, 0x7e, 0x7e, 0x7e, 0x3c, 0x0, 0x0, 0xfc, + 0xfc, 0xfc, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, + 0xff, 0xff, 0xff, + + /* U+F185 "" */ + 0x0, 0x60, 0x0, 0x6, 0x0, 0x0, 0xf0, 0x1, + 0xcf, 0x38, 0x1f, 0xff, 0x81, 0xf0, 0xf8, 0xc, + 0xf3, 0x1, 0xdf, 0xb8, 0x7b, 0xfd, 0xef, 0xbf, + 0xdf, 0x7b, 0xfd, 0xe1, 0x9f, 0x98, 0xc, 0xf3, + 0x0, 0xc0, 0x30, 0x1f, 0xf, 0x81, 0xff, 0xf8, + 0x1c, 0xf3, 0x80, 0xf, 0x0, 0x0, 0x60, 0x0, + 0x6, 0x0, + + /* U+F1E6 "" */ + 0x18, 0x30, 0x70, 0x70, 0xe0, 0xe1, 0xc1, 0xc3, + 0x83, 0x80, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x7f, + 0xfc, 0xff, 0xf9, 0xff, 0xf1, 0xff, 0xc3, 0xff, + 0x83, 0xfe, 0x3, 0xf8, 0x1, 0xc0, 0x3, 0x80, + 0x7, 0x0, 0xe, 0x0, + + /* U+F1FC "" */ + 0x0, 0x0, 0xf0, 0x0, 0x1f, 0x0, 0x3, 0xf0, + 0x0, 0x7e, 0x0, 0xf, 0xe0, 0x3, 0xfc, 0x0, + 0x7f, 0xc0, 0xf, 0xf8, 0x0, 0xff, 0x80, 0x1f, + 0xf0, 0x0, 0xfe, 0x0, 0xf, 0xe0, 0xe, 0x7c, + 0x1, 0xf8, 0x0, 0x9f, 0xc0, 0xf, 0xfc, 0x0, + 0x7f, 0xc0, 0x7, 0xf8, 0x0, 0x1f, 0x0, 0x0, + + /* U+F21E "" */ + 0x1e, 0x7, 0x83, 0xf9, 0xfe, 0x7f, 0xff, 0xef, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xfc, + 0xf7, 0xf7, 0xd6, 0x3e, 0x79, 0x6b, 0xe0, 0x34, + 0x80, 0x1f, 0x9f, 0x80, 0xf9, 0xf0, 0x7, 0xfe, + 0x0, 0x3f, 0xc0, 0x1, 0xf8, 0x0, 0xf, 0x0, + 0x0, 0x60, 0x0, + + /* U+F240 "" */ + 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, + 0x1, 0xfd, 0xff, 0xfe, 0xfe, 0xff, 0xff, 0x7f, + 0x7f, 0xff, 0x9f, 0xbf, 0xff, 0xcf, 0xdf, 0xff, + 0xe7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, + 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, + + /* U+F241 "" */ + 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, + 0x1, 0xfd, 0xff, 0xe0, 0xfe, 0xff, 0xf0, 0x7f, + 0x7f, 0xf8, 0x1f, 0xbf, 0xfc, 0xf, 0xdf, 0xfe, + 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, + 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, + + /* U+F242 "" */ + 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, + 0x1, 0xfd, 0xfe, 0x0, 0xfe, 0xff, 0x0, 0x7f, + 0x7f, 0x80, 0x1f, 0xbf, 0xc0, 0xf, 0xdf, 0xe0, + 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, + 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, + + /* U+F243 "" */ + 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, + 0x1, 0xfd, 0xf0, 0x0, 0xfe, 0xf8, 0x0, 0x7f, + 0x7c, 0x0, 0x1f, 0xbe, 0x0, 0xf, 0xdf, 0x0, + 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, + 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, + + /* U+F244 "" */ + 0x7f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xb8, 0x0, + 0x1, 0xfc, 0x0, 0x0, 0xfe, 0x0, 0x0, 0x7f, + 0x0, 0x0, 0x1f, 0x80, 0x0, 0xf, 0xc0, 0x0, + 0x7, 0xe0, 0x0, 0x7, 0xf0, 0x0, 0x3, 0xff, + 0xff, 0xff, 0xcf, 0xff, 0xff, 0xe0, + + /* U+F293 "" */ + 0x7, 0xe0, 0x3f, 0xe0, 0xfb, 0xe3, 0xf3, 0xe7, + 0xe3, 0xdf, 0xd3, 0xf9, 0xb3, 0xf9, 0x4f, 0xf8, + 0x3f, 0xf8, 0xff, 0xf1, 0xff, 0xc1, 0xff, 0x29, + 0xfc, 0xd9, 0xff, 0xa7, 0xbf, 0x1e, 0x7e, 0x7c, + 0x7d, 0xf0, 0x7f, 0xe0, 0x7f, 0x0, + + /* U+F294 "" */ + 0x0, 0x0, 0x80, 0x18, 0x3, 0x80, 0x78, 0x8d, + 0xb9, 0x9b, 0xb6, 0x3f, 0x83, 0xe0, 0x38, 0x7, + 0x81, 0xf8, 0x6d, 0x99, 0x9a, 0x36, 0x7, 0x80, + 0xe0, 0x18, 0x2, 0x0, 0x0, + + /* U+F3FD "" */ + 0x0, 0xfe, 0x0, 0x7, 0xff, 0x0, 0x3f, 0xbf, + 0x80, 0xfe, 0x2f, 0x83, 0xfe, 0xcf, 0x8f, 0x3f, + 0x27, 0x9e, 0x7e, 0x4f, 0x3f, 0xfc, 0xfe, 0xff, + 0xf3, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xcf, 0xff, + 0xfe, 0x3f, 0xfe, 0x78, 0x3c, 0xff, 0xf0, 0x7f, + 0xdf, 0xe0, 0xff, 0x3f, 0xff, 0xfe, 0x3f, 0xff, + 0xf8, + + /* U+F54B "" */ + 0x0, 0xf, 0xf8, 0x1, 0xdf, 0xff, 0x1, 0xef, + 0xff, 0xc0, 0xf7, 0xff, 0xf0, 0x7b, 0xff, 0xf8, + 0x1d, 0xff, 0xfc, 0x0, 0x1f, 0xfc, 0x0, 0x3, + 0xfc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x7, 0xf8, 0x0, 0xf, 0xfe, + 0x3, 0xbf, 0xff, 0x83, 0xdf, 0xff, 0xc1, 0xef, + 0xff, 0xe0, 0xf7, 0xff, 0xe0, 0x3b, 0xff, 0xe0, + 0x0, 0x7f, 0xc0, 0x0, + + /* U+F560 "" */ + 0x0, 0x0, 0x0, 0x0, 0x60, 0x0, 0xf, 0x0, + 0x1, 0xf0, 0x8, 0x3e, 0x1, 0xc7, 0xc4, 0x1e, + 0xf8, 0xe1, 0xff, 0x1f, 0xf, 0xe3, 0xf0, 0x7c, + 0x7e, 0x23, 0x8f, 0xc7, 0x11, 0xf8, 0xf8, 0x3f, + 0xf, 0xc7, 0xe0, 0x7e, 0xfc, 0x3, 0xff, 0x80, + 0x1f, 0xf0, 0x0, 0xfe, 0x0, 0x7, 0xc0, 0x0, + 0x38, 0x0, 0x1, 0x0, 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +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 = 192, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1, .adv_w = 192, .box_w = 3, .box_h = 14, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 7, .adv_w = 192, .box_w = 7, .box_h = 6, .ofs_x = 3, .ofs_y = 8}, + {.bitmap_index = 13, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 33, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 57, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 77, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 97, .adv_w = 192, .box_w = 3, .box_h = 6, .ofs_x = 5, .ofs_y = 8}, + {.bitmap_index = 100, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 3, .ofs_y = -2}, + {.bitmap_index = 117, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 134, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, + {.bitmap_index = 147, .adv_w = 192, .box_w = 10, .box_h = 9, .ofs_x = 1, .ofs_y = 2}, + {.bitmap_index = 159, .adv_w = 192, .box_w = 5, .box_h = 6, .ofs_x = 3, .ofs_y = -3}, + {.bitmap_index = 163, .adv_w = 192, .box_w = 8, .box_h = 2, .ofs_x = 2, .ofs_y = 5}, + {.bitmap_index = 165, .adv_w = 192, .box_w = 4, .box_h = 4, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 167, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 191, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 209, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 225, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 243, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 261, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 277, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 293, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 311, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 329, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 347, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 365, .adv_w = 192, .box_w = 3, .box_h = 11, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 370, .adv_w = 192, .box_w = 5, .box_h = 14, .ofs_x = 3, .ofs_y = -3}, + {.bitmap_index = 379, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, + {.bitmap_index = 392, .adv_w = 192, .box_w = 9, .box_h = 7, .ofs_x = 2, .ofs_y = 3}, + {.bitmap_index = 400, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, + {.bitmap_index = 413, .adv_w = 192, .box_w = 8, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 427, .adv_w = 192, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 451, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 472, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 490, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 508, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 526, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 542, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 558, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 576, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 592, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 608, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 626, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 646, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 662, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 680, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 696, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 714, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 732, .adv_w = 192, .box_w = 10, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 754, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 772, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 790, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 808, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 824, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 845, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 865, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 883, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 903, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 919, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 4, .ofs_y = -2}, + {.bitmap_index = 933, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 957, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 3, .ofs_y = -2}, + {.bitmap_index = 971, .adv_w = 192, .box_w = 10, .box_h = 8, .ofs_x = 1, .ofs_y = 6}, + {.bitmap_index = 981, .adv_w = 192, .box_w = 10, .box_h = 2, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 984, .adv_w = 192, .box_w = 5, .box_h = 3, .ofs_x = 3, .ofs_y = 13}, + {.bitmap_index = 986, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1000, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1018, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1032, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1050, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1064, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1082, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 1100, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1116, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1135, .adv_w = 192, .box_w = 8, .box_h = 18, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 1153, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1171, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1191, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .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 = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1232, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 1250, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 1268, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1282, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1296, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1314, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1327, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1341, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1357, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1371, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 1389, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1402, .adv_w = 192, .box_w = 9, .box_h = 18, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 1423, .adv_w = 192, .box_w = 3, .box_h = 18, .ofs_x = 5, .ofs_y = -2}, + {.bitmap_index = 1430, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 1453, .adv_w = 192, .box_w = 10, .box_h = 4, .ofs_x = 1, .ofs_y = 5}, + {.bitmap_index = 1458, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 1508, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 1556, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1599, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 1647, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1666, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 1716, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1752, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1800, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1843, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1881, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1919, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1957, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1995, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 2033, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 2071, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2100, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2149, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 2209, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + +static const uint16_t unicode_list_1[] = { + 0x0, 0x16, 0x39, 0x68, 0x128, 0x184, 0x1e5, 0x1fb, + 0x21d, 0x23f, 0x240, 0x241, 0x242, 0x243, 0x292, 0x293, + 0x3fc, 0x54a, 0x55f +}; + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 32, .range_length = 95, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + }, + { + .range_start = 61441, .range_length = 1376, .glyph_id_start = 96, + .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 19, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_dsc_t font_dsc = { + .glyph_bitmap = gylph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 2, + .bpp = 1, + .kern_classes = 0, + .bitmap_format = 0 +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +lv_font_t jetbrains_mono_bold_20 = { + .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 = 21, /*The maximum line height required by the font*/ + .base_line = 3, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + +#endif /*#if JETBRAINS_MONO_BOLD_20*/ + diff --git a/src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c b/src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c new file mode 100644 index 00000000..c9917e40 --- /dev/null +++ b/src/displayapp/fonts/jetbrains_mono_extrabold_compressed.c @@ -0,0 +1,507 @@ +#include "lvgl/lvgl.h" + +/******************************************************************************* + * Size: 80 px + * Bpp: 1 + * Opts: + ******************************************************************************/ + +#ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSED +#define JETBRAINS_MONO_EXTRABOLD_COMPRESSED 1 +#endif + +#if JETBRAINS_MONO_EXTRABOLD_COMPRESSED + +/*----------------- + * BITMAPS + *----------------*/ + +/*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, + 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, + + /* 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, + 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, + 0xff, 0xc0, + + /* 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, + 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, + + /* U+34 "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, 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, 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, + 0xc0, 0x3, 0xff, 0xff, 0xfe, 0x0, 0xf, 0xff, + 0xff, 0xf0, 0x0, 0x3f, 0xff, 0xff, 0x80, 0x0, + 0xff, 0xff, 0xfe, 0x0, 0x3, 0xff, 0xff, 0xf8, + 0x0, 0xf, 0xff, 0xff, 0xe0, 0x0, 0x3f, 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, + 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, + + /* 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+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, + 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, + 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, + 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, + 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, + 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, + 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, + 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, + + /* U+3A ":" */ + 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, + 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, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x7f, 0xfe, 0x7f, 0xfe, 0x3f, 0xfc, + 0x1f, 0xf8, 0x7, 0xe0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +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} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + + + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 48, .range_length = 11, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_dsc_t font_dsc = { + .glyph_bitmap = gylph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 1, + .kern_classes = 0, + .bitmap_format = 0 +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +lv_font_t jetbrains_mono_extrabold_compressed = { + .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*/ + .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 + .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/icons/battery/os_battery_005.c b/src/displayapp/icons/battery/os_battery_005.c new file mode 100644 index 00000000..64832b5c --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_005.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005 uint8_t ck_os_battery_005_map[] = { + 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ + + 0xfc, 0x00, 0x3f, + 0xf8, 0x00, 0x1f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0x00, 0xff, 0x00, + 0x00, 0xff, 0x00, + 0x00, 0xff, 0x00, + 0x00, 0xff, 0x00, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, +}; + +const lv_img_dsc_t ck_os_battery_005 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_battery_005_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_005.png b/src/displayapp/icons/battery/os_battery_005.png new file mode 100644 index 00000000..963767be Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_005.png differ diff --git a/src/displayapp/icons/battery/os_battery_010.c b/src/displayapp/icons/battery/os_battery_010.c new file mode 100644 index 00000000..f36b684b --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_010.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010 uint8_t ck_os_battery_010_map[] = { + 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ + 0x04, 0x7a, 0xf4, 0xff, /*Color of index 2*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 3*/ + + 0x55, 0x5f, 0xff, 0xff, 0xf5, 0x55, 0x55, + 0x55, 0x7f, 0xff, 0xff, 0xfd, 0x55, 0x55, + 0x55, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, + 0x55, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, + 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, + 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, + 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, + 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xff, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xff, 0x55, 0x55, 0x6a, 0xaa, 0xaa, 0xa9, + 0xff, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0x50, 0x05, 0xaa, 0xaa, 0xaa, 0xaa, + 0xff, 0x50, 0x05, 0xaa, 0xaa, 0xaa, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0xff, 0xf5, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0xff, 0xf5, 0xaa, 0xa5, 0x5a, 0xaa, + 0xff, 0xff, 0xf5, 0xaa, 0xaa, 0xaa, 0xaa, + 0xff, 0xff, 0xf5, 0x6a, 0xaa, 0xaa, 0xa9, +}; + +const lv_img_dsc_t ck_os_battery_010 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 240, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_battery_010_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_010.png b/src/displayapp/icons/battery/os_battery_010.png new file mode 100644 index 00000000..68a9f406 Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_010.png differ diff --git a/src/displayapp/icons/battery/os_battery_020.c b/src/displayapp/icons/battery/os_battery_020.c new file mode 100644 index 00000000..3f648fb9 --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_020.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020 uint8_t ck_os_battery_020_map[] = { + 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, + 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, + 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, +}; + +const lv_img_dsc_t ck_os_battery_020 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 208, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_battery_020_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_020.png b/src/displayapp/icons/battery/os_battery_020.png new file mode 100644 index 00000000..32eca651 Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_020.png differ diff --git a/src/displayapp/icons/battery/os_battery_030.c b/src/displayapp/icons/battery/os_battery_030.c new file mode 100644 index 00000000..4d5719b7 --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_030.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_030 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_030 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_030 uint8_t ck_os_battery_030_map[] = { + 0x04, 0x7a, 0xf4, 0xff, /*Color of index 0*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, + 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, + 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, + 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, + 0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, +}; + +const lv_img_dsc_t ck_os_battery_030 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 208, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_battery_030_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_030.png b/src/displayapp/icons/battery/os_battery_030.png new file mode 100644 index 00000000..aeb5eb1f Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_030.png differ diff --git a/src/displayapp/icons/battery/os_battery_040.c b/src/displayapp/icons/battery/os_battery_040.c new file mode 100644 index 00000000..0606fc35 --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_040.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_040 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_040 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_040 uint8_t ck_os_battery_040_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, + 0x07, 0xff, 0xe0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, +}; + +const lv_img_dsc_t ck_os_battery_040 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_battery_040_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_040.png b/src/displayapp/icons/battery/os_battery_040.png new file mode 100644 index 00000000..d84fda40 Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_040.png differ diff --git a/src/displayapp/icons/battery/os_battery_050.c b/src/displayapp/icons/battery/os_battery_050.c new file mode 100644 index 00000000..8732dc7a --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_050.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_050 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_050 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_050 uint8_t ck_os_battery_050_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, + 0x07, 0xff, 0xe0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, +}; + +const lv_img_dsc_t ck_os_battery_050 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_battery_050_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_050.png b/src/displayapp/icons/battery/os_battery_050.png new file mode 100644 index 00000000..224d38d6 Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_050.png differ diff --git a/src/displayapp/icons/battery/os_battery_060.c b/src/displayapp/icons/battery/os_battery_060.c new file mode 100644 index 00000000..a65936bf --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_060.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_060 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_060 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_060 uint8_t ck_os_battery_060_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, + 0x07, 0xff, 0xe0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, +}; + +const lv_img_dsc_t ck_os_battery_060 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_battery_060_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_060.png b/src/displayapp/icons/battery/os_battery_060.png new file mode 100644 index 00000000..e5e00eda Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_060.png differ diff --git a/src/displayapp/icons/battery/os_battery_070.c b/src/displayapp/icons/battery/os_battery_070.c new file mode 100644 index 00000000..949c0b8b --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_070.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_070 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_070 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_070 uint8_t ck_os_battery_070_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, + 0x07, 0xff, 0xe0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, +}; + +const lv_img_dsc_t ck_os_battery_070 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_battery_070_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_070.png b/src/displayapp/icons/battery/os_battery_070.png new file mode 100644 index 00000000..dee969b8 Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_070.png differ diff --git a/src/displayapp/icons/battery/os_battery_080.c b/src/displayapp/icons/battery/os_battery_080.c new file mode 100644 index 00000000..f447370e --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_080.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_080 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_080 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_080 uint8_t ck_os_battery_080_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, + 0x07, 0xff, 0xe0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, +}; + +const lv_img_dsc_t ck_os_battery_080 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_battery_080_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_080.png b/src/displayapp/icons/battery/os_battery_080.png new file mode 100644 index 00000000..3b13fbb2 Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_080.png differ diff --git a/src/displayapp/icons/battery/os_battery_090.c b/src/displayapp/icons/battery/os_battery_090.c new file mode 100644 index 00000000..6fa41b20 --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_090.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_090 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_090 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_090 uint8_t ck_os_battery_090_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, + 0x07, 0xff, 0xe0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, +}; + +const lv_img_dsc_t ck_os_battery_090 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_battery_090_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_090.png b/src/displayapp/icons/battery/os_battery_090.png new file mode 100644 index 00000000..d79f396b Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_090.png differ diff --git a/src/displayapp/icons/battery/os_battery_100.c b/src/displayapp/icons/battery/os_battery_100.c new file mode 100644 index 00000000..92cf9a41 --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_100.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_100 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_100 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_100 uint8_t ck_os_battery_100_map[] = { + 0x7c, 0xd2, 0x34, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0xaa, 0xa5, 0x55, 0x55, 0x5a, 0xaa, + 0xaa, 0x95, 0x55, 0x55, 0x56, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, +}; + +const lv_img_dsc_t ck_os_battery_100 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 208, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_battery_100_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_100.png b/src/displayapp/icons/battery/os_battery_100.png new file mode 100644 index 00000000..dd0d306f Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_100.png differ diff --git a/src/displayapp/icons/battery/os_battery_error.c b/src/displayapp/icons/battery/os_battery_error.c new file mode 100644 index 00000000..af6aba5d --- /dev/null +++ b/src/displayapp/icons/battery/os_battery_error.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_ERROR +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_ERROR +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_ERROR uint8_t ck_os_battery_error_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xc4, 0xc2, 0xc4, 0xff, /*Color of index 1*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0x00, 0x05, 0x55, 0x55, 0x50, 0x00, + 0x00, 0x15, 0x55, 0x55, 0x54, 0x00, + 0x00, 0x55, 0x55, 0x55, 0x55, 0x00, + 0x00, 0x55, 0x55, 0x55, 0x55, 0x00, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, + 0x55, 0x54, 0x00, 0x00, 0x15, 0x55, + 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, + 0x55, 0x00, 0xaa, 0xaa, 0x00, 0x55, + 0x55, 0x02, 0xaa, 0xaa, 0x80, 0x55, + 0x55, 0x02, 0xaa, 0xaa, 0x80, 0x55, + 0x55, 0x0a, 0xa8, 0x2a, 0xa0, 0x55, + 0x55, 0x0a, 0xa0, 0x0a, 0xa0, 0x55, + 0x55, 0x00, 0x00, 0x0a, 0xa0, 0x55, + 0x55, 0x00, 0x00, 0x2a, 0xa0, 0x55, + 0x55, 0x00, 0x02, 0xaa, 0x80, 0x55, + 0x55, 0x00, 0x0a, 0xaa, 0x80, 0x55, + 0x55, 0x00, 0x0a, 0xaa, 0x00, 0x55, + 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, + 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, + 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x55, 0x00, 0x02, 0x80, 0x00, 0x55, + 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, + 0x55, 0x00, 0x0a, 0xa0, 0x00, 0x55, + 0x55, 0x00, 0x02, 0x80, 0x00, 0x55, + 0x55, 0x55, 0x40, 0x01, 0x55, 0x55, + 0x55, 0x55, 0x50, 0x05, 0x55, 0x55, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, +}; + +const lv_img_dsc_t ck_os_battery_error = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 208, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_battery_error_map, +}; diff --git a/src/displayapp/icons/battery/os_battery_error.png b/src/displayapp/icons/battery/os_battery_error.png new file mode 100644 index 00000000..4c7632fe Binary files /dev/null and b/src/displayapp/icons/battery/os_battery_error.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_005.c b/src/displayapp/icons/battery/os_batterycharging_005.c new file mode 100644 index 00000000..1b0c71df --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_005.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_005 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_005 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_005 uint8_t ck_os_batterycharging_005_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, 0x00, + 0x07, 0xff, 0xe0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x07, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x1f, 0x00, + 0xf0, 0x00, 0x3e, 0x00, + 0xf0, 0x00, 0x7e, 0x00, + 0xf0, 0x00, 0xfc, 0x00, + 0xf0, 0x01, 0xff, 0xf0, + 0xf0, 0x03, 0xff, 0xf0, + 0xf0, 0x03, 0xff, 0xf0, + 0xf0, 0x03, 0xff, 0xe0, + 0xf0, 0x00, 0x0f, 0xc0, + 0xf0, 0x00, 0x1f, 0x80, + 0xff, 0xff, 0x3f, 0x00, + 0xff, 0xff, 0x3e, 0x00, + 0xff, 0xff, 0x3c, 0x00, + 0xff, 0xff, 0x38, 0x00, +}; + +const lv_img_dsc_t ck_os_batterycharging_005 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 136, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_batterycharging_005_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_005.png b/src/displayapp/icons/battery/os_batterycharging_005.png new file mode 100644 index 00000000..f9545bc1 Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_005.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_010.c b/src/displayapp/icons/battery/os_batterycharging_010.c new file mode 100644 index 00000000..304c0184 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_010.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_010 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_010 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_010 uint8_t ck_os_batterycharging_010_map[] = { + 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, 0x55, + 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x6a, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x5a, 0xa9, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x6a, 0xa9, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0xaa, 0xa5, 0x55, + 0xaa, 0x55, 0x55, 0x56, 0xaa, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x5a, 0xaa, 0xaa, 0xaa, + 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, + 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xa9, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xa5, + 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x95, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xaa, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa9, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa5, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0x95, 0x55, +}; + +const lv_img_dsc_t ck_os_batterycharging_010 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 240, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_batterycharging_010_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_010.png b/src/displayapp/icons/battery/os_batterycharging_010.png new file mode 100644 index 00000000..04d5f820 Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_010.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_020.c b/src/displayapp/icons/battery/os_batterycharging_020.c new file mode 100644 index 00000000..1721be15 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_020.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_020 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_020 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_020 uint8_t ck_os_batterycharging_020_map[] = { + 0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, 0x55, + 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x6a, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x5a, 0xa9, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x6a, 0xa9, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0xaa, 0xa5, 0x55, + 0xaa, 0x55, 0x55, 0x56, 0xaa, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x5a, 0xaa, 0xaa, 0xaa, + 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, + 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xa9, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xa5, + 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x95, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xaa, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa9, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa5, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0x95, 0x55, +}; + +const lv_img_dsc_t ck_os_batterycharging_020 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 240, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_batterycharging_020_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_020.png b/src/displayapp/icons/battery/os_batterycharging_020.png new file mode 100644 index 00000000..6416e1e6 Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_020.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_030.c b/src/displayapp/icons/battery/os_batterycharging_030.c new file mode 100644 index 00000000..83101fd9 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_030.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_030 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_030 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_030 uint8_t ck_os_batterycharging_030_map[] = { + 0x04, 0x7a, 0xf4, 0xff, /*Color of index 0*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55, 0x55, + 0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0x6a, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x5a, 0xa9, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0x6a, 0xa9, 0x55, + 0xaa, 0x55, 0x55, 0x55, 0xaa, 0xa5, 0x55, + 0xaa, 0x50, 0x00, 0x56, 0xaa, 0xaa, 0xaa, + 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, + 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xaa, + 0xaa, 0x50, 0x00, 0x5a, 0xaa, 0xaa, 0xa9, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xa5, + 0xaa, 0x55, 0x55, 0x55, 0x56, 0xaa, 0x95, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xaa, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa9, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0xa5, 0x55, + 0xaa, 0xaa, 0xaa, 0xaa, 0x5a, 0x95, 0x55, +}; + +const lv_img_dsc_t ck_os_batterycharging_030 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 240, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_batterycharging_030_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_030.png b/src/displayapp/icons/battery/os_batterycharging_030.png new file mode 100644 index 00000000..96b44d2e Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_030.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_040.c b/src/displayapp/icons/battery/os_batterycharging_040.c new file mode 100644 index 00000000..02af00e5 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_040.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_040 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_040 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_040 uint8_t ck_os_batterycharging_040_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, 0x00, + 0x07, 0xff, 0xe0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x07, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x1f, 0x00, + 0xf0, 0x00, 0x3e, 0x00, + 0xf3, 0xf8, 0x7e, 0x00, + 0xf3, 0xf0, 0xfc, 0x00, + 0xf3, 0xf1, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xe0, + 0xf0, 0x00, 0x0f, 0xc0, + 0xf0, 0x00, 0x1f, 0x80, + 0xff, 0xff, 0x3f, 0x00, + 0xff, 0xff, 0x3e, 0x00, + 0xff, 0xff, 0x3c, 0x00, + 0xff, 0xff, 0x38, 0x00, +}; + +const lv_img_dsc_t ck_os_batterycharging_040 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 136, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_batterycharging_040_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_040.png b/src/displayapp/icons/battery/os_batterycharging_040.png new file mode 100644 index 00000000..5a42caf2 Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_040.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_050.c b/src/displayapp/icons/battery/os_batterycharging_050.c new file mode 100644 index 00000000..d2eea829 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_050.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_050 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_050 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_050 uint8_t ck_os_batterycharging_050_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, 0x00, + 0x07, 0xff, 0xe0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x07, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf3, 0xfe, 0x1f, 0x00, + 0xf3, 0xfc, 0x3e, 0x00, + 0xf3, 0xf8, 0x7e, 0x00, + 0xf3, 0xf0, 0xfc, 0x00, + 0xf3, 0xf1, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xe0, + 0xf0, 0x00, 0x0f, 0xc0, + 0xf0, 0x00, 0x1f, 0x80, + 0xff, 0xff, 0x3f, 0x00, + 0xff, 0xff, 0x3e, 0x00, + 0xff, 0xff, 0x3c, 0x00, + 0xff, 0xff, 0x38, 0x00, +}; + +const lv_img_dsc_t ck_os_batterycharging_050 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 136, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_batterycharging_050_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_050.png b/src/displayapp/icons/battery/os_batterycharging_050.png new file mode 100644 index 00000000..ca0e04dd Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_050.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_060.c b/src/displayapp/icons/battery/os_batterycharging_060.c new file mode 100644 index 00000000..05f8b975 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_060.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_060 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_060 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_060 uint8_t ck_os_batterycharging_060_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, 0x00, + 0x07, 0xff, 0xe0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, + 0xf3, 0xff, 0x87, 0x00, + 0xf3, 0xff, 0x0f, 0x00, + 0xf3, 0xfe, 0x1f, 0x00, + 0xf3, 0xfc, 0x3e, 0x00, + 0xf3, 0xf8, 0x7e, 0x00, + 0xf3, 0xf0, 0xfc, 0x00, + 0xf3, 0xf1, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xe0, + 0xf0, 0x00, 0x0f, 0xc0, + 0xf0, 0x00, 0x1f, 0x80, + 0xff, 0xff, 0x3f, 0x00, + 0xff, 0xff, 0x3e, 0x00, + 0xff, 0xff, 0x3c, 0x00, + 0xff, 0xff, 0x38, 0x00, +}; + +const lv_img_dsc_t ck_os_batterycharging_060 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 136, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_batterycharging_060_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_060.png b/src/displayapp/icons/battery/os_batterycharging_060.png new file mode 100644 index 00000000..2930068a Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_060.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_070.c b/src/displayapp/icons/battery/os_batterycharging_070.c new file mode 100644 index 00000000..ac3e319c --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_070.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_070 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_070 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_070 uint8_t ck_os_batterycharging_070_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, 0x00, + 0x07, 0xff, 0xe0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0x0f, 0xff, 0xf0, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xff, 0x00, 0xff, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf0, 0x00, 0x0f, 0x00, + 0xf3, 0xff, 0xc0, 0x00, + 0xf3, 0xff, 0xc0, 0x00, + 0xf3, 0xff, 0x87, 0x00, + 0xf3, 0xff, 0x0f, 0x00, + 0xf3, 0xfe, 0x1f, 0x00, + 0xf3, 0xfc, 0x3e, 0x00, + 0xf3, 0xf8, 0x7e, 0x00, + 0xf3, 0xf0, 0xfc, 0x00, + 0xf3, 0xf1, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xf0, + 0xf3, 0xf3, 0xff, 0xe0, + 0xf0, 0x00, 0x0f, 0xc0, + 0xf0, 0x00, 0x1f, 0x80, + 0xff, 0xff, 0x3f, 0x00, + 0xff, 0xff, 0x3e, 0x00, + 0xff, 0xff, 0x3c, 0x00, + 0xff, 0xff, 0x38, 0x00, +}; + +const lv_img_dsc_t ck_os_batterycharging_070 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 136, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_batterycharging_070_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_070.png b/src/displayapp/icons/battery/os_batterycharging_070.png new file mode 100644 index 00000000..7d5f55d7 Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_070.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_080.c b/src/displayapp/icons/battery/os_batterycharging_080.c new file mode 100644 index 00000000..cc1c1d23 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_080.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_080 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_080 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_080 uint8_t ck_os_batterycharging_080_map[] = { + 0x7c, 0xd2, 0x34, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0xaa, 0xa5, 0x55, 0x55, 0x5a, 0xaa, 0xaa, + 0xaa, 0x95, 0x55, 0x55, 0x56, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x2a, 0x95, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x02, 0xa9, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x0a, 0xa5, 0x56, 0xaa, + 0x55, 0xa0, 0x00, 0x2a, 0x95, 0x56, 0xaa, + 0x55, 0xa0, 0x00, 0xaa, 0x55, 0x5a, 0xaa, + 0x55, 0xa0, 0x00, 0xa9, 0x55, 0x55, 0x55, + 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, + 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, + 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x56, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x5a, + 0x55, 0xaa, 0xaa, 0xaa, 0xa9, 0x55, 0x6a, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x55, 0xaa, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x56, 0xaa, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x5a, 0xaa, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x6a, 0xaa, +}; + +const lv_img_dsc_t ck_os_batterycharging_080 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 240, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_batterycharging_080_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_080.png b/src/displayapp/icons/battery/os_batterycharging_080.png new file mode 100644 index 00000000..cce5052f Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_080.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_090.c b/src/displayapp/icons/battery/os_batterycharging_090.c new file mode 100644 index 00000000..85e1c260 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_090.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_090 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_090 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_090 uint8_t ck_os_batterycharging_090_map[] = { + 0x7c, 0xd2, 0x34, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0xaa, 0xa5, 0x55, 0x55, 0x5a, 0xaa, 0xaa, + 0xaa, 0x95, 0x55, 0x55, 0x56, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, + 0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x0a, 0xaa, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0x2a, 0x95, 0xaa, + 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x02, 0xa9, 0x55, 0xaa, + 0x55, 0xa0, 0x00, 0x0a, 0xa5, 0x56, 0xaa, + 0x55, 0xa0, 0x00, 0x2a, 0x95, 0x56, 0xaa, + 0x55, 0xa0, 0x00, 0xaa, 0x55, 0x5a, 0xaa, + 0x55, 0xa0, 0x00, 0xa9, 0x55, 0x55, 0x55, + 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, + 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x55, + 0x55, 0xa0, 0x00, 0xa5, 0x55, 0x55, 0x56, + 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x5a, + 0x55, 0xaa, 0xaa, 0xaa, 0xa9, 0x55, 0x6a, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x55, 0xaa, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x56, 0xaa, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x5a, 0xaa, + 0x55, 0x55, 0x55, 0x55, 0xa5, 0x6a, 0xaa, +}; + +const lv_img_dsc_t ck_os_batterycharging_090 = { + .header.always_zero = 0, + .header.w = 28, + .header.h = 32, + .data_size = 240, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_batterycharging_090_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_090.png b/src/displayapp/icons/battery/os_batterycharging_090.png new file mode 100644 index 00000000..fc7b443d Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_090.png differ diff --git a/src/displayapp/icons/battery/os_batterycharging_100.c b/src/displayapp/icons/battery/os_batterycharging_100.c new file mode 100644 index 00000000..8dec0cb5 --- /dev/null +++ b/src/displayapp/icons/battery/os_batterycharging_100.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_100 +#define LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_100 +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERYCHARGING_100 uint8_t ck_os_batterycharging_100_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x03, 0xff, 0xc0, + 0x07, 0xff, 0xe0, + 0x0f, 0xff, 0xf0, + 0x0f, 0xff, 0xf0, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x07, 0x0f, + 0xf0, 0x0f, 0x0f, + 0xf0, 0x1f, 0x0f, + 0xf0, 0x3e, 0x0f, + 0xf0, 0x7e, 0x0f, + 0xf0, 0xfc, 0x0f, + 0xf1, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0xcf, + 0xf3, 0xff, 0x8f, + 0xf0, 0x3f, 0x0f, + 0xf0, 0x7e, 0x0f, + 0xf0, 0x7c, 0x0f, + 0xf0, 0xf8, 0x0f, + 0xf0, 0xf0, 0x0f, + 0xf0, 0xe0, 0x0f, + 0xf0, 0x00, 0x0f, + 0xf0, 0x00, 0x0f, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, +}; + +const lv_img_dsc_t ck_os_batterycharging_100 = { + .header.always_zero = 0, + .header.w = 24, + .header.h = 32, + .data_size = 104, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_batterycharging_100_map, +}; diff --git a/src/displayapp/icons/battery/os_batterycharging_100.png b/src/displayapp/icons/battery/os_batterycharging_100.png new file mode 100644 index 00000000..7c8ce0c4 Binary files /dev/null and b/src/displayapp/icons/battery/os_batterycharging_100.png differ diff --git a/src/displayapp/icons/bluetooth/ck_os_bt_connected.png b/src/displayapp/icons/bluetooth/ck_os_bt_connected.png new file mode 100644 index 00000000..53716115 Binary files /dev/null and b/src/displayapp/icons/bluetooth/ck_os_bt_connected.png differ diff --git a/src/displayapp/icons/bluetooth/ck_os_bt_disconnected.png b/src/displayapp/icons/bluetooth/ck_os_bt_disconnected.png new file mode 100644 index 00000000..3275895d Binary files /dev/null and b/src/displayapp/icons/bluetooth/ck_os_bt_disconnected.png differ diff --git a/src/displayapp/icons/bluetooth/os_bt_connected.c b/src/displayapp/icons/bluetooth/os_bt_connected.c new file mode 100644 index 00000000..d30dc9d0 --- /dev/null +++ b/src/displayapp/icons/bluetooth/os_bt_connected.c @@ -0,0 +1,56 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BT_CONNECTED +#define LV_ATTRIBUTE_IMG_CK_OS_BT_CONNECTED +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BT_CONNECTED uint8_t ck_os_bt_connected_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 1*/ + + 0x00, 0x0e, 0x00, 0x00, + 0x00, 0x0f, 0x00, 0x00, + 0x00, 0x0f, 0x80, 0x00, + 0x00, 0x0f, 0xc0, 0x00, + 0x00, 0x0f, 0xe0, 0x00, + 0x00, 0x0f, 0xf0, 0x00, + 0x03, 0x8f, 0xf8, 0x00, + 0x03, 0xcf, 0x7c, 0x00, + 0x03, 0xef, 0x3e, 0x00, + 0x01, 0xff, 0x1f, 0x00, + 0x00, 0xff, 0x1f, 0x00, + 0x00, 0x7f, 0x3e, 0x00, + 0x00, 0x3f, 0x7c, 0x00, + 0x00, 0x1f, 0xf8, 0x00, + 0x00, 0x0f, 0xf0, 0x00, + 0x00, 0x0f, 0xe0, 0x00, + 0x00, 0x0f, 0xe0, 0x00, + 0x00, 0x0f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, + 0x00, 0x3f, 0x7c, 0x00, + 0x00, 0x7f, 0x3e, 0x00, + 0x00, 0xff, 0x1f, 0x00, + 0x01, 0xff, 0x1f, 0x00, + 0x03, 0xef, 0x3e, 0x00, + 0x03, 0xcf, 0x7c, 0x00, + 0x03, 0x8f, 0xf8, 0x00, + 0x00, 0x0f, 0xf0, 0x00, + 0x00, 0x0f, 0xe0, 0x00, + 0x00, 0x0f, 0xc0, 0x00, + 0x00, 0x0f, 0x80, 0x00, + 0x00, 0x0f, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, +}; + +const lv_img_dsc_t ck_os_bt_connected = { + .header.always_zero = 0, + .header.w = 32, + .header.h = 32, + .data_size = 136, + .header.cf = LV_IMG_CF_INDEXED_1BIT, + .data = ck_os_bt_connected_map, +}; diff --git a/src/displayapp/icons/bluetooth/os_bt_connected.png b/src/displayapp/icons/bluetooth/os_bt_connected.png new file mode 100644 index 00000000..53716115 Binary files /dev/null and b/src/displayapp/icons/bluetooth/os_bt_connected.png differ diff --git a/src/displayapp/icons/bluetooth/os_bt_disconnected.c b/src/displayapp/icons/bluetooth/os_bt_disconnected.c new file mode 100644 index 00000000..930179b6 --- /dev/null +++ b/src/displayapp/icons/bluetooth/os_bt_disconnected.c @@ -0,0 +1,58 @@ +#include "lvgl/lvgl.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_CK_OS_BT_DISCONNECTED +#define LV_ATTRIBUTE_IMG_CK_OS_BT_DISCONNECTED +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BT_DISCONNECTED uint8_t ck_os_bt_disconnected_map[] = { + 0x6c, 0xfe, 0x6c, 0xff, /*Color of index 0*/ + 0xc4, 0xc2, 0xc4, 0xff, /*Color of index 1*/ + 0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 3*/ + + 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, + 0x0a, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, + 0x2a, 0x80, 0x00, 0x55, 0x40, 0x00, 0x00, 0x00, + 0x2a, 0xa0, 0x00, 0x55, 0x50, 0x00, 0x00, 0x00, + 0x0a, 0xa8, 0x00, 0x55, 0x54, 0x00, 0x00, 0x00, + 0x02, 0xaa, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, + 0x00, 0xaa, 0x80, 0x55, 0x55, 0x40, 0x00, 0x00, + 0x00, 0x2a, 0xa0, 0x55, 0x15, 0x50, 0x00, 0x00, + 0x00, 0x0a, 0xa8, 0x15, 0x05, 0x54, 0x00, 0x00, + 0x00, 0x02, 0xaa, 0x05, 0x01, 0x55, 0x00, 0x00, + 0x00, 0x00, 0xaa, 0x81, 0x01, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x2a, 0xa0, 0x05, 0x54, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0xa8, 0x15, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x02, 0xaa, 0x05, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2a, 0xa0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0xa8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x42, 0xaa, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x50, 0xaa, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x05, 0x54, 0x2a, 0xa0, 0x00, 0x00, + 0x00, 0x00, 0x15, 0x55, 0x0a, 0xa8, 0x00, 0x00, + 0x00, 0x00, 0x55, 0x55, 0x02, 0xaa, 0x00, 0x00, + 0x00, 0x01, 0x55, 0x55, 0x00, 0xaa, 0x80, 0x00, + 0x00, 0x05, 0x54, 0x55, 0x04, 0x2a, 0xa0, 0x00, + 0x00, 0x05, 0x50, 0x55, 0x15, 0x0a, 0xa8, 0x00, + 0x00, 0x05, 0x40, 0x55, 0x55, 0x42, 0xaa, 0x00, + 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0xaa, 0x80, + 0x00, 0x00, 0x00, 0x55, 0x54, 0x00, 0x2a, 0xa0, + 0x00, 0x00, 0x00, 0x55, 0x50, 0x00, 0x0a, 0xa8, + 0x00, 0x00, 0x00, 0x55, 0x40, 0x00, 0x02, 0xa8, + 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, +}; + +const lv_img_dsc_t ck_os_bt_disconnected = { + .header.always_zero = 0, + .header.w = 32, + .header.h = 32, + .data_size = 272, + .header.cf = LV_IMG_CF_INDEXED_2BIT, + .data = ck_os_bt_disconnected_map, +}; diff --git a/src/displayapp/icons/bluetooth/os_bt_disconnected.png b/src/displayapp/icons/bluetooth/os_bt_disconnected.png new file mode 100644 index 00000000..3275895d Binary files /dev/null and b/src/displayapp/icons/bluetooth/os_bt_disconnected.png differ diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index eb85be4f..71ba91c4 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include "ApplicationList.h" #include "Tile.h" diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h index a1e6811b..9c95acb8 100644 --- a/src/displayapp/screens/ApplicationList.h +++ b/src/displayapp/screens/ApplicationList.h @@ -1,13 +1,14 @@ #pragma once +#include #include -#include + +#include "components/ble/NimbleController.h" #include "Screen.h" #include "Label.h" #include "ScreenList.h" #include "Gauge.h" #include "Meter.h" -#include namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/Brightness.h b/src/displayapp/screens/Brightness.h index 37cbcd7e..7d599acf 100644 --- a/src/displayapp/screens/Brightness.h +++ b/src/displayapp/screens/Brightness.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include "components/brightness/BrightnessController.h" #include "Screen.h" namespace Pinetime { diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp index 06fab9aa..243d4c04 100644 --- a/src/displayapp/screens/Clock.cpp +++ b/src/displayapp/screens/Clock.cpp @@ -1,6 +1,7 @@ #include + #include -#include +#include "components/datetime/DateTimeController.h" #include #include "Clock.h" #include "../DisplayApp.h" diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index 7363fdaf..5753f6a3 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -2,12 +2,13 @@ #include #include + #include "Screen.h" #include #include #include -#include -#include +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/FirmwareUpdate.h b/src/displayapp/screens/FirmwareUpdate.h index faaf3953..893fe68c 100644 --- a/src/displayapp/screens/FirmwareUpdate.h +++ b/src/displayapp/screens/FirmwareUpdate.h @@ -2,11 +2,12 @@ #include #include + #include "Screen.h" #include #include #include -#include +#include "components/ble/BleController.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/FirmwareValidation.cpp b/src/displayapp/screens/FirmwareValidation.cpp index fb2dd956..2300b41d 100644 --- a/src/displayapp/screens/FirmwareValidation.cpp +++ b/src/displayapp/screens/FirmwareValidation.cpp @@ -2,7 +2,7 @@ #include "FirmwareValidation.h" #include "../DisplayApp.h" #include "../../Version.h" -#include "../../Components/FirmwareValidator/FirmwareValidator.h" +#include "components/firmwarevalidator/FirmwareValidator.h" using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; diff --git a/src/displayapp/screens/InfiniPaint.h b/src/displayapp/screens/InfiniPaint.h index a1592f97..fb4f979b 100644 --- a/src/displayapp/screens/InfiniPaint.h +++ b/src/displayapp/screens/InfiniPaint.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include "displayapp/LittleVgl.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/Music.h b/src/displayapp/screens/Music.h index 95cac0f0..d43d31cc 100644 --- a/src/displayapp/screens/Music.h +++ b/src/displayapp/screens/Music.h @@ -2,16 +2,17 @@ #include #include -#include +#include + +#include "components/gfx/Gfx.h" +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" +#include "components/ble/MusicService.h" #include "Screen.h" #include #include #include -#include -#include #include "../../Version.h" -#include -#include namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/ScreenList.h b/src/displayapp/screens/ScreenList.h index d873336d..b198634f 100644 --- a/src/displayapp/screens/ScreenList.h +++ b/src/displayapp/screens/ScreenList.h @@ -1,8 +1,8 @@ #pragma once #include -#include #include +#include "components/ble/NimbleController.h" #include "Screen.h" #include "Label.h" diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index fcafcf7d..8a3b8dbb 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include "SystemInfo.h" #include "../../Version.h" diff --git a/src/displayapp/screens/SystemInfo.h b/src/displayapp/screens/SystemInfo.h index ac8abae5..987a584b 100644 --- a/src/displayapp/screens/SystemInfo.h +++ b/src/displayapp/screens/SystemInfo.h @@ -1,13 +1,14 @@ #pragma once +#include #include -#include + +#include "components/ble/NimbleController.h" #include "Screen.h" #include "Label.h" #include "ScreenList.h" #include "Gauge.h" #include "Meter.h" -#include namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp index 1447d789..deb88472 100644 --- a/src/displayapp/screens/Tile.cpp +++ b/src/displayapp/screens/Tile.cpp @@ -1,8 +1,9 @@ #include #include #include + #include "Tile.h" -#include +#include "displayapp/DisplayApp.h" #include "Symbols.h" #include "../../Version.h" diff --git a/src/displayapp/screens/Tile.h b/src/displayapp/screens/Tile.h index 3136d892..cf5fcf15 100644 --- a/src/displayapp/screens/Tile.h +++ b/src/displayapp/screens/Tile.h @@ -5,7 +5,7 @@ #include #include "Modal.h" #include -#include +#include namespace Pinetime { namespace Applications { diff --git a/src/main.cpp b/src/main.cpp index fe413585..e3243362 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,29 +1,29 @@ #include #include +#include #include +#include +#include +#include #include #include -#include +#include "displayapp/DisplayApp.h" #include -#include -#include -#include -#include "Components/Battery/BatteryController.h" -#include "Components/Ble/BleController.h" +#include "components/datetime/DateTimeController.h" +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" +#include "components/ble/NotificationManager.h" #include #include #include -#include -#include -#include +#include "displayapp/LittleVgl.h" +#include #include #include #include #include #include -#include #include -#include #include #include @@ -32,7 +32,7 @@ #include "Logging/NrfLogger.h" Pinetime::Logging::NrfLogger logger; #else -#include "Logging/DummyLogger.h" +#include "logging/DummyLogger.h" Pinetime::Logging::DummyLogger logger; #endif diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 24f688e2..68f8ab53 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -1,9 +1,9 @@ #include #include #include -#include +#include "displayapp/LittleVgl.h" #include -#include +#include "components/ble/NotificationManager.h" #include #include #include "SystemTask.h" @@ -12,7 +12,7 @@ #include #include #include "../main.h" -#include "Components/Ble/NimbleController.h" +#include "components/ble/NimbleController.h" using namespace Pinetime::System; diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 40277cf3..1be28e3f 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -1,16 +1,17 @@ #pragma once +#include + #include #include -#include #include #include -#include -#include +#include "components/battery/BatteryController.h" +#include "displayapp/DisplayApp.h" #include #include #include "SystemMonitor.h" -#include "Components/Ble/NimbleController.h" +#include "components/ble/NimbleController.h" #include "timers.h" namespace Pinetime { -- cgit v1.2.3