|
6 | 6 | src_filter = [ |
7 | 7 | '+<*.cpp>', |
8 | 8 | '+<helpers/*.cpp>', |
| 9 | + '+<helpers/sensors>' |
9 | 10 | '+<helpers/radiolib/*.cpp>', |
10 | 11 | '+<helpers/ui/MomentaryButton.cpp>', |
11 | 12 | ] |
12 | 13 |
|
| 14 | +# add build and include dirs according to CPPDEFINES |
13 | 15 | for item in menv.get("CPPDEFINES", []): |
| 16 | + |
| 17 | + # STM32 |
14 | 18 | if isinstance(item, str) and item == "STM32_PLATFORM": |
15 | | - # add STM32 specific sources |
16 | 19 | menv.Append(CPPPATH=[realpath("src/helpers/stm32")]) |
17 | 20 | menv.Append(BUILD_FLAGS=["-I src/helpers/stm32"]) |
18 | 21 | src_filter.append("+<helpers/stm32/*>") |
| 22 | + |
| 23 | + # ESP32 |
19 | 24 | elif isinstance(item, str) and item == "ESP32": |
20 | 25 | menv.Append(CPPPATH=[realpath("src/helpers/esp32")]) |
21 | 26 | menv.Append(BUILD_FLAGS=["-I src/helpers/esp32"]) |
22 | 27 | src_filter.append("+<helpers/esp32/*>") |
| 28 | + |
| 29 | + # NRF52 |
| 30 | + elif isinstance(item, str) and item == "NRF52_PLATFORM": |
| 31 | + menv.Append(CPPPATH=[realpath("src/helpers/nrf52")]) |
| 32 | + menv.Append(BUILD_FLAGS=["-I src/helpers/nrf52"]) |
| 33 | + src_filter.append("+<helpers/nrf52/*>") |
| 34 | + |
| 35 | + # RP2040 |
| 36 | + elif isinstance(item, str) and item == "RP2040_PLATFORM": |
| 37 | + menv.Append(CPPPATH=[realpath("src/helpers/rp2040")]) |
| 38 | + menv.Append(BUILD_FLAGS=["-I src/helpers/rp2040"]) |
| 39 | + src_filter.append("+<helpers/rp2040/*>") |
| 40 | + |
| 41 | + # VARIANTS HANDLING |
23 | 42 | elif isinstance(item, tuple) and item[0] == "MC_VARIANT": |
24 | 43 | variant_name = item[1] |
25 | 44 | menv.Append(BUILD_FLAGS=[f"-I variants/{variant_name}"]) |
|
0 commit comments