Browse Source

Support for WPS in core build. Using UNUSED macro to prevent warnings

rules-rpn
Xose Pérez 5 years ago
parent
commit
175fcbf6cf
13 changed files with 32 additions and 23 deletions
  1. +1
    -0
      code/espurna/button.ino
  2. +8
    -9
      code/espurna/config/hardware.h
  3. +2
    -0
      code/espurna/config/prototypes.h
  4. +1
    -1
      code/espurna/pwm.c
  5. +1
    -1
      code/espurna/sensors/ECH1560Sensor.h
  6. +1
    -1
      code/espurna/sensors/EmonADC121Sensor.h
  7. +1
    -1
      code/espurna/sensors/EmonADS1X15Sensor.h
  8. +1
    -1
      code/espurna/sensors/EmonAnalogSensor.h
  9. +1
    -1
      code/espurna/sensors/EventSensor.h
  10. +1
    -1
      code/espurna/sensors/GeigerSensor.h
  11. +1
    -0
      code/espurna/terminal.ino
  12. +4
    -0
      code/espurna/utils.ino
  13. +9
    -7
      code/platformio.ini

+ 1
- 0
code/espurna/button.ino View File

@ -186,6 +186,7 @@ void buttonSetup() {
#else #else
unsigned long btnDelay = getSetting("btnDelay", BUTTON_DBLCLICK_DELAY).toInt(); unsigned long btnDelay = getSetting("btnDelay", BUTTON_DBLCLICK_DELAY).toInt();
UNUSED(btnDelay);
#if BUTTON1_PIN != GPIO_NONE #if BUTTON1_PIN != GPIO_NONE
{ {


+ 8
- 9
code/espurna/config/hardware.h View File

@ -34,28 +34,27 @@
#define MANUFACTURER "ESPRESSIF" #define MANUFACTURER "ESPRESSIF"
#define DEVICE "ESPURNA_CORE" #define DEVICE "ESPURNA_CORE"
// UI modules
#define BUTTON_SUPPORT 0
#define MDNS_SERVER_SUPPORT 0
#define NTP_SUPPORT 0
#define WEB_SUPPORT 0
// Disable non-core modules // Disable non-core modules
#define ALEXA_SUPPORT 0 #define ALEXA_SUPPORT 0
#define API_SUPPORT 0
#define BROKER_SUPPORT 0 #define BROKER_SUPPORT 0
#define DOMOTICZ_SUPPORT 0 #define DOMOTICZ_SUPPORT 0
#define DEBUG_SERIAL_SUPPORT 0
#define DEBUG_TELNET_SUPPORT 0
#define DEBUG_WEB_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0 #define HOMEASSISTANT_SUPPORT 0
#define I2C_SUPPORT 0 #define I2C_SUPPORT 0
#define MQTT_SUPPORT 0 #define MQTT_SUPPORT 0
#define NTP_SUPPORT 0
#define SCHEDULER_SUPPORT 0 #define SCHEDULER_SUPPORT 0
#define SENSOR_SUPPORT 0 #define SENSOR_SUPPORT 0
#define THINGSPEAK_SUPPORT 0 #define THINGSPEAK_SUPPORT 0
#define WEB_SUPPORT 0
// Extra light-weight image // Extra light-weight image
//#define DEBUG_SERIAL_SUPPORT 0
//#define DEBUG_TELNET_SUPPORT 0
//#define DEBUG_WEB_SUPPORT 0
//#define BUTTON_SUPPORT 0
//#define LED_SUPPORT 0 //#define LED_SUPPORT 0
//#define MDNS_SERVER_SUPPORT 0
//#define TELNET_SUPPORT 0 //#define TELNET_SUPPORT 0
//#define TERMINAL_SUPPORT 0 //#define TERMINAL_SUPPORT 0


+ 2
- 0
code/espurna/config/prototypes.h View File

@ -8,6 +8,8 @@ extern "C" {
#include "user_interface.h" #include "user_interface.h"
} }
#define UNUSED(x) (void)(x)
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// API // API
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


+ 1
- 1
code/espurna/pwm.c View File

@ -445,5 +445,5 @@ get_pwm_version(void)
void ICACHE_FLASH_ATTR void ICACHE_FLASH_ATTR
set_pwm_debug_en(uint8_t print_en) set_pwm_debug_en(uint8_t print_en)
{ {
(void) print_en;
UNUSED(print_en);
} }

+ 1
- 1
code/espurna/sensors/ECH1560Sensor.h View File

@ -127,7 +127,7 @@ class ECH1560Sensor : public BaseSensor {
void ICACHE_RAM_ATTR handleInterrupt(unsigned char gpio) { void ICACHE_RAM_ATTR handleInterrupt(unsigned char gpio) {
(void) gpio;
UNSUSED(gpio);
// if we are trying to find the sync-time (CLK goes high for 1-2ms) // if we are trying to find the sync-time (CLK goes high for 1-2ms)
if (_dosync == false) { if (_dosync == false) {


+ 1
- 1
code/espurna/sensors/EmonADC121Sensor.h View File

@ -140,7 +140,7 @@ class EmonADC121Sensor : public EmonSensor {
} }
unsigned int readADC(unsigned char channel) { unsigned int readADC(unsigned char channel) {
(void) channel;
UNUSED(channel);
unsigned int value = i2c_read_uint16(_address, ADC121_REG_RESULT) & 0x0FFF; unsigned int value = i2c_read_uint16(_address, ADC121_REG_RESULT) & 0x0FFF;
return value; return value;
} }


+ 1
- 1
code/espurna/sensors/EmonADS1X15Sensor.h View File

@ -325,7 +325,7 @@ class EmonADS1X15Sensor : public EmonSensor {
} }
unsigned int readADC(unsigned char channel) { unsigned int readADC(unsigned char channel) {
(void) channel;
UNUSED(channel);
unsigned int value = i2c_read_uint16(_address, ADS1X15_REG_POINTER_CONVERT); unsigned int value = i2c_read_uint16(_address, ADS1X15_REG_POINTER_CONVERT);
if (_type = ADS1X15_CHIP_ADS1015) value >>= ADS1015_BIT_SHIFT; if (_type = ADS1X15_CHIP_ADS1015) value >>= ADS1015_BIT_SHIFT;
delayMicroseconds(500); delayMicroseconds(500);


+ 1
- 1
code/espurna/sensors/EmonAnalogSensor.h View File

@ -119,7 +119,7 @@ class EmonAnalogSensor : public EmonSensor {
protected: protected:
unsigned int readADC(unsigned char channel) { unsigned int readADC(unsigned char channel) {
(void) channel;
UNUSED(channel);
return analogRead(0); return analogRead(0);
} }


+ 1
- 1
code/espurna/sensors/EventSensor.h View File

@ -123,7 +123,7 @@ class EventSensor : public BaseSensor {
// Handle interrupt calls // Handle interrupt calls
void ICACHE_RAM_ATTR handleInterrupt(unsigned char gpio) { void ICACHE_RAM_ATTR handleInterrupt(unsigned char gpio) {
(void) gpio;
UNUSED(gpio);
static unsigned long last = 0; static unsigned long last = 0;
// clock count in 32bit value, overflowing: // clock count in 32bit value, overflowing:


+ 1
- 1
code/espurna/sensors/GeigerSensor.h View File

@ -169,7 +169,7 @@ double value(unsigned char index) {
// Handle interrupt calls // Handle interrupt calls
void handleInterrupt(unsigned char gpio) { void handleInterrupt(unsigned char gpio) {
(void) gpio;
UNUSED(gpio);
static unsigned long last = 0; static unsigned long last = 0;
if (millis() - last > _debounce) { if (millis() - last > _debounce) {
_events = _events + 1; _events = _events + 1;


+ 1
- 0
code/espurna/terminal.ino View File

@ -71,6 +71,7 @@ void _terminalKeysCommand() {
} }
unsigned long freeEEPROM = SPI_FLASH_SEC_SIZE - settingsSize(); unsigned long freeEEPROM = SPI_FLASH_SEC_SIZE - settingsSize();
UNUSED(freeEEPROM);
DEBUG_MSG_P(PSTR("Number of keys: %d\n"), keys.size()); DEBUG_MSG_P(PSTR("Number of keys: %d\n"), keys.size());
DEBUG_MSG_P(PSTR("Current EEPROM sector: %u\n"), EEPROMr.current()); DEBUG_MSG_P(PSTR("Current EEPROM sector: %u\n"), EEPROMr.current());
DEBUG_MSG_P(PSTR("Free EEPROM: %d bytes (%d%%)\n"), freeEEPROM, 100 * freeEEPROM / SPI_FLASH_SEC_SIZE); DEBUG_MSG_P(PSTR("Free EEPROM: %d bytes (%d%%)\n"), freeEEPROM, 100 * freeEEPROM / SPI_FLASH_SEC_SIZE);


+ 4
- 0
code/espurna/utils.ino View File

@ -206,6 +206,9 @@ void heartbeat() {
unsigned long uptime_seconds = getUptime(); unsigned long uptime_seconds = getUptime();
unsigned int free_heap = getFreeHeap(); unsigned int free_heap = getFreeHeap();
UNUSED(uptime_seconds);
UNUSED(free_heap);
#if MQTT_SUPPORT #if MQTT_SUPPORT
unsigned char _heartbeat_mode = getHeartbeatMode(); unsigned char _heartbeat_mode = getHeartbeatMode();
@ -418,6 +421,7 @@ void info() {
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
FlashMode_t mode = ESP.getFlashChipMode(); FlashMode_t mode = ESP.getFlashChipMode();
UNUSED(mode);
DEBUG_MSG_P(PSTR("[MAIN] Flash chip ID: 0x%06X\n"), ESP.getFlashChipId()); DEBUG_MSG_P(PSTR("[MAIN] Flash chip ID: 0x%06X\n"), ESP.getFlashChipId());
DEBUG_MSG_P(PSTR("[MAIN] Flash speed: %u Hz\n"), ESP.getFlashChipSpeed()); DEBUG_MSG_P(PSTR("[MAIN] Flash speed: %u Hz\n"), ESP.getFlashChipSpeed());
DEBUG_MSG_P(PSTR("[MAIN] Flash mode: %s\n"), mode == FM_QIO ? "QIO" : mode == FM_QOUT ? "QOUT" : mode == FM_DIO ? "DIO" : mode == FM_DOUT ? "DOUT" : "UNKNOWN"); DEBUG_MSG_P(PSTR("[MAIN] Flash mode: %s\n"), mode == FM_QIO ? "QIO" : mode == FM_QOUT ? "QOUT" : mode == FM_DIO ? "DIO" : mode == FM_DOUT ? "DOUT" : "UNKNOWN");


+ 9
- 7
code/platformio.ini View File

@ -1,5 +1,5 @@
[platformio] [platformio]
env_default = nodemcu-lolin
env_default = wemos-d1mini-relayshield
src_dir = espurna src_dir = espurna
data_dir = espurna/data data_dir = espurna/data
@ -13,14 +13,16 @@ data_dir = espurna/data
# arduino core 2.4.0 = platformIO 1.6.0 # arduino core 2.4.0 = platformIO 1.6.0
# arduino core 2.4.1 = platformIO 1.7.3 # arduino core 2.4.1 = platformIO 1.7.3
# arduino core 2.4.2 = platformIO 1.8.0 # arduino core 2.4.2 = platformIO 1.8.0
# arduino core 2.5.0 = platformIO 2.0.4
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
arduino_core_2_3_0 = espressif8266@1.5.0 arduino_core_2_3_0 = espressif8266@1.5.0
arduino_core_2_4_0 = espressif8266@1.6.0 arduino_core_2_4_0 = espressif8266@1.6.0
arduino_core_2_4_1 = espressif8266@1.7.3 arduino_core_2_4_1 = espressif8266@1.7.3
arduino_core_2_4_2 = espressif8266@1.8.0 arduino_core_2_4_2 = espressif8266@1.8.0
arduino_core_2_5_0 = espressif8266@2.0.4
platform = ${common.arduino_core_2_3_0} platform = ${common.arduino_core_2_3_0}
platform_latest = ${common.arduino_core_2_4_2}
platform_latest = ${common.arduino_core_2_5_0}
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# FLAGS: DEBUG # FLAGS: DEBUG
@ -116,7 +118,7 @@ board = ${common.board_1m}
board_build.flash_mode = ${common.flash_mode} board_build.flash_mode = ${common.flash_mode}
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m0m} -DESPURNA_CORE
build_flags = ${common.build_flags_1m0m} -DESPURNA_CORE -DJUSTWIFI_ENABLE_WPS=1
monitor_speed = ${common.monitor_speed} monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts} extra_scripts = ${common.extra_scripts}
@ -127,7 +129,7 @@ board = ${common.board_2m}
board_build.flash_mode = ${common.flash_mode} board_build.flash_mode = ${common.flash_mode}
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_2m1m} -DESPURNA_CORE
build_flags = ${common.build_flags_2m1m} -DESPURNA_CORE -DJUSTWIFI_ENABLE_WPS=1
monitor_speed = ${common.monitor_speed} monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts} extra_scripts = ${common.extra_scripts}
@ -138,7 +140,7 @@ board = ${common.board_4m}
board_build.flash_mode = ${common.flash_mode} board_build.flash_mode = ${common.flash_mode}
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_4m1m} -DESPURNA_CORE
build_flags = ${common.build_flags_4m1m} -DESPURNA_CORE -DJUSTWIFI_ENABLE_WPS=1
monitor_speed = ${common.monitor_speed} monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts} extra_scripts = ${common.extra_scripts}
@ -250,7 +252,7 @@ monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts} extra_scripts = ${common.extra_scripts}
[env:wemos-d1mini-relayshield-ssl] [env:wemos-d1mini-relayshield-ssl]
platform = ${common.platform_173}
platform = ${common.arduino_core_2_5_0}
framework = ${common.framework} framework = ${common.framework}
board = ${common.board_4m} board = ${common.board_4m}
board_build.flash_mode = ${common.flash_mode} board_build.flash_mode = ${common.flash_mode}
@ -287,7 +289,7 @@ monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts} extra_scripts = ${common.extra_scripts}
[env:nodemcu-lolin-ssl] [env:nodemcu-lolin-ssl]
platform = ${common.platform_173}
platform = ${common.arduino_core_2_5_0}
framework = ${common.framework} framework = ${common.framework}
board = ${common.board_4m} board = ${common.board_4m}
board_build.flash_mode = ${common.flash_mode} board_build.flash_mode = ${common.flash_mode}


Loading…
Cancel
Save