Skip to content

Commit

Permalink
Merge pull request #780 from lobradov/h-split
Browse files Browse the repository at this point in the history
.h splitting and reorg
  • Loading branch information
xoseperez authored Apr 11, 2018
2 parents 4600fd5 + daf79d6 commit 15d69d9
Show file tree
Hide file tree
Showing 17 changed files with 467 additions and 396 deletions.
3 changes: 3 additions & 0 deletions code/espurna/config/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
#endif

#include "version.h"
#include "types.h"
#include "arduino.h"
#include "hardware.h"
#include "defaults.h"
#include "general.h"
#include "prototypes.h"
#include "sensors.h"
#include "progmem.h"
#include "dependencies.h"

#ifdef USE_CORE_VERSION_H
#include "core_version.h"
Expand Down
8 changes: 0 additions & 8 deletions code/espurna/config/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,6 @@
#define HOSTNAME ""
#endif

// Needed for ESP8285 boards under Windows using PlatformIO (?)
#ifndef BUTTON_PUSHBUTTON
#define BUTTON_PUSHBUTTON 0
#define BUTTON_SWITCH 1
#define BUTTON_DEFAULT_HIGH 2
#define BUTTON_SET_PULLUP 4
#endif

// Relay providers
#ifndef RELAY_PROVIDER
#define RELAY_PROVIDER RELAY_PROVIDER_RELAY
Expand Down
74 changes: 74 additions & 0 deletions code/espurna/config/dependencies.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#pragma once

//------------------------------------------------------------------------------
// Do not change this file unless you know what you are doing
// Configuration settings are in the settings.h file
//------------------------------------------------------------------------------


#if DEBUG_TELNET_SUPPORT
#undef TELNET_SUPPORT
#define TELNET_SUPPORT 1
#endif

#ifndef DEBUG_WEB_SUPPORT
#define DEBUG_WEB_SUPPORT WEB_SUPPORT // Enable web debug log if web is enabled too
#endif

#if DEBUG_WEB_SUPPORT
#undef WEB_SUPPORT
#define WEB_SUPPORT 1 // Chicken and egg :)
#endif

#if not WEB_SUPPORT
#undef SSDP_SUPPORT
#define SSDP_SUPPORT 0 // SSDP support requires web support
#endif

#if UART_MQTT_SUPPORT
#define MQTT_SUPPORT 1
#undef TERMINAL_SUPPORT
#define TERMINAL_SUPPORT 0
#undef DEBUG_SERIAL_SUPPORT
#define DEBUG_SERIAL_SUPPORT 0
#endif

#if DOMOTICZ_SUPPORT
#undef MQTT_SUPPORT
#define MQTT_SUPPORT 1 // If Domoticz enabled enable MQTT
#endif

#if HOMEASSISTANT_SUPPORT
#undef MQTT_SUPPORT
#define MQTT_SUPPORT 1 // If Home Assistant enabled enable MQTT
#endif

#ifndef ASYNC_TCP_SSL_ENABLED
#if THINGSPEAK_USE_SSL && THINGSPEAK_USE_ASYNC
#undef THINGSPEAK_SUPPORT // Thingspeak in ASYNC mode requires ASYNC_TCP_SSL_ENABLED
#endif
#endif

#if SCHEDULER_SUPPORT
#undef NTP_SUPPORT
#define NTP_SUPPORT 1 // Scheduler needs NTP
#endif

//------------------------------------------------------------------------------
// Sensors
//------------------------------------------------------------------------------


#if ANALOG_SUPPORT
#undef ADC_VCC_ENABLED
#define ADC_VCC_ENABLED 0
#endif

#if EMON_ANALOG_SUPPORT
#undef ADC_VCC_ENABLED
#define ADC_VCC_ENABLED 0
#endif

// I2C dependencies moved to actual sensor files.

//------------------------------------------------------------------------------
Loading

0 comments on commit 15d69d9

Please sign in to comment.