Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ if (CONFIG_ARDUINO_API)
elseif (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/variants/${NORMALIZED_BOARD_TARGET})
set(variant_dir variants/${NORMALIZED_BOARD_TARGET})
else()
message(FATAL_ERROR "Variant dir not found: variants/${BOARD}, variants/${NORMALIZED_BOARD_TARGET}")
message(WARNING
"Variant dir not found: variants/${BOARD}, variants/${NORMALIZED_BOARD_TARGET}\n"
"Your board is currently not supported. To use it you must create a DTS overlay."
)
set(variant_dir variants/default)
endif()

add_subdirectory(cores)
Expand Down
2 changes: 2 additions & 0 deletions documentation/variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ variants/
│   ├── variant.h
```

It is possible to apply the overlay outside of the `variants` folder. In that case `cmake` will show a warning and a default empty `variant.h` file will be used. The `zephyr,user` section will still need to be defined somewhere in your project, as described in the [Guide to Writing Overlays section](#guide-to-writing-overlays).

## Guide to Writing Overlays

### DeviceTree Overlay files for Arduino boards
Expand Down
7 changes: 7 additions & 0 deletions variants/default/variant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2026 Michal Gagos
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once
Loading