Merge branch 'Aircoookie:main' into main

This commit is contained in:
mrbubble62 2022-12-18 12:38:45 -05:00 committed by GitHub
commit fab34c9e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 16 deletions

View File

@ -392,12 +392,22 @@
#define INTERFACE_UPDATE_COOLDOWN 2000 //time in ms to wait between websockets, alexa, and MQTT updates #define INTERFACE_UPDATE_COOLDOWN 2000 //time in ms to wait between websockets, alexa, and MQTT updates
// HW_PIN_SCL & HW_PIN_SDA are used for information in usermods settings page and usermods themselves
// which GPIO pins are actually used in a hardwarea layout (controller board)
#if defined(I2CSCLPIN) && !defined(HW_PIN_SCL)
#define HW_PIN_SCL I2CSCLPIN
#endif
#if defined(I2CSDAPIN) && !defined(HW_PIN_SDA)
#define HW_PIN_SDA I2CSDAPIN
#endif
// you cannot change HW I2C pins on 8266
#if defined(ESP8266) && defined(HW_PIN_SCL) #if defined(ESP8266) && defined(HW_PIN_SCL)
#undef HW_PIN_SCL #undef HW_PIN_SCL
#endif #endif
#if defined(ESP8266) && defined(HW_PIN_SDA) #if defined(ESP8266) && defined(HW_PIN_SDA)
#undef HW_PIN_SDA #undef HW_PIN_SDA
#endif #endif
// defaults for 1st I2C on ESP32 (Wire global)
#ifndef HW_PIN_SCL #ifndef HW_PIN_SCL
#define HW_PIN_SCL SCL #define HW_PIN_SCL SCL
#endif #endif
@ -405,6 +415,18 @@
#define HW_PIN_SDA SDA #define HW_PIN_SDA SDA
#endif #endif
// HW_PIN_SCLKSPI & HW_PIN_MOSISPI & HW_PIN_MISOSPI are used for information in usermods settings page and usermods themselves
// which GPIO pins are actually used in a hardwarea layout (controller board)
#if defined(SPISCLKPIN) && !defined(HW_PIN_CLOCKSPI)
#define HW_PIN_CLOCKSPI SPISCLKPIN
#endif
#if defined(SPIMOSIPIN) && !defined(HW_PIN_MOSISPI)
#define HW_PIN_MOSISPI SPIMOSIPIN
#endif
#if defined(SPIMISOPIN) && !defined(HW_PIN_MISOSPI)
#define HW_PIN_MISOSPI SPIMISOPIN
#endif
// you cannot change HW SPI pins on 8266
#if defined(ESP8266) && defined(HW_PIN_CLOCKSPI) #if defined(ESP8266) && defined(HW_PIN_CLOCKSPI)
#undef HW_PIN_CLOCKSPI #undef HW_PIN_CLOCKSPI
#endif #endif
@ -414,10 +436,7 @@
#if defined(ESP8266) && defined(HW_PIN_MISOSPI) #if defined(ESP8266) && defined(HW_PIN_MISOSPI)
#undef HW_PIN_MISOSPI #undef HW_PIN_MISOSPI
#endif #endif
#if defined(ESP8266) && defined(HW_PIN_CSSPI) // defaults for VSPI on ESP32 (SPI global, SPI.cpp) as HSPI is used by WLED (bus_wrapper.h)
#undef HW_PIN_CSSPI
#endif
// defaults for VSPI
#ifndef HW_PIN_CLOCKSPI #ifndef HW_PIN_CLOCKSPI
#define HW_PIN_CLOCKSPI SCK #define HW_PIN_CLOCKSPI SCK
#endif #endif
@ -427,8 +446,5 @@
#ifndef HW_PIN_MISOSPI #ifndef HW_PIN_MISOSPI
#define HW_PIN_MISOSPI MISO #define HW_PIN_MISOSPI MISO
#endif #endif
#ifndef HW_PIN_CSSPI
#define HW_PIN_CSSPI SS
#endif
#endif #endif

View File

@ -676,11 +676,37 @@ WLED_GLOBAL uint16_t ledMaps _INIT(0); // bitfield representation of available l
// Usermod manager // Usermod manager
WLED_GLOBAL UsermodManager usermods _INIT(UsermodManager()); WLED_GLOBAL UsermodManager usermods _INIT(UsermodManager());
WLED_GLOBAL int8_t i2c_sda _INIT(-1); // global I2C SDA pin [HW_PIN_SDA] (used for usermods) // global I2C SDA pin (used for usermods)
WLED_GLOBAL int8_t i2c_scl _INIT(-1); // global I2C SCL pin [HW_PIN_SCL] (used for usermods) #ifndef I2CSDAPIN
WLED_GLOBAL int8_t spi_mosi _INIT(-1); // global SPI DATA/MOSI pin [HW_PIN_DATASPI] (used for usermods) WLED_GLOBAL int8_t i2c_sda _INIT(-1);
WLED_GLOBAL int8_t spi_miso _INIT(-1); // global SPI DATA/MISO pin [HW_PIN_MISOSPI] (used for usermods) #else
WLED_GLOBAL int8_t spi_sclk _INIT(-1); // global SPI CLOCK/SCLK pin [HW_PIN_CLOCKSPI] (used for usermods) WLED_GLOBAL int8_t i2c_sda _INIT(I2CSDAPIN);
#endif
// global I2C SCL pin (used for usermods)
#ifndef I2CSCLPIN
WLED_GLOBAL int8_t i2c_scl _INIT(-1);
#else
WLED_GLOBAL int8_t i2c_scl _INIT(I2CSCLPIN);
#endif
// global SPI DATA/MOSI pin (used for usermods)
#ifndef SPIMOSIPIN
WLED_GLOBAL int8_t spi_mosi _INIT(-1);
#else
WLED_GLOBAL int8_t spi_mosi _INIT(SPIMOSIPIN);
#endif
// global SPI DATA/MISO pin (used for usermods)
#ifndef SPIMISOPIN
WLED_GLOBAL int8_t spi_miso _INIT(-1);
#else
WLED_GLOBAL int8_t spi_miso _INIT(SPIMISOPIN);
#endif
// global SPI CLOCK/SCLK pin (used for usermods)
#ifndef SPISCLKPIN
WLED_GLOBAL int8_t spi_sclk _INIT(-1);
#else
WLED_GLOBAL int8_t spi_sclk _INIT(SPISCLKPIN);
#endif
// global ArduinoJson buffer // global ArduinoJson buffer
WLED_GLOBAL StaticJsonDocument<JSON_BUFFER_SIZE> doc; WLED_GLOBAL StaticJsonDocument<JSON_BUFFER_SIZE> doc;