Browse Source

Allow overriding several build settings

i18n
Xose Pérez 6 years ago
parent
commit
1087134c65
3 changed files with 33 additions and 17 deletions
  1. +12
    -13
      code/espurna/config/all.h
  2. +14
    -0
      code/espurna/config/general.h
  3. +7
    -4
      code/espurna/config/hardware.h

+ 12
- 13
code/espurna/config/all.h View File

@ -1,15 +1,3 @@
#include "version.h"
#include "arduino.h"
#include "hardware.h"
#include "defaults.h"
#include "general.h"
#include "prototypes.h"
#include "sensors.h"
#ifdef USE_CORE_VERSION_H
#include "core_version.h"
#endif
/* /*
If you want to modify the stock configuration but you don't want to touch If you want to modify the stock configuration but you don't want to touch
the repo files you can either define USE_CUSTOM_H or remove the the repo files you can either define USE_CUSTOM_H or remove the
@ -20,7 +8,18 @@
(Define USE_CUSTOM_H on commandline for platformio: (Define USE_CUSTOM_H on commandline for platformio:
export PLATFORMIO_BUILD_FLAGS="'-DUSE_CUSTOM_H'" ) export PLATFORMIO_BUILD_FLAGS="'-DUSE_CUSTOM_H'" )
*/ */
#ifdef USE_CUSTOM_H #ifdef USE_CUSTOM_H
#include "custom.h" #include "custom.h"
#endif #endif
#include "version.h"
#include "arduino.h"
#include "hardware.h"
#include "defaults.h"
#include "general.h"
#include "prototypes.h"
#include "sensors.h"
#ifdef USE_CORE_VERSION_H
#include "core_version.h"
#endif

+ 14
- 0
code/espurna/config/general.h View File

@ -496,11 +496,21 @@ PROGMEM const char* const custom_reset_string[] = {
#define MQTT_QUEUE_MAX_SIZE 10 // Size of the MQTT queue when MQTT_USE_JSON is enabled #define MQTT_QUEUE_MAX_SIZE 10 // Size of the MQTT queue when MQTT_USE_JSON is enabled
// These are the properties that will be sent when useJson is true // These are the properties that will be sent when useJson is true
#ifndef MQTT_ENQUEUE_IP
#define MQTT_ENQUEUE_IP 1 #define MQTT_ENQUEUE_IP 1
#endif
#ifndef MQTT_ENQUEUE_MAC
#define MQTT_ENQUEUE_MAC 1 #define MQTT_ENQUEUE_MAC 1
#endif
#ifndef MQTT_ENQUEUE_HOSTNAME
#define MQTT_ENQUEUE_HOSTNAME 1 #define MQTT_ENQUEUE_HOSTNAME 1
#endif
#ifndef MQTT_ENQUEUE_DATETIME
#define MQTT_ENQUEUE_DATETIME 1 #define MQTT_ENQUEUE_DATETIME 1
#endif
#ifndef MQTT_ENQUEUE_MESSAGE_ID
#define MQTT_ENQUEUE_MESSAGE_ID 1 #define MQTT_ENQUEUE_MESSAGE_ID 1
#endif
// These particles will be concatenated to the MQTT_TOPIC base to form the actual topic // These particles will be concatenated to the MQTT_TOPIC base to form the actual topic
#define MQTT_TOPIC_JSON "data" #define MQTT_TOPIC_JSON "data"
@ -553,8 +563,12 @@ PROGMEM const char* const custom_reset_string[] = {
// Custom get and set postfixes // Custom get and set postfixes
// Use something like "/status" or "/set", with leading slash // Use something like "/status" or "/set", with leading slash
// Since 1.9.0 the default value is "" for getter and "/set" for setter // Since 1.9.0 the default value is "" for getter and "/set" for setter
#ifndef MQTT_GETTER
#define MQTT_GETTER "" #define MQTT_GETTER ""
#endif
#ifndef MQTT_SETTER
#define MQTT_SETTER "/set" #define MQTT_SETTER "/set"
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// SETTINGS // SETTINGS


+ 7
- 4
code/espurna/config/hardware.h View File

@ -1393,9 +1393,12 @@
#define RELAY8_TYPE RELAY_TYPE_NORMAL #define RELAY8_TYPE RELAY_TYPE_NORMAL
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Unknown hardware
// -----------------------------------------------------------------------------
#else
#error "UNSUPPORTED HARDWARE!"
#endif
// -----------------------------------------------------------------------------
// Check definitions
// -----------------------------------------------------------------------------
#if not defined(MANUFACTURER) || not defined(DEVICE)
#error "UNSUPPORTED HARDWARE!!"
#endif #endif

Loading…
Cancel
Save