diff --git a/Platformio/HAL/Interface/HardwareInterface.h b/Platformio/HAL/Interface/HardwareInterface.h new file mode 100644 index 0000000..71a455f --- /dev/null +++ b/Platformio/HAL/Interface/HardwareInterface.h @@ -0,0 +1,27 @@ +// OMOTE Hardware Abstraction +// 2023 Matthew Colvin + +#pragma once +#include +#include + +class HardwareInterface { +public: + struct batteryStatus { + /// @brief Percent of battery remaining (0-100] + int percentage; + /// @brief Voltage of battery in millivolts + int voltage; + /// @brief True - Battery is Charging + /// False - Battery discharging + bool isCharging; + }; + + HardwareInterface() = default; + + virtual void init() = 0; + virtual void sendIR() = 0; + virtual void MQTTPublish(const char *topic, const char *payload) = 0; + virtual batteryStatus getBatteryPercentage() = 0; + virtual void debugPrint(std::string message) = 0; +}; diff --git a/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp b/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp index 08013c6..e34b140 100644 --- a/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp +++ b/Platformio/HAL/Targets/ESP32/HardwareRevX.hpp @@ -16,6 +16,7 @@ #include "wifihandler.hpp" + #include "omoteconfig.h" #include "BatteryInterface.h" #include "wifiHandlerInterface.h" diff --git a/Platformio/HAL/Targets/Simulator/omoteconfig.h b/Platformio/HAL/Targets/Simulator/omoteconfig.h index 94e4a42..0838bbe 100644 --- a/Platformio/HAL/Targets/Simulator/omoteconfig.h +++ b/Platformio/HAL/Targets/Simulator/omoteconfig.h @@ -1,3 +1,3 @@ #pragma once -#define IS_SIMULATOR true \ No newline at end of file +#define IS_SIMULATOR true diff --git a/Platformio/OmoteUI/OmoteUI.cpp b/Platformio/OmoteUI/OmoteUI.cpp index 77daff9..360dc71 100644 --- a/Platformio/OmoteUI/OmoteUI.cpp +++ b/Platformio/OmoteUI/OmoteUI.cpp @@ -288,6 +288,9 @@ void OmoteUI::layout_UI() { appleImg = imgs.addAppleDisplayImage(button); lv_obj_align(appleImg, LV_ALIGN_CENTER, -3, 0); + lv_obj_set_style_img_recolor(appleImg, lv_color_white(), LV_PART_MAIN); + lv_obj_set_style_img_recolor_opa(appleImg, LV_OPA_COVER, LV_PART_MAIN); + lv_obj_align(appleImg, LV_ALIGN_CENTER, -3, 0); button = lv_btn_create(tab3); lv_obj_align(button, LV_ALIGN_BOTTOM_RIGHT, -10, 0); @@ -298,6 +301,9 @@ void OmoteUI::layout_UI() { appleImg = imgs.addAppleDisplayImage(button); lv_obj_align(appleImg, LV_ALIGN_CENTER, 0, 0); + lv_obj_set_style_img_recolor(appleImg, lv_color_white(), LV_PART_MAIN); + lv_obj_set_style_img_recolor_opa(appleImg, LV_OPA_COVER, LV_PART_MAIN); + lv_obj_align(appleImg, LV_ALIGN_CENTER, 0, 0); this->setup_settings(tab1);