Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use scons to track html changes #970

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions code/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ build_environments() {

for environment in $environments; do
echo -n "* espurna-$version-$environment.bin --- "
platformio run --silent --environment $environment || exit 1
platformio run --verbose --environment $environment || exit 1
stat -c %s .pioenvs/$environment/firmware.bin
[[ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]] || \
mv .pioenvs/$environment/firmware.bin ../firmware/espurna-$version/espurna-$version-$environment.bin
Expand Down Expand Up @@ -129,5 +129,6 @@ if [[ "${CI}" = true ]]; then
print_environments
fi

build_webui
# see extra_scripts.py
#build_webui
build_environments
13 changes: 2 additions & 11 deletions code/espurna/config/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,12 @@

*/

#ifdef USE_CUSTOM_H
#include "custom.h"
#endif

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

#ifdef USE_CORE_VERSION_H
#include "core_version.h"
Expand Down
11 changes: 11 additions & 0 deletions code/espurna/config/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifdef USE_CUSTOM_H
#include "custom.h"
#endif

#include "types.h"
#include "version.h"
#include "hardware.h"
#include "defaults.h"
#include "general.h"
#include "sensors.h"
#include "dependencies.h"
2 changes: 0 additions & 2 deletions code/espurna/config/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// Debug
// -----------------------------------------------------------------------------

#define DEBUG_SUPPORT DEBUG_SERIAL_SUPPORT || DEBUG_UDP_SUPPORT || DEBUG_TELNET_SUPPORT || DEBUG_WEB_SUPPORT

#if DEBUG_SUPPORT
#define DEBUG_MSG(...) debugSend(__VA_ARGS__)
#define DEBUG_MSG_P(...) debugSend_P(__VA_ARGS__)
Expand Down
36 changes: 36 additions & 0 deletions code/espurna/config/dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,41 @@
#define NTP_SUPPORT 1 // Scheduler needs NTP
#endif

// Have any debug enabled
#define DEBUG_SUPPORT DEBUG_SERIAL_SUPPORT || DEBUG_UDP_SUPPORT || DEBUG_TELNET_SUPPORT || DEBUG_WEB_SUPPORT

// Have any sensor enabled
#ifndef SENSOR_SUPPORT
#define SENSOR_SUPPORT ( \
AM2320_SUPPORT || \
ANALOG_SUPPORT || \
BH1750_SUPPORT || \
BMX280_SUPPORT || \
CSE7766_SUPPORT || \
DALLAS_SUPPORT || \
DHT_SUPPORT || \
DIGITAL_SUPPORT || \
ECH1560_SUPPORT || \
EMON_ADC121_SUPPORT || \
EMON_ADS1X15_SUPPORT || \
EMON_ANALOG_SUPPORT || \
EVENTS_SUPPORT || \
GEIGER_SUPPORT || \
GUVAS12SD_SUPPORT || \
HCSR04_SUPPORT || \
HLW8012_SUPPORT || \
MHZ19_SUPPORT || \
NTC_SUPPORT || \
SENSEAIR_SUPPORT || \
PMSX003_SUPPORT || \
PZEM004T_SUPPORT || \
SHT3X_I2C_SUPPORT || \
SI7021_SUPPORT || \
TMP3X_SUPPORT || \
V9261F_SUPPORT \
)
#endif

// -----------------------------------------------------------------------------
// WEB UI IMAGE
// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -99,3 +134,4 @@
#ifndef WEBUI_IMAGE
#define WEBUI_IMAGE WEBUI_IMAGE_SMALL
#endif

162 changes: 0 additions & 162 deletions code/espurna/config/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,41 +602,6 @@
#define V9261F_POWER_FACTOR 153699.0
#define V9261F_RPOWER_FACTOR V9261F_CURRENT_FACTOR

// =============================================================================
// Sensor helpers configuration - can't move to dependencies.h
// =============================================================================

#ifndef SENSOR_SUPPORT
#define SENSOR_SUPPORT ( \
AM2320_SUPPORT || \
ANALOG_SUPPORT || \
BH1750_SUPPORT || \
BMX280_SUPPORT || \
CSE7766_SUPPORT || \
DALLAS_SUPPORT || \
DHT_SUPPORT || \
DIGITAL_SUPPORT || \
ECH1560_SUPPORT || \
EMON_ADC121_SUPPORT || \
EMON_ADS1X15_SUPPORT || \
EMON_ANALOG_SUPPORT || \
EVENTS_SUPPORT || \
GEIGER_SUPPORT || \
GUVAS12SD_SUPPORT || \
HCSR04_SUPPORT || \
HLW8012_SUPPORT || \
MHZ19_SUPPORT || \
NTC_SUPPORT || \
SENSEAIR_SUPPORT || \
PMSX003_SUPPORT || \
PZEM004T_SUPPORT || \
SHT3X_I2C_SUPPORT || \
SI7021_SUPPORT || \
TMP3X_SUPPORT || \
V9261F_SUPPORT \
)
#endif

// -----------------------------------------------------------------------------
// ADC
// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -668,130 +633,3 @@
#define I2C_SCL_FREQUENCY 1000 // BRZO SCL frequency
#define I2C_CLEAR_BUS 0 // Clear I2C bus on boot
#define I2C_PERFORM_SCAN 1 // Perform a bus scan on boot

//--------------------------------------------------------------------------------
// Class loading
//--------------------------------------------------------------------------------

#if SENSOR_SUPPORT

#if SENSOR_DEBUG
#include "../config/debug.h"
#endif

#include "../sensors/BaseSensor.h"

