mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-26 22:33:24 +00:00
try-fix i2c touch
This commit is contained in:
parent
500c7d41a7
commit
3f30a84752
34
src/main.cpp
34
src/main.cpp
@ -696,17 +696,35 @@ void setup()
|
|||||||
.spi{.pin_dc = (int8_t)settingsMap[displayDC],
|
.spi{.pin_dc = (int8_t)settingsMap[displayDC],
|
||||||
.use_lock = true,
|
.use_lock = true,
|
||||||
.spi_host = (uint16_t)settingsMap[displayspidev]}})
|
.spi_host = (uint16_t)settingsMap[displayspidev]}})
|
||||||
.touch(DisplayDriverConfig::touch_config_t{.type = touch[settingsMap[touchscreenModule]],
|
|
||||||
.freq = (uint32_t)settingsMap[touchscreenBusFrequency],
|
|
||||||
.pin_int = (int16_t)settingsMap[touchscreenIRQ],
|
|
||||||
.offset_rotation = (uint8_t)settingsMap[touchscreenRotate],
|
|
||||||
.spi{
|
|
||||||
.spi_host = (int8_t)settingsMap[touchscreenspidev],
|
|
||||||
},
|
|
||||||
.pin_cs = (int16_t)settingsMap[touchscreenCS]})
|
|
||||||
.light(DisplayDriverConfig::light_config_t{.pin_bl = (int16_t)settingsMap[displayBacklight],
|
.light(DisplayDriverConfig::light_config_t{.pin_bl = (int16_t)settingsMap[displayBacklight],
|
||||||
.pwm_channel = (int8_t)settingsMap[displayBacklightPWMChannel],
|
.pwm_channel = (int8_t)settingsMap[displayBacklightPWMChannel],
|
||||||
.invert = (bool)settingsMap[displayBacklightInvert]});
|
.invert = (bool)settingsMap[displayBacklightInvert]});
|
||||||
|
if (settingsMap[touchscreenI2CAddr] == -1) {
|
||||||
|
displayConfig.touch(
|
||||||
|
DisplayDriverConfig::touch_config_t{.type = touch[settingsMap[touchscreenModule]],
|
||||||
|
.freq = (uint32_t)settingsMap[touchscreenBusFrequency],
|
||||||
|
.pin_int = (int16_t)settingsMap[touchscreenIRQ],
|
||||||
|
.offset_rotation = (uint8_t)settingsMap[touchscreenRotate],
|
||||||
|
.spi{
|
||||||
|
.spi_host = (int8_t)settingsMap[touchscreenspidev],
|
||||||
|
},
|
||||||
|
.pin_cs = (int16_t)settingsMap[touchscreenCS]});
|
||||||
|
} else {
|
||||||
|
displayConfig.touch(DisplayDriverConfig::touch_config_t{
|
||||||
|
.type = touch[settingsMap[touchscreenModule]],
|
||||||
|
.freq = (uint32_t)settingsMap[touchscreenBusFrequency],
|
||||||
|
.x_min = 0,
|
||||||
|
.x_max =
|
||||||
|
(uint16_t)((settingsMap[touchscreenRotate] & 1 ? settingsMap[displayWidth] : settingsMap[displayHeight]) -
|
||||||
|
1),
|
||||||
|
.y_min = 0,
|
||||||
|
.y_max =
|
||||||
|
(uint16_t)((settingsMap[touchscreenRotate] & 1 ? settingsMap[displayHeight] : settingsMap[displayWidth]) -
|
||||||
|
1),
|
||||||
|
.pin_int = (int16_t)settingsMap[touchscreenIRQ],
|
||||||
|
.offset_rotation = (uint8_t)settingsMap[touchscreenRotate],
|
||||||
|
.i2c{.i2c_addr = (uint8_t)settingsMap[touchscreenI2CAddr]}});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
deviceScreen = &DeviceScreen::create(&displayConfig);
|
deviceScreen = &DeviceScreen::create(&displayConfig);
|
||||||
PacketAPI::create(PacketServer::init());
|
PacketAPI::create(PacketServer::init());
|
||||||
|
@ -23,7 +23,7 @@ build_flags = ${portduino_base.build_flags} -O0 -fno-omit-frame-pointer -fsaniti
|
|||||||
-D DISP_HOR_RES=320
|
-D DISP_HOR_RES=320
|
||||||
-D DISP_VER_RES=240
|
-D DISP_VER_RES=240
|
||||||
-D LV_BUILD_TEST=0
|
-D LV_BUILD_TEST=0
|
||||||
-D CALIBRATE_TOUCH=0
|
; -D CALIBRATE_TOUCH=0
|
||||||
-D LV_USE_PERF_MONITOR=1
|
-D LV_USE_PERF_MONITOR=1
|
||||||
-D LV_USE_MEM_MONITOR=1
|
-D LV_USE_MEM_MONITOR=1
|
||||||
-D LV_LVGL_H_INCLUDE_SIMPLE
|
-D LV_LVGL_H_INCLUDE_SIMPLE
|
||||||
@ -63,7 +63,7 @@ build_flags = ${portduino_base.build_flags} -Ofast -lX11
|
|||||||
-D DISP_HOR_RES=320
|
-D DISP_HOR_RES=320
|
||||||
-D DISP_VER_RES=240
|
-D DISP_VER_RES=240
|
||||||
-D LV_BUILD_TEST=0
|
-D LV_BUILD_TEST=0
|
||||||
-D CALIBRATE_TOUCH=0
|
; -D CALIBRATE_TOUCH=0
|
||||||
-D LV_USE_PERF_MONITOR=0
|
-D LV_USE_PERF_MONITOR=0
|
||||||
-D LV_USE_MEM_MONITOR=0
|
-D LV_USE_MEM_MONITOR=0
|
||||||
-D LV_LVGL_H_INCLUDE_SIMPLE
|
-D LV_LVGL_H_INCLUDE_SIMPLE
|
||||||
|
Loading…
Reference in New Issue
Block a user