Skip to content

Commit 171cebe

Browse files
committed
Add build flags for global i2c & SPI pins
1 parent 8619e8f commit 171cebe

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

wled00/wled.h

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
#include "src/dependencies/dmx/ESPDMX.h"
131131
#else //ESP32
132132
#include "src/dependencies/dmx/SparkFunDMX.h"
133-
#endif
133+
#endif
134134
#endif
135135

136136
#include "src/dependencies/e131/ESPAsyncE131.h"
@@ -393,8 +393,8 @@ WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to f
393393
#ifdef ESP8266
394394
WLED_GLOBAL DMXESPSerial dmx;
395395
#else //ESP32
396-
WLED_GLOBAL SparkFunDMX dmx;
397-
#endif
396+
WLED_GLOBAL SparkFunDMX dmx;
397+
#endif
398398
WLED_GLOBAL uint16_t e131ProxyUniverse _INIT(0); // output this E1.31 (sACN) / ArtNet universe via MAX485 (0 = disabled)
399399
#endif
400400
WLED_GLOBAL uint16_t e131Universe _INIT(1); // settings for E1.31 (sACN) protocol (only DMX_MODE_MULTIPLE_* can span over consequtive universes)
@@ -578,7 +578,7 @@ WLED_GLOBAL int16_t currentPlaylist _INIT(-1);
578578
//still used for "PL=~" HTTP API command
579579
WLED_GLOBAL byte presetCycCurr _INIT(0);
580580
WLED_GLOBAL byte presetCycMin _INIT(1);
581-
WLED_GLOBAL byte presetCycMax _INIT(5);
581+
WLED_GLOBAL byte presetCycMax _INIT(5);
582582

583583
// realtime
584584
WLED_GLOBAL byte realtimeMode _INIT(REALTIME_MODE_INACTIVE);
@@ -676,11 +676,37 @@ WLED_GLOBAL uint16_t ledMaps _INIT(0); // bitfield representation of available l
676676
// Usermod manager
677677
WLED_GLOBAL UsermodManager usermods _INIT(UsermodManager());
678678

679-
WLED_GLOBAL int8_t i2c_sda _INIT(-1); // global I2C SDA pin [HW_PIN_SDA] (used for usermods)
680-
WLED_GLOBAL int8_t i2c_scl _INIT(-1); // global I2C SCL pin [HW_PIN_SCL] (used for usermods)
681-
WLED_GLOBAL int8_t spi_mosi _INIT(-1); // global SPI DATA/MOSI pin [HW_PIN_DATASPI] (used for usermods)
682-
WLED_GLOBAL int8_t spi_miso _INIT(-1); // global SPI DATA/MISO pin [HW_PIN_MISOSPI] (used for usermods)
683-
WLED_GLOBAL int8_t spi_sclk _INIT(-1); // global SPI CLOCK/SCLK pin [HW_PIN_CLOCKSPI] (used for usermods)
679+
// global I2C SDA pin [HW_PIN_SDA] (used for usermods)
680+
#ifndef I2CSDAPIN
681+
WLED_GLOBAL int8_t i2c_sda _INIT(-1);
682+
#else
683+
WLED_GLOBAL int8_t i2c_sda _INIT(I2CSDAPIN);
684+
#endif
685+
// global I2C SCL pin [HW_PIN_SCL] (used for usermods)
686+
#ifndef I2CSCLPIN
687+
WLED_GLOBAL int8_t i2c_scl _INIT(-1);
688+
#else
689+
WLED_GLOBAL int8_t i2c_scl _INIT(I2CSCLPIN);
690+
#endif
691+
692+
// global SPI DATA/MOSI pin [HW_PIN_DATASPI] (used for usermods)
693+
#ifndef SPIMOSIPIN
694+
WLED_GLOBAL int8_t spi_mosi _INIT(-1);
695+
#else
696+
WLED_GLOBAL int8_t spi_mosi _INIT(SPIMOSIPIN);
697+
#endif
698+
// global SPI DATA/MISO pin [HW_PIN_MISOSPI] (used for usermods)
699+
#ifndef SPIMISOPIN
700+
WLED_GLOBAL int8_t spi_miso _INIT(-1);
701+
#else
702+
WLED_GLOBAL int8_t spi_miso _INIT(SPIMISOPIN);
703+
#endif
704+
// global SPI CLOCK/SCLK pin [HW_PIN_CLOCKSPI] (used for usermods)
705+
#ifndef SPISCLKPIN
706+
WLED_GLOBAL int8_t spi_sclk _INIT(-1);
707+
#else
708+
WLED_GLOBAL int8_t spi_sclk _INIT(SPISCLKPIN);
709+
#endif
684710

685711
// global ArduinoJson buffer
686712
WLED_GLOBAL StaticJsonDocument<JSON_BUFFER_SIZE> doc;

0 commit comments

Comments
 (0)