Skip to content

Commit 2be3608

Browse files
committed
Merge branch 'led_clockless_spi' into no_more_audio_task
# Conflicts: # platformio.ini
2 parents cbe68b8 + e898ee6 commit 2be3608

File tree

8 files changed

+37
-12
lines changed

8 files changed

+37
-12
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## DEV-branch
44

5+
* 12.06.2025: Fix compilation error with NEOPIXEL_REVERSE_ROTATION (#369), thanks to @SZenglein !
6+
* 12.06.2025: Clear ping- and trackProgress intervals when websocket reconnects (#368), thanks to @SZenglein !
57
* 10.05.2025: MQTT: switch from pubsubclient to IDF-MQTT (#363), thanks to @Joe91
68
* 05.05.2025: Switch DEV-branch to Arduino 3.2.0 (ESP-IDF 5.4.1)
79
* 30.04.2025: Fix loosing Websocket Ping/Pong connection, thanks to @Joe91 !

html/management.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,14 +2087,18 @@ <h5 class="modal-title" data-i18n="tools.nvs.erase.title"></h5>
20872087
/* File Explorer functions end */
20882088
var socket = undefined;
20892089
var tm;
2090+
var pingInterval;
2091+
var getTrackProgressInterval;
20902092
var volumeSlider = new Slider("#setVolume");
20912093
document.getElementById('setVolume').remove();
20922094

20932095
function connect() {
20942096
socket = new WebSocket("ws://" + host + "/ws");
20952097
socket.onopen = function () {
2096-
setInterval(ping, 3000);
2097-
setInterval(getTrackProgress, 1000);
2098+
clearInterval(pingInterval);
2099+
clearInterval(getTrackProgressInterval);
2100+
pingInterval = setInterval(ping, 3000);
2101+
setTrackProgressInterval = setInterval(getTrackProgress, 1000);
20982102
// clear old socket messages
20992103
socket.sendBuffer = [];
21002104
socket.send('{"settings":{"settings":"settings"}}'); // request settings

install_dependencies.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
import subprocess
3+
4+
def install_dependencies():
5+
try:
6+
# Überprüfen, ob das Modul bereits installiert ist
7+
import rich
8+
print("Module 'rich' is already installed.")
9+
except ImportError:
10+
print("Module 'rich' is not installed. Let's try to install it...")
11+
# Installation des Moduls mit pip
12+
subprocess.check_call([os.sys.executable, '-m', 'pip', 'install', 'rich'])
13+
14+
if __name__ == "__main__":
15+
install_dependencies()

platformio.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ board_build.flash_mode = qio
1717
board_build.bootloader = dio
1818
board_build.partitions = custom_4mb_noota.csv
1919
;platform = espressif32@^6.10.0 ; Arduino 2.0.17 (ESP-IDF 4.4.7)
20-
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip ; Arduino 3.2.0 (ESP-IDF 5.4.1)
20+
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21/platform-espressif32.zip ; Arduino 3.2.1 (ESP-IDF 5.4.2)
2121
;framework = arduino
2222
framework = arduino, espidf
2323
monitor_speed = 115200
@@ -26,15 +26,16 @@ monitor_filters = esp32_exception_decoder
2626
;upload_port = /dev/cu.SLAB_USBtoUART
2727
;upload_speed = 115200
2828
extra_scripts =
29+
pre:install_dependencies.py
2930
pre:gitVersion.py
3031
pre:updateSdkConfig.py
3132
pre:processHtml.py
3233
lib_deps =
3334
https://github.com/schreibfaul1/ESP32-audioI2S.git#f394a91 ; v3.3.2 + bugfix large files
3435
https://github.com/madhephaestus/ESP32Encoder.git#2c986e0
3536
https://github.com/peterus/ESP-FTP-Server-Lib.git#554959f
36-
https://github.com/FastLED/FastLED.git#99d5863 ; v3.10.1+ fix
37-
https://github.com/ESP32Async/ESPAsyncWebServer.git#1baee81 ; v3.7.7
37+
https://github.com/FastLED/FastLED.git#8abc9c6 ; v3.10.1+ fix of issue 16188
38+
https://github.com/ESP32Async/ESPAsyncWebServer.git#f06bca1 ; v3.7.8
3839
https://github.com/bblanchon/ArduinoJson.git#3252013 ; v7.4.1
3940
https://github.com/pschatzmann/arduino-audio-tools.git#c19fbd6 ; v1.0.2
4041
https://github.com/pschatzmann/ESP32-A2DP.git#8faaafa ; v1.8.7

src/Led.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include <esp_task_wdt.h>
1919

2020
#ifdef NEOPIXEL_ENABLE
21-
#include <FastLED.h>
22-
2321
#define LED_INDICATOR_SET(indicator) ((Led_Indicators) |= (1u << ((uint8_t) indicator)))
2422
#define LED_INDICATOR_IS_SET(indicator) (((Led_Indicators) & (1u << ((uint8_t) indicator))) > 0u)
2523
#define LED_INDICATOR_CLEAR(indicator) ((Led_Indicators) &= ~(1u << ((uint8_t) indicator)))
@@ -108,7 +106,7 @@ bool Led_LoadSettings(LedSettings &settings) {
108106

109107
// get reverse rotation from NVS
110108
#ifdef NEOPIXEL_REVERSE_ROTATION
111-
const bool defReverseRotation = NEOPIXEL_REVERSE_ROTATION;
109+
const bool defReverseRotation = true;
112110
#else
113111
const bool defReverseRotation = false;
114112
#endif
@@ -359,6 +357,7 @@ static void Led_Task(void *parameter) {
359357
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, numIndicatorLeds + numControlLeds).setCorrection(TypicalSMD5050);
360358
FastLED.setBrightness(gLedSettings.Led_Brightness);
361359
FastLED.setDither(DISABLE_DITHER);
360+
FastLED.setMaxRefreshRate(200); // limit LED refresh rate to 200Hz (less likely to cause flickering)
362361

363362
LedAnimationType activeAnimation = LedAnimationType::NoNewAnimation;
364363
LedAnimationType nextAnimation = LedAnimationType::NoNewAnimation;
@@ -537,6 +536,9 @@ static void Led_Task(void *parameter) {
537536
// get the time to wait and delay the task
538537
if ((animationTimer > 0) && (animationTimer < taskDelay)) {
539538
taskDelay = animationTimer;
539+
if (taskDelay < 5) {
540+
taskDelay = 5; // minimum delay
541+
}
540542
}
541543
animationTimer -= taskDelay;
542544
vTaskDelay(portTICK_PERIOD_MS * taskDelay);

src/Led.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ struct AnimationReturnType {
6262
#define LED_INITIAL_BRIGHTNESS 16u
6363
#define LED_INITIAL_NIGHT_BRIGHTNESS 2u
6464

65+
#define FASTLED_ESP32_USE_CLOCKLESS_SPI 1
66+
67+
#include <FastLED.h>
68+
6569
struct LedSettings {
6670
uint8_t numIndicatorLeds = NUM_INDICATOR_LEDS;
6771
uint8_t numControlLeds = NUM_CONTROL_LEDS;

src/Web.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#include "Common.h"
1212
#include "ESPAsyncWebServer.h"
1313
#include "EnumUtils.h"
14-
#ifdef NEOPIXEL_ENABLE
15-
#include <FastLED.h>
16-
#endif
1714
#include "Ftp.h"
1815
#include "HTMLbinary.h"
1916
#include "HallEffectSensor.h"

src/revision.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#pragma once
22

33
#include "gitrevision.h"
4-
constexpr const char softwareRevision[] = "Software-revision: 20250515-1-DEV";
4+
constexpr const char softwareRevision[] = "Software-revision: 20250612-1-DEV";

0 commit comments

Comments
 (0)