#if AM2320_SUPPORT
#include "../sensors/AM2320Sensor.h"
#endif

#if ANALOG_SUPPORT
#include "../sensors/AnalogSensor.h"
#endif

#if BH1750_SUPPORT
#include "../sensors/BH1750Sensor.h"
#endif

#if BMX280_SUPPORT
#include "../sensors/BMX280Sensor.h"
#endif

#if CSE7766_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/CSE7766Sensor.h"
#endif

#if DALLAS_SUPPORT
#include <OneWire.h>
#include "../sensors/DallasSensor.h"
#endif

#if DHT_SUPPORT
#include "../sensors/DHTSensor.h"
#endif

#if DIGITAL_SUPPORT
#include "../sensors/DigitalSensor.h"
#endif

#if ECH1560_SUPPORT
#include "../sensors/ECH1560Sensor.h"
#endif

#if EMON_ADC121_SUPPORT
#include "../sensors/EmonADC121Sensor.h"
#endif

#if EMON_ADS1X15_SUPPORT
#include "../sensors/EmonADS1X15Sensor.h"
#endif

#if EMON_ANALOG_SUPPORT
#include "../sensors/EmonAnalogSensor.h"
#endif

#if EVENTS_SUPPORT
#include "../sensors/EventSensor.h"
#endif

#if GEIGER_SUPPORT
#include "../sensors/GeigerSensor.h" // The main file for geiger counting module
#endif

#if GUVAS12SD_SUPPORT
#include "../sensors/GUVAS12SDSensor.h"
#endif

#if HCSR04_SUPPORT
#include "../sensors/HCSR04Sensor.h"
#endif

#if HLW8012_SUPPORT
#include <HLW8012.h>
#include "../sensors/HLW8012Sensor.h"
#endif

#if MHZ19_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/MHZ19Sensor.h"
#endif

#if NTC_SUPPORT
#include "../sensors/AnalogSensor.h"
#include "../sensors/NTCSensor.h"
#endif

#if SENSEAIR_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/SenseAirSensor.h"
#endif

#if PMSX003_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/PMSX003Sensor.h"
#endif

#if PZEM004T_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/PZEM004TSensor.h"
#endif

#if SI7021_SUPPORT
#include "../sensors/SI7021Sensor.h"
#endif

#if SHT3X_I2C_SUPPORT
#include "../sensors/SHT3XI2CSensor.h"
#endif

#if TMP3X_SUPPORT
#include "../sensors/TMP3XSensor.h"
#endif

#if V9261F_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/V9261FSensor.h"
#endif

#endif // SENSOR_SUPPORT
108 changes: 108 additions & 0 deletions code/espurna/sensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,114 @@ Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
#include "filters/MovingAverageFilter.h"
#include "sensors/BaseSensor.h"

#if AM2320_SUPPORT
#include "sensors/AM2320Sensor.h"
#endif

#if ANALOG_SUPPORT
#include "sensors/AnalogSensor.h"
#endif

#if BH1750_SUPPORT
#include "sensors/BH1750Sensor.h"
#endif

#if BMX280_SUPPORT
#include "sensors/BMX280Sensor.h"
#endif

#if CSE7766_SUPPORT
#include <SoftwareSerial.h>
#include "sensors/CSE7766Sensor.h"
#endif

#if DALLAS_SUPPORT
#include <OneWire.h>
#include "sensors/DallasSensor.h"
#endif

#if DHT_SUPPORT
#include "sensors/DHTSensor.h"
#endif

#if DIGITAL_SUPPORT
#include "sensors/DigitalSensor.h"
#endif

#if ECH1560_SUPPORT
#include "sensors/ECH1560Sensor.h"
#endif

#if EMON_ADC121_SUPPORT
#include "sensors/EmonADC121Sensor.h"
#endif

#if EMON_ADS1X15_SUPPORT
#include "sensors/EmonADS1X15Sensor.h"
#endif

#if EMON_ANALOG_SUPPORT
#include "sensors/EmonAnalogSensor.h"
#endif

#if EVENTS_SUPPORT
#include "sensors/EventSensor.h"
#endif

#if GEIGER_SUPPORT
#include "sensors/GeigerSensor.h" // The main file for geiger counting module
#endif

#if GUVAS12SD_SUPPORT
#include "sensors/GUVAS12SDSensor.h"
#endif

#if HCSR04_SUPPORT
#include "sensors/HCSR04Sensor.h"
#endif

#if HLW8012_SUPPORT
#include <HLW8012.h>
#include "sensors/HLW8012Sensor.h"
#endif

#if MHZ19_SUPPORT
#include <SoftwareSerial.h>
#include "sensors/MHZ19Sensor.h"
#endif

#if SENSEAIR_SUPPORT
#include <SoftwareSerial.h>
#include "sensors/SenseAirSensor.h"
#endif

#if PMSX003_SUPPORT
#include <SoftwareSerial.h>
#include "sensors/PMSX003Sensor.h"
#endif

#if PZEM004T_SUPPORT
#include <SoftwareSerial.h>
#include "sensors/PZEM004TSensor.h"
#endif

#if SI7021_SUPPORT
#include "sensors/SI7021Sensor.h"
#endif

#if SHT3X_I2C_SUPPORT
#include "sensors/SHT3XI2CSensor.h"
#endif

#if TMP3X_SUPPORT
#include "sensors/TMP3XSensor.h"
#endif

#if V9261F_SUPPORT
#include <SoftwareSerial.h>
#include "sensors/V9261FSensor.h"
#endif

typedef struct {
BaseSensor * sensor; // Sensor object
BaseFilter * filter; // Filter object
Expand Down
Loading