diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e3f076ce0..bc660170c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,7 @@ "features": { "ghcr.io/devcontainers/features/python:1": { "installTools": true, - "version": "3.14" + "version": "3.13" } }, "customizations": { diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 080e70d08..670d668e2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,9 @@ { - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format "recommendations": [ - "platformio.platformio-ide" + "pioarduino.pioarduino-ide" ], "unwantedRecommendations": [ - "ms-vscode.cpptools-extension-pack" + "ms-vscode.cpptools-extension-pack", + "platformio.platformio-ide" ] } diff --git a/bin/build-esp32.sh b/bin/build-esp32.sh index 4e799b30a..e48e18781 100755 --- a/bin/build-esp32.sh +++ b/bin/build-esp32.sh @@ -33,7 +33,7 @@ echo "Copying ESP32 update bin file" cp $BUILDDIR/$basename.bin $OUTDIR/$basename.bin echo "Copying Filesystem for ESP32 targets" -cp $BUILDDIR/littlefs-$1-$VERSION.bin $OUTDIR/littlefs-$1-$VERSION.bin +cp $BUILDDIR/littlefs-$1-$VERSION.bin $OUTDIR/littlefs-$1-$VERSION.bin || true cp bin/device-install.* $OUTDIR/ cp bin/device-update.* $OUTDIR/ diff --git a/bin/platformio-custom.py b/bin/platformio-custom.py index b6560f35b..824eeb0fa 100644 --- a/bin/platformio-custom.py +++ b/bin/platformio-custom.py @@ -173,7 +173,8 @@ if platform.name == "espressif32": target_lfs = env.DataToBin( join("$BUILD_DIR", "${ESP32_FS_IMAGE_NAME}"), "$PROJECT_DATA_DIR" ) - mtjson_deps.append(target_lfs) + # prepend the littlefs target to the mtjson dependencies + # mtjson_deps.insert(0, target_lfs) env.AddCustomTarget( name="mtjson", diff --git a/boards/CDEBYTE_EoRa-S3.json b/boards/CDEBYTE_EoRa-S3.json index afaabc5a7..2355cecd3 100644 --- a/boards/CDEBYTE_EoRa-S3.json +++ b/boards/CDEBYTE_EoRa-S3.json @@ -7,7 +7,7 @@ "extra_flags": [ "-D CDEBYTE_EORA_S3", "-D ARDUINO_USB_CDC_ON_BOOT=1", - "-D ARDUINO_USB_MODE=0", + "-D ARDUINO_USB_MODE=1", "-D ARDUINO_RUNNING_CORE=1", "-D ARDUINO_EVENT_RUNNING_CORE=1", "-D BOARD_HAS_PSRAM" diff --git a/boards/bpi_picow_esp32_s3.json b/boards/bpi_picow_esp32_s3.json index 75983d845..62ad666f1 100644 --- a/boards/bpi_picow_esp32_s3.json +++ b/boards/bpi_picow_esp32_s3.json @@ -6,7 +6,7 @@ "core": "esp32", "extra_flags": [ "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1", "-DBOARD_HAS_PSRAM" diff --git a/boards/hackaday-communicator.json b/boards/hackaday-communicator.json index 6e6c1ad2d..5aedf5d19 100644 --- a/boards/hackaday-communicator.json +++ b/boards/hackaday-communicator.json @@ -8,7 +8,7 @@ "extra_flags": [ "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/heltec_vision_master_e213.json b/boards/heltec_vision_master_e213.json index 152515cf3..d9d5f8582 100644 --- a/boards/heltec_vision_master_e213.json +++ b/boards/heltec_vision_master_e213.json @@ -9,7 +9,7 @@ "extra_flags": [ "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/heltec_vision_master_e290.json b/boards/heltec_vision_master_e290.json index b7cbac878..171125338 100644 --- a/boards/heltec_vision_master_e290.json +++ b/boards/heltec_vision_master_e290.json @@ -9,7 +9,7 @@ "extra_flags": [ "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/heltec_vision_master_t190.json b/boards/heltec_vision_master_t190.json index 440f76ad0..fbdf1f09d 100644 --- a/boards/heltec_vision_master_t190.json +++ b/boards/heltec_vision_master_t190.json @@ -9,7 +9,7 @@ "extra_flags": [ "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/heltec_wireless_tracker.json b/boards/heltec_wireless_tracker.json index 04c6e5553..59d0daa15 100644 --- a/boards/heltec_wireless_tracker.json +++ b/boards/heltec_wireless_tracker.json @@ -8,7 +8,7 @@ "extra_flags": [ "-DHELTEC_WIRELESS_TRACKER", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/heltec_wireless_tracker_v2.json b/boards/heltec_wireless_tracker_v2.json index 502954e69..3d20f7edb 100644 --- a/boards/heltec_wireless_tracker_v2.json +++ b/boards/heltec_wireless_tracker_v2.json @@ -7,7 +7,7 @@ "core": "esp32", "extra_flags": [ "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/seeed-xiao-s3.json b/boards/seeed-xiao-s3.json index 6981085dd..d8e5d6b94 100644 --- a/boards/seeed-xiao-s3.json +++ b/boards/seeed-xiao-s3.json @@ -8,7 +8,7 @@ "extra_flags": [ "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=0" ], diff --git a/boards/station-g2.json b/boards/station-g2.json index 871f067aa..f7ce50779 100755 --- a/boards/station-g2.json +++ b/boards/station-g2.json @@ -8,7 +8,7 @@ "extra_flags": [ "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=0" ], diff --git a/boards/t-deck.json b/boards/t-deck.json index b112921b9..33a34b60d 100644 --- a/boards/t-deck.json +++ b/boards/t-deck.json @@ -8,7 +8,7 @@ "extra_flags": [ "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/t-watch-s3.json b/boards/t-watch-s3.json index bae4f47b0..f3c0bea8e 100644 --- a/boards/t-watch-s3.json +++ b/boards/t-watch-s3.json @@ -9,7 +9,7 @@ "-DBOARD_HAS_PSRAM", "-DT_WATCH_S3", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/tbeam-s3-core.json b/boards/tbeam-s3-core.json index 7bda2e5a0..8d2c3eed6 100644 --- a/boards/tbeam-s3-core.json +++ b/boards/tbeam-s3-core.json @@ -8,7 +8,7 @@ "-DBOARD_HAS_PSRAM", "-DLILYGO_TBEAM_S3_CORE", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/boards/tlora-t3s3-v1.json b/boards/tlora-t3s3-v1.json index 0bfd17afc..652b4178e 100644 --- a/boards/tlora-t3s3-v1.json +++ b/boards/tlora-t3s3-v1.json @@ -7,7 +7,7 @@ "extra_flags": [ "-DLILYGO_T3S3_V1", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1", "-DBOARD_HAS_PSRAM" diff --git a/boards/unphone.json b/boards/unphone.json index 4d37f7bb5..72075f5ae 100644 --- a/boards/unphone.json +++ b/boards/unphone.json @@ -10,7 +10,7 @@ "-DBOARD_HAS_PSRAM", "-DUNPHONE_SPIN=9", "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], diff --git a/default_16MB.csv b/default_16MB.csv new file mode 100644 index 000000000..67d773728 --- /dev/null +++ b/default_16MB.csv @@ -0,0 +1,7 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x640000, +app1, app, ota_1, 0x650000,0x640000, +spiffs, data, spiffs, 0xc90000,0x360000, +coredump, data, coredump,0xFF0000,0x10000, diff --git a/default_8MB.csv b/default_8MB.csv new file mode 100644 index 000000000..4e92afa69 --- /dev/null +++ b/default_8MB.csv @@ -0,0 +1,7 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x330000, +app1, app, ota_1, 0x340000,0x330000, +spiffs, data, spiffs, 0x670000,0x180000, +coredump, data, coredump,0x7F0000,0x10000, diff --git a/extra_scripts/esp32_extra.py b/extra_scripts/esp32_extra.py index f7698561a..1abc56924 100755 --- a/extra_scripts/esp32_extra.py +++ b/extra_scripts/esp32_extra.py @@ -43,14 +43,14 @@ def esp32_create_combined_bin(source, target, env): cmd = [ "--chip", chip, - "merge_bin", + "merge-bin", "-o", new_file_name, - "--flash_mode", + "--flash-mode", flash_mode, - "--flash_freq", + "--flash-freq", flash_freq, - "--flash_size", + "--flash-size", flash_size, ] @@ -70,17 +70,6 @@ def esp32_create_combined_bin(source, target, env): env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin) -esp32_kind = env.GetProjectOption("custom_esp32_kind") -if esp32_kind == "esp32": - # Free up some IRAM by removing auxiliary SPI flash chip drivers. - # Wrapped stub symbols are defined in src/platform/esp32/iram-quirk.c. - env.Append( - LINKFLAGS=[ - "-Wl,--wrap=esp_flash_chip_gd", - "-Wl,--wrap=esp_flash_chip_issi", - "-Wl,--wrap=esp_flash_chip_winbond", - ] - ) -else: - # For newer ESP32 targets, using newlib nano works better. - env.Append(LINKFLAGS=["--specs=nano.specs", "-u", "_printf_float"]) +# Enable Newlib Nano formatting to save space +# ...but allow printf float support (compromise) +env.Append(LINKFLAGS=["--specs=nano.specs", "-u", "_printf_float"]) diff --git a/platformio.ini b/platformio.ini index 2b52ce3a5..768dd5dc4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -2,7 +2,7 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = tbeam +default_envs = heltec-v3 extra_configs = variants/*/*.ini diff --git a/src/DebugConfiguration.h b/src/DebugConfiguration.h index 98bbe0f72..2a4ca70f3 100644 --- a/src/DebugConfiguration.h +++ b/src/DebugConfiguration.h @@ -151,9 +151,8 @@ extern "C" void logLegacy(const char *level, const char *fmt, ...); #include #endif // HAS_ETHERNET -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET #if HAS_WIFI diff --git a/src/Power.cpp b/src/Power.cpp index 33dda8e11..95d6b5971 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -20,6 +20,13 @@ #include "main.h" #include "meshUtils.h" #include "sleep.h" +#ifdef ARCH_ESP32 +// #include +#include +#include +#include +#include +#endif #if defined(ARCH_PORTDUINO) #include "api/WiFiServerAPI.h" @@ -38,9 +45,8 @@ #include #endif -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET #endif @@ -52,21 +58,86 @@ #if defined(BATTERY_PIN) && defined(ARCH_ESP32) #ifndef BAT_MEASURE_ADC_UNIT // ADC1 is default -static const adc1_channel_t adc_channel = ADC_CHANNEL; +static const adc_channel_t adc_channel = ADC_CHANNEL; static const adc_unit_t unit = ADC_UNIT_1; -#else // ADC2 -static const adc2_channel_t adc_channel = ADC_CHANNEL; +#else // ADC2 +static const adc_channel_t adc_channel = ADC_CHANNEL; static const adc_unit_t unit = ADC_UNIT_2; -RTC_NOINIT_ATTR uint64_t RTC_reg_b; - #endif // BAT_MEASURE_ADC_UNIT -esp_adc_cal_characteristics_t *adc_characs = (esp_adc_cal_characteristics_t *)calloc(1, sizeof(esp_adc_cal_characteristics_t)); +static adc_oneshot_unit_handle_t adc_handle = nullptr; +static adc_cali_handle_t adc_cali_handle = nullptr; +static bool adc_calibrated = false; #ifndef ADC_ATTENUATION static const adc_atten_t atten = ADC_ATTEN_DB_12; #else static const adc_atten_t atten = ADC_ATTENUATION; #endif +#ifdef ADC_BITWIDTH +static const adc_bitwidth_t adc_width = ADC_BITWIDTH; +#else +static const adc_bitwidth_t adc_width = ADC_BITWIDTH_DEFAULT; +#endif + +static int adcBitWidthToBits(adc_bitwidth_t width) +{ + switch (width) { + case ADC_BITWIDTH_9: + return 9; + case ADC_BITWIDTH_10: + return 10; + case ADC_BITWIDTH_11: + return 11; + case ADC_BITWIDTH_12: + return 12; +#ifdef ADC_BITWIDTH_13 + case ADC_BITWIDTH_13: + return 13; +#endif + default: + return 12; + } +} + +static bool initAdcCalibration() +{ +#if ADC_CALI_SCHEME_CURVE_FITTING_SUPPORTED + adc_cali_curve_fitting_config_t cali_config = { + .unit_id = unit, + .atten = atten, + .bitwidth = adc_width, + }; + esp_err_t ret = adc_cali_create_scheme_curve_fitting(&cali_config, &adc_cali_handle); + if (ret == ESP_OK) { + LOG_INFO("ADC calibration: curve fitting enabled"); + return true; + } + if (ret != ESP_ERR_NOT_SUPPORTED) { + LOG_WARN("ADC calibration: curve fitting failed: %s", esp_err_to_name(ret)); + } +#endif + +#if ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED + adc_cali_line_fitting_config_t cali_config = { + .unit_id = unit, + .atten = atten, + .bitwidth = adc_width, + .default_vref = DEFAULT_VREF, + }; + esp_err_t ret = adc_cali_create_scheme_line_fitting(&cali_config, &adc_cali_handle); + if (ret == ESP_OK) { + LOG_INFO("ADC calibration: line fitting enabled"); + return true; + } + if (ret != ESP_ERR_NOT_SUPPORTED) { + LOG_WARN("ADC calibration: line fitting failed: %s", esp_err_to_name(ret)); + } +#endif + + LOG_INFO("ADC calibration not supported; using approximate scaling"); + return false; +} + #endif // BATTERY_PIN && ARCH_ESP32 #ifdef EXT_CHRG_DETECT @@ -329,8 +400,20 @@ class AnalogBatteryLevel : public HasBatteryLevel battery_adcEnable(); #ifdef ARCH_ESP32 // ADC block for espressif platforms raw = espAdcRead(); - scaled = esp_adc_cal_raw_to_voltage(raw, adc_characs); - scaled *= operativeAdcMultiplier; + int voltage_mv = 0; + if (adc_calibrated && adc_cali_handle) { + if (adc_cali_raw_to_voltage(adc_cali_handle, raw, &voltage_mv) != ESP_OK) { + LOG_WARN("ADC calibration read failed; using raw value"); + voltage_mv = 0; + } + } + if (voltage_mv == 0) { + // Fallback approximate conversion without calibration + const int bits = adcBitWidthToBits(adc_width); + const float max_code = powf(2.0f, bits) - 1.0f; + voltage_mv = (int)((raw / max_code) * DEFAULT_VREF); + } + scaled = voltage_mv * operativeAdcMultiplier; #else // block for all other platforms for (uint32_t i = 0; i < BATTERY_SENSE_SAMPLES; i++) { raw += analogRead(BATTERY_PIN); @@ -368,51 +451,22 @@ class AnalogBatteryLevel : public HasBatteryLevel uint32_t raw = 0; uint8_t raw_c = 0; // raw reading counter -#ifndef BAT_MEASURE_ADC_UNIT // ADC1 + if (!adc_handle) { + LOG_ERROR("ADC oneshot handle not initialized"); + return 0; + } + for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) { - int val_ = adc1_get_raw(adc_channel); - if (val_ >= 0) { // save only valid readings - raw += val_; + int val = 0; + esp_err_t err = adc_oneshot_read(adc_handle, adc_channel, &val); + if (err == ESP_OK) { + raw += val; raw_c++; - } - // delayMicroseconds(100); - } -#else // ADC2 -#ifdef CONFIG_IDF_TARGET_ESP32S3 // ESP32S3 - // ADC2 wifi bug workaround not required, breaks compile - // On ESP32S3, ADC2 can take turns with Wifi (?) - - int32_t adc_buf; - esp_err_t read_result; - - // Multiple samples - for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) { - adc_buf = 0; - read_result = -1; - - read_result = adc2_get_raw(adc_channel, ADC_WIDTH_BIT_12, &adc_buf); - if (read_result == ESP_OK) { - raw += adc_buf; - raw_c++; // Count valid samples } else { - LOG_DEBUG("An attempt to sample ADC2 failed"); + LOG_DEBUG("ADC read failed: %s", esp_err_to_name(err)); } } -#else // Other ESP32 - int32_t adc_buf = 0; - for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) { - // ADC2 wifi bug workaround, see - // https://github.com/espressif/arduino-esp32/issues/102 - WRITE_PERI_REG(SENS_SAR_READ_CTRL2_REG, RTC_reg_b); - SET_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DATA_INV); - adc2_get_raw(adc_channel, ADC_WIDTH_BIT_12, &adc_buf); - raw += adc_buf; - raw_c++; - } -#endif // BAT_MEASURE_ADC_UNIT - -#endif // End BAT_MEASURE_ADC_UNIT return (raw / (raw_c < 1 ? 1 : raw_c)); } #endif @@ -624,40 +678,30 @@ bool Power::analogInit() #endif #ifdef ARCH_ESP32 // ESP32 needs special analog stuff + adc_oneshot_unit_init_cfg_t init_config = { + .unit_id = unit, + }; -#ifndef ADC_WIDTH // max resolution by default - static const adc_bits_width_t width = ADC_WIDTH_BIT_12; -#else - static const adc_bits_width_t width = ADC_WIDTH; -#endif -#ifndef BAT_MEASURE_ADC_UNIT // ADC1 - adc1_config_width(width); - adc1_config_channel_atten(adc_channel, atten); -#else // ADC2 - adc2_config_channel_atten(adc_channel, atten); -#ifndef CONFIG_IDF_TARGET_ESP32S3 - // ADC2 wifi bug workaround - // Not required with ESP32S3, breaks compile - RTC_reg_b = READ_PERI_REG(SENS_SAR_READ_CTRL2_REG); -#endif -#endif - // calibrate ADC - esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, width, DEFAULT_VREF, adc_characs); - // show ADC characterization base - if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP) { - LOG_INFO("ADC config based on Two Point values stored in eFuse"); - } else if (val_type == ESP_ADC_CAL_VAL_EFUSE_VREF) { - LOG_INFO("ADC config based on reference voltage stored in eFuse"); + if (!adc_handle) { + esp_err_t err = adc_oneshot_new_unit(&init_config, &adc_handle); + if (err != ESP_OK) { + LOG_ERROR("ADC oneshot init failed: %s", esp_err_to_name(err)); + return false; + } } -#ifdef CONFIG_IDF_TARGET_ESP32S3 - // ESP32S3 - else if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP_FIT) { - LOG_INFO("ADC config based on Two Point values and fitting curve coefficients stored in eFuse"); - } -#endif - else { - LOG_INFO("ADC config based on default reference voltage"); + + adc_oneshot_chan_cfg_t config = { + .atten = atten, + .bitwidth = adc_width, + }; + + esp_err_t err = adc_oneshot_config_channel(adc_handle, adc_channel, &config); + if (err != ESP_OK) { + LOG_ERROR("ADC channel config failed: %s", esp_err_to_name(err)); + return false; } + + adc_calibrated = initAdcCalibration(); #endif // ARCH_ESP32 #ifdef ARCH_NRF52 diff --git a/src/graphics/niche/InkHUD/MessageStore.cpp b/src/graphics/niche/InkHUD/MessageStore.cpp index 94e0aa661..b89a51196 100644 --- a/src/graphics/niche/InkHUD/MessageStore.cpp +++ b/src/graphics/niche/InkHUD/MessageStore.cpp @@ -50,12 +50,14 @@ void InkHUD::MessageStore::saveToFlash() // For each message for (uint8_t i = 0; i < messages.size() && i < MAX_MESSAGES_SAVED; i++) { Message &m = messages.at(i); - f.write((uint8_t *)&m.timestamp, sizeof(m.timestamp)); // Write timestamp. 4 bytes - f.write((uint8_t *)&m.sender, sizeof(m.sender)); // Write sender NodeId. 4 Bytes - f.write((uint8_t *)&m.channelIndex, sizeof(m.channelIndex)); // Write channel index. 1 Byte - f.write((uint8_t *)m.text.c_str(), min(MAX_MESSAGE_SIZE, m.text.size())); // Write message text. Variable length - f.write('\0'); // Append null term - LOG_DEBUG("Wrote message %u, length %u, text \"%s\"", (uint32_t)i, min(MAX_MESSAGE_SIZE, m.text.size()), m.text.c_str()); + f.write((uint8_t *)&m.timestamp, sizeof(m.timestamp)); // Write timestamp. 4 bytes + f.write((uint8_t *)&m.sender, sizeof(m.sender)); // Write sender NodeId. 4 Bytes + f.write((uint8_t *)&m.channelIndex, sizeof(m.channelIndex)); // Write channel index. 1 Byte + f.write((uint8_t *)m.text.c_str(), + std::min(MAX_MESSAGE_SIZE, m.text.size())); // Write message text. Variable length + f.write('\0'); // Append null term + LOG_DEBUG("Wrote message %u, length %u, text \"%s\"", (uint32_t)i, std::min(MAX_MESSAGE_SIZE, m.text.size()), + m.text.c_str()); } // Release firmware's SPI lock, because SafeFile::close needs it diff --git a/src/input/ExpressLRSFiveWay.h b/src/input/ExpressLRSFiveWay.h index 7c7f210f8..e98031710 100644 --- a/src/input/ExpressLRSFiveWay.h +++ b/src/input/ExpressLRSFiveWay.h @@ -13,6 +13,8 @@ #ifdef INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE +// REVISIT esp_adc_cal.h +// "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h" #include #include diff --git a/src/input/TLoraPagerKeyboard.cpp b/src/input/TLoraPagerKeyboard.cpp index 9a4fd8679..73bd63c16 100644 --- a/src/input/TLoraPagerKeyboard.cpp +++ b/src/input/TLoraPagerKeyboard.cpp @@ -68,7 +68,7 @@ TLoraPagerKeyboard::TLoraPagerKeyboard() : TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), modifierFlag(0), last_modifier_time(0), last_key(-1), next_key(-1), last_tap(0L), char_idx(0), tap_interval(0) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) +#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0) ledcAttach(KB_BL_PIN, LEDC_BACKLIGHT_FREQ, LEDC_BACKLIGHT_BIT_WIDTH); #else ledcSetup(LEDC_BACKLIGHT_CHANNEL, LEDC_BACKLIGHT_FREQ, LEDC_BACKLIGHT_BIT_WIDTH); @@ -108,7 +108,7 @@ void TLoraPagerKeyboard::setBacklight(bool on) uint32_t _brightness = 0; if (on) _brightness = brightness; -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) +#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0) ledcWrite(KB_BL_PIN, _brightness); #else ledcWrite(LEDC_BACKLIGHT_CHANNEL, _brightness); diff --git a/src/mesh/api/WiFiServerAPI.h b/src/mesh/api/WiFiServerAPI.h index 5f2019983..4d754e7ed 100644 --- a/src/mesh/api/WiFiServerAPI.h +++ b/src/mesh/api/WiFiServerAPI.h @@ -3,9 +3,8 @@ #include "ServerAPI.h" #include -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET /** diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index 3a264fa5a..e5a6ab552 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -12,9 +12,8 @@ #include #include -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET #ifdef ARCH_ESP32 diff --git a/src/mesh/udp/UdpMulticastHandler.h b/src/mesh/udp/UdpMulticastHandler.h index 2df8686a3..49aab1dea 100644 --- a/src/mesh/udp/UdpMulticastHandler.h +++ b/src/mesh/udp/UdpMulticastHandler.h @@ -12,9 +12,8 @@ #include -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET #define UDP_MULTICAST_DEFAUL_PORT 4403 // Default port for UDP multicast is same as TCP api server diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index 45944872e..aadb59d99 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -10,9 +10,8 @@ #include "target_specific.h" #include -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET #include diff --git a/src/mesh/wifi/WiFiAPClient.h b/src/mesh/wifi/WiFiAPClient.h index 078c40193..4b432cbb1 100644 --- a/src/mesh/wifi/WiFiAPClient.h +++ b/src/mesh/wifi/WiFiAPClient.h @@ -9,9 +9,8 @@ #include #endif -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET extern bool needReconnect; diff --git a/src/modules/esp32/PaxcounterModule.cpp b/src/modules/esp32/PaxcounterModule.cpp index 9c25177bc..4bee4fb7e 100644 --- a/src/modules/esp32/PaxcounterModule.cpp +++ b/src/modules/esp32/PaxcounterModule.cpp @@ -90,8 +90,8 @@ int32_t PaxcounterModule::runOnce() configuration.blecounter = 1; configuration.blescantime = 0; // infinite configuration.wificounter = 1; - configuration.wifi_channel_map = WIFI_CHANNEL_ALL; - configuration.wifi_channel_switch_interval = 50; + // configuration.wifi_channel_map = WIFI_CHANNEL_ALL; + // configuration.wifi_channel_switch_interval = 50; configuration.wifi_rssi_threshold = Default::getConfiguredOrDefault(moduleConfig.paxcounter.wifi_threshold, -80); configuration.ble_rssi_threshold = Default::getConfiguredOrDefault(moduleConfig.paxcounter.ble_threshold, -80); libpax_update_config(&configuration); diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 7c33f0360..7b9000408 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -19,9 +19,8 @@ #include "mesh/wifi/WiFiAPClient.h" #include #endif -#if HAS_ETHERNET && defined(USE_WS5500) -#include -#define ETH ETH2 +#if HAS_ETHERNET && defined(ARCH_ESP32) +#include #endif // HAS_ETHERNET #include "Default.h" #if !defined(ARCH_NRF52) || NRF52_USE_JSON diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index 760964119..7ff1c85f6 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -169,9 +169,10 @@ void esp32Setup() // #define APP_WATCHDOG_SECS 45 #define APP_WATCHDOG_SECS 90 -#ifdef CONFIG_IDF_TARGET_ESP32C6 +#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0) esp_task_wdt_config_t *wdt_config = (esp_task_wdt_config_t *)malloc(sizeof(esp_task_wdt_config_t)); wdt_config->timeout_ms = APP_WATCHDOG_SECS * 1000; + wdt_config->idle_core_mask = 1 << 1; wdt_config->trigger_panic = true; res = esp_task_wdt_init(wdt_config); assert(res == ESP_OK); @@ -259,8 +260,10 @@ void cpuDeepSleep(uint32_t msecToWake) #endif // #end ESP32S3_WAKE_TYPE #endif +#if SOC_PM_SUPPORT_RTC_PERIPH_PD // We want RTC peripherals to stay on esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); +#endif esp_sleep_enable_timer_wakeup(msecToWake * 1000ULL); // call expects usecs esp_deep_sleep_start(); // TBD mA sleep current (battery) diff --git a/src/power.h b/src/power.h index c826d98b4..1518d41a9 100644 --- a/src/power.h +++ b/src/power.h @@ -4,8 +4,10 @@ #include "configuration.h" #ifdef ARCH_ESP32 -// "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h -#include +// #include +#include +#include +#include #include #endif @@ -35,11 +37,6 @@ #define NUM_CELLS 1 #endif -#ifdef BAT_MEASURE_ADC_UNIT -extern RTC_NOINIT_ATTR uint64_t RTC_reg_b; -#include "soc/sens_reg.h" // needed for adc pin reset -#endif - #if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR #include "modules/Telemetry/Sensor/nullSensor.h" #if __has_include() diff --git a/src/sleep.cpp b/src/sleep.cpp index 756582c74..8d79a7d35 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -17,8 +17,6 @@ #include "target_specific.h" #ifdef ARCH_ESP32 -// "esp_pm_config_esp32_t is deprecated, please include esp_pm.h and use esp_pm_config_t instead" -#include "esp32/pm.h" #include "esp_pm.h" #if HAS_WIFI #include "mesh/wifi/WiFiAPClient.h" @@ -389,8 +387,10 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r // NOTE! ESP docs say we must disable bluetooth and wifi before light sleep +#if SOC_PM_SUPPORT_RTC_PERIPH_PD // We want RTC peripherals to stay on esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); +#endif #if defined(BUTTON_PIN) && defined(BUTTON_NEED_PULLUP) gpio_pullup_en((gpio_num_t)BUTTON_PIN); @@ -512,11 +512,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r */ void enableModemSleep() { -#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0) static esp_pm_config_t esp32_config; // filled with zeros because bss -#else - static esp_pm_config_esp32_t esp32_config; // filled with zeros because bss -#endif #if CONFIG_IDF_TARGET_ESP32S3 esp32_config.max_freq_mhz = CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ; #elif CONFIG_IDF_TARGET_ESP32S2 diff --git a/variants/esp32/chatter2/platformio.ini b/variants/esp32/chatter2/platformio.ini index 94a846bc9..e850cd5e1 100644 --- a/variants/esp32/chatter2/platformio.ini +++ b/variants/esp32/chatter2/platformio.ini @@ -9,5 +9,5 @@ build_flags = lib_deps = ${esp32_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip diff --git a/variants/esp32/chatter2/variant.h b/variants/esp32/chatter2/variant.h index 0c1ef6967..98e02d784 100644 --- a/variants/esp32/chatter2/variant.h +++ b/variants/esp32/chatter2/variant.h @@ -72,7 +72,7 @@ // Battery #define BATTERY_PIN 34 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO34_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_6 #define ADC_ATTENUATION \ ADC_ATTEN_DB_2_5 // 2_5-> 100mv-1250mv, 11-> 150mv-3100mv for ESP32 // ESP32-S2/C3/S3 are different diff --git a/variants/esp32/diy/9m2ibr_aprs_lora_tracker/variant.h b/variants/esp32/diy/9m2ibr_aprs_lora_tracker/variant.h index 037933140..182f21673 100644 --- a/variants/esp32/diy/9m2ibr_aprs_lora_tracker/variant.h +++ b/variants/esp32/diy/9m2ibr_aprs_lora_tracker/variant.h @@ -30,7 +30,7 @@ // Battery sense #define BATTERY_PIN 35 #define ADC_MULTIPLIER 2.01 // 100k + 100k, and add 1% tolerance -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION // SPI diff --git a/variants/esp32/diy/dr-dev/variant.h b/variants/esp32/diy/dr-dev/variant.h index 35b18ee74..e47b4c41c 100644 --- a/variants/esp32/diy/dr-dev/variant.h +++ b/variants/esp32/diy/dr-dev/variant.h @@ -3,7 +3,7 @@ #define I2C_SDA 4 #define I2C_SCL 5 #define BATTERY_PIN 34 -#define ADC_CHANNEL ADC1_GPIO34_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_6 // GPS #undef GPS_RX_PIN diff --git a/variants/esp32/diy/hydra/variant.h b/variants/esp32/diy/hydra/variant.h index e5c10e26b..be16643bf 100644 --- a/variants/esp32/diy/hydra/variant.h +++ b/variants/esp32/diy/hydra/variant.h @@ -11,7 +11,7 @@ // Note: On the ESP32 base version, gpio34-39 are input-only, and do not have internal pull-ups. // If 39 is not being used for a button, it is suggested to remove the #define. #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k) #define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards #define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975). diff --git a/variants/esp32/diy/v1/variant.h b/variants/esp32/diy/v1/variant.h index 8a2df3f2b..d5335ea23 100644 --- a/variants/esp32/diy/v1/variant.h +++ b/variants/esp32/diy/v1/variant.h @@ -11,7 +11,7 @@ #define BUTTON_PIN 39 // The middle button GPIO on the T-Beam #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k) #define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards #define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975). diff --git a/variants/esp32/esp32-common.ini b/variants/esp32/esp32-common.ini index 15ab8ad44..df3b2a6b2 100644 --- a/variants/esp32/esp32-common.ini +++ b/variants/esp32/esp32-common.ini @@ -4,8 +4,10 @@ extends = arduino_base custom_esp32_kind = custom_mtjson_part = platform = - # renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32 - platformio/espressif32@6.12.0 + # TODO renovate + ; https://github.com/tasmota/platform-espressif32/releases/download/2025.12.30/platform-espressif32.zip + https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip + ; https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip extra_scripts = ${env.extra_scripts} @@ -24,10 +26,10 @@ board_build.filesystem = littlefs # Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging. # See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h # This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h -build_unflags = -fno-lto +build_unflags = + -fno-lto build_flags = ${arduino_base.build_flags} - -flto -Wall -Wextra -Isrc/platform/esp32 @@ -36,12 +38,6 @@ build_flags = -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL -DAXP_DEBUG_PORT=Serial - -DCONFIG_BT_NIMBLE_ENABLED - -DCONFIG_BT_NIMBLE_MAX_BONDS=6 # default is 3 - -DCONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=2 - -DCONFIG_BT_NIMBLE_MAX_CCCDS=20 - -DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 -DESP_OPENSSL_SUPPRESS_LEGACY_WARNING -DSERIAL_BUFFER_SIZE=4096 -DSERIAL_HAS_ON_RECEIVE @@ -54,26 +50,45 @@ build_flags = lib_deps = ${arduino_base.lib_deps} ${networking_base.lib_deps} - ${networking_extra.lib_deps} ${environmental_base.lib_deps} ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} - # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master - https://github.com/meshtastic/esp32_https_server/archive/3223704846752e6d545139204837bdb2a55459ca.zip + # TODO renovate + https://github.com/jackjansen/esp32_idf5_https_server/archive/v1.1.1.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@2.3.7 - # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master - https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip + # TODO renovate + https://github.com/mverch67/libpax/archive/6f52ee989301cdabaeef00bcbf93bff55708ce2f.zip # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib lewisxhe/XPowersLib@0.3.2 - # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master - https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@0.4.0 lib_ignore = segger_rtt ESP32 BLE Arduino + ; Ignore builtin NimBLE libs + BLE + BluetoothSerial + SimpleBLE + WiFiProv + ArduinoOTA + ; Ignore pioarduino esp32 libs we don't use + ESP_I2S + ESP_NOW + ESP_SR + Insights + Matter + OpenThread + RainMaker + ;SPIFFS + USB + ;NetworkClientSecure + Zigbee + Micro-RTSP + ; testing below + mqtt + esp-mqtt ; leave this commented out to avoid breaking Windows ;upload_port = /dev/ttyUSB0 @@ -86,3 +101,223 @@ lib_ignore = ; customize the partition table ; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables board_build.partitions = partition-table.csv + +custom_component_remove = + espressif/esp_hosted + espressif/esp_wifi_remote + espressif/esp_modem + espressif/esp-dsp + espressif/esp32-camera + espressif/libsodium + espressif/esp-modbus + espressif/qrcode + espressif/esp_insights + espressif/esp_diag_data_store + espressif/esp_diagnostics + espressif/esp_rainmaker + espressif/rmaker_common + espressif/network_provisioning + chmorgan/esp-libhelix-mp3 + espressif/esp-tflite-micro + espressif/esp-sr + espressif/esp_matter + espressif/esp-zboss-lib + espressif/esp-zigbee-lib + espressif/mqtt + +custom_sdkconfig = + ; CONFIG_LOG_DEFAULT_LEVEL=4 + ; CONFIG_LOG_MAXIMUM_LEVEL=4 + ; CONFIG_BT_NIMBLE_CPP_LOG_LEVEL=1 + CONFIG_LOG_COLORS=y + CONFIG_ARDUHAL_LOG_COLORS=y + CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y + CONFIG_IDF_EXPERIMENTAL_FEATURES=y + ; + ; Compiler options + ; + CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=n + CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y + CONFIG_COMPILER_CXX_EXCEPTIONS=n + CONFIG_COMPILER_STACK_CHECK_MODE_NORM=n + CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y + CONFIG_COMPILER_DISABLE_GCC12_WARNINGS=y + CONFIG_COMPILER_DISABLE_GCC13_WARNINGS=y + CONFIG_COMPILER_DISABLE_GCC14_WARNINGS=y + CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=n + CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y + CONFIG_ESP_GDBSTUB_ENABLED=n + CONFIG_ESP_TASK_WDT_INIT=n + CONFIG_NEWLIB_NANO_FORMAT=y + ; LIBC_NEWLIB_NANO_FORMAT is enabled via 'esp32_extra.py' to allow float support + CONFIG_ESP_COREDUMP_ENABLE=n + CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=n + CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y + CONFIG_ESP32_ENABLE_COREDUMP=n + CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=n + CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=n + CONFIG_FREERTOS_USE_TRACE_FACILITY=n + CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y + CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y + CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM=y + CONFIG_ESP_WIFI_IRAM_OPT=n + CONFIG_ESP32_WIFI_RX_IRAM_OPT=n + CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=n + CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=n + CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=n + CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=n + CONFIG_UNITY_ENABLE_FLOAT=n + CONFIG_UNITY_ENABLE_DOUBLE=n + CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n + CONFIG_SUPPORT_TERMIOS=n + CONFIG_VFS_SUPPORT_TERMIOS=n + CONFIG_VFS_SUPPORT_SELECT=n + CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=n + CONFIG_WS_TRANSPORT=n + CONFIG_PPP_SUPPORT=n + ; CONFIG_LWIP_DHCPS=n + CONFIG_LWIP_PPP_SUPPORT=n + CONFIG_LWIP_IP_FORWARD=n + CONFIG_LWIP_IPV4_NAPT=n + ; + ; MBEDTLS + ; + CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=8192 + CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n + CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN=y + ; Switch to custom CA bundle (for Meshtastic MQTT/etc) in the future + ; https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/kconfig-reference.html#certificate-bundle-configuration + ; CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE=y + ; CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH="" + CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=1 + ; #shame + CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION=y + CONFIG_MBEDTLS_SSL_RENEGOTIATION=n + CONFIG_MBEDTLS_SSL_PROTO_DTLS=n + CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=n + CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=n + CONFIG_MBEDTLS_PKCS7_C=n + CONFIG_MBEDTLS_CAMELLIA_C=n + CONFIG_MBEDTLS_CCM_C=n + CONFIG_MBEDTLS_CMAC_C=n + CONFIG_MBEDTLS_SHA512_C=n + CONFIG_MBEDTLS_X509_CRL_PARSE_C=n + CONFIG_MBEDTLS_X509_CSR_PARSE_C=n + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=n + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=n + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=n + CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=n + CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=n + CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=n + CONFIG_MDNS_ENABLE_CONSOLE_CLI=n + CONFIG_MDNS_PREDEF_NETIF_AP=n + ; CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n + CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=n + CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=n + CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=n + CONFIG_ESP_WIFI_ENABLE_SAE_H2E=n + CONFIG_OPENTHREAD_ENABLED=n + CONFIG_ZB_ENABLED=n + CONFIG_IEEE802154_ENABLED=n + CONFIG_ESP_INSIGHTS_ENABLED=n + CONFIG_HTTPD_WS_SUPPORT=n + CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=n + CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH=n + ; using esp-idf5-https_server library instead, for now? + CONFIG_ESP_HTTPS_SERVER_ENABLE=n + ; + ; Builtin ESP-MQTT, we don't use this (yet?) + ; + CONFIG_MQTT_TRANSPORT_SSL=n + CONFIG_MQTT_TRANSPORT_WEBSOCKET=n + CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=n + CONFIG_MQTT_PROTOCOL_311=n + ; + ; Ethernet + ; Disabled in esp32_common, re-enable on variants that need it + ; + CONFIG_ETH_ENABLED=n + CONFIG_ARDUINO_SELECTIVE_Ethernet=n + ; + ; Bluetooth + ; + CONFIG_BLE_MESH=n + CONFIG_BT_ENABLED=y + CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y + CONFIG_BT_BLUEDROID_ENABLED=n + CONFIG_BT_NIMBLE_ENABLED=y + CONFIG_BT_NIMBLE_NVS_PERSIST=y + CONFIG_BT_NIMBLE_ROLE_CENTRAL=n + CONFIG_BT_NIMBLE_ROLE_OBSERVER=n + CONFIG_BT_CONTROLLER_ENABLED=y + CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 + CONFIG_BT_NIMBLE_MAX_CCCDS=20 + CONFIG_BT_NIMBLE_MAX_BONDS=6 + CONFIG_BT_NIMBLE_ENABLE_PERIODIC_SYNC=n + CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV=n + CONFIG_BT_NIMBLE_EXT_SCAN=n + CONFIG_BT_NIMBLE_PERIODIC_ADV_SYNC_TRANSFER=n + CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY=n + CONFIG_BT_NIMBLE_BLUFI_ENABLE=n + CONFIG_BT_NIMBLE_PROX_SERVICE=n + CONFIG_BT_NIMBLE_ANS_SERVICE=n + CONFIG_BT_NIMBLE_CTS_SERVICE=n + CONFIG_BT_NIMBLE_HTP_SERVICE=n + CONFIG_BT_NIMBLE_IPSS_SERVICE=n + CONFIG_BT_NIMBLE_TPS_SERVICE=n + CONFIG_BT_NIMBLE_IAS_SERVICE=n + CONFIG_BT_NIMBLE_LLS_SERVICE=n + CONFIG_BT_NIMBLE_SPS_SERVICE=n + CONFIG_BT_NIMBLE_HR_SERVICE=n + CONFIG_BT_NIMBLE_HID_SERVICE=n + CONFIG_BT_NIMBLE_BAS_SERVICE=n + CONFIG_BT_NIMBLE_DIS_SERVICE=n + ; + ; Arduino selective compilation + ; Disable unused Arduino libraries to save space + ; + CONFIG_ARDUINO_SELECTIVE_COMPILATION=y + CONFIG_ARDUINO_SELECTIVE_SPI=y + CONFIG_ARDUINO_SELECTIVE_Wire=y + CONFIG_ARDUINO_SELECTIVE_ESP_SR=n + CONFIG_ARDUINO_SELECTIVE_EEPROM=y + CONFIG_ARDUINO_SELECTIVE_Preferences=y + CONFIG_ARDUINO_SELECTIVE_Ticker=y + CONFIG_ARDUINO_SELECTIVE_Update=y + CONFIG_ARDUINO_SELECTIVE_Zigbee=n + CONFIG_ARDUINO_SELECTIVE_FS=y + CONFIG_ARDUINO_SELECTIVE_SD=y + CONFIG_ARDUINO_SELECTIVE_SD_MMC=y + CONFIG_ARDUINO_SELECTIVE_SPIFFS=y + CONFIG_ARDUINO_SELECTIVE_FFat=n + CONFIG_ARDUINO_SELECTIVE_LittleFS=y + CONFIG_ARDUINO_SELECTIVE_Network=y + ; CONFIG_ARDUINO_SELECTIVE_Ethernet=n + CONFIG_ARDUINO_SELECTIVE_PPP=n + CONFIG_ARDUINO_SELECTIVE_Hash=y + CONFIG_ARDUINO_SELECTIVE_ArduinoOTA=n + CONFIG_ARDUINO_SELECTIVE_AsyncUDP=y + CONFIG_ARDUINO_SELECTIVE_DNSServer=n + CONFIG_ARDUINO_SELECTIVE_ESPmDNS=y + CONFIG_ARDUINO_SELECTIVE_HTTPClient=n + CONFIG_ARDUINO_SELECTIVE_Matter=n + CONFIG_ARDUINO_SELECTIVE_NetBIOS=n + CONFIG_ARDUINO_SELECTIVE_WebServer=n + CONFIG_ARDUINO_SELECTIVE_WiFi=y + CONFIG_ARDUINO_SELECTIVE_NetworkClientSecure=y + CONFIG_ARDUINO_SELECTIVE_WiFiProv=n + CONFIG_ARDUINO_SELECTIVE_BLE=n + CONFIG_ARDUINO_SELECTIVE_BluetoothSerial=n + CONFIG_ARDUINO_SELECTIVE_SimpleBLE=n + CONFIG_ARDUINO_SELECTIVE_RainMaker=n + CONFIG_ARDUINO_SELECTIVE_OpenThread=n + CONFIG_ARDUINO_SELECTIVE_Insights=n diff --git a/variants/esp32/esp32.ini b/variants/esp32/esp32.ini index 532fd4e12..bd10c3ca6 100644 --- a/variants/esp32/esp32.ini +++ b/variants/esp32/esp32.ini @@ -6,3 +6,8 @@ custom_esp32_kind = esp32 build_flags = ${esp32_common.build_flags} + -mtext-section-literals + -DMESHTASTIC_EXCLUDE_AUDIO=1 + +custom_sdkconfig = + ${esp32_common.custom_sdkconfig} diff --git a/variants/esp32/heltec_wsl_v2.1/variant.h b/variants/esp32/heltec_wsl_v2.1/variant.h index 3927a89d6..262b4e143 100644 --- a/variants/esp32/heltec_wsl_v2.1/variant.h +++ b/variants/esp32/heltec_wsl_v2.1/variant.h @@ -12,7 +12,7 @@ #define ADC_CTRL 21 #define ADC_CTRL_ENABLED LOW #define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_CHANNEL_1 +#define ADC_CHANNEL ADC_CHANNEL_1 // ratio of voltage divider = 3.20 (R1=100k, R2=220k) #define ADC_MULTIPLIER 3.2 diff --git a/variants/esp32/m5stack_core/platformio.ini b/variants/esp32/m5stack_core/platformio.ini index 5006d62ff..807569744 100644 --- a/variants/esp32/m5stack_core/platformio.ini +++ b/variants/esp32/m5stack_core/platformio.ini @@ -25,5 +25,5 @@ lib_ignore = m5stack-core lib_deps = ${esp32_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip diff --git a/variants/esp32/m5stack_coreink/variant.h b/variants/esp32/m5stack_coreink/variant.h index b1708352b..4f9bba489 100644 --- a/variants/esp32/m5stack_coreink/variant.h +++ b/variants/esp32/m5stack_coreink/variant.h @@ -93,7 +93,7 @@ #define PIN_EINK_MOSI 23 // EPD_MOSI #define BATTERY_PIN 35 -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 // https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/m5paper/M5_PAPER_SCH.pdf // https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58 // VBAT diff --git a/variants/esp32/nano-g1-explorer/variant.h b/variants/esp32/nano-g1-explorer/variant.h index f3640241a..48d064710 100644 --- a/variants/esp32/nano-g1-explorer/variant.h +++ b/variants/esp32/nano-g1-explorer/variant.h @@ -33,7 +33,7 @@ #endif #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity. #define ADC_MULTIPLIER 2 diff --git a/variants/esp32/radiomaster_900_bandit/platformio.ini b/variants/esp32/radiomaster_900_bandit/platformio.ini index 6729235ed..fdc483fe3 100644 --- a/variants/esp32/radiomaster_900_bandit/platformio.ini +++ b/variants/esp32/radiomaster_900_bandit/platformio.ini @@ -7,7 +7,7 @@ build_flags = -DVTABLES_IN_FLASH=1 -DCONFIG_DISABLE_HAL_LOCKS=1 -DHAS_STK8XXX=1 - -O2 + ; -O2 -I variants/esp32/radiomaster_900_bandit board_build.f_cpu = 240000000L upload_protocol = esptool diff --git a/variants/esp32/rak11200/variant.h b/variants/esp32/rak11200/variant.h index 01edb8b73..cafc1ac8b 100644 --- a/variants/esp32/rak11200/variant.h +++ b/variants/esp32/rak11200/variant.h @@ -49,7 +49,7 @@ static const uint8_t SCK = 33; #define PIN_VBAT WB_A0 #define BATTERY_PIN PIN_VBAT -#define ADC_CHANNEL ADC1_GPIO36_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 // https://docs.rakwireless.com/Product-Categories/WisBlock/RAK13300/ diff --git a/variants/esp32/station-g1/variant.h b/variants/esp32/station-g1/variant.h index 6c3a39261..29f3cc1d8 100644 --- a/variants/esp32/station-g1/variant.h +++ b/variants/esp32/station-g1/variant.h @@ -32,7 +32,7 @@ #endif #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define BATTERY_SENSE_SAMPLES 30 // Set the number of samples, It has an effect of increasing sensitivity. #define ADC_MULTIPLIER 6.45 #define CELL_TYPE_LION // same curve for liion/lipo diff --git a/variants/esp32/tbeam_v07/variant.h b/variants/esp32/tbeam_v07/variant.h index 898705ce2..1fdb295bf 100644 --- a/variants/esp32/tbeam_v07/variant.h +++ b/variants/esp32/tbeam_v07/variant.h @@ -6,7 +6,7 @@ #define BUTTON_PIN 39 #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module diff --git a/variants/esp32/tlora_v1_3/variant.h b/variants/esp32/tlora_v1_3/variant.h index 73cb31f27..6533b3782 100644 --- a/variants/esp32/tlora_v1_3/variant.h +++ b/variants/esp32/tlora_v1_3/variant.h @@ -1,5 +1,5 @@ #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define I2C_SDA 21 // I2C pins for this board #define I2C_SCL 22 diff --git a/variants/esp32/tlora_v2/variant.h b/variants/esp32/tlora_v2/variant.h index 8a7cf89ec..df78dbc6a 100644 --- a/variants/esp32/tlora_v2/variant.h +++ b/variants/esp32/tlora_v2/variant.h @@ -1,5 +1,5 @@ #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define I2C_SDA 21 // I2C pins for this board #define I2C_SCL 22 diff --git a/variants/esp32/tlora_v2_1_16/variant.h b/variants/esp32/tlora_v2_1_16/variant.h index 9584dd68b..a03b0d8e7 100644 --- a/variants/esp32/tlora_v2_1_16/variant.h +++ b/variants/esp32/tlora_v2_1_16/variant.h @@ -1,5 +1,5 @@ #define BATTERY_PIN 35 -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define BATTERY_SENSE_SAMPLES 30 // ratio of voltage divider = 2.0 (R42=100k, R43=100k) diff --git a/variants/esp32/tlora_v2_1_18/variant.h b/variants/esp32/tlora_v2_1_18/variant.h index efc676992..df32f4a55 100644 --- a/variants/esp32/tlora_v2_1_18/variant.h +++ b/variants/esp32/tlora_v2_1_18/variant.h @@ -1,7 +1,7 @@ #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage // ratio of voltage divider = 2.0 (R42=100k, R43=100k) #define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define I2C_SDA 21 // I2C pins for this board #define I2C_SCL 22 diff --git a/variants/esp32/trackerd/variant.h b/variants/esp32/trackerd/variant.h index c4dfb9e93..038044583 100644 --- a/variants/esp32/trackerd/variant.h +++ b/variants/esp32/trackerd/variant.h @@ -23,7 +23,7 @@ #undef BAT_MEASURE_ADC_UNIT #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_MULTIPLIER 1.34 // tracked resistance divider is 100k+470k, so it can not fillfull well on esp32 adc -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define ADC_ATTENUATION ADC_ATTEN_DB_12 // lower dB for high resistance voltage divider #undef GPS_RX_PIN diff --git a/variants/esp32/wiphone/platformio.ini b/variants/esp32/wiphone/platformio.ini index fcf36a23c..0f3ce004d 100644 --- a/variants/esp32/wiphone/platformio.ini +++ b/variants/esp32/wiphone/platformio.ini @@ -10,8 +10,8 @@ build_flags = -I variants/esp32/wiphone lib_deps = ${esp32_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip # renovate: datasource=custom.pio depName=SX1509 IO Expander packageName=sparkfun/library/SX1509 IO Expander sparkfun/SX1509 IO Expander@3.0.6 # renovate: datasource=custom.pio depName=APA102 packageName=pololu/library/APA102 diff --git a/variants/esp32c3/align-text.handler_execute-4.ld b/variants/esp32c3/align-text.handler_execute-4.ld new file mode 100644 index 000000000..e747edcc4 --- /dev/null +++ b/variants/esp32c3/align-text.handler_execute-4.ld @@ -0,0 +1,11 @@ +/* Arduino fix: catch esp_event's orphaned .text.handler_execute section and align to 4 bytes */ +SECTIONS +{ + .text.handler_execute : + { + KEEP(*(.text.handler_execute)) + KEEP(*(.text.handler_execute.*)) + . = ALIGN(4); + } +} +INSERT AFTER .flash.text; \ No newline at end of file diff --git a/variants/esp32c3/esp32c3.ini b/variants/esp32c3/esp32c3.ini index 7634a4141..873fd1cfc 100644 --- a/variants/esp32c3/esp32c3.ini +++ b/variants/esp32c3/esp32c3.ini @@ -7,5 +7,18 @@ monitor_filters = esp32_c3_exception_decoder build_flags = ${esp32_common.build_flags} - -DCONFIG_BT_NIMBLE_EXT_ADV=1 - -DCONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=2 + ; Linker script to align text.handler_execute section to 4 bytes + -Wl,-Tvariants/esp32c3/align-text.handler_execute-4.ld + +custom_sdkconfig = + ${esp32_common.custom_sdkconfig} + ; ESP32c3 doesn't support SD_MMC + CONFIG_ARDUINO_SELECTIVE_SD_MMC=n + CONFIG_BT_NIMBLE_EXT_ADV=y + CONFIG_BT_NIMBLE_TRANSPORT_EVT_SIZE=257 + CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=2 + +lib_deps = + ${esp32_common.lib_deps} + # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master + https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip diff --git a/variants/esp32c6/esp32c6.ini b/variants/esp32c6/esp32c6.ini index c1dfa4d28..a32c0e240 100644 --- a/variants/esp32c6/esp32c6.ini +++ b/variants/esp32c6/esp32c6.ini @@ -1,48 +1,32 @@ [esp32c6_base] extends = esp32_common -platform = - # Do not renovate until we have switched to pioarduino tagged builds - https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip -build_flags = - ${arduino_base.build_flags} - -Wall - -Wextra - -Isrc/platform/esp32 - -std=c++11 - -DESP_OPENSSL_SUPPRESS_LEGACY_WARNING - -DSERIAL_BUFFER_SIZE=4096 - -DLIBPAX_ARDUINO - -DLIBPAX_WIFI - -DLIBPAX_BLE - -DMESHTASTIC_EXCLUDE_WEBSERVER - ;-DDEBUG_HEAP - ; TEMP - -DHAS_BLUETOOTH=0 - -DMESHTASTIC_EXCLUDE_PAXCOUNTER - -DMESHTASTIC_EXCLUDE_BLUETOOTH +custom_esp32_kind = esp32c6 -lib_deps = - ${arduino_base.lib_deps} - ${networking_base.lib_deps} - ${environmental_base.lib_deps} - ${environmental_extra.lib_deps} - ${radiolib_base.lib_deps} - # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib - lewisxhe/XPowersLib@0.3.2 - # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master - https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip - # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto - rweather/Crypto@0.4.0 +build_flags = + ${esp32_common.build_flags} + ; Exclude Paxcounter, it uses 'esp_vhci_host_send_packet' whch is not available on ESP32-C6 + ; https://github.com/espressif/arduino-esp32/issues/11716 + -DMESHTASTIC_EXCLUDE_PAXCOUNTER build_src_filter = - ${esp32_common.build_src_filter} - + ${esp32_common.build_src_filter} monitor_speed = 460800 monitor_filters = esp32_c3_exception_decoder +custom_sdkconfig = + ${esp32_common.custom_sdkconfig} + ; ESP32c6 doesn't support SD_MMC + CONFIG_ARDUINO_SELECTIVE_SD_MMC=n + CONFIG_BT_NIMBLE_EXT_ADV=y + CONFIG_BT_NIMBLE_TRANSPORT_EVT_SIZE=257 + CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=2 + lib_ignore = ${esp32_common.lib_ignore} - NonBlockingRTTTL - NimBLE-Arduino libpax - + +lib_deps = + ${esp32_common.lib_deps} + # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master + https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip diff --git a/variants/esp32c6/m5stack_unitc6l/platformio.ini b/variants/esp32c6/m5stack_unitc6l/platformio.ini index 780f32c4e..cdfbcdf58 100644 --- a/variants/esp32c6/m5stack_unitc6l/platformio.ini +++ b/variants/esp32c6/m5stack_unitc6l/platformio.ini @@ -6,29 +6,16 @@ board = esp32-c6-devkitc-1 ;Normal method upload_protocol = esptool ;upload_port = /dev/ttyACM2 -build_unflags = - -D HAS_BLUETOOTH - -D MESHTASTIC_EXCLUDE_BLUETOOTH - -D HAS_WIFI lib_deps = ${esp32c6_base.lib_deps} # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel adafruit/Adafruit NeoPixel@1.15.2 - # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino - h2zero/NimBLE-Arduino@2.3.7 build_flags = ${esp32c6_base.build_flags} -D M5STACK_UNITC6L -I variants/esp32c6/m5stack_unitc6l - -DMESHTASTIC_EXCLUDE_PAXCOUNTER=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 - -D HAS_BLUETOOTH=1 - -DCONFIG_BT_NIMBLE_EXT_ADV=1 - -DCONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=2 monitor_speed=115200 -lib_ignore = - NonBlockingRTTTL - libpax build_src_filter = ${esp32c6_base.build_src_filter} +<../variants/esp32c6/m5stack_unitc6l> \ No newline at end of file diff --git a/variants/esp32c6/tlora_c6/platformio.ini b/variants/esp32c6/tlora_c6/platformio.ini index 6b402d7c5..46d17c075 100644 --- a/variants/esp32c6/tlora_c6/platformio.ini +++ b/variants/esp32c6/tlora_c6/platformio.ini @@ -8,3 +8,10 @@ build_flags = -I variants/esp32c6/tlora_c6 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 + ; Disable audio. + ; ESP32-C6 with 4MB flash is TIGHT on space. + -DMESHTASTIC_EXCLUDE_AUDIO=1 + +lib_ignore = + ${esp32c6_base.lib_ignore} + ESP32 Codec2 diff --git a/variants/esp32s2/esp32s2.ini b/variants/esp32s2/esp32s2.ini index c806943ee..b338bbf14 100644 --- a/variants/esp32s2/esp32s2.ini +++ b/variants/esp32s2/esp32s2.ini @@ -12,8 +12,17 @@ build_flags = -DHAS_BLUETOOTH=0 -DMESHTASTIC_EXCLUDE_PAXCOUNTER -DMESHTASTIC_EXCLUDE_BLUETOOTH - + -mtext-section-literals + +custom_sdkconfig = + ${esp32_common.custom_sdkconfig} + lib_ignore = ${esp32_common.lib_ignore} NimBLE-Arduino libpax + +lib_deps = + ${esp32_common.lib_deps} + # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master + https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip diff --git a/variants/esp32s3/CDEBYTE_EoRa-S3/variant.h b/variants/esp32s3/CDEBYTE_EoRa-S3/variant.h index 5da99667b..e33e347ff 100644 --- a/variants/esp32s3/CDEBYTE_EoRa-S3/variant.h +++ b/variants/esp32s3/CDEBYTE_EoRa-S3/variant.h @@ -18,7 +18,7 @@ // Battery voltage monitoring - TODO: test, currently untested, copied from T3S3 variant #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_MULTIPLIER \ 2.11 // ratio of voltage divider = 2.0 (R10=1M, R13=1M), plus some undervoltage correction - TODO: this was carried over from // the T3S3, test to see if the undervoltage correction is needed. diff --git a/variants/esp32s3/ELECROW-ThinkNode-M2/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M2/variant.h index ff4f883fe..a5154a8ab 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M2/variant.h +++ b/variants/esp32s3/ELECROW-ThinkNode-M2/variant.h @@ -43,8 +43,8 @@ // Battery // #define BATTERY_PIN 2 #define BATTERY_PIN 17 -// #define ADC_CHANNEL ADC1_GPIO2_CHANNEL -#define ADC_CHANNEL ADC2_GPIO17_CHANNEL +// #define ADC_CHANNEL ADC_CHANNEL_1 +#define ADC_CHANNEL ADC_CHANNEL_6 #define BATTERY_SENSE_RESOLUTION_BITS 12 #define BATTERY_SENSE_RESOLUTION 4096.0 #undef AREF_VOLTAGE diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h index 5f5133e61..ff6647b28 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h @@ -12,7 +12,7 @@ // USB_CHECK #define EXT_PWR_DETECT 12 #define BATTERY_PIN 8 -#define ADC_CHANNEL ADC1_GPIO8_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_7 #define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. diff --git a/variants/esp32s3/crowpanel-esp32s3-5-epaper/variant.h b/variants/esp32s3/crowpanel-esp32s3-5-epaper/variant.h index 360e33481..ab80d773e 100644 --- a/variants/esp32s3/crowpanel-esp32s3-5-epaper/variant.h +++ b/variants/esp32s3/crowpanel-esp32s3-5-epaper/variant.h @@ -17,7 +17,7 @@ // #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to // measure battery voltage ratio of voltage divider = 2.0 (assumption) // #define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. -// #define ADC_CHANNEL ADC1_GPIO1_CHANNEL +// #define ADC_CHANNEL ADC_CHANNEL_0 #define I2C_SDA SDA // 21 #define I2C_SCL SCL // 15 diff --git a/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini index 95e909b91..04076ed10 100644 --- a/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini +++ b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini @@ -14,9 +14,6 @@ lib_deps = zinggjm/GxEPD2@1.6.5 # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel adafruit/Adafruit NeoPixel@1.15.2 -build_unflags = - ${esp32s3_base.build_unflags} - -DARDUINO_USB_MODE=1 build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW @@ -28,3 +25,4 @@ build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DARDUINO_USB_MODE=0 + -DARDUINO_USB_CDC_ON_BOOT=1 diff --git a/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini b/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini index 4f759d1e6..67b08c055 100644 --- a/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini +++ b/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini @@ -12,13 +12,9 @@ lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel adafruit/Adafruit NeoPixel@1.15.2 -build_unflags = - ${esp32s3_base.build_unflags} - -DARDUINO_USB_MODE=1 build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW -I variants/esp32s3/diy/my_esp32s3_diy_oled -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -DARDUINO_USB_MODE=0 diff --git a/variants/esp32s3/diy/t-energy-s3_e22/platformio.ini b/variants/esp32s3/diy/t-energy-s3_e22/platformio.ini index 681ee6c45..9d977e45d 100644 --- a/variants/esp32s3/diy/t-energy-s3_e22/platformio.ini +++ b/variants/esp32s3/diy/t-energy-s3_e22/platformio.ini @@ -6,13 +6,10 @@ board_build.partitions = default_16MB.csv board_level = extra board_upload.flash_size = 16MB ;Specify the FLASH capacity as 16MB board_build.arduino.memory_type = qio_opi ;Enable internal PSRAM -build_unflags = - ${esp32s3_base.build_unflags} - -D ARDUINO_USB_MODE=1 build_flags = ${esp32s3_base.build_flags} -D EBYTE_ESP32_S3 -D BOARD_HAS_PSRAM - -D ARDUINO_USB_MODE=0 + -D ARDUINO_USB_MODE=1 -D ARDUINO_USB_CDC_ON_BOOT=1 -I variants/esp32s3/diy/t-energy-s3_e22 diff --git a/variants/esp32s3/diy/t-energy-s3_e22/variant.h b/variants/esp32s3/diy/t-energy-s3_e22/variant.h index 6933d7715..10a0fc20d 100644 --- a/variants/esp32s3/diy/t-energy-s3_e22/variant.h +++ b/variants/esp32s3/diy/t-energy-s3_e22/variant.h @@ -4,7 +4,7 @@ // Battery #define BATTERY_PIN 3 #define ADC_MULTIPLIER 2.0 -#define ADC_CHANNEL ADC1_GPIO3_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_2 // Button on NanoVHF PCB #define BUTTON_PIN 39 diff --git a/variants/esp32s3/dreamcatcher/platformio.ini b/variants/esp32s3/dreamcatcher/platformio.ini index c830346e0..1480864fd 100644 --- a/variants/esp32s3/dreamcatcher/platformio.ini +++ b/variants/esp32s3/dreamcatcher/platformio.ini @@ -13,7 +13,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=ESP8266Audio packageName=earlephilhower/library/ESP8266Audio - earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266Audio@2.4.1 # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM earlephilhower/ESP8266SAM@1.1.0 diff --git a/variants/esp32s3/elecrow_panel/pins_arduino.h b/variants/esp32s3/elecrow_panel/pins_arduino.h index 81c9e0a2c..75b5d561a 100644 --- a/variants/esp32s3/elecrow_panel/pins_arduino.h +++ b/variants/esp32s3/elecrow_panel/pins_arduino.h @@ -15,9 +15,9 @@ static const uint8_t MOSI = 48; static const uint8_t MISO = 47; static const uint8_t SCK = 41; -static const uint8_t SPI_MOSI = 6; -static const uint8_t SPI_SCK = 5; -static const uint8_t SPI_MISO = 4; +// static const uint8_t SPI_MOSI = 6; +// static const uint8_t SPI_SCK = 5; +// static const uint8_t SPI_MISO = 4; static const uint8_t A0 = 1; static const uint8_t A1 = 2; diff --git a/variants/esp32s3/elecrow_panel/platformio.ini b/variants/esp32s3/elecrow_panel/platformio.ini index 3ed90f3f1..604f2dd8c 100644 --- a/variants/esp32s3/elecrow_panel/platformio.ini +++ b/variants/esp32s3/elecrow_panel/platformio.ini @@ -38,15 +38,19 @@ build_flags = ${esp32s3_base.build_flags} -Os -D USE_PACKET_API -D HAS_SDCARD -D SD_SPI_FREQUENCY=75000000 + -D SPI_MISO=4 + -D SPI_MOSI=6 + -D SPI_SCK=5 lib_deps = ${esp32s3_base.lib_deps} ${device-ui_base.lib_deps} # renovate: datasource=custom.pio depName=ESP8266Audio packageName=earlephilhower/library/ESP8266Audio - earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266Audio@2.4.1 # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM - earlephilhower/ESP8266SAM@1.0.1 - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality + earlephilhower/ESP8266SAM@1.1.0 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip + ; REVISIT note: v1.2.7 breaks the elecrow 7" display functionality # renovate: datasource=custom.pio depName=TCA9534 packageName=hideakitai/library/TCA9534 hideakitai/TCA9534@0.1.1 diff --git a/variants/esp32s3/esp32-s3-pico/variant.h b/variants/esp32s3/esp32-s3-pico/variant.h index bfcb6059d..ea877a800 100644 --- a/variants/esp32s3/esp32-s3-pico/variant.h +++ b/variants/esp32s3/esp32-s3-pico/variant.h @@ -22,8 +22,8 @@ // https://www.waveshare.com/img/devkit/ESP32-S3-Pico/ESP32-S3-Pico-details-inter-1.jpg // digram is incorrect labeled as battery pin is getting readings on GPIO7_CH1? #define BATTERY_PIN 7 -#define ADC_CHANNEL ADC1_GPIO7_CHANNEL -// #define ADC_CHANNEL ADC1_GPIO6_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_6 +// #define ADC_CHANNEL ADC_CHANNEL_5 // ratio of voltage divider = 3.0 (R17=200k, R18=100k) #define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic diff --git a/variants/esp32s3/esp32s3.ini b/variants/esp32s3/esp32s3.ini index 92ce25084..9423f650d 100644 --- a/variants/esp32s3/esp32s3.ini +++ b/variants/esp32s3/esp32s3.ini @@ -6,5 +6,15 @@ monitor_speed = 115200 build_flags = ${esp32_common.build_flags} - -DCONFIG_BT_NIMBLE_EXT_ADV=1 - -DCONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=2 + -mtext-section-literals + +custom_sdkconfig = + ${esp32_common.custom_sdkconfig} + CONFIG_BT_NIMBLE_EXT_ADV=y + CONFIG_BT_NIMBLE_TRANSPORT_EVT_SIZE=257 + CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=2 + +lib_deps = + ${esp32_common.lib_deps} + # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master + https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip diff --git a/variants/esp32s3/hackaday-communicator/variant.h b/variants/esp32s3/hackaday-communicator/variant.h index a127f548f..b5de24b24 100644 --- a/variants/esp32s3/hackaday-communicator/variant.h +++ b/variants/esp32s3/hackaday-communicator/variant.h @@ -22,7 +22,7 @@ // #define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage // ratio of voltage divider = 2.0 (RD2=100k, RD3=100k) // #define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. -// #define ADC_CHANNEL ADC1_GPIO4_CHANNEL +// #define ADC_CHANNEL ADC_CHANNEL_3 // keyboard #define I2C_SDA 47 // I2C pins for this board diff --git a/variants/esp32s3/heltec_capsule_sensor_v3/variant.h b/variants/esp32s3/heltec_capsule_sensor_v3/variant.h index b30b7fc3e..2d94097e1 100644 --- a/variants/esp32s3/heltec_capsule_sensor_v3/variant.h +++ b/variants/esp32s3/heltec_capsule_sensor_v3/variant.h @@ -7,7 +7,7 @@ #define BUTTON_ACTIVE_PULLUP false #define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO7_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_6 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER (4.9 * 1.045) #define ADC_CTRL 36 // active HIGH, powers the voltage divider. Only on 1.1 diff --git a/variants/esp32s3/heltec_sensor_hub/variant.h b/variants/esp32s3/heltec_sensor_hub/variant.h index 8c5d31c9a..4bbefa616 100644 --- a/variants/esp32s3/heltec_sensor_hub/variant.h +++ b/variants/esp32s3/heltec_sensor_hub/variant.h @@ -5,7 +5,7 @@ #define BUTTON_ACTIVE_PULLUP false #define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO7_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_6 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER (4.9 * 1.045) #define ADC_CTRL 34 // active HIGH, powers the voltage divider. Only on 1.1 diff --git a/variants/esp32s3/heltec_v3/variant.h b/variants/esp32s3/heltec_v3/variant.h index d760c3b7f..ab25028ad 100644 --- a/variants/esp32s3/heltec_v3/variant.h +++ b/variants/esp32s3/heltec_v3/variant.h @@ -16,7 +16,7 @@ #define ADC_CTRL 37 #define ADC_CTRL_ENABLED LOW #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 * 1.045 diff --git a/variants/esp32s3/heltec_v4/platformio.ini b/variants/esp32s3/heltec_v4/platformio.ini index 28f7e0484..49ba6748c 100644 --- a/variants/esp32s3/heltec_v4/platformio.ini +++ b/variants/esp32s3/heltec_v4/platformio.ini @@ -103,8 +103,8 @@ build_flags = lib_deps = ${heltec_v4_base.lib_deps} ; ${device-ui_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.0 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip # renovate: datasource=git-refs depName=Quency-D_chsc6x packageName=https://github.com/Quency-D/chsc6x gitBranch=master https://github.com/Quency-D/chsc6x/archive/5cbead829d6b432a8d621ed1aafd4eb474fd4f27.zip ; TODO revert to official device-ui (when merged) diff --git a/variants/esp32s3/heltec_v4/variant.h b/variants/esp32s3/heltec_v4/variant.h index 6524bbc72..2d349168a 100644 --- a/variants/esp32s3/heltec_v4/variant.h +++ b/variants/esp32s3/heltec_v4/variant.h @@ -4,7 +4,7 @@ #define ADC_CTRL 37 #define ADC_CTRL_ENABLED HIGH #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 * 1.045 diff --git a/variants/esp32s3/heltec_vision_master_e213/platformio.ini b/variants/esp32s3/heltec_vision_master_e213/platformio.ini index cf28eb3e6..d9d831350 100644 --- a/variants/esp32s3/heltec_vision_master_e213/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_e213/platformio.ini @@ -4,6 +4,7 @@ board = heltec_vision_master_e213 board_build.partitions = default_8MB.csv build_flags = ${esp32s3_base.build_flags} + -DBOARD_HAS_PSRAM -Ivariants/esp32s3/heltec_vision_master_e213 -DHELTEC_VISION_MASTER_E213 -DUSE_EINK @@ -32,6 +33,7 @@ build_src_filter = build_flags = ${esp32s3_base.build_flags} ${inkhud.build_flags} + -D BOARD_HAS_PSRAM -I variants/esp32s3/heltec_vision_master_e213 -D HELTEC_VISION_MASTER_E213 lib_deps = diff --git a/variants/esp32s3/heltec_vision_master_e213/variant.h b/variants/esp32s3/heltec_vision_master_e213/variant.h index 60f4e00cc..592f234be 100644 --- a/variants/esp32s3/heltec_vision_master_e213/variant.h +++ b/variants/esp32s3/heltec_vision_master_e213/variant.h @@ -28,7 +28,7 @@ #define ADC_CTRL 46 #define ADC_CTRL_ENABLED HIGH #define BATTERY_PIN 7 -#define ADC_CHANNEL ADC1_GPIO7_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_6 #define ADC_MULTIPLIER 4.9 * 1.03 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 diff --git a/variants/esp32s3/heltec_vision_master_e290/variant.h b/variants/esp32s3/heltec_vision_master_e290/variant.h index d7bae7dc2..2b9bffbaf 100644 --- a/variants/esp32s3/heltec_vision_master_e290/variant.h +++ b/variants/esp32s3/heltec_vision_master_e290/variant.h @@ -27,7 +27,7 @@ #define ADC_CTRL 46 #define ADC_CTRL_ENABLED HIGH #define BATTERY_PIN 7 -#define ADC_CHANNEL ADC1_GPIO7_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_6 #define ADC_MULTIPLIER 4.9 * 1.03 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 diff --git a/variants/esp32s3/heltec_vision_master_t190/variant.h b/variants/esp32s3/heltec_vision_master_t190/variant.h index a6a809207..037460c2f 100644 --- a/variants/esp32s3/heltec_vision_master_t190/variant.h +++ b/variants/esp32s3/heltec_vision_master_t190/variant.h @@ -45,7 +45,7 @@ #define ADC_CTRL 46 #define ADC_CTRL_ENABLED HIGH #define BATTERY_PIN 6 -#define ADC_CHANNEL ADC1_GPIO6_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_5 #define ADC_MULTIPLIER 4.9 * 1.03 // Voltage divider is roughly 1:1 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // Voltage divider output is quite high diff --git a/variants/esp32s3/heltec_wireless_paper/variant.h b/variants/esp32s3/heltec_wireless_paper/variant.h index bbfd54ada..221a3edc9 100644 --- a/variants/esp32s3/heltec_wireless_paper/variant.h +++ b/variants/esp32s3/heltec_wireless_paper/variant.h @@ -24,7 +24,7 @@ #define VEXT_ON_VALUE LOW #define ADC_CTRL 19 #define BATTERY_PIN 20 -#define ADC_CHANNEL ADC2_GPIO20_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_9 #define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1 #define BAT_MEASURE_ADC_UNIT 2 // Use ADC2 #define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high diff --git a/variants/esp32s3/heltec_wireless_paper_v1/variant.h b/variants/esp32s3/heltec_wireless_paper_v1/variant.h index 4505395c9..2efe0907c 100644 --- a/variants/esp32s3/heltec_wireless_paper_v1/variant.h +++ b/variants/esp32s3/heltec_wireless_paper_v1/variant.h @@ -25,7 +25,7 @@ #define VEXT_ON_VALUE LOW #define ADC_CTRL 19 #define BATTERY_PIN 20 -#define ADC_CHANNEL ADC2_GPIO20_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_9 #define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1 #define BAT_MEASURE_ADC_UNIT 2 // Use ADC2 #define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high diff --git a/variants/esp32s3/heltec_wireless_tracker/platformio.ini b/variants/esp32s3/heltec_wireless_tracker/platformio.ini index 45d3870fc..205207a05 100644 --- a/variants/esp32s3/heltec_wireless_tracker/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker/platformio.ini @@ -4,13 +4,15 @@ board = heltec_wireless_tracker board_build.partitions = default_8MB.csv upload_protocol = esptool -build_flags = +build_flags = ${esp32s3_base.build_flags} -I variants/esp32s3/heltec_wireless_tracker -D HELTEC_TRACKER_V1_1 + -DARDUINO_USB_CDC_ON_BOOT=1 + -DARDUINO_USB_MODE=1 ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip diff --git a/variants/esp32s3/heltec_wireless_tracker/variant.h b/variants/esp32s3/heltec_wireless_tracker/variant.h index 3b19f5afd..d17b569a7 100644 --- a/variants/esp32s3/heltec_wireless_tracker/variant.h +++ b/variants/esp32s3/heltec_wireless_tracker/variant.h @@ -39,7 +39,7 @@ #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 * 1.045 #define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1 diff --git a/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini index e3bc1c850..da31d41af 100644 --- a/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini @@ -11,5 +11,5 @@ build_flags = ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip diff --git a/variants/esp32s3/heltec_wireless_tracker_V1_0/variant.h b/variants/esp32s3/heltec_wireless_tracker_V1_0/variant.h index df5ab4716..62fba3535 100644 --- a/variants/esp32s3/heltec_wireless_tracker_V1_0/variant.h +++ b/variants/esp32s3/heltec_wireless_tracker_V1_0/variant.h @@ -35,7 +35,7 @@ #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 * 1.045 diff --git a/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini b/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini index 8bdb71541..5c82f0468 100644 --- a/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini @@ -10,5 +10,5 @@ build_flags = -D HELTEC_WIRELESS_TRACKER_V2 lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip diff --git a/variants/esp32s3/heltec_wireless_tracker_v2/variant.h b/variants/esp32s3/heltec_wireless_tracker_v2/variant.h index 0ce6b3e00..2b86ddef6 100644 --- a/variants/esp32s3/heltec_wireless_tracker_v2/variant.h +++ b/variants/esp32s3/heltec_wireless_tracker_v2/variant.h @@ -34,7 +34,7 @@ #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 * 1.045 #define ADC_CTRL 2 // active HIGH, powers the voltage divider. diff --git a/variants/esp32s3/heltec_wsl_v3/variant.h b/variants/esp32s3/heltec_wsl_v3/variant.h index c103b9172..b14203a3a 100644 --- a/variants/esp32s3/heltec_wsl_v3/variant.h +++ b/variants/esp32s3/heltec_wsl_v3/variant.h @@ -10,7 +10,7 @@ #define ADC_CTRL 37 #define ADC_CTRL_ENABLED LOW #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 * 1.045 diff --git a/variants/esp32s3/icarus/platformio.ini b/variants/esp32s3/icarus/platformio.ini index 0aaff52f5..de29cc2cf 100644 --- a/variants/esp32s3/icarus/platformio.ini +++ b/variants/esp32s3/icarus/platformio.ini @@ -7,12 +7,10 @@ board_build.mcu = esp32s3 board_build.partitions = default_8MB.csv upload_protocol = esptool upload_speed = 921600 -build_unflags = - ${esp32s3_base.build_unflags} - -DARDUINO_USB_MODE=1 build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW -I variants/esp32s3/icarus -DBOARD_HAS_PSRAM + -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=0 diff --git a/variants/esp32s3/mesh-tab/platformio.ini b/variants/esp32s3/mesh-tab/platformio.ini index 21d8fb432..b84cb57e5 100644 --- a/variants/esp32s3/mesh-tab/platformio.ini +++ b/variants/esp32s3/mesh-tab/platformio.ini @@ -50,8 +50,8 @@ build_src_filter = ${esp32s3_base.build_src_filter} lib_deps = ${esp32s3_base.lib_deps} ${device-ui_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip [mesh_tab_xpt2046] extends = mesh_tab_base diff --git a/variants/esp32s3/mesh-tab/variant.h b/variants/esp32s3/mesh-tab/variant.h index 63ef17d85..92ee951bb 100644 --- a/variants/esp32s3/mesh-tab/variant.h +++ b/variants/esp32s3/mesh-tab/variant.h @@ -10,7 +10,7 @@ #define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage // ratio of voltage divider (100k, 220k) #define ADC_MULTIPLIER 1.6 // 1.45 + 10% for correction of display undervoltage. -#define ADC_CHANNEL ADC1_GPIO4_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_3 // LED #define LED_PIN 21 diff --git a/variants/esp32s3/picomputer-s3/platformio.ini b/variants/esp32s3/picomputer-s3/platformio.ini index ccc6f7839..c2502e961 100644 --- a/variants/esp32s3/picomputer-s3/platformio.ini +++ b/variants/esp32s3/picomputer-s3/platformio.ini @@ -15,8 +15,8 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip build_src_filter = ${esp32s3_base.build_src_filter} diff --git a/variants/esp32s3/picomputer-s3/variant.h b/variants/esp32s3/picomputer-s3/variant.h index 275da1b61..1f63d9089 100644 --- a/variants/esp32s3/picomputer-s3/variant.h +++ b/variants/esp32s3/picomputer-s3/variant.h @@ -11,7 +11,7 @@ // A battery voltage measurement pin, voltage divider connected here to measure battery voltage // ratio of voltage divider = 3.0 (R11=200k, R7=100k) #define ADC_MULTIPLIER 3.1 // 3.0 with correction of display undervoltage. -#define ADC_CHANNEL ADC1_GPIO2_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_1 #define USE_RF95 // RFM95/SX127x diff --git a/variants/esp32s3/rak3312/variant.h b/variants/esp32s3/rak3312/variant.h index dfdf4de71..b672eb9cd 100644 --- a/variants/esp32s3/rak3312/variant.h +++ b/variants/esp32s3/rak3312/variant.h @@ -40,5 +40,5 @@ #define GPS_RX_PIN 44 #define BATTERY_PIN 1 -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_MULTIPLIER 1.667 \ No newline at end of file diff --git a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini index e4ff9812c..5ced3cc06 100644 --- a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini +++ b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini @@ -15,8 +15,8 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip [ft5x06] extends = mesh_tab_base diff --git a/variants/esp32s3/rak_wismesh_tap_v2/variant.h b/variants/esp32s3/rak_wismesh_tap_v2/variant.h index 2fc056557..9b1954e36 100644 --- a/variants/esp32s3/rak_wismesh_tap_v2/variant.h +++ b/variants/esp32s3/rak_wismesh_tap_v2/variant.h @@ -54,7 +54,7 @@ #define USE_VIRTUAL_KEYBOARD 1 #define BATTERY_PIN 1 -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_MULTIPLIER 1.667 #define PIN_BUZZER 38 diff --git a/variants/esp32s3/seeed-sensecap-indicator/platformio.ini b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini index dd9dfc668..fa4587147 100644 --- a/variants/esp32s3/seeed-sensecap-indicator/platformio.ini +++ b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini @@ -2,7 +2,8 @@ [env:seeed-sensecap-indicator] extends = esp32s3_base platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/mverch67/arduino-esp32/archive/aef7fef6de3329ed6f75512d46d63bba12b09bb5.zip ; add_tca9535 (based on 2.0.16) + ; Version needs to match the pioarduino version used in esp32_common.ini + platformio/framework-arduinoespressif32 @ https://github.com/mverch67/arduino-esp32#60946733b52c30e3d5b58a7158700d65fc1dddae board = seeed-sensecap-indicator board_check = true @@ -12,7 +13,7 @@ upload_protocol = esptool build_flags = ${esp32s3_base.build_flags} -Ivariants/esp32s3/seeed-sensecap-indicator -DSENSECAP_INDICATOR - -DCONFIG_ARDUHAL_LOG_COLORS + -DUSE_ARDUINO_HAL_GPIO -DRADIOLIB_DEBUG_SPI=0 -DRADIOLIB_DEBUG_PROTOCOL=0 -DRADIOLIB_DEBUG_BASIC=0 @@ -21,13 +22,14 @@ build_flags = ${esp32s3_base.build_flags} -DIO_EXPANDER=0x40 -DIO_EXPANDER_IRQ=42 ;-DIO_EXPANDER_DEBUG - -DUSE_ARDUINO_HAL_GPIO + ; mverch's hacks: + -D lcd_periph_signals=lcd_periph_rgb_signals lib_deps = ${esp32s3_base.lib_deps} ; TODO switch back to official LovyanGFX - https://github.com/mverch67/LovyanGFX/archive/4c76238c1344162a234ae917b27651af146d6fb2.zip + https://github.com/mverch67/LovyanGFX/archive/a1c1278fc9116d1c6cb15a7bb14565aef59a9a97.zip # renovate: datasource=custom.pio depName=ESP8266Audio packageName=earlephilhower/library/ESP8266Audio - earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266Audio@2.4.1 # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM earlephilhower/ESP8266SAM@1.1.0 @@ -43,10 +45,10 @@ build_flags = -D HAS_SCREEN=1 -D HAS_TFT=1 -D DISPLAY_SET_RESOLUTION - -D RAM_SIZE=4096 - -D LV_LVGL_H_INCLUDE_SIMPLE - -D LV_CONF_INCLUDE_SIMPLE - -D LV_COMP_CONF_INCLUDE_SIMPLE + -D RAM_SIZE=3072 + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE -D LV_USE_SYSMON=0 -D LV_USE_PROFILER=0 -D LV_USE_PERF_MONITOR=0 diff --git a/variants/esp32s3/seeed-sensecap-indicator/variant.h b/variants/esp32s3/seeed-sensecap-indicator/variant.h index f946528ae..6c20507ce 100644 --- a/variants/esp32s3/seeed-sensecap-indicator/variant.h +++ b/variants/esp32s3/seeed-sensecap-indicator/variant.h @@ -4,7 +4,7 @@ // This board has a serial coprocessor for sensor readings #define SENSOR_RP2040_TXD 19 #define SENSOR_RP2040_RXD 20 -#define SENSOR_PORT_NUM 2 +#define SENSOR_PORT_NUM UART_NUM_2 #define SENSOR_BAUD_RATE 115200 #define BUTTON_PIN 38 @@ -14,7 +14,7 @@ // #define BUTTON_NEED_PULLUP // #define BATTERY_PIN 27 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -// #define ADC_CHANNEL ADC1_GPIO27_CHANNEL +// #define ADC_CHANNEL ADC2_GPIO27_CHANNEL // #define ADC_MULTIPLIER 2 // ST7701 TFT LCD diff --git a/variants/esp32s3/seeed_xiao_s3/platformio.ini b/variants/esp32s3/seeed_xiao_s3/platformio.ini index 3460399d9..b2736167c 100644 --- a/variants/esp32s3/seeed_xiao_s3/platformio.ini +++ b/variants/esp32s3/seeed_xiao_s3/platformio.ini @@ -6,12 +6,8 @@ board_check = true board_build.partitions = default_8MB.csv upload_protocol = esptool upload_speed = 921600 -build_unflags = - ${esp32s3_base.build_unflags} - -DARDUINO_USB_MODE=1 build_flags = ${esp32s3_base.build_flags} -D SEEED_XIAO_S3 -I variants/esp32s3/seeed_xiao_s3 -DBOARD_HAS_PSRAM - -DARDUINO_USB_MODE=0 diff --git a/variants/esp32s3/seeed_xiao_s3/variant.h b/variants/esp32s3/seeed_xiao_s3/variant.h index d8dcbc8d4..9f10f80fe 100644 --- a/variants/esp32s3/seeed_xiao_s3/variant.h +++ b/variants/esp32s3/seeed_xiao_s3/variant.h @@ -37,7 +37,7 @@ L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-S #define BUTTON_NEED_PULLUP #define BATTERY_PIN -1 -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define BATTERY_SENSE_RESOLUTION_BITS 12 /*Warning: diff --git a/variants/esp32s3/station-g2/platformio.ini b/variants/esp32s3/station-g2/platformio.ini index a528151be..8039cb456 100755 --- a/variants/esp32s3/station-g2/platformio.ini +++ b/variants/esp32s3/station-g2/platformio.ini @@ -8,13 +8,9 @@ board_build.mcu = esp32s3 upload_protocol = esptool ;upload_port = /dev/ttyACM0 upload_speed = 921600 -build_unflags = - ${esp32s3_base.build_unflags} - -DARDUINO_USB_MODE=1 build_flags = ${esp32s3_base.build_flags} -D STATION_G2 -I variants/esp32s3/station-g2 -DBOARD_HAS_PSRAM -DSTATION_G2 - -DARDUINO_USB_MODE=0 diff --git a/variants/esp32s3/station-g2/variant.h b/variants/esp32s3/station-g2/variant.h index 8f0b4b220..e5ac90745 100755 --- a/variants/esp32s3/station-g2/variant.h +++ b/variants/esp32s3/station-g2/variant.h @@ -42,7 +42,7 @@ Board Information: https://wiki.uniteng.com/en/meshtastic/station-g2 /* #define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO4_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_3 #define ADC_MULTIPLIER 4 #define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity. #define BAT_FULLVOLT 8400 diff --git a/variants/esp32s3/t-deck/platformio.ini b/variants/esp32s3/t-deck/platformio.ini index c8f3c8d5e..4f2ff5172 100644 --- a/variants/esp32s3/t-deck/platformio.ini +++ b/variants/esp32s3/t-deck/platformio.ini @@ -12,10 +12,10 @@ build_flags = ${esp32s3_base.build_flags} -I variants/esp32s3/t-deck lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip # renovate: datasource=custom.pio depName=ESP8266Audio packageName=earlephilhower/library/ESP8266Audio - earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266Audio@2.4.1 # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM earlephilhower/ESP8266SAM@1.1.0 diff --git a/variants/esp32s3/t-deck/variant.h b/variants/esp32s3/t-deck/variant.h index 8d2996131..2d19056e0 100644 --- a/variants/esp32s3/t-deck/variant.h +++ b/variants/esp32s3/t-deck/variant.h @@ -53,7 +53,7 @@ #define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage // ratio of voltage divider = 2.0 (RD2=100k, RD3=100k) #define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. -#define ADC_CHANNEL ADC1_GPIO4_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_3 // keyboard #define I2C_SDA 18 // I2C pins for this board diff --git a/variants/esp32s3/t-eth-elite/platformio.ini b/variants/esp32s3/t-eth-elite/platformio.ini index 5ed67e977..5b1f01db7 100644 --- a/variants/esp32s3/t-eth-elite/platformio.ini +++ b/variants/esp32s3/t-eth-elite/platformio.ini @@ -10,10 +10,15 @@ build_flags = -D HAS_UDP_MULTICAST=1 -I variants/esp32s3/t-eth-elite -lib_ignore = - Ethernet +custom_sdkconfig = + ${esp32s3_base.custom_sdkconfig} + CONFIG_ETH_ENABLED=y + CONFIG_ARDUINO_SELECTIVE_Ethernet=y -lib_deps = - ${esp32s3_base.lib_deps} - # renovate: datasource=github-tags depName=ETHClass2 packageName=meshtastic/ETHClass2 - https://github.com/meshtastic/ETHClass2/archive/v1.0.0.zip +; lib_ignore = +; Ethernet + +; lib_deps = +; ${esp32s3_base.lib_deps} +; # renovate: datasource=github-tags depName=ETHClass2 packageName=meshtastic/ETHClass2 +; https://github.com/meshtastic/ETHClass2/archive/v1.0.0.zip diff --git a/variants/esp32s3/t-watch-s3/platformio.ini b/variants/esp32s3/t-watch-s3/platformio.ini index 9785119b5..1723e3424 100644 --- a/variants/esp32s3/t-watch-s3/platformio.ini +++ b/variants/esp32s3/t-watch-s3/platformio.ini @@ -11,13 +11,13 @@ build_flags = ${esp32s3_base.build_flags} -Ivariants/esp32s3/t-watch-s3 lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib lewisxhe/SensorLib@0.3.3 # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library adafruit/Adafruit DRV2605 Library@1.2.4 # renovate: datasource=custom.pio depName=ESP8266Audio packageName=earlephilhower/library/ESP8266Audio - earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266Audio@2.4.1 # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM earlephilhower/ESP8266SAM@1.1.0 diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini index 98b9f51f5..e0372955b 100644 --- a/variants/esp32s3/tlora-pager/platformio.ini +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -17,12 +17,12 @@ build_flags = ${esp32s3_base.build_flags} -D ROTARY_BUXTRONICS lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip # renovate: datasource=custom.pio depName=ESP8266Audio packageName=earlephilhower/library/ESP8266Audio - earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266Audio@2.4.1 # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM - earlephilhower/ESP8266SAM@1.0.1 + earlephilhower/ESP8266SAM@1.1.0 # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library adafruit/Adafruit DRV2605 Library@1.2.4 # renovate: datasource=custom.pio depName=PCF8563 packageName=lewisxhe/library/PCF8563_Library diff --git a/variants/esp32s3/tlora_t3s3_epaper/variant.h b/variants/esp32s3/tlora_t3s3_epaper/variant.h index 1ed505420..c7ac53b91 100644 --- a/variants/esp32s3/tlora_t3s3_epaper/variant.h +++ b/variants/esp32s3/tlora_t3s3_epaper/variant.h @@ -12,7 +12,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to // measure battery voltage ratio of voltage divider = 2.0 (assumption) #define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define I2C_SDA SDA #define I2C_SCL SCL diff --git a/variants/esp32s3/tlora_t3s3_v1/variant.h b/variants/esp32s3/tlora_t3s3_v1/variant.h index babe44a58..7c5b0b68d 100644 --- a/variants/esp32s3/tlora_t3s3_v1/variant.h +++ b/variants/esp32s3/tlora_t3s3_v1/variant.h @@ -6,7 +6,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage // ratio of voltage divider = 2.0 (R42=100k, R43=100k) #define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define I2C_SDA 18 // I2C pins for this board #define I2C_SCL 17 diff --git a/variants/esp32s3/tracksenger/internal/variant.h b/variants/esp32s3/tracksenger/internal/variant.h index 2287dfe0b..4dbae8eb1 100644 --- a/variants/esp32s3/tracksenger/internal/variant.h +++ b/variants/esp32s3/tracksenger/internal/variant.h @@ -35,7 +35,7 @@ #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 #define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1 diff --git a/variants/esp32s3/tracksenger/lcd/variant.h b/variants/esp32s3/tracksenger/lcd/variant.h index f42a5b19f..91f02e5d7 100644 --- a/variants/esp32s3/tracksenger/lcd/variant.h +++ b/variants/esp32s3/tracksenger/lcd/variant.h @@ -59,7 +59,7 @@ #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 #define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1 diff --git a/variants/esp32s3/tracksenger/oled/variant.h b/variants/esp32s3/tracksenger/oled/variant.h index 85cc019c4..07dba3130 100644 --- a/variants/esp32s3/tracksenger/oled/variant.h +++ b/variants/esp32s3/tracksenger/oled/variant.h @@ -36,7 +36,7 @@ #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_CHANNEL ADC_CHANNEL_0 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider #define ADC_MULTIPLIER 4.9 #define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1 diff --git a/variants/esp32s3/tracksenger/platformio.ini b/variants/esp32s3/tracksenger/platformio.ini index 73212c546..139740fa7 100644 --- a/variants/esp32s3/tracksenger/platformio.ini +++ b/variants/esp32s3/tracksenger/platformio.ini @@ -12,8 +12,8 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip [env:tracksenger-lcd] extends = esp32s3_base @@ -29,8 +29,8 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.7 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip [env:tracksenger-oled] extends = esp32s3_base diff --git a/variants/esp32s3/unphone/platformio.ini b/variants/esp32s3/unphone/platformio.ini index 6c638af29..be75db52e 100644 --- a/variants/esp32s3/unphone/platformio.ini +++ b/variants/esp32s3/unphone/platformio.ini @@ -12,7 +12,6 @@ build_flags = ${esp32s3_base.build_flags} -D UNPHONE -I variants/esp32s3/unphone - -D ARDUINO_USB_MODE=0 -D UNPHONE_ACCEL=0 -D UNPHONE_TOUCHS=0 -D UNPHONE_SDCARD=0 @@ -27,8 +26,8 @@ build_src_filter = +<../variants/esp32s3/unphone> lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.0 + # renovate: datasource=git-refs depName=LovyanGFX-develop packageName=https://github.com/lovyan03/LovyanGFX gitBranch=develop + https://github.com/lovyan03/LovyanGFX/archive/2689b7c12e384558991d324e19bc67782f986551.zip # TODO renovate https://gitlab.com/hamishcunningham/unphonelibrary#meshtastic@9.0.0 # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel