diff options
79 files changed, 331 insertions, 1892 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0b8e876..6a729c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -366,34 +366,7 @@ set(QCBOR_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/batteryicon.c ) list(APPEND SOURCE_FILES @@ -403,14 +376,12 @@ list(APPEND SOURCE_FILES displayapp/screens/Screen.cpp displayapp/screens/Clock.cpp displayapp/screens/Tile.cpp - displayapp/screens/Meter.cpp displayapp/screens/InfiniPaint.cpp displayapp/screens/Paddle.cpp displayapp/screens/StopWatch.cpp displayapp/screens/BatteryIcon.cpp displayapp/screens/BleIcon.cpp displayapp/screens/NotificationIcon.cpp - displayapp/screens/Brightness.cpp displayapp/screens/SystemInfo.cpp displayapp/screens/Label.cpp displayapp/screens/FirmwareUpdate.cpp @@ -623,14 +594,12 @@ set(INCLUDE_FILES displayapp/screens/Screen.h displayapp/screens/Clock.h displayapp/screens/Tile.h - displayapp/screens/Meter.h displayapp/screens/InfiniPaint.h displayapp/screens/StopWatch.h displayapp/screens/Paddle.h displayapp/screens/BatteryIcon.h displayapp/screens/BleIcon.h displayapp/screens/NotificationIcon.h - displayapp/screens/Brightness.h displayapp/screens/SystemInfo.h displayapp/screens/ScreenList.h displayapp/screens/Label.h @@ -807,7 +776,7 @@ link_directories( ) -set(COMMON_FLAGS -MP -MD -mthumb -mabi=aapcs -Wall -Wextra -Warray-bounds=2 -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-nonliteral -ftree-vrp -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-expansion-to-defined -O2 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wreturn-type -Werror=return-type -fstack-usage -fno-exceptions -fno-non-call-exceptions) +set(COMMON_FLAGS -MP -MD -mthumb -mabi=aapcs -Wall -Wextra -Warray-bounds=2 -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-nonliteral -ftree-vrp -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-expansion-to-defined -O2 -Os -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wreturn-type -Werror=return-type -fstack-usage -fno-exceptions -fno-non-call-exceptions) add_definitions(-DCONFIG_GPIO_AS_PINRESET) add_definitions(-DNIMBLE_CFG_CONTROLLER) add_definitions(-DOS_CPUTIME_FREQ) @@ -841,10 +810,10 @@ add_library(nimble STATIC ${NIMBLE_SRC} ${TINYCRYPT_SRC}) target_include_directories(nimble SYSTEM PUBLIC . ../) target_include_directories(nimble SYSTEM PUBLIC ${INCLUDES_FROM_LIBS}) target_compile_options(nimble PRIVATE - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -Wno-unused-but-set-variable -Wno-maybe-uninitialized> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -Wno-unused-but-set-variable -Wno-maybe-uninitialized> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wno-unused-but-set-variable -Wno-maybe-uninitialized> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wno-unused-but-set-variable -Wno-maybe-uninitialized> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -853,10 +822,10 @@ add_library(lvgl STATIC ${LVGL_SRC}) target_include_directories(lvgl SYSTEM PUBLIC . ../) target_include_directories(lvgl SYSTEM PUBLIC ${INCLUDES_FROM_LIBS}) target_compile_options(lvgl PRIVATE - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -874,8 +843,8 @@ target_compile_definitions(QCBOR PUBLIC QCBOR_DISABLE_UNCOMMON_TAGS) target_compile_definitions(QCBOR PUBLIC USEFULBUF_CONFIG_LITTLE_ENDIAN) set_target_properties(QCBOR PROPERTIES LINKER_LANGUAGE C) target_compile_options(QCBOR PRIVATE - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS}> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -884,10 +853,10 @@ add_library(littlefs STATIC ${LITTLEFS_SRC}) target_include_directories(littlefs SYSTEM PUBLIC . ../) target_include_directories(littlefs SYSTEM PUBLIC ${INCLUDES_FROM_LIBS}) target_compile_options(littlefs PRIVATE - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wno-unused-function -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wno-unused-function -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wno-unused-function -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wno-unused-function -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wno-unused-function> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wno-unused-function> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wno-unused-function -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wno-unused-function -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -899,10 +868,10 @@ add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES}) set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_FILE_NAME}) target_link_libraries(${EXECUTABLE_NAME} nimble nrf-sdk lvgl littlefs QCBOR) target_compile_options(${EXECUTABLE_NAME} PUBLIC - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -929,10 +898,10 @@ add_executable(${EXECUTABLE_MCUBOOT_NAME} ${SOURCE_FILES}) target_link_libraries(${EXECUTABLE_MCUBOOT_NAME} nimble nrf-sdk lvgl littlefs QCBOR) set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_FILE_NAME}) target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -966,10 +935,10 @@ target_link_libraries(${EXECUTABLE_RECOVERY_NAME} nimble nrf-sdk littlefs QCBOR) set_target_properties(${EXECUTABLE_RECOVERY_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_FILE_NAME}) target_compile_definitions(${EXECUTABLE_RECOVERY_NAME} PUBLIC "PINETIME_IS_RECOVERY") target_compile_options(${EXECUTABLE_RECOVERY_NAME} PUBLIC - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -996,10 +965,10 @@ target_link_libraries(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} nimble nrf-sdk littlef set_target_properties(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}) target_compile_definitions(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC "PINETIME_IS_RECOVERY") target_compile_options(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) @@ -1033,10 +1002,10 @@ add_executable(${EXECUTABLE_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE_FILES}) target_link_libraries(${EXECUTABLE_RECOVERYLOADER_NAME} nrf-sdk QCBOR) set_target_properties(${EXECUTABLE_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERYLOADER_FILE_NAME}) target_compile_options(${EXECUTABLE_RECOVERYLOADER_NAME} PUBLIC - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) target_include_directories(${EXECUTABLE_RECOVERYLOADER_NAME} PUBLIC @@ -1066,10 +1035,10 @@ add_executable(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE target_link_libraries(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} nrf-sdk QCBOR) set_target_properties(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}) target_compile_options(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PUBLIC - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Os -fno-rtti> - $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS}> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -fno-rtti> + $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -fno-rtti> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> ) target_include_directories(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PUBLIC diff --git a/src/FreeRTOSConfig.h b/src/FreeRTOSConfig.h index f9c6b6c..b9b82b8 100644 --- a/src/FreeRTOSConfig.h +++ b/src/FreeRTOSConfig.h @@ -93,8 +93,8 @@ /* Software timer definitions. */ #define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY (1) -#define configTIMER_QUEUE_LENGTH 32 +#define configTIMER_TASK_PRIORITY (2) +#define configTIMER_QUEUE_LENGTH 4 #define configTIMER_TASK_STACK_DEPTH (300) /* Tickless Idle configuration. */ diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp index cd011f6..4131f3f 100644 --- a/src/components/alarm/AlarmController.cpp +++ b/src/components/alarm/AlarmController.cpp @@ -20,6 +20,12 @@ #include "app_timer.h" #include "task.h" #include <chrono> +#include <ratio> +#include <cstdint> + +namespace { + typedef std::chrono::duration< int64_t, std::ratio<1, configTICK_RATE_HZ> > ticks_t; +} using namespace Pinetime::Controllers; using namespace std::chrono_literals; @@ -36,7 +42,7 @@ namespace { void AlarmController::Init(System::SystemTask* systemTask) { this->systemTask = systemTask; - alarmAppTimer = xTimerCreate("alarmAppTm", 1, pdFALSE, this, SetOffAlarm); + alarmTimer = xTimerCreate("alarmAppTm", 1, pdFALSE, this, SetOffAlarm); } void AlarmController::SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin) { @@ -45,25 +51,26 @@ void AlarmController::SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin) { } void AlarmController::OnAdjustTime() { + if (state != AlarmState::Set) { + return; + } - if (state != AlarmState::Set) { return; } - - xTimerStop(alarmAppTimer, 0); + xTimerStop(alarmTimer, 0); auto now = dateTimeController.CurrentDateTime(); - if (now > alarmTime) { - xTimerChangePeriod(alarmAppTimer, 1, 0); + if (now >= alarmTime) { + xTimerChangePeriod(alarmTimer, 1, 0); } else { - auto mSecToAlarm = std::chrono::duration_cast<std::chrono::milliseconds>(alarmTime - now).count(); - xTimerChangePeriod(alarmAppTimer, APP_TIMER_TICKS(mSecToAlarm), 0); + auto ticksToAlarm = std::chrono::duration_cast<ticks_t>(alarmTime - now).count(); + xTimerChangePeriod(alarmTimer, ++ticksToAlarm, 0); } - xTimerStart(alarmAppTimer, 0); + xTimerStart(alarmTimer, 0); } void AlarmController::ScheduleAlarm() { // Determine the next time the alarm needs to go off and set the timer - xTimerStop(alarmAppTimer, 0); + xTimerStop(alarmTimer, 0); auto now = dateTimeController.CurrentDateTime(); alarmTime = now; @@ -94,9 +101,9 @@ void AlarmController::ScheduleAlarm() { // now can convert back to a time_point alarmTime = std::chrono::system_clock::from_time_t(std::mktime(tmAlarmTime)); - auto mSecToAlarm = std::chrono::duration_cast<std::chrono::milliseconds>(alarmTime - now).count(); - xTimerChangePeriod(alarmAppTimer, APP_TIMER_TICKS(mSecToAlarm), 0); - xTimerStart(alarmAppTimer, 0); + auto ticksToAlarm = std::chrono::duration_cast<ticks_t>(alarmTime - now).count(); + xTimerChangePeriod(alarmTimer, ticksToAlarm, 0); + xTimerStart(alarmTimer, 0); state = AlarmState::Set; } @@ -106,7 +113,7 @@ uint32_t AlarmController::SecondsToAlarm() { } void AlarmController::DisableAlarm() { - xTimerStop(alarmAppTimer, 0); + xTimerStop(alarmTimer, 0); state = AlarmState::Not_Set; } diff --git a/src/components/alarm/AlarmController.h b/src/components/alarm/AlarmController.h index 6ad220f..a4f0c67 100644 --- a/src/components/alarm/AlarmController.h +++ b/src/components/alarm/AlarmController.h @@ -64,7 +64,7 @@ namespace Pinetime { private: Controllers::DateTime& dateTimeController; System::SystemTask* systemTask = nullptr; - TimerHandle_t alarmAppTimer; + TimerHandle_t alarmTimer; uint8_t hours = 7; uint8_t minutes = 0; std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> alarmTime; diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp index 300d097..8575fff 100644 --- a/src/components/battery/BatteryController.cpp +++ b/src/components/battery/BatteryController.cpp @@ -61,7 +61,7 @@ void Battery::SaadcInit() { void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) { const uint16_t battery_max = 4180; // maximum voltage of battery ( max charging voltage is 4.21 ) - const uint16_t battery_min = 3200; // minimum voltage of battery before shutdown ( depends on the battery ) + const uint16_t battery_min = 3600; // battery voltage corresponding to 0% if (p_event->type == NRFX_SAADC_EVT_DONE) { diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 5c5aad2..2ec77c3 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -12,14 +12,12 @@ #include "components/motion/MotionController.h" #include "components/motor/MotorController.h" #include "displayapp/screens/ApplicationList.h" -#include "displayapp/screens/Brightness.h" #include "displayapp/screens/Clock.h" #include "displayapp/screens/FirmwareUpdate.h" #include "displayapp/screens/FirmwareValidation.h" #include "displayapp/screens/InfiniPaint.h" #include "displayapp/screens/Paddle.h" #include "displayapp/screens/StopWatch.h" -#include "displayapp/screens/Meter.h" #include "displayapp/screens/Metronome.h" #include "displayapp/screens/Music.h" #include "displayapp/screens/Navigation.h" diff --git a/src/displayapp/fonts/neofont.c b/src/displayapp/fonts/neofont.c index b4ec7d5..1c115e1 100644 --- a/src/displayapp/fonts/neofont.c +++ b/src/displayapp/fonts/neofont.c @@ -730,21 +730,17 @@ static const uint8_t glyphs[96][2] = { * Store the result in `dsc_out`. * The next letter (`unicode_letter_next`) might be used to calculate the width required by this glyph (kerning) */ -static bool neofont0mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - /*Your code here*/ - - /* Store the result. - * For example ... - */ - dsc_out->adv_w = 4; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 5; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 3; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 0; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = 0; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ +static bool neofont0mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if (unicode_letter < 32) { + return false; + } + dsc_out->adv_w = 4; + dsc_out->box_h = 5; + dsc_out->box_w = 3; + dsc_out->ofs_x = 0; + dsc_out->ofs_y = 0; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ @@ -793,14 +789,6 @@ lv_font_t neofont0mono = { .user_data = 0 /*Optionally some extra user data*/ }; -static bool neofont1mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - /*Your code here*/ - - /* Store the result. - * For example ... - */ - // ######..###### // ##::::..::##:: // ######..::##:: @@ -818,14 +806,17 @@ static bool neofont1mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_ // ######..::##::.. // ######..::##::.. - dsc_out->adv_w = 8; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 10; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 6; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 1; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -1; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ +static bool neofont1mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if (unicode_letter < 32) { + return false; + } + dsc_out->adv_w = 8; + dsc_out->box_h = 10; + dsc_out->box_w = 6; + dsc_out->ofs_x = 1; + dsc_out->ofs_y = -1; + dsc_out->bpp = 1; + return true; } #if 0 @@ -973,16 +964,17 @@ lv_font_t neofont1mono = { .user_data = 0 /*Optionally some extra user data*/ }; -static bool neofont15mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - dsc_out->adv_w = 12; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 15; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 9; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 1; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -1; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ +static bool neofont15mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if (unicode_letter < 32) { + return false; + } + dsc_out->adv_w = 12; + dsc_out->box_h = 15; + dsc_out->box_w = 9; + dsc_out->ofs_x = 1; + dsc_out->ofs_y = -1; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ @@ -1085,15 +1077,17 @@ lv_font_t neofont15mono = { * Store the result in `dsc_out`. * The next letter (`unicode_letter_next`) might be used to calculate the width required by this glyph (kerning) */ -static bool neofont2mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - dsc_out->adv_w = 16; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 20; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 12; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 2; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -2; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - return true; /*true: glyph found; false: glyph was not found*/ +static bool neofont2mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if (unicode_letter < 32) { + return false; + } + dsc_out->adv_w = 16; + dsc_out->box_h = 20; + dsc_out->box_w = 12; + dsc_out->ofs_x = 2; + dsc_out->ofs_y = -2; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ @@ -1185,15 +1179,17 @@ lv_font_t neofont2mono = { * Store the result in `dsc_out`. * The next letter (`unicode_letter_next`) might be used to calculate the width required by this glyph (kerning) */ -static bool neofont3mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - dsc_out->adv_w = 32; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 40; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 24; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 4; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -4; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - return true; /*true: glyph found; false: glyph was not found*/ +static bool neofont3mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if (unicode_letter < 32) { + return false; + } + dsc_out->adv_w = 32; + dsc_out->box_h = 40; + dsc_out->box_w = 24; + dsc_out->ofs_x = 4; + dsc_out->ofs_y = -4; + dsc_out->bpp = 1; + return true; } static void mono_bitmap_scale_4( @@ -1293,15 +1289,17 @@ static bool isthin(uint32_t unicode_letter) { } static bool neofont3_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { - // if (unicode_letter == '\n') { return false; } + if (unicode_letter < 32) { + return false; + } bool thin = isthin(unicode_letter); - dsc_out->adv_w = thin ? 16 : (unicode_letter >= 0xF8000 ? 24 : 32); /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 40; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 24; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = thin ? (4-8) : 4; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -4; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - return true; /*true: glyph found; false: glyph was not found*/ + dsc_out->adv_w = thin ? 16 : (unicode_letter >= 0xF8000 ? 24 : 32); + dsc_out->box_h = 40; + dsc_out->box_w = 24; + dsc_out->ofs_x = thin ? (4-8) : 4; + dsc_out->ofs_y = -4; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ @@ -1335,17 +1333,18 @@ lv_font_t neofont3 = { * Store the result in `dsc_out`. * The next letter (`unicode_letter_next`) might be used to calculate the width required by this glyph (kerning) */ -static bool neofont2_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - // if (unicode_letter == '\n') { return false; } +static bool neofont2_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if (unicode_letter < 32) { + return false; + } bool thin = isthin(unicode_letter); - dsc_out->adv_w = thin ? 8 : (unicode_letter >= 0xF8000 ? 12 : 16); /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 20; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 12; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = thin ? (2-4) : 2; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -2; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - return true; /*true: glyph found; false: glyph was not found*/ + dsc_out->adv_w = thin ? 8 : (unicode_letter >= 0xF8000 ? 12 : 16); + dsc_out->box_h = 20; + dsc_out->box_w = 12; + dsc_out->ofs_x = thin ? (2-4) : 2; + dsc_out->ofs_y = -2; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ @@ -1376,16 +1375,17 @@ lv_font_t neofont2 = { }; static bool neofont15_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { - // if (unicode_letter == '\n') { return false; } + if (unicode_letter < 32) { + return false; + } bool thin = isthin(unicode_letter); dsc_out->adv_w = thin ? 6 : (unicode_letter >= 0xF8000 ? 9 : 12); /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 15; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 9; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = thin ? (1-3) : 1; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -1; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ + dsc_out->box_h = 15; + dsc_out->box_w = 9; + dsc_out->ofs_x = thin ? (1-3) : 1; + dsc_out->ofs_y = -1; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ @@ -1416,16 +1416,17 @@ lv_font_t neofont15 = { }; static bool neofont1_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { - // if (unicode_letter == '\n') { return false; } + if (unicode_letter < 32) { + return false; + } bool thin = isthin(unicode_letter); - dsc_out->adv_w = thin ? 4 : (unicode_letter >= 0xF8000 ? 6 : 8); /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 10; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 6; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = thin ? (1-2) : 1; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -1; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ + dsc_out->adv_w = thin ? 4 : (unicode_letter >= 0xF8000 ? 6 : 8); + dsc_out->box_h = 10; + dsc_out->box_w = 6; + dsc_out->ofs_x = thin ? (1-2) : 1; + dsc_out->ofs_y = -1; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ @@ -1456,16 +1457,17 @@ lv_font_t neofont1 = { }; static bool neofont0_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { - // if (unicode_letter == '\n') { return false; } + if (unicode_letter < 32) { + return false; + } bool thin = isthin(unicode_letter); - dsc_out->adv_w = thin ? 2 : (unicode_letter >= 0xF8000 ? 3 : 4); /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 5; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 3; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = thin ? (0-1) : 0; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = 0; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ + dsc_out->adv_w = thin ? 2 : (unicode_letter >= 0xF8000 ? 3 : 4); + dsc_out->box_h = 5; + dsc_out->box_w = 3; + dsc_out->ofs_x = thin ? (0-1) : 0; + dsc_out->ofs_y = 0; + dsc_out->bpp = 1; + return true; } /* Get the bitmap of `unicode_letter` from `font`. */ diff --git a/src/displayapp/icons/battery/battery.png b/src/displayapp/icons/battery/battery.png Binary files differnew file mode 100644 index 0000000..0fca804 --- /dev/null +++ b/src/displayapp/icons/battery/battery.png diff --git a/src/displayapp/icons/battery/batteryicon.c b/src/displayapp/icons/battery/batteryicon.c new file mode 100644 index 0000000..05ddf16 --- /dev/null +++ b/src/displayapp/icons/battery/batteryicon.c @@ -0,0 +1,52 @@ +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) +#include "lvgl.h" +#else +#include "lvgl/lvgl.h" +#endif + + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_BATTERYICON +#define LV_ATTRIBUTE_IMG_BATTERYICON +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BATTERYICON uint8_t batteryicon_map[] = { + 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ + 0x6a, 0xfc, 0x6c, 0xff, /*Color of index 1*/ + + 0xe0, 0x70, + 0xe0, 0x70, + 0x00, 0x00, + 0x00, 0x00, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x3f, 0xc0, + 0x00, 0x00, + 0x00, 0x00, +}; + +const lv_img_dsc_t batteryicon = { + { + LV_IMG_CF_INDEXED_1BIT, + 0, + 0, + 12, + 20, + }, + 48, + batteryicon_map, +}; 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 64832b5..0000000 --- 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 Binary files differdeleted file mode 100644 index 963767b..0000000 --- a/src/displayapp/icons/battery/os_battery_005.png +++ /dev/null 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 f36b684..0000000 --- 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 Binary files differdeleted file mode 100644 index 68a9f40..0000000 --- a/src/displayapp/icons/battery/os_battery_010.png +++ /dev/null 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 3f648fb..0000000 --- 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 Binary files differdeleted file mode 100644 index 32eca65..0000000 --- a/src/displayapp/icons/battery/os_battery_020.png +++ /dev/null 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 4d5719b..0000000 --- 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 Binary files differdeleted file mode 100644 index aeb5eb1..0000000 --- a/src/displayapp/icons/battery/os_battery_030.png +++ /dev/null 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 0606fc3..0000000 --- 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 Binary files differdeleted file mode 100644 index d84fda4..0000000 --- a/src/displayapp/icons/battery/os_battery_040.png +++ /dev/null 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 8732dc7..0000000 --- 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 Binary files differdeleted file mode 100644 index 224d38d..0000000 --- a/src/displayapp/icons/battery/os_battery_050.png +++ /dev/null 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 a65936b..0000000 --- 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 Binary files differdeleted file mode 100644 index e5e00ed..0000000 --- a/src/displayapp/icons/battery/os_battery_060.png +++ /dev/null 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 949c0b8..0000000 --- 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 Binary files differdeleted file mode 100644 index dee969b..0000000 --- a/src/displayapp/icons/battery/os_battery_070.png +++ /dev/null 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 f447370..0000000 --- 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 Binary files differdeleted file mode 100644 index 3b13fbb..0000000 --- a/src/displayapp/icons/battery/os_battery_080.png +++ /dev/null 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 6fa41b2..0000000 --- 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 Binary files differdeleted file mode 100644 index d79f396..0000000 --- a/src/displayapp/icons/battery/os_battery_090.png +++ /dev/null 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 92cf9a4..0000000 --- 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 Binary files differdeleted file mode 100644 index dd0d306..0000000 --- a/src/displayapp/icons/battery/os_battery_100.png +++ /dev/null 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 af6aba5..0000000 --- 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 Binary files differdeleted file mode 100644 index 4c7632f..0000000 --- a/src/displayapp/icons/battery/os_battery_error.png +++ /dev/null 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 1b0c71d..0000000 --- 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 Binary files differdeleted file mode 100644 index f9545bc..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_005.png +++ /dev/null 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 304c018..0000000 --- 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 Binary files differdeleted file mode 100644 index 04d5f82..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_010.png +++ /dev/null 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 1721be1..0000000 --- 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 Binary files differdeleted file mode 100644 index 6416e1e..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_020.png +++ /dev/null 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 83101fd..0000000 --- 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 Binary files differdeleted file mode 100644 index 96b44d2..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_030.png +++ /dev/null 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 02af00e..0000000 --- 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 Binary files differdeleted file mode 100644 index 5a42caf..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_040.png +++ /dev/null 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 d2eea82..0000000 --- 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 Binary files differdeleted file mode 100644 index ca0e04d..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_050.png +++ /dev/null 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 05f8b97..0000000 --- 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 Binary files differdeleted file mode 100644 index 2930068..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_060.png +++ /dev/null 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 ac3e319..0000000 --- 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 Binary files differdeleted file mode 100644 index 7d5f55d..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_070.png +++ /dev/null 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 cc1c1d2..0000000 --- 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 Binary files differdeleted file mode 100644 index cce5052..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_080.png +++ /dev/null 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 85e1c26..0000000 --- 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 Binary files differdeleted file mode 100644 index fc7b443..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_090.png +++ /dev/null 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 8dec0cb..0000000 --- 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 Binary files differdeleted file mode 100644 index 7c8ce0c..0000000 --- a/src/displayapp/icons/battery/os_batterycharging_100.png +++ /dev/null diff --git a/src/displayapp/icons/bluetooth/ck_os_bt_connected.png b/src/displayapp/icons/bluetooth/ck_os_bt_connected.png Binary files differdeleted file mode 100644 index 5371611..0000000 --- a/src/displayapp/icons/bluetooth/ck_os_bt_connected.png +++ /dev/null diff --git a/src/displayapp/icons/bluetooth/ck_os_bt_disconnected.png b/src/displayapp/icons/bluetooth/ck_os_bt_disconnected.png Binary files differdeleted file mode 100644 index 3275895..0000000 --- a/src/displayapp/icons/bluetooth/ck_os_bt_disconnected.png +++ /dev/null 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 d30dc9d..0000000 --- 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 Binary files differdeleted file mode 100644 index 5371611..0000000 --- a/src/displayapp/icons/bluetooth/os_bt_connected.png +++ /dev/null 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 930179b..0000000 --- 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 Binary files differdeleted file mode 100644 index 3275895..0000000 --- a/src/displayapp/icons/bluetooth/os_bt_disconnected.png +++ /dev/null diff --git a/src/displayapp/screens/BatteryIcon.cpp b/src/displayapp/screens/BatteryIcon.cpp index 08aaab7..4c8c2b2 100644 --- a/src/displayapp/screens/BatteryIcon.cpp +++ b/src/displayapp/screens/BatteryIcon.cpp @@ -1,23 +1,30 @@ #include "displayapp/screens/BatteryIcon.h" #include <cstdint> #include "displayapp/screens/Symbols.h" +#include "displayapp/icons/battery/batteryicon.c" using namespace Pinetime::Applications::Screens; -const char* BatteryIcon::GetBatteryIcon(uint8_t batteryPercent) { - if (batteryPercent > 87) - return Symbols::batteryFull; - if (batteryPercent > 62) - return Symbols::batteryThreeQuarter; - if (batteryPercent > 37) - return Symbols::batteryHalf; - if (batteryPercent > 12) - return Symbols::batteryOneQuarter; - return Symbols::batteryEmpty; +void BatteryIcon::Create(lv_obj_t* parent) { + batteryImg = lv_img_create(parent, nullptr); + lv_img_set_src(batteryImg, &batteryicon); + lv_obj_set_style_local_image_recolor(batteryImg, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + + batteryJuice = lv_obj_create(batteryImg, nullptr); + lv_obj_set_width(batteryJuice, 8); + lv_obj_align(batteryJuice, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -2, -2); + lv_obj_set_style_local_radius(batteryJuice, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 0); +} + +void BatteryIcon::SetBatteryPercentage(uint8_t percentage) { + lv_obj_set_height(batteryJuice, percentage * 14 / 100); + lv_obj_realign(batteryJuice); } -const char* BatteryIcon::GetUnknownIcon() { - return Symbols::batteryEmpty; +void BatteryIcon::SetColor(lv_color_t color) { + lv_obj_set_style_local_image_recolor(batteryImg, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, color); + lv_obj_set_style_local_image_recolor_opa(batteryImg, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_COVER); + lv_obj_set_style_local_bg_color(batteryJuice, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, color); } const char* BatteryIcon::GetPlugIcon(bool isCharging) { diff --git a/src/displayapp/screens/BatteryIcon.h b/src/displayapp/screens/BatteryIcon.h index bec2e4e..2f76466 100644 --- a/src/displayapp/screens/BatteryIcon.h +++ b/src/displayapp/screens/BatteryIcon.h @@ -1,15 +1,27 @@ #pragma once #include <cstdint> +#include <lvgl/src/lv_core/lv_obj.h> namespace Pinetime { namespace Applications { namespace Screens { class BatteryIcon { public: + void Create(lv_obj_t* parent); + + void SetColor(lv_color_t); + void SetBatteryPercentage(uint8_t percentage); + inline lv_obj_t* GetObject() { + return batteryImg; + } + static const char* GetUnknownIcon(); - static const char* GetBatteryIcon(uint8_t batteryPercent); static const char* GetPlugIcon(bool isCharging); + + private: + lv_obj_t* batteryImg; + lv_obj_t* batteryJuice; }; } } -}
\ No newline at end of file +} diff --git a/src/displayapp/screens/Brightness.cpp b/src/displayapp/screens/Brightness.cpp deleted file mode 100644 index d9901ae..0000000 --- a/src/displayapp/screens/Brightness.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "displayapp/screens/Brightness.h" -#include <lvgl/lvgl.h> - -using namespace Pinetime::Applications::Screens; - -void slider_event_cb(lv_obj_t* slider, lv_event_t event) { - if (event == LV_EVENT_VALUE_CHANGED) { - auto* brightnessSlider = static_cast<Brightness*>(slider->user_data); - brightnessSlider->OnValueChanged(); - } -} - -Brightness::Brightness(Pinetime::Applications::DisplayApp* app, Controllers::BrightnessController& brightness) - : Screen(app), brightness {brightness} { - slider = lv_slider_create(lv_scr_act(), nullptr); - lv_obj_set_user_data(slider, this); - lv_obj_set_width(slider, LV_DPI * 2); - lv_obj_align(slider, nullptr, LV_ALIGN_CENTER, 0, 0); - lv_obj_set_event_cb(slider, slider_event_cb); - lv_slider_set_range(slider, 0, 2); - lv_slider_set_value(slider, LevelToInt(brightness.Level()), LV_ANIM_OFF); - - slider_label = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(slider_label, LevelToString(brightness.Level())); - lv_obj_set_auto_realign(slider_label, true); - lv_obj_align(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 30); -} - -Brightness::~Brightness() { - lv_obj_clean(lv_scr_act()); -} - -const char* Brightness::LevelToString(Pinetime::Controllers::BrightnessController::Levels level) { - switch (level) { - case Pinetime::Controllers::BrightnessController::Levels::Off: - return "Off"; - case Pinetime::Controllers::BrightnessController::Levels::Low: - return "Low"; - case Pinetime::Controllers::BrightnessController::Levels::Medium: - return "Medium"; - case Pinetime::Controllers::BrightnessController::Levels::High: - return "High"; - default: - return "???"; - } -} - -void Brightness::OnValueChanged() { - SetValue(lv_slider_get_value(slider)); -} - -void Brightness::SetValue(uint8_t value) { - switch (value) { - case 0: - brightness.Set(Controllers::BrightnessController::Levels::Low); - break; - case 1: - brightness.Set(Controllers::BrightnessController::Levels::Medium); - break; - case 2: - brightness.Set(Controllers::BrightnessController::Levels::High); - break; - } - lv_label_set_text(slider_label, LevelToString(brightness.Level())); -} - -uint8_t Brightness::LevelToInt(Pinetime::Controllers::BrightnessController::Levels level) { - switch (level) { - case Pinetime::Controllers::BrightnessController::Levels::Off: - return 0; - case Pinetime::Controllers::BrightnessController::Levels::Low: - return 0; - case Pinetime::Controllers::BrightnessController::Levels::Medium: - return 1; - case Pinetime::Controllers::BrightnessController::Levels::High: - return 2; - default: - return 0; - } -} - -bool Brightness::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - switch (event) { - case TouchEvents::SwipeLeft: - brightness.Lower(); - if (brightness.Level() == Pinetime::Controllers::BrightnessController::Levels::Off) { - brightness.Set(Controllers::BrightnessController::Levels::Low); - } - SetValue(); - return true; - case TouchEvents::SwipeRight: - brightness.Higher(); - SetValue(); - return true; - default: - return false; - } -} - -void Brightness::SetValue() { - lv_slider_set_value(slider, LevelToInt(brightness.Level()), LV_ANIM_OFF); - lv_label_set_text(slider_label, LevelToString(brightness.Level())); -} diff --git a/src/displayapp/screens/Brightness.h b/src/displayapp/screens/Brightness.h deleted file mode 100644 index 693570c..0000000 --- a/src/displayapp/screens/Brightness.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include <lvgl/src/lv_core/lv_obj.h> -#include <cstdint> -#include "displayapp/screens/Screen.h" -#include "components/brightness/BrightnessController.h" - -namespace Pinetime { - namespace Applications { - namespace Screens { - class Brightness : public Screen { - public: - Brightness(DisplayApp* app, Controllers::BrightnessController& brightness); - ~Brightness() override; - - bool OnTouchEvent(TouchEvents event) override; - - void OnValueChanged(); - - private: - Controllers::BrightnessController& brightness; - - lv_obj_t* slider_label; - lv_obj_t* slider; - - const char* LevelToString(Controllers::BrightnessController::Levels level); - uint8_t LevelToInt(Controllers::BrightnessController::Levels level); - void SetValue(uint8_t value); - void SetValue(); - }; - } - } -} diff --git a/src/displayapp/screens/Meter.cpp b/src/displayapp/screens/Meter.cpp deleted file mode 100644 index 9c85310..0000000 --- a/src/displayapp/screens/Meter.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "displayapp/screens/Meter.h" -#include <lvgl/lvgl.h> -#include "displayapp/DisplayApp.h" - -using namespace Pinetime::Applications::Screens; - -Meter::Meter(Pinetime::Applications::DisplayApp* app) : Screen(app) { - - /*Create a line meter */ - lmeter = lv_linemeter_create(lv_scr_act(), nullptr); - lv_linemeter_set_range(lmeter, 0, 60); /*Set the range*/ - lv_linemeter_set_value(lmeter, value); /*Set the current value*/ - lv_linemeter_set_angle_offset(lmeter, 180); - lv_linemeter_set_scale(lmeter, 360, 60); /*Set the angle and number of lines*/ - - lv_obj_set_style_local_scale_end_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(255, 0, 0)); - lv_obj_set_style_local_scale_grad_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(160, 0, 0)); - lv_obj_set_style_local_line_width(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, 2); - lv_obj_set_style_local_line_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_SILVER); - - lv_obj_set_size(lmeter, 200, 200); - lv_obj_align(lmeter, nullptr, LV_ALIGN_CENTER, 0, 0); - - taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); -} - -Meter::~Meter() { - lv_task_del(taskRefresh); - lv_obj_clean(lv_scr_act()); -} - -void Meter::Refresh() { - lv_linemeter_set_value(lmeter, value++); /*Set the current value*/ - if (value >= 60) - value = 0; -} diff --git a/src/displayapp/screens/Meter.h b/src/displayapp/screens/Meter.h deleted file mode 100644 index 50d9f83..0000000 --- a/src/displayapp/screens/Meter.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include <cstdint> -#include "displayapp/screens/Screen.h" -#include <lvgl/src/lv_core/lv_style.h> -#include <lvgl/src/lv_core/lv_obj.h> - -namespace Pinetime { - namespace Applications { - namespace Screens { - - class Meter : public Screen { - public: - Meter(DisplayApp* app); - ~Meter() override; - - void Refresh() override; - - private: - lv_style_t style_lmeter; - lv_obj_t* lmeter; - - uint32_t value = 0; - - lv_task_t* taskRefresh; - }; - } - } -} diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp index c63b5ac..3cb811a 100644 --- a/src/displayapp/screens/Tile.cpp +++ b/src/displayapp/screens/Tile.cpp @@ -33,14 +33,12 @@ Tile::Tile(uint8_t screenID, // Time label_time = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); lv_obj_align(label_time, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); // Battery - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); - lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, -8, 0); + batteryIcon.Create(lv_scr_act()); + lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_RIGHT, -8, 0); if (numScreens > 1) { pageIndicatorBasePoints[0].x = LV_HOR_RES - 1; @@ -111,6 +109,8 @@ Tile::Tile(uint8_t screenID, lv_label_set_text_static(backgroundLabel, ""); taskUpdate = lv_task_create(lv_update_task, 5000, LV_TASK_PRIO_MID, this); + + UpdateScreen(); } Tile::~Tile() { @@ -120,7 +120,7 @@ Tile::~Tile() { void Tile::UpdateScreen() { lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); + batteryIcon.SetBatteryPercentage(batteryController.PercentRemaining()); } void Tile::OnValueChangedEvent(lv_obj_t* obj, uint32_t buttonId) { diff --git a/src/displayapp/screens/Tile.h b/src/displayapp/screens/Tile.h index 1d4b7b6..ae85dea 100644 --- a/src/displayapp/screens/Tile.h +++ b/src/displayapp/screens/Tile.h @@ -9,6 +9,7 @@ #include "components/settings/Settings.h" #include "components/datetime/DateTimeController.h" #include "components/battery/BatteryController.h" +#include <displayapp/screens/BatteryIcon.h> namespace Pinetime { namespace Applications { @@ -40,13 +41,14 @@ namespace Pinetime { lv_task_t* taskUpdate; lv_obj_t* label_time; - lv_obj_t* batteryIcon; lv_point_t pageIndicatorBasePoints[2]; lv_point_t pageIndicatorPoints[2]; lv_obj_t* pageIndicatorBase; lv_obj_t* pageIndicator; lv_obj_t* btnm1; + BatteryIcon batteryIcon; + const char* btnmMap[8]; Pinetime::Applications::Apps apps[6]; }; diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index 4cfc969..c1df675 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -66,10 +66,13 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app, lv_img_set_src(bg_clock_img, &bg_clock); lv_obj_align(bg_clock_img, NULL, LV_ALIGN_CENTER, 0, 0); - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_static(batteryIcon, Symbols::batteryHalf); - lv_obj_align(batteryIcon, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 0); - lv_obj_set_auto_realign(batteryIcon, true); + batteryIcon.Create(lv_scr_act()); + lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); + + plugIcon = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(plugIcon, Symbols::plug); + lv_obj_set_style_local_text_color(plugIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); + lv_obj_align(plugIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); notificationIcon = lv_label_create(lv_scr_act(), NULL); lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00)); @@ -121,7 +124,8 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app, lv_obj_add_style(hour_body_trace, LV_LINE_PART_MAIN, &hour_line_style_trace); taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); - UpdateClock(); + + Refresh(); } WatchFaceAnalog::~WatchFaceAnalog() { @@ -180,21 +184,18 @@ void WatchFaceAnalog::UpdateClock() { void WatchFaceAnalog::SetBatteryIcon() { auto batteryPercent = batteryPercentRemaining.Get(); - if (batteryPercent == 100) { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); - } else { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); - } - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); + batteryIcon.SetBatteryPercentage(batteryPercent); } void WatchFaceAnalog::Refresh() { isCharging = batteryController.IsCharging(); if (isCharging.IsUpdated()) { if (isCharging.Get()) { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); - lv_label_set_text_static(batteryIcon, Symbols::plug); + lv_obj_set_hidden(batteryIcon.GetObject(), true); + lv_obj_set_hidden(plugIcon, false); } else { + lv_obj_set_hidden(batteryIcon.GetObject(), false); + lv_obj_set_hidden(plugIcon, true); SetBatteryIcon(); } } diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index 4d76298..04d9e71 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -9,6 +9,7 @@ #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" +#include <displayapp/screens/BatteryIcon.h> namespace Pinetime { namespace Controllers { @@ -64,9 +65,11 @@ namespace Pinetime { lv_style_t second_line_style; lv_obj_t* label_date_day; - lv_obj_t* batteryIcon; + lv_obj_t* plugIcon; lv_obj_t* notificationIcon; + BatteryIcon batteryIcon; + const Controllers::DateTime& dateTimeController; Controllers::Battery& batteryController; Controllers::Ble& bleController; diff --git a/src/displayapp/screens/WatchFaceAnalog24.cpp b/src/displayapp/screens/WatchFaceAnalog24.cpp index 5e37e7b..500243e 100644 --- a/src/displayapp/screens/WatchFaceAnalog24.cpp +++ b/src/displayapp/screens/WatchFaceAnalog24.cpp @@ -70,15 +70,18 @@ WatchFaceAnalog24::WatchFaceAnalog24(Pinetime::Applications::DisplayApp* app, lv_img_set_src(bg_clock_img, &bg_analog24); lv_obj_align(bg_clock_img, nullptr, LV_ALIGN_CENTER, 0, 0); - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(batteryIcon, Symbols::batteryHalf); - lv_obj_align(batteryIcon, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 0); - lv_obj_set_auto_realign(batteryIcon, true); + batteryIcon.Create(lv_scr_act()); + lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); + + plugIcon = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(plugIcon, Symbols::plug); + lv_obj_set_style_local_text_color(plugIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); + lv_obj_align(plugIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); bleIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x0082FC)); lv_label_set_text_static(bleIcon, Symbols::bluetooth); - lv_obj_align(bleIcon, batteryIcon, LV_ALIGN_OUT_BOTTOM_RIGHT, 0, 0); + lv_obj_align(bleIcon, plugIcon, LV_ALIGN_OUT_BOTTOM_RIGHT, 0, 0); lv_obj_set_auto_realign(bleIcon, true); notificationIcon = lv_label_create(lv_scr_act(), NULL); @@ -180,21 +183,18 @@ void WatchFaceAnalog24::UpdateClock() { void WatchFaceAnalog24::SetBatteryIcon() { auto batteryPercent = batteryPercentRemaining.Get(); - if (batteryPercent == 100) { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); - } else { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); - } - lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); + batteryIcon.SetBatteryPercentage(batteryPercent); } void WatchFaceAnalog24::Refresh() { isCharging = batteryController.IsCharging(); if (isCharging.IsUpdated()) { if (isCharging.Get()) { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); - lv_label_set_text(batteryIcon, Symbols::plug); + lv_obj_set_hidden(batteryIcon.GetObject(), true); + lv_obj_set_hidden(plugIcon, false); } else { + lv_obj_set_hidden(batteryIcon.GetObject(), false); + lv_obj_set_hidden(plugIcon, true); SetBatteryIcon(); } } diff --git a/src/displayapp/screens/WatchFaceAnalog24.h b/src/displayapp/screens/WatchFaceAnalog24.h index 5df8979..033519a 100644 --- a/src/displayapp/screens/WatchFaceAnalog24.h +++ b/src/displayapp/screens/WatchFaceAnalog24.h @@ -11,6 +11,7 @@ #include "components/ble/NotificationManager.h" #include "components/heartrate/HeartRateController.h" #include "components/motion/MotionController.h" +#include <displayapp/screens/BatteryIcon.h> namespace Pinetime { namespace Controllers { @@ -65,7 +66,7 @@ namespace Pinetime { lv_style_t hour_line_style_trace; // lv_obj_t* label_date_day; - lv_obj_t* batteryIcon; + lv_obj_t* plugIcon; lv_obj_t* bleIcon; lv_obj_t* heartbeatIcon; lv_obj_t* heartbeatValue; @@ -73,6 +74,8 @@ namespace Pinetime { lv_obj_t* stepValue; lv_obj_t* notificationIcon; + BatteryIcon batteryIcon; + Controllers::DateTime& dateTimeController; Controllers::Battery& batteryController; Controllers::Ble& bleController; diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 98e1199..46a0d81 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -36,20 +36,19 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, heartRateController {heartRateController}, motionController {motionController} { - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_static(batteryIcon, Symbols::batteryFull); - lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); + batteryIcon.Create(lv_scr_act()); + lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); batteryPlug = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFF0000)); lv_label_set_text_static(batteryPlug, Symbols::plug); - lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, 0, 0); + lv_obj_align(batteryPlug, batteryIcon.GetObject(), LV_ALIGN_OUT_LEFT_MID, 0, 0); batteryPercentLabel = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color( batteryPercentLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999)); lv_obj_set_style_local_text_font( batteryPercentLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont1); lv_label_set_text_static( batteryPercentLabel, battery_percent_label_text); - lv_obj_align( batteryPercentLabel, batteryIcon, LV_ALIGN_OUT_BOTTOM_RIGHT, 0, 0); + lv_obj_align( batteryPercentLabel, batteryIcon.GetObject(), LV_ALIGN_OUT_BOTTOM_RIGHT, 0, 0); lv_label_set_align( batteryPercentLabel, LV_LABEL_ALIGN_RIGHT); batteryVoltageLabel = lv_label_create(lv_scr_act(), nullptr); @@ -273,19 +272,13 @@ void WatchFaceDigital::Refresh() { if (batteryPercentRemaining.IsUpdated()) { batteryRefreshed = true; auto batteryPercent = batteryPercentRemaining.Get(); - if (batteryPercent == 100) { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); - } else { - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); - } - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); + batteryIcon.SetBatteryPercentage(batteryPercent); } bleState = bleController.IsConnected(); if (bleState.IsUpdated()) { lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get())); } - lv_obj_realign(batteryIcon); lv_obj_realign(batteryPlug); lv_obj_realign(bleIcon); diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index 09dae6e..eac21b0 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -1,5 +1,6 @@ #pragma once +#include <displayapp/screens/BatteryIcon.h> #include <lvgl/src/lv_core/lv_obj.h> #include <chrono> #include <cstdint> @@ -84,7 +85,6 @@ namespace Pinetime { lv_obj_t* label_time_deciseconds; lv_obj_t* label_date; lv_obj_t* backgroundLabel; - lv_obj_t* batteryIcon; lv_obj_t* bleIcon; lv_obj_t* batteryPlug; lv_obj_t* heartbeatIcon; @@ -96,6 +96,8 @@ namespace Pinetime { lv_obj_t* batteryVoltageLabel; lv_obj_t* memfragLabel; + BatteryIcon batteryIcon; + Controllers::DateTime& dateTimeController; Controllers::Battery& batteryController; Controllers::Ble& bleController; diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp index dde07e8..b9afcc8 100644 --- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp +++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp @@ -101,11 +101,14 @@ WatchFacePineTimeStyle::WatchFacePineTimeStyle(DisplayApp* app, lv_obj_align(sidebar, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); // Display icons - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); - lv_label_set_text_static(batteryIcon, Symbols::batteryFull); - lv_obj_align(batteryIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 2); - lv_obj_set_auto_realign(batteryIcon, true); + batteryIcon.Create(sidebar); + batteryIcon.SetColor(LV_COLOR_BLACK); + lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_MID, 0, 2); + + plugIcon = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(plugIcon, Symbols::plug); + lv_obj_set_style_local_text_color(plugIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_align(plugIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 2); bleIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000)); @@ -340,7 +343,7 @@ bool WatchFacePineTimeStyle::OnButtonPushed() { void WatchFacePineTimeStyle::SetBatteryIcon() { auto batteryPercent = batteryPercentRemaining.Get(); - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); + batteryIcon.SetBatteryPercentage(batteryPercent); } void WatchFacePineTimeStyle::AlignIcons() { @@ -358,8 +361,11 @@ void WatchFacePineTimeStyle::Refresh() { isCharging = batteryController.IsCharging(); if (isCharging.IsUpdated()) { if (isCharging.Get()) { - lv_label_set_text_static(batteryIcon, Symbols::plug); + lv_obj_set_hidden(batteryIcon.GetObject(), true); + lv_obj_set_hidden(plugIcon, false); } else { + lv_obj_set_hidden(batteryIcon.GetObject(), false); + lv_obj_set_hidden(plugIcon, true); SetBatteryIcon(); } } diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.h b/src/displayapp/screens/WatchFacePineTimeStyle.h index 465aa70..e703d89 100644 --- a/src/displayapp/screens/WatchFacePineTimeStyle.h +++ b/src/displayapp/screens/WatchFacePineTimeStyle.h @@ -8,6 +8,7 @@ #include "displayapp/Colors.h" #include "components/datetime/DateTimeController.h" #include "components/ble/BleController.h" +#include <displayapp/screens/BatteryIcon.h> namespace Pinetime { namespace Controllers { @@ -79,7 +80,7 @@ namespace Pinetime { lv_obj_t* dateDay; lv_obj_t* dateMonth; lv_obj_t* backgroundLabel; - lv_obj_t* batteryIcon; + lv_obj_t* plugIcon; lv_obj_t* bleIcon; lv_obj_t* calendarOuter; lv_obj_t* calendarInner; @@ -93,6 +94,8 @@ namespace Pinetime { lv_obj_t* lbl_btnSet; lv_color_t needle_colors[1]; + BatteryIcon batteryIcon; + Controllers::DateTime& dateTimeController; Controllers::Battery& batteryController; Controllers::Ble& bleController; diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp index 46f2f02..be5509f 100644 --- a/src/displayapp/screens/settings/QuickSettings.cpp +++ b/src/displayapp/screens/settings/QuickSettings.cpp @@ -35,13 +35,11 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app, // Time label_time = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 0, 0); - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); - lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); + batteryIcon.Create(lv_scr_act()); + lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); static constexpr uint8_t barHeight = 20 + innerDistance; static constexpr uint8_t buttonHeight = (LV_VER_RES_MAX - barHeight - innerDistance) / 2; @@ -113,6 +111,8 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app, lv_label_set_text_static(backgroundLabel, ""); taskUpdate = lv_task_create(lv_update_task, 5000, LV_TASK_PRIO_MID, this); + + UpdateScreen(); } QuickSettings::~QuickSettings() { @@ -124,7 +124,7 @@ QuickSettings::~QuickSettings() { void QuickSettings::UpdateScreen() { lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); + batteryIcon.SetBatteryPercentage(batteryController.PercentRemaining()); } void QuickSettings::OnButtonEvent(lv_obj_t* object, lv_event_t event) { diff --git a/src/displayapp/screens/settings/QuickSettings.h b/src/displayapp/screens/settings/QuickSettings.h index 7913898..40a2a2e 100644 --- a/src/displayapp/screens/settings/QuickSettings.h +++ b/src/displayapp/screens/settings/QuickSettings.h @@ -8,6 +8,7 @@ #include "components/motor/MotorController.h" #include "components/settings/Settings.h" #include "components/battery/BatteryController.h" +#include <displayapp/screens/BatteryIcon.h> namespace Pinetime { @@ -37,7 +38,6 @@ namespace Pinetime { Controllers::Settings& settingsController; lv_task_t* taskUpdate; - lv_obj_t* batteryIcon; lv_obj_t* label_time; lv_style_t btn_style; @@ -48,6 +48,8 @@ namespace Pinetime { lv_obj_t* btn3; lv_obj_t* btn3_lvl; lv_obj_t* btn4; + + BatteryIcon batteryIcon; }; } } |
