From 3f0366d910e09e5787e298bf705c749def6db0fa Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 1 Dec 2022 01:09:18 +0300 Subject: [PATCH] hw: uart can be disabled with a specific flag resolve #2558 resolve #2559 --- code/espurna/config/custom.h.example | 20 ++++++++++++-------- code/espurna/config/hardware.h | 2 -- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/code/espurna/config/custom.h.example b/code/espurna/config/custom.h.example index 5a9266fc..24277de9 100644 --- a/code/espurna/config/custom.h.example +++ b/code/espurna/config/custom.h.example @@ -19,7 +19,7 @@ #define DEVICE "SONOFF_BASIC_BUILD01" // Disable these - #define DEBUG_SERIAL_SUPPORT 0 + #define UART_SUPPORT 0 #define ALEXA_SUPPORT 0 #define DOMOTICZ_SUPPORT 0 #define HOMEASSISTANT_SUPPORT 0 @@ -53,15 +53,16 @@ #define DEVICE "SONOFF_BASIC_BMX280" // You can use your own name here // Disable these - #define DEBUG_SERIAL_SUPPORT 0 + #define UART_SUPPORT 0 #define ALEXA_SUPPORT 0 #define DOMOTICZ_SUPPORT 0 #define HOMEASSISTANT_SUPPORT 0 #define THINGSPEAK_SUPPORT 0 + // Always publish button events to MQTT + #define BUTTON_MQTT_SEND_ALL_EVENTS 1 // 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 @@ -70,6 +71,7 @@ #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 @@ -87,10 +89,12 @@ #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** + // Non-default I2C on hardware UART0 pins. Make sure to disable UART for these to work! + #define I2C_SDA_PIN 1 + #define I2C_SCL_PIN 3 + + // BMX280 depends on I2C + #define BMX280_SUPPORT 1 + #define BMX280_ADDRESS 0x76 #endif diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index c968f921..76ed6e8a 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -70,7 +70,6 @@ #define RPN_RULES_SUPPORT 0 #define SCHEDULER_SUPPORT 0 #define SENSOR_SUPPORT 0 - #define TERMINAL_SERIAL_SUPORT 0 #define THINGSPEAK_SUPPORT 0 #define UART_SUPPORT 0 #define WEB_SUPPORT 0 @@ -110,7 +109,6 @@ #define NTP_SUPPORT 0 #define SCHEDULER_SUPPORT 0 #define SENSOR_SUPPORT 0 - #define TERMINAL_SERIAL_SUPORT 0 #define THINGSPEAK_SUPPORT 0 #define UART_SUPPORT 0