mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-26 22:33:24 +00:00
add portduino seetingsMap configuration
This commit is contained in:
parent
d83838d7d7
commit
a98394327f
@ -24,7 +24,7 @@ lib_deps =
|
||||
${env.lib_deps}
|
||||
${networking_base.lib_deps}
|
||||
rweather/Crypto@^0.4.0
|
||||
;lovyan03/LovyanGFX@^1.1.12
|
||||
https://github.com/lovyan03/LovyanGFX.git#a0e0d14df3f6d24e589b77adb524cc3a75dbf8fa ; contains SDL2 fix
|
||||
|
||||
build_flags =
|
||||
${arduino_base.build_flags}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 1e390665bdbf1ac85505ad385cbbc24ee4735161
|
||||
Subproject commit 6382b3f57c9350361b0faa6185244ea9f5375bd4
|
62
src/main.cpp
62
src/main.cpp
@ -107,6 +107,7 @@ AudioThread *audioThread;
|
||||
|
||||
#if HAS_TFT
|
||||
#include "DeviceScreen.h"
|
||||
#include "DisplayDriverConfig.h"
|
||||
#include "PacketClient.h"
|
||||
#include "PacketServer.h"
|
||||
|
||||
@ -675,14 +676,69 @@ void setup()
|
||||
#endif
|
||||
|
||||
#if HAS_TFT
|
||||
PacketServer::init();
|
||||
#ifdef PORTDUINO
|
||||
if (settingsMap[displayPanel] != no_screen) {
|
||||
DisplayDriverConfig displayConfig;
|
||||
char *panels[] = {"NOSCREEN", "ST7789", "ST7735", "ST7735S", "ILI9341", "HX8357D"};
|
||||
char *touch[] = {"NOTOUCH", "XPT2046", "STMPE610", "GT911", "FT5x06"};
|
||||
if (settingsMap[displayPanel] == no_screen /* x11 */) { // TODO: add x11 enum
|
||||
displayConfig.device(DisplayDriverConfig::device_t::X11);
|
||||
} else {
|
||||
displayConfig.device(DisplayDriverConfig::device_t::CUSTOM_TFT)
|
||||
.panel(DisplayDriverConfig::panel_config_t{
|
||||
.type = panels[settingsMap[displayPanel]],
|
||||
.panel_width = (uint16_t)settingsMap[displayWidth],
|
||||
.panel_height = (uint16_t)settingsMap[displayHeight],
|
||||
.rotation = (bool)settingsMap[displayRotate],
|
||||
.pin_cs = (int16_t)settingsMap[displayCS],
|
||||
.pin_rst = (int16_t)settingsMap[displayReset],
|
||||
.offset_x = (uint16_t)settingsMap[displayOffsetX],
|
||||
.offset_y = (uint16_t)settingsMap[displayOffsetY],
|
||||
.offset_rotation = 1, // TODO:
|
||||
.invert = settingsMap[displayInvert] ? true : false,
|
||||
.rgb_order = false // TODO:
|
||||
})
|
||||
.bus(DisplayDriverConfig::bus_config_t{.freq_write = 40000000,
|
||||
.freq_read = 16000000,
|
||||
.spi{
|
||||
// .pin_sclk = 11,
|
||||
// .pin_miso = 9,
|
||||
// .pin_mosi = 10,
|
||||
.pin_dc = (int8_t)settingsMap[displayDC],
|
||||
.use_lock = true,
|
||||
// .spi_host = 0 // TODO:
|
||||
}})
|
||||
.touch(DisplayDriverConfig::touch_config_t{.type = touch[settingsMap[touchscreenModule]],
|
||||
//.freq = 2500000,
|
||||
.pin_int = (int16_t)settingsMap[touchscreenIRQ],
|
||||
.spi{
|
||||
.spi_host = 0, // TODO:
|
||||
// .pin_sclk = 11,
|
||||
// .pin_mosi = 10,
|
||||
// .pin_miso = 9,
|
||||
},
|
||||
.pin_cs = (int16_t)settingsMap[touchscreenCS]})
|
||||
.light(DisplayDriverConfig::light_config_t{
|
||||
.pin_bl = (int16_t)settingsMap[displayBacklight],
|
||||
.pwm_channel = -1, // TODO:
|
||||
.invert = false // TODO:
|
||||
});
|
||||
}
|
||||
deviceScreen = &DeviceScreen::create(&displayConfig);
|
||||
PacketServer::init();
|
||||
deviceScreen->init(new PacketClient);
|
||||
}
|
||||
#else
|
||||
deviceScreen = &DeviceScreen::create();
|
||||
PacketServer::init();
|
||||
deviceScreen->init(new PacketClient);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Initialize the screen first so we can show the logo while we start up everything else.
|
||||
#if HAS_SCREEN
|
||||
screen = new graphics::Screen(screen_found, screen_model, screen_geometry);
|
||||
|
||||
#endif
|
||||
// setup TZ prior to time actions.
|
||||
if (*config.device.tzdef) {
|
||||
setenv("TZ", config.device.tzdef, 1);
|
||||
@ -1059,7 +1115,7 @@ void tft_task_handler(void *param = nullptr)
|
||||
#ifdef HAS_FREE_RTOS
|
||||
vTaskDelay((TickType_t)5);
|
||||
#else
|
||||
delay(10);
|
||||
delay(5);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -7,20 +7,22 @@ build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino -I /usr/in
|
||||
!pkg-config --libs openssl --silence-errors || :
|
||||
board = cross_platform
|
||||
lib_deps = ${portduino_base.lib_deps}
|
||||
; lovyan03/LovyanGFX@^1.1.12
|
||||
https://github.com/lovyan03/LovyanGFX.git#a0e0d14df3f6d24e589b77adb524cc3a75dbf8fa
|
||||
build_src_filter = ${portduino_base.build_src_filter}
|
||||
|
||||
[env:native-tft-320x240]
|
||||
extends = portduino_base
|
||||
build_flags = ${portduino_base.build_flags} -O0 -fno-omit-frame-pointer -fsanitize=address
|
||||
build_flags = ${portduino_base.build_flags} -O0 -fno-omit-frame-pointer -fsanitize=address -lX11
|
||||
-I variants/portduino
|
||||
-I /usr/include
|
||||
-D DEBUG_HEAP
|
||||
-D RAM_SIZE=4096
|
||||
-D USE_X11=1 ; enables usage of X11
|
||||
-D HAS_TFT=1
|
||||
-D HAS_SCREEN=0
|
||||
-D DISP_HOR_RES=320
|
||||
-D DISP_VER_RES=240
|
||||
-D LV_BUILD_TEST=0
|
||||
-D CALIBRATE_TOUCH=0
|
||||
-D LV_LVGL_H_INCLUDE_SIMPLE
|
||||
-D LV_CONF_INCLUDE_SIMPLE
|
||||
-D LV_COMP_CONF_INCLUDE_SIMPLE
|
||||
@ -28,19 +30,21 @@ build_flags = ${portduino_base.build_flags} -O0 -fno-omit-frame-pointer -fsaniti
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D USE_PACKET_API
|
||||
-I lib/device-ui/generated/ui_320x240
|
||||
; -I lib/device-ui/portduino
|
||||
; The pkg-config commands below optionally add link flags.
|
||||
; the || : is just a "or run the null command" to avoid returning an error code
|
||||
!pkg-config --libs libulfius --silence-errors || :
|
||||
!pkg-config --libs openssl --silence-errors || :
|
||||
board = cross_platform
|
||||
lib_deps = ${portduino_base.lib_deps}
|
||||
; lovyan03/LovyanGFX@^1.1.12
|
||||
https://github.com/lovyan03/LovyanGFX.git#a0e0d14df3f6d24e589b77adb524cc3a75dbf8fa
|
||||
; x11 is currently only supported in master branch, not in 6.1.1
|
||||
https://github.com/lvgl/lv_drivers.git#110089d7f4be4df34aa7efc17c8cdd911e562846
|
||||
build_src_filter = ${portduino_base.build_src_filter}
|
||||
-<graphics/TFTDisplay.cpp>
|
||||
+<../lib/device-ui/generated/ui_320x240>
|
||||
+<../lib/device-ui/generated/ui_320x240/fonts>
|
||||
+<../lib/device-ui/resources>
|
||||
+<../lib/device-ui/portduino>
|
||||
+<../lib/device-ui/source>
|
||||
|
||||
[env:native-x11-320x240]
|
||||
@ -63,15 +67,16 @@ build_flags = ${portduino_base.build_flags} -O0 -fno-omit-frame-pointer -fsaniti
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D USE_PACKET_API
|
||||
-I lib/device-ui/generated/ui_320x240
|
||||
; -I lib/device-ui/portduino
|
||||
board = cross_platform
|
||||
lib_deps = ${portduino_base.lib_deps}
|
||||
; x11 is currently only supported in master branch, not in 6.1.1
|
||||
https://github.com/lvgl/lv_drivers.git#110089d7f4be4df34aa7efc17c8cdd911e562846
|
||||
https://github.com/lovyan03/LovyanGFX.git#a0e0d14df3f6d24e589b77adb524cc3a75dbf8fa
|
||||
build_src_filter = ${portduino_base.build_src_filter}
|
||||
-<graphics/TFTDisplay.cpp>
|
||||
+<../lib/device-ui/generated/ui_320x240>
|
||||
+<../lib/device-ui/generated/ui_320x240/fonts>
|
||||
+<../lib/device-ui/resources>
|
||||
+<../lib/device-ui/portduino>
|
||||
+<../lib/device-ui/source>
|
||||
+<mesh/sharedMem/>
|
||||
|
@ -1,4 +1,6 @@
|
||||
#ifndef HAS_SCREEN
|
||||
#define HAS_SCREEN 1
|
||||
#endif
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
#define HAS_GPS 1
|
||||
#define MAX_NUM_NODES settingsMap[maxnodes]
|
||||
|
Loading…
Reference in New Issue
Block a user