Browse Source

Move strings to progmem

webui
Xose Pérez 6 years ago
parent
commit
c291b96e5a
5 changed files with 9 additions and 27 deletions
  1. +1
    -1
      code/espurna/config/all.h
  2. +1
    -17
      code/espurna/config/sensors.h
  3. +4
    -4
      code/espurna/influxdb.ino
  4. +3
    -3
      code/espurna/ir.ino
  5. +0
    -2
      code/espurna/sensors/SI7021Sensor.h

+ 1
- 1
code/espurna/config/all.h View File

@ -30,11 +30,11 @@
#include "defaults.h" #include "defaults.h"
#include "general.h" #include "general.h"
#include "dependencies.h" #include "dependencies.h"
#include "debug.h"
#include "prototypes.h" #include "prototypes.h"
#include "sensors.h" #include "sensors.h"
#include "webui.h" #include "webui.h"
#include "progmem.h" #include "progmem.h"
#include "debug.h"
#ifdef USE_CORE_VERSION_H #ifdef USE_CORE_VERSION_H
#include "core_version.h" #include "core_version.h"


+ 1
- 17
code/espurna/config/sensors.h View File

@ -725,12 +725,6 @@
#if SENSOR_SUPPORT #if SENSOR_SUPPORT
#if SENSOR_DEBUG
#include "../config/debug.h"
#endif
#include "../sensors/BaseSensor.h"
#if AM2320_SUPPORT #if AM2320_SUPPORT
#include "../sensors/AM2320Sensor.h" #include "../sensors/AM2320Sensor.h"
#endif #endif
@ -748,12 +742,10 @@
#endif #endif
#if CSE7766_SUPPORT #if CSE7766_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/CSE7766Sensor.h" #include "../sensors/CSE7766Sensor.h"
#endif #endif
#if DALLAS_SUPPORT #if DALLAS_SUPPORT
#include <OneWire.h>
#include "../sensors/DallasSensor.h" #include "../sensors/DallasSensor.h"
#endif #endif
@ -786,7 +778,7 @@
#endif #endif
#if GEIGER_SUPPORT #if GEIGER_SUPPORT
#include "../sensors/GeigerSensor.h" // The main file for geiger counting module
#include "../sensors/GeigerSensor.h"
#endif #endif
#if GUVAS12SD_SUPPORT #if GUVAS12SD_SUPPORT
@ -794,37 +786,30 @@
#endif #endif
#if HLW8012_SUPPORT #if HLW8012_SUPPORT
#include <HLW8012.h>
#include "../sensors/HLW8012Sensor.h" #include "../sensors/HLW8012Sensor.h"
#endif #endif
#if MHZ19_SUPPORT #if MHZ19_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/MHZ19Sensor.h" #include "../sensors/MHZ19Sensor.h"
#endif #endif
#if NTC_SUPPORT #if NTC_SUPPORT
#include "../sensors/AnalogSensor.h"
#include "../sensors/NTCSensor.h" #include "../sensors/NTCSensor.h"
#endif #endif
#if SDS011_SUPPORT #if SDS011_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/SDS011Sensor.h" #include "../sensors/SDS011Sensor.h"
#endif #endif
#if SENSEAIR_SUPPORT #if SENSEAIR_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/SenseAirSensor.h" #include "../sensors/SenseAirSensor.h"
#endif #endif
#if PMSX003_SUPPORT #if PMSX003_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/PMSX003Sensor.h" #include "../sensors/PMSX003Sensor.h"
#endif #endif
#if PZEM004T_SUPPORT #if PZEM004T_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/PZEM004TSensor.h" #include "../sensors/PZEM004TSensor.h"
#endif #endif
@ -845,7 +830,6 @@
#endif #endif
#if V9261F_SUPPORT #if V9261F_SUPPORT
#include <SoftwareSerial.h>
#include "../sensors/V9261FSensor.h" #include "../sensors/V9261FSensor.h"
#endif #endif


