Merge pull request #715 from zewelor/allow_to_override_some_const
Allow to override some costs
This commit is contained in:
commit
1979236f3a
@ -13,12 +13,25 @@
|
||||
//#define WLED_USE_H801 //H801 controller. Please uncomment #define WLED_USE_ANALOG_LEDS as well
|
||||
//#define WLED_USE_5CH_LEDS //5 Channel H801 for cold and warm white
|
||||
|
||||
#ifndef BTNPIN
|
||||
#define BTNPIN 0 //button pin. Needs to have pullup (gpio0 recommended)
|
||||
#define IR_PIN 4 //infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
|
||||
#define RLYPIN 12 //pin for relay, will be set HIGH if LEDs are on (-1 to disable). Also usable for standby leds, triggers,...
|
||||
#define AUXPIN -1 //debug auxiliary output pin (-1 to disable)
|
||||
#endif
|
||||
|
||||
#ifndef IR_PIN
|
||||
#define IR_PIN 4 //infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
|
||||
#endif
|
||||
|
||||
#ifndef RLYPIN
|
||||
#define RLYPIN 12 //pin for relay, will be set HIGH if LEDs are on (-1 to disable). Also usable for standby leds, triggers,...
|
||||
#endif
|
||||
|
||||
#ifndef AUXPIN
|
||||
#define AUXPIN -1 //debug auxiliary output pin (-1 to disable)
|
||||
#endif
|
||||
|
||||
#ifndef RLYMDE
|
||||
#define RLYMDE 1 //mode for relay, 0: LOW if LEDs are on 1: HIGH if LEDs are on
|
||||
#endif
|
||||
|
||||
//END CONFIGURATION
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
#ifndef wled_const_h
|
||||
#define wled_const_h
|
||||
|
||||
//Defaults
|
||||
#define DEFAULT_CLIENT_SSID "Your_Network"
|
||||
#define DEFAULT_AP_PASS "wled1234"
|
||||
#define DEFAULT_OTA_PASS "wledota"
|
||||
|
||||
//Access point behavior
|
||||
#define AP_BEHAVIOR_BOOT_NO_CONN 0 //Open AP when no connection after boot
|
||||
#define AP_BEHAVIOR_NO_CONN 1 //Open when no connection (either after boot or if connection is lost)
|
||||
|
@ -85,6 +85,14 @@ DMXESPSerial dmx;
|
||||
#include "ir_codes.h"
|
||||
#include "const.h"
|
||||
|
||||
#ifndef CLIENT_SSID
|
||||
#define CLIENT_SSID DEFAULT_CLIENT_SSID
|
||||
#endif
|
||||
|
||||
#ifndef CLIENT_PASS
|
||||
#define CLIENT_PASS ""
|
||||
#endif
|
||||
|
||||
|
||||
#if IR_PIN < 0
|
||||
#ifndef WLED_DISABLE_INFRARED
|
||||
@ -117,8 +125,8 @@ char versionString[] = "0.9.1";
|
||||
|
||||
|
||||
//AP and OTA default passwords (for maximum change them!)
|
||||
char apPass[65] = "wled1234";
|
||||
char otaPass[33] = "wledota";
|
||||
char apPass[65] = DEFAULT_AP_PASS;
|
||||
char otaPass[33] = DEFAULT_OTA_PASS;
|
||||
|
||||
|
||||
//Hardware CONFIG (only changeble HERE, not at runtime)
|
||||
@ -130,8 +138,8 @@ char ntpServerName[33] = "0.wled.pool.ntp.org";//NTP server to use
|
||||
|
||||
|
||||
//WiFi CONFIG (all these can be changed via web UI, no need to set them here)
|
||||
char clientSSID[33] = "Your_Network";
|
||||
char clientPass[65] = "";
|
||||
char clientSSID[33] = CLIENT_SSID;
|
||||
char clientPass[65] = CLIENT_PASS;
|
||||
char cmDNS[33] = "x"; //mDNS address (placeholder, will be replaced by wledXXXXXXXXXXXX.local)
|
||||
char apSSID[33] = ""; //AP off by default (unless setup)
|
||||
byte apChannel = 1; //2.4GHz WiFi AP channel (1-13)
|
||||
@ -468,7 +476,7 @@ bool e131NewData = false;
|
||||
WS2812FX strip = WS2812FX();
|
||||
|
||||
#define WLED_CONNECTED (WiFi.status() == WL_CONNECTED)
|
||||
#define WLED_WIFI_CONFIGURED (strlen(clientSSID) >= 1 && strcmp(clientSSID,"Your_Network") != 0)
|
||||
#define WLED_WIFI_CONFIGURED (strlen(clientSSID) >= 1 && strcmp(clientSSID,DEFAULT_CLIENT_SSID) != 0)
|
||||
|
||||
//debug macros
|
||||
#ifdef WLED_DEBUG
|
||||
|
@ -43,7 +43,7 @@ void wledInit()
|
||||
loadSettingsFromEEPROM(true);
|
||||
beginStrip();
|
||||
userSetup();
|
||||
if (strcmp(clientSSID,"Your_Network") == 0) showWelcomePage = true;
|
||||
if (strcmp(clientSSID,DEFAULT_CLIENT_SSID) == 0) showWelcomePage = true;
|
||||
WiFi.persistent(false);
|
||||
|
||||
if (macroBoot>0) applyMacro(macroBoot);
|
||||
@ -126,7 +126,7 @@ void initAP(bool resetAP=false){
|
||||
if (apBehavior == AP_BEHAVIOR_BUTTON_ONLY && !resetAP) return;
|
||||
|
||||
if (!apSSID[0] || resetAP) strcpy(apSSID, "WLED-AP");
|
||||
if (resetAP) strcpy(apPass,"wled1234");
|
||||
if (resetAP) strcpy(apPass,DEFAULT_AP_PASS);
|
||||
DEBUG_PRINT("Opening access point ");
|
||||
DEBUG_PRINTLN(apSSID);
|
||||
WiFi.softAPConfig(IPAddress(4, 3, 2, 1), IPAddress(4, 3, 2, 1), IPAddress(255,255,255,0));
|
||||
|
Loading…
Reference in New Issue
Block a user