Created Drivers folder with ILI934x subproject (#209)
Refactored all existing boards to re-use the ILI934x driver code.
This commit is contained in:
committed by
GitHub
parent
8ccba15c25
commit
c74006f8b6
@@ -24,6 +24,10 @@
|
||||
|
||||
namespace tt::app::boot {
|
||||
|
||||
static std::shared_ptr<tt::hal::Display> getHalDisplay() {
|
||||
return hal::findFirstDevice<hal::Display>(hal::Device::Type::Display);
|
||||
}
|
||||
|
||||
class BootApp : public App {
|
||||
|
||||
private:
|
||||
@@ -35,9 +39,7 @@ private:
|
||||
|
||||
kernel::systemEventPublish(kernel::SystemEvent::BootSplash);
|
||||
|
||||
auto* lvgl_display = lv_display_get_default();
|
||||
assert(lvgl_display != nullptr);
|
||||
auto* hal_display = (hal::Display*)lv_display_get_user_data(lvgl_display);
|
||||
auto hal_display = getHalDisplay();
|
||||
assert(hal_display != nullptr);
|
||||
if (hal_display->supportsBacklightDuty()) {
|
||||
int32_t backlight_duty = app::display::getBacklightDuty();
|
||||
|
||||
@@ -22,13 +22,14 @@ static uint8_t gamma = 255;
|
||||
#define ROTATION_270 2
|
||||
#define ROTATION_90 3
|
||||
|
||||
static std::shared_ptr<tt::hal::Display> getHalDisplay() {
|
||||
return hal::findFirstDevice<hal::Display>(hal::Device::Type::Display);
|
||||
}
|
||||
|
||||
static void onBacklightSliderEvent(lv_event_t* event) {
|
||||
auto* slider = static_cast<lv_obj_t*>(lv_event_get_target(event));
|
||||
|
||||
auto* lvgl_display = lv_display_get_default();
|
||||
assert(lvgl_display != nullptr);
|
||||
auto* hal_display = (tt::hal::Display*)lv_display_get_user_data(lvgl_display);
|
||||
auto hal_display = getHalDisplay();
|
||||
assert(hal_display != nullptr);
|
||||
|
||||
if (hal_display->supportsBacklightDuty()) {
|
||||
@@ -57,10 +58,6 @@ static void onGammaSliderEvent(lv_event_t* event) {
|
||||
}
|
||||
}
|
||||
|
||||
static std::shared_ptr<tt::hal::Display> getHalDisplay() {
|
||||
return hal::findFirstDevice<hal::Display>(hal::Device::Type::Display);
|
||||
}
|
||||
|
||||
static lv_display_rotation_t orientationSettingToDisplayRotation(uint32_t setting) {
|
||||
if (setting == ROTATION_180) {
|
||||
return LV_DISPLAY_ROTATION_180;
|
||||
|
||||
Reference in New Issue
Block a user