Skip to content

Commit

Permalink
Fix superfluous whitespaces and line endings
Browse files Browse the repository at this point in the history
resolve #2310
  • Loading branch information
mcspr committed Sep 30, 2020
1 parent 1f1d6a9 commit 63b6f46
Show file tree
Hide file tree
Showing 27 changed files with 176 additions and 184 deletions.
2 changes: 1 addition & 1 deletion code/espurna/DebounceEvent.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Original code:
Debounce buttons and trigger events
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/broker.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct TBroker<R(Args...)> {

// TODO: since 1.14.0 we intoduced static syntax for Brokers, ::Register & ::Publish.
// Preserve it (up to a point) when creating module-level objects.
// Provide a helper namespace with Register & Publish, instance and
// Provide a helper namespace with Register & Publish, instance and
// To help out VS Code with argument discovery, put TArgs as the first template parameter.

#define BrokerDeclare(Name, Signature) \
Expand Down
7 changes: 3 additions & 4 deletions code/espurna/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ constexpr const debounce_event::types::Config _buttonDecodeConfigBitmask(const u
((bitmask & ButtonMask::Pushbutton)
? debounce_event::types::Mode::Pushbutton
: debounce_event::types::Mode::Switch),
((bitmask & ButtonMask::DefaultHigh)
((bitmask & ButtonMask::DefaultHigh)
? debounce_event::types::PinValue::High
: debounce_event::types::PinValue::Low),
((bitmask & ButtonMask::SetPullup) ? debounce_event::types::PinMode::InputPullup
: (bitmask & ButtonMask::SetPulldown) ? debounce_event::types::PinMode::InputPulldown
((bitmask & ButtonMask::SetPullup) ? debounce_event::types::PinMode::InputPullup
: (bitmask & ButtonMask::SetPulldown) ? debounce_event::types::PinMode::InputPulldown
: debounce_event::types::PinMode::Input)
};
}
Expand Down Expand Up @@ -841,7 +841,6 @@ void buttonSetup() {
actions,
delays
);

}
}
#endif // BUTTON_PROVIDER_ITEAD_SONOFF_DUAL_SUPPORT || BUTTON_PROVIDER_FOXEL_LIGHTFOX_DUAL
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct button_event_delays_t {
struct button_t {

button_t(unsigned char relayID, const button_actions_t& actions, const button_event_delays_t& delays);
button_t(std::shared_ptr<BasePin> pin, const debounce_event::types::Config& config,
button_t(std::shared_ptr<BasePin> pin, const debounce_event::types::Config& config,
unsigned char relayID, const button_actions_t& actions, const button_event_delays_t& delays);

bool state();
Expand Down
192 changes: 96 additions & 96 deletions code/espurna/config/custom.h.example
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
// ------------------------------------------------------------------------------
// Example file for custom.h
// Either copy and paste this file then rename removing the .example or create your
// own file: 'custom.h'
// This file allows users to create their own configurations.
// See 'code/espurna/config/general.h' for default settings.
//
// See: https://github.com/xoseperez/espurna/wiki/Software-features#enabling-features
// and 'code/platformio_override.ini.example' for more details.
// ------------------------------------------------------------------------------
// Example of a Sonoff Basic board with some options disabled to reduce firmware size.
#if defined(MY_SONOFF_BUILD01) // This section will be used when src_build_flags contains
// -DMY_SONOFF_BUILD01 in 'platformio_override.ini'
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_BASIC_BUILD01"
// Disable these
#define DEBUG_SERIAL_SUPPORT 0
#define ALEXA_SUPPORT 0
#define DOMOTICZ_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0
#define THINGSPEAK_SUPPORT 0
// Buttons
#define BUTTON1_PIN 0
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
// Example of the Sonoff Basic board above but with two buttons on different GPIOs.
// The two buttons both toggle the one RELAY but ALL button events send MQTT values.
// An MQTT based system can then carry out differnt functions depending on
// the 'DOUBLE CLICK, LONG CLICK OR LONG-LONG CLICK' trigger. A BMX280 environment
// sensor is also connected using I2C on GPIO 1 and 3.
#elif defined(MY_SONOFF_BUILD02) // This section will be used when src_build_flags contains
// -DMY_SONOFF_BUILD02 in 'platformio_override.ini
// Info - Custom Basic with BMX280 I2C on GPIO 1 and 3
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_BASIC_BMX280" // You can use your own name here
// Disable these
#define DEBUG_SERIAL_SUPPORT 0
#define ALEXA_SUPPORT 0
#define DOMOTICZ_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0
#define THINGSPEAK_SUPPORT 0
// Buttons
#define BUTTON_MQTT_SEND_ALL_EVENTS 1
#define BUTTON1_PIN 0 // Built in button.
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
#define BUTTON1_PRESS BUTTON_MODE_NONE
#define BUTTON1_CLICK BUTTON_MODE_TOGGLE
#define BUTTON1_DBLCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGCLICK BUTTON_MODE_OFF
#define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
#define BUTTON2_PIN 2 // External push button connected between IO2 and GND.
#define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
#define BUTTON2_RELAY 1
#define BUTTON2_PRESS BUTTON_MODE_NONE
#define BUTTON2_CLICK BUTTON_MODE_TOGGLE
#define BUTTON2_DBLCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
// Extras
#define BMX280_SUPPORT 1
#define BMX280_ADDRESS 0x76
#define I2C_SDA_PIN 1 //TX PIN **DISABLE DEBUG_SERIAL_SUPPORT**
#define I2C_SCL_PIN 3 //RX PIN **DISABLE DEBUG_SERIAL_SUPPORT**
#endif
// ------------------------------------------------------------------------------
// Example file for custom.h
// Either copy and paste this file then rename removing the .example or create your
// own file: 'custom.h'
// This file allows users to create their own configurations.
// See 'code/espurna/config/general.h' for default settings.
//
// See: https://github.com/xoseperez/espurna/wiki/Software-features#enabling-features
// and 'code/platformio_override.ini.example' for more details.
// ------------------------------------------------------------------------------


// Example of a Sonoff Basic board with some options disabled to reduce firmware size.

#if defined(MY_SONOFF_BUILD01) // This section will be used when src_build_flags contains
// -DMY_SONOFF_BUILD01 in 'platformio_override.ini'

#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_BASIC_BUILD01"

// Disable these
#define DEBUG_SERIAL_SUPPORT 0
#define ALEXA_SUPPORT 0
#define DOMOTICZ_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0
#define THINGSPEAK_SUPPORT 0

// Buttons
#define BUTTON1_PIN 0
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1

// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL

// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1


// Example of the Sonoff Basic board above but with two buttons on different GPIOs.
// The two buttons both toggle the one RELAY but ALL button events send MQTT values.
// An MQTT based system can then carry out differnt functions depending on
// the 'DOUBLE CLICK, LONG CLICK OR LONG-LONG CLICK' trigger. A BMX280 environment
// sensor is also connected using I2C on GPIO 1 and 3.

#elif defined(MY_SONOFF_BUILD02) // This section will be used when src_build_flags contains
// -DMY_SONOFF_BUILD02 in 'platformio_override.ini

// Info - Custom Basic with BMX280 I2C on GPIO 1 and 3
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_BASIC_BMX280" // You can use your own name here

// Disable these
#define DEBUG_SERIAL_SUPPORT 0
#define ALEXA_SUPPORT 0
#define DOMOTICZ_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0
#define THINGSPEAK_SUPPORT 0


// Buttons
#define BUTTON_MQTT_SEND_ALL_EVENTS 1
#define BUTTON1_PIN 0 // Built in button.
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
#define BUTTON1_PRESS BUTTON_MODE_NONE
#define BUTTON1_CLICK BUTTON_MODE_TOGGLE
#define BUTTON1_DBLCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGCLICK BUTTON_MODE_OFF
#define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
#define BUTTON2_PIN 2 // External push button connected between IO2 and GND.
#define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
#define BUTTON2_RELAY 1
#define BUTTON2_PRESS BUTTON_MODE_NONE
#define BUTTON2_CLICK BUTTON_MODE_TOGGLE
#define BUTTON2_DBLCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE

// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL

// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1

// Extras
#define BMX280_SUPPORT 1
#define BMX280_ADDRESS 0x76
#define I2C_SDA_PIN 1 //TX PIN **DISABLE DEBUG_SERIAL_SUPPORT**
#define I2C_SCL_PIN 3 //RX PIN **DISABLE DEBUG_SERIAL_SUPPORT**

#endif
4 changes: 2 additions & 2 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -3422,10 +3422,10 @@
#define DEBUG_SERIAL_SUPPORT 0

// ----------------------------------------------------------------------------------------
// Power socket 16A similar to BLITZWOLF_BWSHPX but button pin differs
// Power socket 16A similar to BLITZWOLF_BWSHPX but button pin differs
// IMPORTANT, This template is for hardware version SP111_A_Wifi_Ver1.1 (as printed on the PCB)
// hhttps://www.amazon.de/-/en/Smallest-Consumption-Measuring-Function-Compatible/dp/B07PSMF47W
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------

#elif defined(GOSUND_SP111)

Expand Down
Loading

0 comments on commit 63b6f46

Please sign in to comment.