Skip to content
This repository was archived by the owner on Oct 27, 2024. It is now read-only.

Commit a5d7e0c

Browse files
authored
Update WeatherSensorCfg.h.template
1 parent b432305 commit a5d7e0c

File tree

1 file changed

+53
-69
lines changed

1 file changed

+53
-69
lines changed

WeatherSensorCfg.h.template

Lines changed: 53 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
// 20240122 Modified for unit testing
5757
// 20240204 Added separate ARDUINO_heltec_wireless_stick_v2/v3
5858
// 20240322 Added pin definitions for M5Stack Core2 with M5Stack Module LoRa868
59+
// 20240415 Added pin definitions for ESP32-S3 PowerFeather with with RFM95W "FeatherWing" ADA3232
60+
// 20240417 Modified SENSOR_IDS_INC
61+
// 20240425 Added define variant ARDUINO_heltec_wifi_lora_32_V3
62+
// 20240507 Renamed NUM_SENSORS to MAX_SENSORS_DEFAULT
63+
// NOTE: ARDUINO_ARCH_AVR no longer supported due to code size!!!
5964
//
6065
// ToDo:
6166
// -
@@ -70,7 +75,7 @@
7075
// ------------------------------------------------------------------------------------------------
7176
// --- Weather Sensors ---
7277
// ------------------------------------------------------------------------------------------------
73-
#define NUM_SENSORS 1 // Number of sensors to be received
78+
#define MAX_SENSORS_DEFAULT 1 // Maximum number of sensors to be received
7479

7580
// List of sensor IDs to be excluded - can be empty
7681
#define SENSOR_IDS_EXC { 0x792882A2 }
@@ -115,8 +120,6 @@
115120
// ------------------------------------------------------------------------------------------------
116121
// --- Board ---
117122
// ------------------------------------------------------------------------------------------------
118-
// Use pinning for LoRaWAN Node
119-
120123

121124
// LILIGO TTGO LoRaP32 board with integrated RF tranceiver (SX1276)
122125
// See pin definitions in
@@ -185,7 +188,7 @@
185188

186189
#elif defined(ARDUINO_TTGO_LoRa32_V2)
187190
#pragma message("ARDUINO_TTGO_LoRa32_V2 defined; using on-board transceiver")
188-
#pragma message("LoRa DIO1 must be wired to GPIO33 manually!")
191+
#pragma message("Wiring required for LMIC: DIO1 to GPIO33")
189192
#define USE_SX1276
190193

191194
#elif defined(ARDUINO_TTGO_LoRa32_v21new)
@@ -210,36 +213,44 @@
210213
#pragma message("ARDUINO_heltec_wifi_lora_32_V2 defined; using on-board transceiver")
211214
#define USE_SX1276
212215

213-
#elif defined(ARDUINO_heltec_wifi_32_lora_V3)
214-
#pragma message("ARDUINO_heltec_wifi_32_lora_V3 defined; using on-board transceiver")
216+
#elif defined(ARDUINO_heltec_wifi_32_lora_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
217+
#pragma message("ARDUINO_heltec_wifi_32_lora_V3 (or similar) defined; using on-board transceiver")
215218
#define USE_SX1262
216219

217220
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
218221
#pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
219222
#define USE_SX1276
220223

224+
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
225+
#pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32_V2 defined; assuming RFM95W FeatherWing will be used")
226+
#define USE_SX1276
227+
#pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
228+
221229
#elif defined(ARDUINO_FEATHER_ESP32)
222230
#pragma message("ARDUINO_FEATHER_ESP32 defined; assuming RFM95W FeatherWing will be used")
223231
#define USE_SX1276
224232
#pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
225233

226234
#elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2)
235+
// Note: Depending on board package file date, either variant is used -
236+
// see https://github.com/espressif/arduino-esp32/issues/9423!
227237
#pragma message("ARDUINO_M5STACK_CORE2 defined; assuming M5Stack Module LoRa868 will be used")
228238
#define USE_SX1276
229-
#pragma message("Required wiring: DIO1 to GPIO35")
239+
#pragma message("Wiring required for LMIC: DIO1 to GPIO35")
230240

231-
#elif defined(ARDUINO_AVR_FEATHER32U4)
232-
#pragma message("ARDUINO_AVR_FEATHER32U4 defined; assuming this is the Adafruit Feather 32u4 RFM95 LoRa Radio")
241+
#elif defined(ARDUINO_ESP32S3_POWERFEATHER)
242+
#pragma message("ARDUINO_ESP32S3_POWERFEATHER defined; assuming RFM95W FeatherWing will be used")
233243
#define USE_SX1276
244+
#pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
234245

235246
#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
236-
#pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming assuming RFM95W FeatherWing will be used")
247+
#pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming RFM95W FeatherWing will be used")
237248
#define USE_SX1276
238249
#pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
239250

240251
#elif defined(ARDUINO_ESP32_DEV) || defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32)
241-
#define LORAWAN_NODE
242-
//#define FIREBEETLE_ESP32_COVER_LORA
252+
//#define LORAWAN_NODE
253+
#define FIREBEETLE_ESP32_COVER_LORA
243254

