* this prevents "open after open", that could lead to file corruption when "f" was still holding some changes in its buffer (written out with f.close())
* enable ARDUINOJSON_DECODE_UNICODE (otherwise unicode needs 6(!) bytes for encoding)
* robustness: increase a few tiny string buffers for some extra margin
* Web UI: allow entering up to 64 chars as segment name
* mark synchronization variables volatile (thread-safe)
* additional logic in closeFile() to avoid file write while leds are pushed out by NPB driver
* some comments and analysis
* replace "yield()" after file ops with "delay(0)" before operations.
accroding to the docs of setBufferSize() and svbuf():
> setBufferSize() has to be called right after opening file before any other operation!
so changing buffer sizes on an already opened and partially read file can cause file corruption as the internal buffer is exchanged "mid-flight".
Fix: move all f.setBufferSize() so they appear directly after f.open().
* trying to make the caching mechanism bulletproof.
`cacheInvalidate` is changed when
- autosave usermod updates presets
- a file was upload
* (coding style) fixed some unitialized variables
it seems that reading/writing "larger" files from LittleFS causes LED flickering.
This change adds a simple cache for "file not found" results, so that repeated file.exists() calls are avoided.
The NeoPixelBus RMT driver seems to get stalled when ESP.get.... functions are called (big kernel lock?). Also its glitching during flash file access.
This change tries to avoid some conflicts by first checking that the driver is not sending.
* use size_t instead of uint16_t -> prevents random behaviour (corruption) in case that JSON files get larger than 64Kbytes.
* use a constant for max large file space (was UINT16_MAX)
* reduced the scope of some functions and variables to "static" - avoids name clashes and may support better optimization by the compiler
WLED was using uint16_t internally to index files, which leads to random behaviour when the real filesize is above 64Kb.
Better to use size_t which is the "right" type that can hold the largest possible size.
* Use arduino-esp32 2.0.2 for ESP32-S2
LittleFS is merged into it.
* Fix filesystem error for ESP32-S2
Use platform of tasmota until upstream released it and
use board_build.flash_mode = qio
* Fix empty disk usage
* Add esp32s2_saola to default_envs
* Remove lorol LITTLEFS for esp32dev, too
* Revert "Remove lorol LITTLEFS for esp32dev, too"
This reverts commit 3586d5eef7affa3390bd057232600f6189145706.
* Remove -w (Suppress all warnings, including those which GNU CPP issues by default.) and add back in -Wall (Turn on all optional warnings which are desirable for normal code.) from build_flags
* Fixes warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
* Fixes warning: "CONFIG_LITTLEFS_FOR_IDF_3_2" redefined
* Fixes warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
* Fixes warning: enumeration value 'onoff' not handled in switch [-Wswitch]
* Fixes warning: "ntohl" redefined, warning: "ntohs" redefined, warning: "htonl" redefined, warning: "htons" redefined
- Original fix: 858f8f4ee9
* Fixes warning: unused variable 'mainSeg' [-Wunused-variable]
* Fixes warning: unused variable 'start' [-Wunused-variable]
* (untested!) Fixes warning: operation on '...' may be undefined [-Wsequence-point]
* Fixes warning: unused variable
* Fixes warning: unused variable and warning: narrowing conversion
* Fixes warning: unused variable
* Fixes warning: unused variable
* (untested!) Fixes warning: statement has no effect [-Wunused-value]
* Fixes warning: control reaches end of non-void function
* Fixes warning: unused variable
* Fixes warning: left operand of comma operator has no effect
* Fixes warning: no return statement in function returning non-void
* (untested!) Fixes warning: ISO C++ forbids converting a string constant to 'char*' and fixes warning: unused variable 'nPins'
* Fixes warning: deleting array 'dmxData'
* Fixes warning: unused variable
* Remove all warning suppression buildflags
Co-authored-by: Louis Beaudoin <louis@embedded-creations.com>
Co-authored-by: Aircoookie <dev.aircoookie@gmail.com>