Compare commits

..

3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
28d6e347ec Use 1024*1024 instead of magic number for bytes to MB conversion
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-28 18:10:05 +00:00
copilot-swe-agent[bot]
1b1f5811de Convert PSRAM from bytes to MB in usage reporting JavaScript
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-28 18:07:06 +00:00
copilot-swe-agent[bot]
ff184c1f41 Initial plan 2025-11-28 17:58:10 +00:00
10 changed files with 28 additions and 168 deletions

View File

@@ -1,6 +1,10 @@
name: Usermod CI
on:
push:
paths:
- usermods/**
- .github/workflows/usermods.yml
pull_request:
paths:
- usermods/**
@@ -8,8 +12,6 @@ on:
jobs:
get_usermod_envs:
# Only run for pull requests from forks (not from branches within wled/WLED)
if: github.event.pull_request.head.repo.full_name != github.repository
name: Gather Usermods
runs-on: ubuntu-latest
steps:
@@ -29,8 +31,6 @@ jobs:
build:
# Only run for pull requests from forks (not from branches within wled/WLED)
if: github.event.pull_request.head.repo.full_name != github.repository
name: Build Enviornments
runs-on: ubuntu-latest
needs: get_usermod_envs

View File

@@ -2,7 +2,7 @@
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv"
"partitions": "partitions-8MB-tinyuf2.csv"
},
"core": "esp32",
"extra_flags": [
@@ -43,8 +43,16 @@
"arduino",
"espidf"
],
"name": "Adafruit MatrixPortal ESP32-S3 for WLED",
"name": "Adafruit MatrixPortal ESP32-S3",
"upload": {
"arduino": {
"flash_extra_images": [
[
"0x410000",
"variants/adafruit_matrixportal_esp32s3/tinyuf2.bin"
]
]
},
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,

View File

@@ -1,122 +0,0 @@
/*-------------------------------------------------------------------------
NeoPixel library helper functions for Esp8266.
FIXED VERSION FROM https://github.com/Makuna/NeoPixelBus/pull/894
This library will overlay/shadow the base version from NeoPixelBus
Written by Michael C. Miller.
Thanks to g3gg0.de for porting the initial DMA support which lead to this.
Thanks to github/cnlohr for the original work on DMA support, which opend
all our minds to a better way (located at https://github.com/cnlohr/esp8266ws2812i2s).
I invest time and resources providing this open source code,
please support me by donating (see https://github.com/Makuna/NeoPixelBus)
-------------------------------------------------------------------------
This file is part of the Makuna/NeoPixelBus library.
NeoPixelBus is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
NeoPixelBus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/
#pragma once
#ifdef ARDUINO_ARCH_ESP8266
#include "internal/methods/NeoEsp8266DmaMethod.h"
template<typename T_PATTERN> class NeoEsp8266Dma3StepEncodeFixed : public T_PATTERN
{
public:
const static size_t DmaBitsPerPixelBit = 3; // 3 step cadence, matches encoding
static size_t SpacingPixelSize(size_t sizePixel)
{
return sizePixel;
}
static void FillBuffers(uint8_t* i2sBuffer,
const uint8_t* data,
size_t sizeData,
[[maybe_unused]] size_t sizePixel)
{
const uint8_t SrcBitMask = 0x80;
const size_t BitsInSample = sizeof(uint32_t) * 8;
uint32_t* pDma = reinterpret_cast<uint32_t*>(i2sBuffer);
uint32_t dmaValue = 0;
uint8_t destBitsLeft = BitsInSample;
const uint8_t* pSrc = data;
const uint8_t* pEnd = pSrc + sizeData;
while (pSrc < pEnd)
{
uint8_t value = *(pSrc++);
for (uint8_t bitSrc = 0; bitSrc < 8; bitSrc++)
{
const uint16_t Bit = ((value & SrcBitMask) ? T_PATTERN::OneBit3Step : T_PATTERN::ZeroBit3Step);
if (destBitsLeft > 3)
{
destBitsLeft -= 3;
dmaValue |= Bit << destBitsLeft;
#if defined(NEO_DEBUG_DUMP_I2S_BUFFER)
NeoUtil::PrintBin<uint32_t>(dmaValue);
Serial.print(" < ");
Serial.println(destBitsLeft);
#endif
}
else if (destBitsLeft <= 3)
{
uint8_t bitSplit = (3 - destBitsLeft);
dmaValue |= Bit >> bitSplit;
#if defined(NEO_DEBUG_DUMP_I2S_BUFFER)
NeoUtil::PrintBin<uint32_t>(dmaValue);
Serial.print(" > ");
Serial.println(bitSplit);
#endif
// next dma value, store and reset
*(pDma++) = dmaValue;
dmaValue = 0;
destBitsLeft = BitsInSample - bitSplit;
if (bitSplit)
{
dmaValue |= Bit << destBitsLeft;
}
#if defined(NEO_DEBUG_DUMP_I2S_BUFFER)
NeoUtil::PrintBin<uint32_t>(dmaValue);
Serial.print(" v ");
Serial.println(bitSplit);
#endif
}
// Next
value <<= 1;
}
}
// store the remaining bits
if (destBitsLeft != BitsInSample) *pDma++ = dmaValue;
}
};
// Abuse explict specialization to overlay the methods
template<> class NeoEsp8266Dma3StepEncode<NeoEsp8266DmaNormalPattern> : public NeoEsp8266Dma3StepEncodeFixed<NeoEsp8266DmaNormalPattern> {};
template<> class NeoEsp8266Dma3StepEncode<NeoEsp8266DmaInvertedPattern> : public NeoEsp8266Dma3StepEncodeFixed<NeoEsp8266DmaInvertedPattern> {};
#endif

View File

@@ -1,12 +0,0 @@
{
"name": "NeoESP8266DMAFix",
"build": { "libArchive": false },
"platforms": ["espressif8266"],
"dependencies": [
{
"owner": "makuna",
"name": "NeoPixelBus",
"version": "2.8.3"
}
]
}

View File

@@ -14,14 +14,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/wled/WLED.git"
"url": "git+https://github.com/wled-dev/WLED.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/wled/WLED/issues"
"url": "https://github.com/wled-dev/WLED/issues"
},
"homepage": "https://github.com/wled/WLED#readme",
"homepage": "https://github.com/wled-dev/WLED#readme",
"dependencies": {
"clean-css": "^5.3.3",
"html-minifier-terser": "^7.2.0",
@@ -31,4 +31,4 @@
"engines": {
"node": ">=20.0.0"
}
}
}

View File

@@ -220,7 +220,6 @@ lib_deps =
ESPAsyncUDP
ESP8266PWM
${env.lib_deps}
NeoESP8266DMAFix
;; compatibilty flags - same as 0.14.0 which seems to work better on some 8266 boards. Not using PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
build_flags_compat =

View File

@@ -580,7 +580,7 @@ build_flags = ${common.build_flags}
[env:adafruit_matrixportal_esp32s3]
; ESP32-S3 processor, 8 MB flash, 2 MB of PSRAM, dedicated driver pins for HUB75
board = adafruit_matrixportal_esp32s3_wled ; modified board definition: removed flash section that causes FS erase on upload
board = adafruit_matrixportal_esp32s3
;; adafruit recommends to use arduino-esp32 2.0.14
;;platform = espressif32@ ~6.5.0
;;platform_packages = platformio/framework-arduinoespressif32 @ 3.20014.231204 ;; arduino-esp32 2.0.14

View File

@@ -4,9 +4,6 @@
//#define NPB_CONF_4STEP_CADENCE
#include "NeoPixelBus.h"
#ifdef ARDUINO_ARCH_ESP8266
#include <NeoEsp8266DmaMethodFix.h>
#endif
//Hardware SPI Pins
#define P_8266_HS_MOSI 13

View File

@@ -12,20 +12,7 @@
#ifdef ESP32
constexpr size_t METADATA_OFFSET = 256; // ESP32: metadata appears after Espressif metadata
#define UPDATE_ERROR errorString
// Bootloader is at fixed offset 0x1000 (4KB), 0x0000 (0KB), or 0x2000 (8KB), and is typically 32KB
// Bootloader offsets for different MCUs => see https://github.com/wled/WLED/issues/5064
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)
constexpr size_t BOOTLOADER_OFFSET = 0x0000; // esp32-S3, esp32-C3 and (future support) esp32-c6
constexpr size_t BOOTLOADER_SIZE = 0x8000; // 32KB, typical bootloader size
#elif defined(CONFIG_IDF_TARGET_ESP32P4) || defined(CONFIG_IDF_TARGET_ESP32C5)
constexpr size_t BOOTLOADER_OFFSET = 0x2000; // (future support) esp32-P4 and esp32-C5
constexpr size_t BOOTLOADER_SIZE = 0x8000; // 32KB, typical bootloader size
#else
constexpr size_t BOOTLOADER_OFFSET = 0x1000; // esp32 and esp32-s2
constexpr size_t BOOTLOADER_SIZE = 0x8000; // 32KB, typical bootloader size
#endif
const size_t BOOTLOADER_OFFSET = 0x1000;
#elif defined(ESP8266)
constexpr size_t METADATA_OFFSET = 0x1000; // ESP8266: metadata appears at 4KB offset
#define UPDATE_ERROR getErrorString
@@ -293,6 +280,9 @@ static String bootloaderSHA256HexCache = "";
void calculateBootloaderSHA256() {
if (!bootloaderSHA256HexCache.isEmpty()) return;
// Bootloader is at fixed offset 0x1000 (4KB) and is typically 32KB
const uint32_t bootloaderSize = 0x8000; // 32KB, typical bootloader size
// Calculate SHA256
uint8_t sha256[32];
mbedtls_sha256_context ctx;
@@ -302,8 +292,8 @@ void calculateBootloaderSHA256() {
const size_t chunkSize = 256;
uint8_t buffer[chunkSize];
for (uint32_t offset = 0; offset < BOOTLOADER_SIZE; offset += chunkSize) {
size_t readSize = min((size_t)(BOOTLOADER_SIZE - offset), chunkSize);
for (uint32_t offset = 0; offset < bootloaderSize; offset += chunkSize) {
size_t readSize = min((size_t)(bootloaderSize - offset), chunkSize);
if (esp_flash_read(NULL, buffer, BOOTLOADER_OFFSET + offset, readSize) == ESP_OK) {
mbedtls_sha256_update(&ctx, buffer, readSize);
}

View File

@@ -1170,11 +1170,11 @@ String generateDeviceFingerprint() {
// mix in ADC calibration data:
esp_adc_cal_characteristics_t ch;
#if SOC_ADC_MAX_BITWIDTH == 13 // S2 has 13 bit ADC
constexpr auto myBIT_WIDTH = ADC_WIDTH_BIT_13;
#define BIT_WIDTH ADC_WIDTH_BIT_13
#else
constexpr auto myBIT_WIDTH = ADC_WIDTH_BIT_12;
#define BIT_WIDTH ADC_WIDTH_BIT_12
#endif
esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, myBIT_WIDTH, 1100, &ch);
esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, BIT_WIDTH, 1100, &ch);
fp[0] ^= ch.coeff_a;
fp[1] ^= ch.coeff_b;
if (ch.low_curve) {