Skip to content

Commit

Permalink
Custom define file (letscontrolit#807)
Browse files Browse the repository at this point in the history
* Allows to use a Custom.h file to change defaults setting without changing the repo file

* Custom.h example
  • Loading branch information
soif authored and psy0rz committed Feb 2, 2018
1 parent c2e7036 commit ebfa0a4
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.piolibdeps

lib/readme.txt
src/Custom.h
42 changes: 42 additions & 0 deletions src/Custom-sample.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
To modify the stock configuration without changing the EspEasy.ino file :
1) rename this file to "Custom.h" (It is ignored by Git)
2) define your own settings below
3) define USE_CUSTOM_H as a build flags. ie : export PLATFORMIO_BUILD_FLAGS="'-DUSE_CUSTOM_H'"
*/



// make the compiler show a warning to confirm that this file is inlcuded
#warning "**** Using Settings from Custom.h File ***"

/*
#######################################################################################################
Your Own Default Settings
#######################################################################################################
You can basically ovveride ALL macro defined in ESPEasy.ino.
Don't forget to first #undef each existing #define that you add below.
Here are some examples:
*/


#undef DEFAULT_NAME
#define DEFAULT_NAME "MyEspEasyDevice" // Enter your device friendly name

#undef DEFAULT_SSID
#define DEFAULT_SSID "MyHomeSSID" // Enter your network SSID

#undef DEFAULT_KEY
#define DEFAULT_KEY "MySuperSecretPassword" // Enter your network WPA key

#undef DEFAULT_AP_KEY
#define DEFAULT_AP_KEY "MyOwnConfigPassword" // Enter network WPA key for AP (config) mode

#ifdef BUILD_GIT
#undef BUILD_GIT
#endif

#define BUILD_GIT "MyBuildNum"
11 changes: 11 additions & 0 deletions src/ESPEasy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,17 @@
#define DAT_OFFSET_CUSTOM_CONTROLLER 32768 // each custom controller config = 1k, 4 max.


/*
To modify the stock configuration without changing this repo file :
- define USE_CUSTOM_H as a build flags. ie : export PLATFORMIO_BUILD_FLAGS="'-DUSE_CUSTOM_H'"
- add a "Custom.h" file in this folder.
*/
#ifdef USE_CUSTOM_H
#include "Custom.h"
#endif


#include "lwip/tcp_impl.h"
#include <ESP8266WiFi.h>
#include <DNSServer.h>
Expand Down

0 comments on commit ebfa0a4

Please sign in to comment.