Add CustomEffects as usermod: step 1: c compiles

- Only C part, it only compiles
- UI to be done
- Needs to be tested
This commit is contained in:
Ewowi
2022-08-29 13:56:46 +02:00
parent c6126db2a2
commit 9a87d2bd8e
6 changed files with 3525 additions and 0 deletions

View File

@@ -634,6 +634,8 @@ typedef struct Segment {
} segment;
//static int segSize = sizeof(Segment);
#define floatNull -32768 //WLEDSR Custom Effects
// main "strip" class
class WS2812FX { // 96 bytes
typedef uint16_t (*mode_ptr)(void); // pointer to mode function
@@ -898,6 +900,12 @@ class WS2812FX { // 96 bytes
void
estimateCurrentAndLimitBri(void);
public:
//WLEDSR Custom Effects
float arti_external_function(uint8_t function, float par1 = floatNull, float par2 = floatNull, float par3 = floatNull, float par4 = floatNull, float par5 = floatNull);
float arti_get_external_variable(uint8_t variable, float par1 = floatNull, float par2 = floatNull, float par3 = floatNull);
void arti_set_external_variable(float value, uint8_t variable, float par1 = floatNull, float par2 = floatNull, float par3 = floatNull);
};
extern const char JSON_mode_names[];

View File

@@ -80,6 +80,7 @@
#define USERMOD_ID_SI7021_MQTT_HA 29 //Usermod "usermod_si7021_mqtt_ha.h"
#define USERMOD_ID_BME280 30 //Usermod "usermod_bme280.h
#define USERMOD_ID_AUDIOREACTIVE 31 //Usermod "audioreactive.h"
#define USERMOD_ID_CUSTOMEFFECTS 32 //Usermod "usermod_v2_customeffects.h"
//Access point behavior
#define AP_BEHAVIOR_BOOT_NO_CONN 0 //Open AP when no connection after boot

View File

@@ -139,6 +139,10 @@
#include "../usermods/audioreactive/audio_reactive.h"
#endif
#ifdef USERMOD_CUSTOMEFFECTS
#include "../usermods/customeffects/usermod_v2_customeffects.h"
#endif
void registerUsermods()
{
/*
@@ -265,4 +269,9 @@ void registerUsermods()
#endif
usermods.add(new AudioReactive());
#endif
#ifdef USERMOD_CUSTOMEFFECTS
usermods.add(new CustomEffectsUserMod());
#endif
}