Fix lovyan driver issue

This commit is contained in:
fvanroie 2022-10-22 01:33:44 +02:00
parent 0b5eb9bb41
commit e973fe2b16

View File

@ -492,22 +492,21 @@ void LovyanGfx::init(int w, int h)
Preferences preferences;
preferences.begin("tft", false);
this->tft_driver = preferences.getUInt("DRIVER", get_tft_driver());
lgfx::IBus* _bus_instance = _init_bus(&preferences);
this->tft_driver = preferences.getUInt("DRIVER", get_tft_driver());
lgfx::Panel_Device* _panel_instance = _init_panel(_bus_instance);
lgfx::ITouch* _touch_instance = _init_touch(&preferences);
if(_panel_instance != nullptr) {
_panel_instance->setBus(_bus_instance);
configure_panel(_panel_instance, &preferences);
}
lgfx::ITouch* touch = _init_touch(&preferences);
#endif
tft.setPanel(_panel_instance);
lgfx::v1::ITouch* touch = _panel_instance->getTouch();
if(touch) {
if(_touch_instance) {
LOG_INFO(TAG_TFT, F("Touch " D_SERVICE_STARTED));
} else {
LOG_WARNING(TAG_TFT, F("Touch " D_SERVICE_START_FAILED));