244255
#if defined(FIREBEETLE_ESP32_COVER_LORA)
245256
#pragma message("FIREBEETLE_ESP32_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
@@ -332,48 +343,6 @@
332343

333344
#endif
334345

335-
336-
// Replacement for
337-
// https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
338-
// on Arduino AVR:
339-
#if defined(ARDUINO_ARCH_AVR)
340-
#define ARDUHAL_LOG_LEVEL_NONE 0
341-
#define ARDUHAL_LOG_LEVEL_ERROR 1
342-
#define ARDUHAL_LOG_LEVEL_WARN 2
343-
#define ARDUHAL_LOG_LEVEL_INFO 3
344-
#define ARDUHAL_LOG_LEVEL_DEBUG 4
345-
#define ARDUHAL_LOG_LEVEL_VERBOSE 5
346-
347-
// Set desired level here!
348-
#define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO
349-
350-
#if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE
351-
#define log_e(...) { printf(__VA_ARGS__); println(); }
352-
#else
353-
#define log_e(...) {}
354-
#endif
355-
#if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR
356-
#define log_w(...) { printf(__VA_ARGS__); println(); }
357-
#else
358-
#define log_w(...) {}
359-
#endif
360-
#if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN
361-
#define log_i(...) { printf(__VA_ARGS__); println(); }
362-
#else
363-
#define log_i(...) {}
364-
#endif
365-
#if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO
366-
#define log_d(...) { printf(__VA_ARGS__); println(); }
367-
#else
368-
#define log_d(...) {}
369-
#endif
370-
#if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG
371-
#define log_v(...) { printf(__VA_ARGS__); println(); }
372-
#else
373-
#define log_v(...) {}
374-
#endif
375-
#endif
376-
377346
#if ( (defined(USE_CC1101) && defined(USE_SX1276)) || \
378347
(defined(USE_SX1276) && defined(USE_SX1262)) || \
379348
(defined(USE_SX1262) && defined(USE_CC1101)) )
@@ -462,7 +431,7 @@
462431
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
463432
#define PIN_RECEIVER_RST RST_LoRa
464433

465-
#elif defined(ARDUINO_heltec_wifi_32_lora_V3)
434+
#elif defined(ARDUINO_heltec_wifi_32_lora_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
466435
// Use pinning for Heltec WiFi LoRa32 V3
467436
#define PIN_RECEIVER_CS SS
468437

@@ -488,6 +457,19 @@
488457
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
489458
#define PIN_RECEIVER_RST 9
490459

460+
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
461+
// Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
462+
#define PIN_RECEIVER_CS 14
463+
464+
// CC1101: GDO0 / RFM95W/SX127x: G0
465+
#define PIN_RECEIVER_IRQ 32
466+
467+
// CC1101: GDO2 / RFM95W/SX127x: G1
468+
#define PIN_RECEIVER_GPIO 33
469+
470+
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
471+
#define PIN_RECEIVER_RST 27
472+
491473
#elif defined(ARDUINO_FEATHER_ESP32)
492474
// Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
493475
#define PIN_RECEIVER_CS 14
@@ -501,7 +483,9 @@
501483
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
502484
#define PIN_RECEIVER_RST 27
503485

504-
#elif defined(ARDUINO_M5STACK_CORE2)
486+
#elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2)
487+
// Note: Depending on board package file date, either variant is used -
488+
// see https://github.com/espressif/arduino-esp32/issues/9423!
505489
// Use pinning for M5Stack Core2 with M5Stack Module LoRa868
506490
#define PIN_RECEIVER_CS 33
507491

@@ -514,6 +498,19 @@
514498
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
515499
#define PIN_RECEIVER_RST 26
516500

501+
#elif defined(ARDUINO_ESP32S3_POWERFEATHER)
502+
// Use pinning for ESP32-S3 PowerFeather with RFM95W "FeatherWing" ADA3232
503+
#define PIN_RECEIVER_CS 15
504+
505+
// CC1101: GDO0 / RFM95W/SX127x: G0
506+
#define PIN_RECEIVER_IRQ 16
507+
508+
// CC1101: GDO2 / RFM95W/SX127x: G1
509+
#define PIN_RECEIVER_GPIO 18
510+
511+
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
512+
#define PIN_RECEIVER_RST 45
513+
517514
#elif defined(ESP32)
518515
// Generic pinning for ESP32 development boards
519516
#define PIN_RECEIVER_CS 27
@@ -539,19 +536,6 @@
539536

540537
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
541538
#define PIN_RECEIVER_RST 2
542-
543-
#elif defined(ARDUINO_AVR_FEATHER32U4)
544-
// Pinning for Adafruit Feather 32u4
545-
#define PIN_RECEIVER_CS 8
546-
547-
// CC1101: GDO0 / RFM95W/SX127x: G0
548-
#define PIN_RECEIVER_IRQ 7
549-
550-
// CC1101: GDO2 / RFM95W/SX127x: G1 (not used)
551-
#define PIN_RECEIVER_GPIO 99
552-
553-
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
554-
#define PIN_RECEIVER_RST 4
555539

556540
#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
557541
// Use pinning for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232

0 commit comments

Comments
 (0)