+ 4
- 4
code/espurna/influxdb.ino View File

@ -51,7 +51,7 @@ bool idbSend(const char * topic, const char * payload) {
#endif #endif
char * host = strdup(h.c_str()); char * host = strdup(h.c_str());
unsigned int port = getSetting("idbPort", INFLUXDB_PORT).toInt(); unsigned int port = getSetting("idbPort", INFLUXDB_PORT).toInt();
DEBUG_MSG("[INFLUXDB] Sending to %s:%u\n", host, port);
DEBUG_MSG_P(PSTR("[INFLUXDB] Sending to %s:%u\n"), host, port);
bool success = false; bool success = false;
@ -60,7 +60,7 @@ bool idbSend(const char * topic, const char * payload) {
char data[128]; char data[128];
snprintf(data, sizeof(data), "%s,device=%s value=%s", topic, getSetting("hostname").c_str(), String(payload).c_str()); snprintf(data, sizeof(data), "%s,device=%s value=%s", topic, getSetting("hostname").c_str(), String(payload).c_str());
DEBUG_MSG("[INFLUXDB] Data: %s\n", data);
DEBUG_MSG_P(PSTR("[INFLUXDB] Data: %s\n"), data);
char request[256]; char request[256];
snprintf(request, sizeof(request), "POST /write?db=%s&u=%s&p=%s HTTP/1.1\r\nHost: %s:%u\r\nContent-Length: %d\r\n\r\n%s", snprintf(request, sizeof(request), "POST /write?db=%s&u=%s&p=%s HTTP/1.1\r\nHost: %s:%u\r\nContent-Length: %d\r\n\r\n%s",
@ -74,14 +74,14 @@ bool idbSend(const char * topic, const char * payload) {
if (_idb_client.connected()) _idb_client.stop(); if (_idb_client.connected()) _idb_client.stop();
success = true; success = true;
} else { } else {
DEBUG_MSG("[INFLUXDB] Sent failed\n");
DEBUG_MSG_P(PSTR("[INFLUXDB] Sent failed\n"));
} }
_idb_client.stop(); _idb_client.stop();
while (_idb_client.connected()) yield(); while (_idb_client.connected()) yield();
} else { } else {
DEBUG_MSG("[INFLUXDB] Connection failed\n");
DEBUG_MSG_P(PSTR("[INFLUXDB] Connection failed\n"));
} }
free(host); free(host);


+ 3
- 3
code/espurna/ir.ino View File

@ -174,11 +174,11 @@ void _irMqttCallback(unsigned int type, const char * topic, const char * payload
DEBUG_MSG_P(PSTR("[IR] Raw IR output %d codes, repeat %d times on %d(k)Hz freq.\n"), count, _ir_repeat, _ir_freq); DEBUG_MSG_P(PSTR("[IR] Raw IR output %d codes, repeat %d times on %d(k)Hz freq.\n"), count, _ir_repeat, _ir_freq);
/* /*
DEBUG_MSG("[IR] main codes: ");
DEBUG_MSG_P(PSTR("[IR] main codes: "));
for(int i = 0; i < count; i++) { for(int i = 0; i < count; i++) {
DEBUG_MSG("%d,",_ir_raw[i]);
DEBUG_MSG_P(PSTR("%d,"),_ir_raw[i]);
} }
DEBUG_MSG("\n");
DEBUG_MSG_P(PSTR("\n"));
*/ */
#if defined(IR_RX_PIN) #if defined(IR_RX_PIN)


+ 0
- 2
code/espurna/sensors/SI7021Sensor.h View File

@ -10,8 +10,6 @@
#undef I2C_SUPPORT #undef I2C_SUPPORT
#define I2C_SUPPORT 1 // Explicitly request I2C support. #define I2C_SUPPORT 1 // Explicitly request I2C support.
#include "Arduino.h" #include "Arduino.h"
#include "I2CSensor.h" #include "I2CSensor.h"


Loading…
Cancel
Save