diff --git a/esp8266_artnet_dmx512/esp8266_artnet_dmx512.ino.d1_mini.bin b/esp8266_artnet_dmx512/esp8266_artnet_dmx512.ino.d1_mini.bin new file mode 100644 index 0000000..60f34e6 Binary files /dev/null and b/esp8266_artnet_dmx512/esp8266_artnet_dmx512.ino.d1_mini.bin differ diff --git a/esp8266_artnet_dmx512/setup_ota.h b/esp8266_artnet_dmx512/setup_ota.h index d66a54b..f42691d 100644 --- a/esp8266_artnet_dmx512/setup_ota.h +++ b/esp8266_artnet_dmx512/setup_ota.h @@ -9,15 +9,12 @@ #include #define JSON_TO_CONFIG(x, y) { if (root.containsKey(y)) { config.x = root[y]; } } -#define CONFIG_TO_JSON(x, y) { root[y] = config.x; } +#define CONFIG_TO_JSON(x, y) { root.set(y, config.x); } #define KEYVAL_TO_CONFIG(x, y) { if (server.hasArg(y)) { String str = server.arg(y); config.x = str.toInt(); } } - -struct Config { - int universe; - int channels; - int delay; -}; +#define S_JSON_TO_CONFIG(x, y) { if (root.containsKey(y)) { strcpy(config.x, root[y]); } } +#define S_CONFIG_TO_JSON(x, y) { root.set(y, config.x); } +#define S_KEYVAL_TO_CONFIG(x, y) { if (server.hasArg(y)) { String str = server.arg(y); strcpy(config.x, str.c_str()); } } bool initialConfig(void); bool loadConfig(void); @@ -33,5 +30,11 @@ void handleStaticFile(String); void handleStaticFile(const char *); void handleJSON(); +struct Config { + int universe; + int channels; + int delay; +}; + #endif // _SETUP_OTA_H_ diff --git a/esp8266_artnet_neopixel/setup_ota.h b/esp8266_artnet_neopixel/setup_ota.h index ee0d530..b8ef60f 100644 --- a/esp8266_artnet_neopixel/setup_ota.h +++ b/esp8266_artnet_neopixel/setup_ota.h @@ -9,23 +9,12 @@ #include #define JSON_TO_CONFIG(x, y) { if (root.containsKey(y)) { config.x = root[y]; } } -#define CONFIG_TO_JSON(x, y) { root[y] = config.x; } +#define CONFIG_TO_JSON(x, y) { root.set(y, config.x); } #define KEYVAL_TO_CONFIG(x, y) { if (server.hasArg(y)) { String str = server.arg(y); config.x = str.toInt(); } } - -struct Config { - int universe; - int offset; - int pixels; - int leds; - int white; - int brightness; - int hsv; - int mode; - int reverse; - int speed; - int position; -}; +#define S_JSON_TO_CONFIG(x, y) { if (root.containsKey(y)) { strcpy(config.x, root[y]); } } +#define S_CONFIG_TO_JSON(x, y) { root.set(y, config.x); } +#define S_KEYVAL_TO_CONFIG(x, y) { if (server.hasArg(y)) { String str = server.arg(y); strcpy(config.x, str.c_str()); } } bool initialConfig(void); bool loadConfig(void); @@ -41,5 +30,19 @@ void handleStaticFile(String); void handleStaticFile(const char *); void handleJSON(); +struct Config { + int universe; + int offset; + int pixels; + int leds; + int white; + int brightness; + int hsv; + int mode; + int reverse; + int speed; + int position; +}; + #endif // _SETUP_OTA_H_ diff --git a/esp8266_imu_osc/setup_ota.h b/esp8266_imu_osc/setup_ota.h index 6166a68..a27f6b7 100644 --- a/esp8266_imu_osc/setup_ota.h +++ b/esp8266_imu_osc/setup_ota.h @@ -16,6 +16,20 @@ #define S_CONFIG_TO_JSON(x, y) { root.set(y, config.x); } #define S_KEYVAL_TO_CONFIG(x, y) { if (server.hasArg(y)) { String str = server.arg(y); strcpy(config.x, str.c_str()); } } +bool initialConfig(void); +bool loadConfig(void); +bool saveConfig(void); + +void handleUpdate1(void); +void handleUpdate2(void); +void handleDirList(void); +void handleNotFound(void); +void handleRedirect(String); +void handleRedirect(const char *); +void handleStaticFile(String); +void handleStaticFile(const char *); +void handleJSON(); + struct Config { int sensors; int decimate; @@ -24,9 +38,4 @@ struct Config { int port; }; -void handleNotFound(); -void handleStaticFile(String filename); -void handleStaticFile(const char * filename); -void handleJSON(); - #endif diff --git a/esp8266_polar_wearlink/setup_ota.h b/esp8266_polar_wearlink/setup_ota.h index 7f8ecd3..20e75ab 100644 --- a/esp8266_polar_wearlink/setup_ota.h +++ b/esp8266_polar_wearlink/setup_ota.h @@ -16,14 +16,23 @@ #define S_CONFIG_TO_JSON(x, y) { root.set(y, config.x); } #define S_KEYVAL_TO_CONFIG(x, y) { if (server.hasArg(y)) { String str = server.arg(y); strcpy(config.x, str.c_str()); } } +bool initialConfig(void); +bool loadConfig(void); +bool saveConfig(void); + +void handleUpdate1(void); +void handleUpdate2(void); +void handleDirList(void); +void handleNotFound(void); +void handleRedirect(String); +void handleRedirect(const char *); +bool handleStaticFile(String); +bool handleStaticFile(const char *); +void handleJSON(); + struct Config { char redis[32]; int port; }; -void handleNotFound(); -bool handleStaticFile(String filename); -bool handleStaticFile(const char * filename); -void handleJSON(); - #endif