Convert usermods to static libraries
Redesign the usermod system so that usermods are implemented as PlatformIO libraries instead of headers. This permits them to call for dependencies, and eliminates the compiler flags for enabling each one, allowing the build cache to behave better. The usermod list is built using some linker magic to construct a static list in ROM memory. This eliminates the need for wasting SRAM on something fixed at build time.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "wled.h"
|
||||
|
||||
@@ -2064,3 +2063,6 @@ const char AudioReactive::_digitalmic[] PROGMEM = "digitalmic";
|
||||
const char AudioReactive::_addPalettes[] PROGMEM = "add-palettes";
|
||||
const char AudioReactive::UDP_SYNC_HEADER[] PROGMEM = "00002"; // new sync header version, as format no longer compatible with previous structure
|
||||
const char AudioReactive::UDP_SYNC_HEADER_v1[] PROGMEM = "00001"; // old sync header version - need to add backwards-compatibility feature
|
||||
|
||||
static AudioReactive ar_module;
|
||||
REGISTER_USERMOD(ar_module);
|
||||
17
usermods/audioreactive/library.json
Normal file
17
usermods/audioreactive/library.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "audioreactive",
|
||||
"build": {
|
||||
"srcDir": ".",
|
||||
"includeDir": "../../wled00",
|
||||
"libLDFMode": "chain+",
|
||||
"libArchive": false
|
||||
},
|
||||
"dependencies": [
|
||||
{
|
||||
"owner": "kosme",
|
||||
"name": "arduinoFFT",
|
||||
"version": "2.0.1",
|
||||
"platforms": "espressif32"
|
||||
}
|
||||
]
|
||||
}
|
||||
8
usermods/usermod_v2_auto_save/library.json
Normal file
8
usermods/usermod_v2_auto_save/library.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "auto_save",
|
||||
"build": {
|
||||
"srcDir": ".",
|
||||
"includeDir": "../../wled00",
|
||||
"libLDFMode": "chain+"
|
||||
}
|
||||
}
|
||||
@@ -275,3 +275,6 @@ const char AutoSaveUsermod::_autoSaveEnabled[] PROGMEM = "enabled";
|
||||
const char AutoSaveUsermod::_autoSaveAfterSec[] PROGMEM = "autoSaveAfterSec";
|
||||
const char AutoSaveUsermod::_autoSavePreset[] PROGMEM = "autoSavePreset";
|
||||
const char AutoSaveUsermod::_autoSaveApplyOnBoot[] PROGMEM = "autoSaveApplyOnBoot";
|
||||
|
||||
static AutoSaveUsermod autosave;
|
||||
REGISTER_USERMOD(autosave);
|
||||
Reference in New Issue
Block a user