Skip to content

Commit 5baffaf

Browse files
authored
Merge branch 'MoonModules:mdev' into mdev
2 parents 7657c90 + c532b5d commit 5baffaf

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

platformio.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,8 @@ build_unflags = ${env:esp32S3_8MB_M.build_unflags} ;; use the same as "normal"
24902490
build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation
24912491
${common_mm.build_flags_S}
24922492
-D WLED_RELEASE_NAME=matrixportal_esp32s3
2493-
-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 ;; for Hardware-CDC USB mode
2493+
; Serial debug enabled -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 ;; for Hardware-CDC USB mode
2494+
-D ARDUINO_USB_CDC_ON_BOOT=0
24942495
-D WLED_DISABLE_ADALIGHT ;; disables serial protocols - recommended for Hardware-CDC USB (Serial RX will receive junk commands when RX pin is unconnected, unless its pulled down by resistor)
24952496
${common_mm.animartrix_build_flags}
24962497
${common_mm.build_disable_sync_interfaces}

tools/ESP32-Chip_info.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,8 @@ void show_psram_info_part2(void)
543543

544544
void showRealSpeed() {
545545
//Serial.begin(115200);
546+
if (!Serial) return; // Avoid writing to unconnected USB-CDC
547+
546548
Serial.flush();
547549
Serial.println(F("\n"));
548550
for(int aa=0; aa<65; aa++) Serial.print("="); Serial.println();

usermods/usermod_v2_auto_playlist/usermod_v2_auto_playlist.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ class AutoPlaylistUsermod : public Usermod {
322322

323323
if (bri == 0) return;
324324

325+
if(!functionality_enabled) return;
326+
325327
um_data_t *um_data;
326328

327329
if (!usermods.getUMData(&um_data, USERMOD_ID_AUDIOREACTIVE)) {

wled00/data/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,18 @@ function readState(s,command=false)
19511951
if (s.error && s.error != 0) {
19521952
var errstr = "";
19531953
switch (s.error) {
1954+
case 1:
1955+
errstr = "Denied!";
1956+
break;
1957+
case 3:
1958+
errstr = "Buffer locked!";
1959+
break;
1960+
case 8:
1961+
errstr = "Effect RAM depleted!";
1962+
break;
1963+
case 9:
1964+
errstr = "JSON parsing error!";
1965+
break;
19541966
case 10:
19551967
errstr = "Could not mount filesystem!";
19561968
break;
@@ -1963,6 +1975,9 @@ function readState(s,command=false)
19631975
case 13:
19641976
errstr = "Missing ir.json.";
19651977
break;
1978+
case 14:
1979+
errstr = "Missing remote.json.";
1980+
break;
19661981
case 19:
19671982
errstr = "A filesystem error has occured.";
19681983
break;

wled00/improv.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ void handleImprovPacket() {
5050
uint8_t rpcCommandType = 0;
5151
char rpcData[128];
5252
rpcData[0] = 0;
53+
if (!Serial) return; // WLEDMM avoid reading from unconnected USB-CDC
5354

5455
while (!timeout) {
5556
if (Serial.available() < 1) {

wled00/wled_serial.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void updateBaudRate(uint32_t rate){
4242
// RGB LED data return as JSON array. Slow, but easy to use on the other end.
4343
void sendJSON(){
4444
if (!pinManager.isPinAllocated(hardwareTX) || pinManager.getPinOwner(hardwareTX) == PinOwner::DebugOut) {
45+
if (!Serial) return; // WLEDMM avoid writing to unconnected USB-CDC
4546
uint16_t used = strip.getLengthTotal();
4647
Serial.write('[');
4748
for (uint16_t i=0; i<used; i++) {
@@ -55,6 +56,7 @@ void sendJSON(){
5556
// RGB LED data returned as bytes in TPM2 format. Faster, and slightly less easy to use on the other end.
5657
void sendBytes(){
5758
if (!pinManager.isPinAllocated(hardwareTX) || pinManager.getPinOwner(hardwareTX) == PinOwner::DebugOut) {
59+
if (!Serial) return; // WLEDMM avoid writing to unconnected USB-CDC
5860
Serial.write(0xC9); Serial.write(0xDA);
5961
uint16_t used = strip.getLengthTotal();
6062
uint16_t len = used*3;

0 commit comments

Comments
 (0)