Skip to content

Commit ac96257

Browse files
committed
Change pin assignment for easier swap from Wemos D1 mini to LilyGO TTGO T7 Mini32 and vice versa
1 parent f257b53 commit ac96257

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

VanLiveConnect/Config.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,17 @@
120120
// to simulate a power-off event.
121121
//
122122
#ifdef ARDUINO_ARCH_ESP32
123+
// Only GPIOs which are have RTC functionality can be used: 0,2,4,12-15,25-27,32-39.
123124
#ifdef CONFIG_IDF_TARGET_ESP32S2
124125
#define LIGHT_SLEEP_WAKE_PIN GPIO_NUM_35
125126
#else
126-
// Only GPIOs which are have RTC functionality can be used: 0,2,4,12-15,25-27,32-39.
127-
#define LIGHT_SLEEP_WAKE_PIN GPIO_NUM_13
127+
#define LIGHT_SLEEP_WAKE_PIN GPIO_NUM_26 // GPIO pins also tested OK: 13, 36. Tested NOT OK: 23.
128+
#define LIGHT_SLEEP_WAKE_PIN_ALT GPIO_NUM_22 // Matches pin D0 on Wemos D1 mini board
128129
#endif
130+
129131
#else
130132
#define LIGHT_SLEEP_WAKE_PIN D1
133+
#define LIGHT_SLEEP_WAKE_PIN_ALT D0 // Matches pin GPIO_NUM_22 on LilyGO TTGO T7 Mini32 board
131134
#endif // ARDUINO_ARCH_ESP32
132135

133136
// -----
@@ -299,16 +302,16 @@
299302
#define IR_GND GPIO_NUM_5
300303
#else
301304
#define IR_RECV_PIN GPIO_NUM_23 // IR receiver data pin
302-
#define IR_VCC GPIO_NUM_18
303-
#define IR_GND GPIO_NUM_26
305+
#define IR_VCC GPIO_NUM_19
306+
#define IR_GND GPIO_NUM_18
304307
#endif
305308
#else
306309
#define IR_RECV_PIN D7 // IR receiver data pin
307310

308-
// Using D5 as VCC and D0 as ground pin for the IR receiver. Should be possible with e.g. the
311+
// Using D6 as VCC and D5 as ground pin for the IR receiver. Should be possible with e.g. the
309312
// TSOP31238 IR receiver as it typically uses only 0.35 mA.
310-
#define IR_VCC D5
311-
#define IR_GND D0
313+
#define IR_VCC D6
314+
#define IR_GND D5
312315

313316
#endif // ARDUINO_ARCH_ESP32
314317

@@ -324,13 +327,13 @@
324327
#define IR_GND GPIO_NUM_5
325328
#else
326329
#define TEST_IR_RECV_PIN GPIO_NUM_23
327-
#define TEST_IR_VCC_TEST GPIO_NUM_18
328-
#define TEST_IR_GND GPIO_NUM_26 // TODO - also VanBus ANALYSER_PIN
330+
#define TEST_IR_VCC_TEST GPIO_NUM_19
331+
#define TEST_IR_GND GPIO_NUM_18
329332
#endif
330333
#else
331334
#define TEST_IR_RECV_PIN D7
332-
#define TEST_IR_VCC_TEST D5
333-
#define TEST_IR_GND D0
335+
#define TEST_IR_VCC_TEST D6
336+
#define TEST_IR_GND D5
334337
#endif // ARDUINO_ARCH_ESP32
335338

336339
#ifdef ARDUINO_ARCH_ESP32

VanLiveConnect/Sleep.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ void SetupSleep()
3737
#else
3838
gpio_pin_wakeup_disable();
3939
pinMode(LIGHT_SLEEP_WAKE_PIN, INPUT_PULLUP);
40+
pinMode(LIGHT_SLEEP_WAKE_PIN_ALT, INPUT_PULLUP);
4041

4142
#endif // ARDUINO_ARCH_ESP32
4243
} // SetupSleep
@@ -46,6 +47,7 @@ void WakeupCallback()
4647
{
4748
gpio_pin_wakeup_disable();
4849
pinMode(LIGHT_SLEEP_WAKE_PIN, INPUT_PULLUP);
50+
pinMode(LIGHT_SLEEP_WAKE_PIN_ALT, INPUT_PULLUP);
4951

5052
// Seems to help in decreasing the jitter on the VAN bus bit timings. But also seems to
5153
// deteriorate Wi-Fi connectivity.

0 commit comments

Comments
 (0)