Skip to content

Commit d14bab2

Browse files
committed
variants: Add _default configuration
Add `_default` for provides default `variant.h` Accordingly, delete the empty variant.h. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1 parent 8cf4c19 commit d14bab2

File tree

8 files changed

+8
-36
lines changed

8 files changed

+8
-36
lines changed

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
if (CONFIG_ARDUINO_API)
44
string(REPLACE "__" "_" NORMALIZED_BOARD_TARGET "${NORMALIZED_BOARD_TARGET}")
55

6-
if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/variants/${BOARD})
6+
message(CHECK_START "Arduino variant dir")
7+
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/variants/${BOARD}/variant.h)
8+
message(CHECK_PASS "Found: variant/${BOARD}")
79
set(variant_dir variants/${BOARD})
8-
elseif (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/variants/${NORMALIZED_BOARD_TARGET})
10+
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/variants/${NORMALIZED_BOARD_TARGET}/variant.h)
11+
message(CHECK_PASS "Found: variant/${NORMALIZED_BOARD_TARGET}")
912
set(variant_dir variants/${NORMALIZED_BOARD_TARGET})
1013
else()
11-
message(FATAL_ERROR "Variant dir not found: variants/${BOARD}, variants/${NORMALIZED_BOARD_TARGET}")
14+
message(CHECK_FAIL "Not found, use variants/_default: variants/${BOARD}, variants/${NORMALIZED_BOARD_TARGET}")
15+
set(variant_dir variants/_default)
1216
endif()
1317

1418
add_subdirectory(cores)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Dhruva Gole
2+
* Copyright (c) 2026 TOKITA Hiroshi
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/

variants/arduino_nano_33_ble_nrf52840/variant.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

variants/arduino_nano_33_ble_nrf52840_sense/variant.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

variants/arduino_nano_33_iot_samd21g18a/variant.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

variants/nrf52840dk_nrf52840/variant.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

variants/pocketbeagle_2_am6254_a53/variant.h

Lines changed: 0 additions & 7 deletions
This file was deleted.

variants/rpi_pico_rp2040/variant.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)