Skip to content

Commit

Permalink
Add workaround for ESP32 init_hal naming conflict
Browse files Browse the repository at this point in the history
This workaround fixes a naming conflict for function hal_init.
The conflict was introduced by newer versions (> 3.5.0) of
PlatformIO Espressif 32 platform (ESP32 Arduino core).
See LMIC-node issue #41.
  • Loading branch information
lnlp committed Apr 30, 2022
1 parent fabdde2 commit 157754e
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,19 @@ lib_deps =
; ███ Add additional libraries for User Code below this line ███


; --------------------------------------------------
; | Shortcuts to enable quick and easy changes |
; --------------------------------------------------
; -------------------------------
; | Shortcuts and Workarounds |
; -------------------------------

[esp32]
build_flags =
-D hal_init=LMICHAL_init ; Workaround for naming conflict of function hal_init
; introduced by newer versions (> 3.5.0) of
; PlatformIO Espressif 32 platform (ESP32 Arduino core).
; See https://github.com/lnlp/LMIC-node/issues/41 for more information.

[pico]
upload_port = E: ; For Raspberry Pi Pico.
upload_port = E: ; Shortcut for Raspberry Pi Pico.
; Operating system and hardware dependent.
; Placed here so it can be easily changed.
; See section [env:pico] below for more information.
Expand Down Expand Up @@ -264,6 +271,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_heltec_wifi_lora_32_v2.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -286,6 +294,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_heltec_wifi_lora_32.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -308,6 +317,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_heltec_wireless_stick_lite.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -331,6 +341,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_heltec_wireless_stick.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -356,6 +367,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_lopy4.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand Down Expand Up @@ -402,6 +414,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_ttgo_lora32_v1.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -427,6 +440,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_ttgo_lora32_v2.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -449,6 +463,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_ttgo_lora32_v21.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -471,6 +486,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_ttgo_t_beam.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -495,6 +511,7 @@ lib_deps =
lewisxhe/AXP202X_Library ; Power management chip library
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_ttgo_t_beam_v1.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand Down Expand Up @@ -652,6 +669,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_lolin_d32_pro.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -674,6 +692,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_lolin_d32.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -696,6 +715,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_lolin32.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand All @@ -718,6 +738,7 @@ lib_deps =
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${esp32.build_flags}
${mcci_lmic.build_flags}
-D BSFILE=\"boards/bsf_nodemcu_32s.h\"
-D MONITOR_SPEED=${common.monitor_speed}
Expand Down

0 comments on commit 157754e

Please sign in to comment.