Skip to content

Commit 3784c5a

Browse files
authored
Merge pull request #746 from mcci-catena/issue736
Fix #736: don't compile config objects that are for other platforms
2 parents b680117 + c21e4e3 commit 3784c5a

File tree

6 files changed

+28
-1
lines changed

6 files changed

+28
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,7 @@ function uflt12f(rawUflt12)
12511251
- Adopt semantic versions completely [#726](https://github.com/mcci-catena/arduino-lmic/issues/726).
12521252
- Implement JoinAccept CFList processing for US/AU [#739](https://github.com/mcci-catena/arduino-lmic/issues/739).
12531253
- Correct JoinAccept CFList processing for AS923 [#740](https://github.com/mcci-catena/arduino-lmic/issues/740).
1254+
- Don't compile board config objects when we know for sure they'll not be used; compilers can't always tell [#736](https://github.com/mcci-catena/arduino-lmic/issues/736).
12541255

12551256
- v3.3.0 is primarily a maintenance and roll-up release.
12561257

src/hal/getpinmap_catena4420.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Copyright & License:
1313
1414
*/
1515

16+
#if defined(ARDUINO_MCCI_CATENA_4420) || \
17+
/* legacy names */ \
18+
defined(ARDUINO_CATENA_4420)
19+
1620
#include <arduino_lmic_hal_boards.h>
1721
#include <Arduino.h>
1822

@@ -71,4 +75,6 @@ const HalPinmap_t *GetPinmap_Catena4420(void)
7175
return &myPinmap;
7276
}
7377

74-
} // namespace Arduino_LMIC;
78+
} // namespace Arduino_LMIC
79+
80+
#endif

src/hal/getpinmap_feather32u4lora.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Copyright & License:
1313
1414
*/
1515

16+
#if defined(ARDUINO_AVR_FEATHER32U4)
17+
1618
#include <arduino_lmic_hal_boards.h>
1719
#include <Arduino.h>
1820

@@ -77,3 +79,5 @@ const HalPinmap_t *GetPinmap_Feather32U4LoRa(void)
7779
}
7880

7981
}; // namespace Arduino_LMIC
82+
83+
#endif // ARDUINO_AVR_FEATHER32U4

src/hal/getpinmap_featherm0lora.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ Copyright & License:
1313
1414
*/
1515

16+
// The Adafruit FeatherM0 and FeatherM0 Express BSPs are not consistent
17+
// as to how they declare themselves. Both are SAMDs. Detect either one.
18+
#if defined(ARDUINO_ARCH_SAMD)
19+
# if defined(ADAFRUIT_FEATHER_M0) || defined(ARDUINO_SAMD_FEATHER_M0)
20+
1621
#include <arduino_lmic_hal_boards.h>
1722
#include <Arduino.h>
1823

@@ -72,3 +77,6 @@ const HalPinmap_t *GetPinmap_FeatherM0LoRa(void)
7277
}
7378

7479
}; // namespace Arduino_LMIC
80+
81+
# endif // defined(ADAFRUIT_FEATHER_M0) || defined(ARDUINO_SAMD_FEATHER_M0)
82+
#endif // defined(ARDUINO_ARCH_SAMD)

src/hal/getpinmap_heltec_lora32.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Copyright & License:
1313
1414
*/
1515

16+
#if defined(ARDUINO_HELTEC_WIFI_LORA_32) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(ARDUINO_HELTEC_WIRELESS_STICK)
17+
1618
#include <arduino_lmic_hal_boards.h>
1719
#include <Arduino.h>
1820

@@ -78,3 +80,5 @@ const HalPinmap_t *GetPinmap_heltec_lora32(void)
7880
}
7981

8082
}; // namespace Arduino_LMIC
83+
84+
#endif // defined(ARDUINO_HELTEC_WIFI_LORA_32) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(ARDUINO_HELTEC_WIRELESS_STICK)

src/hal/getpinmap_ttgo_lora32_v1.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Copyright & License:
1313
1414
*/
1515

16+
#if defined(ARDUINO_TTGO_LoRa32_V1)
17+
1618
#include <arduino_lmic_hal_boards.h>
1719
#include <Arduino.h>
1820

@@ -76,3 +78,5 @@ const HalPinmap_t * GetPinmap_ttgo_lora32_v1 (void)
7678
}
7779

7880
}; // namespace Arduino_LMIC
81+
82+
#endif // ARDUINO_TTGO_LoRa32_V1

0 commit comments

Comments
 (0)