diff --git a/platformio.ini b/platformio.ini index 42453a33e..2953d8ccb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -118,7 +118,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/9ed5355a24059750e9b2eb5d669574d9ea42a37b.zip + https://github.com/meshtastic/device-ui/archive/9603b1d37fd8b22ddd5a6ea9352d3bd26020b999.zip ; Common libs for environmental measurements in telemetry module [environmental_base] diff --git a/variants/esp32s3/elecrow_panel/platformio.ini b/variants/esp32s3/elecrow_panel/platformio.ini index 065f22538..72fe051ce 100644 --- a/variants/esp32s3/elecrow_panel/platformio.ini +++ b/variants/esp32s3/elecrow_panel/platformio.ini @@ -128,3 +128,6 @@ build_flags = ${crowpanel_large_esp32s3_base.build_flags} -D VIEW_320x240 -D DISPLAY_SIZE=800x480 ; landscape mode +build_src_filter = + ${esp32s3_base.build_src_filter} + +<../variants/esp32s3/elecrow_panel> diff --git a/variants/esp32s3/elecrow_panel/variant.cpp b/variants/esp32s3/elecrow_panel/variant.cpp new file mode 100644 index 000000000..9a3c53c58 --- /dev/null +++ b/variants/esp32s3/elecrow_panel/variant.cpp @@ -0,0 +1,21 @@ +// meshtastic/firmware/variants/elecrow_panel/variant.cpp + +#include "variant.h" +#include "Arduino.h" +#include "Wire.h" + +bool elecrow_v2 = false; // false = v1, true = v2 + +extern "C" { + +void initVariant() +{ + Wire.begin(I2C_SDA, I2C_SCL, 100000); + delay(50); + Wire.beginTransmission(0x30); + if (Wire.endTransmission() == 0) { + elecrow_v2 = true; + } + Wire.end(); +} +} \ No newline at end of file diff --git a/variants/esp32s3/elecrow_panel/variant.h b/variants/esp32s3/elecrow_panel/variant.h index 99069b723..e32d5c3c5 100644 --- a/variants/esp32s3/elecrow_panel/variant.h +++ b/variants/esp32s3/elecrow_panel/variant.h @@ -1,6 +1,8 @@ #define I2C_SDA 15 #define I2C_SCL 16 +extern bool elecrow_v2; // false = v1, true = v2 + #if CROW_SELECT == 1 #define WAKE_ON_TOUCH #define SCREEN_TOUCH_INT 47 @@ -72,7 +74,7 @@ #define SENSOR_POWER_ON LOW #else // 4.3", 5.0", 7.0" -#define LORA_CS 0 +#define LORA_CS (elecrow_v2 ? 8 : 0) #define LORA_SCK 5 #define LORA_MISO 4 #define LORA_MOSI 6