Skip to content

Commit 3538c54

Browse files
soburiDhruvaG2000
authored andcommitted
variants: Rename variants.h to variant.h
The header for Arduino board-specific settings is variant.h, not variants.h, so I modified it accordingly. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent c199921 commit 3538c54

File tree

10 files changed

+6
-6
lines changed

10 files changed

+6
-6
lines changed

cores/arduino/Arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ enum analogPins { DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user),
9797

9898
#endif
9999

100-
#include <variants.h>
100+
#include <variant.h>
101101
#ifdef __cplusplus
102102
#include <zephyrPrint.h>
103103
#include <zephyrSerial.h>

documentation/variants.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ target board. To add board support:
2727
needs to be added it needs to be done in the `variants/` folder.
2828
Add a folder inside of the variants folder that matches the name of your board.
2929
2. Add an overlay file and a pinmap header file that match the name of the board.
30-
3. Add your new headerfile to an `#ifdef` statement in the variants.h file.
30+
3. Add your new headerfile to an `#ifdef` statement in the variant.h file.
3131

3232
An example of this structure is shown below.
3333

@@ -37,13 +37,13 @@ variants/
3737
│   ├── arduino_nano_33_ble.overlay
3838
│   └── arduino_nano_33_ble_pinmap.h
3939
├── CMakeLists.txt
40-
└── variants.h
40+
└── variant.h
4141
4242
```
4343

44-
- The top level consists of `CMakeLists.txt`, `variants.h` and the `<BOARD_NAME>` folder. Each of these files have a specific role to play.
44+
- The top level consists of `CMakeLists.txt`, `variant.h` and the `<BOARD_NAME>` folder. Each of these files have a specific role to play.
4545
- The `Cmakelists` help the compiler locate the proper directory to help find the proper header files that are board specific. You need to add the name using `zephyr_include_directories(BOARD_NAME)` to this file. Do note that this `BOARD_NAME` is the same as the name of your board's directory.
46-
- `variants.h` contains the necessary `#includes` inorder to tell the source code about your board's pinmap.
46+
- `variant.h` contains the necessary `#includes` inorder to tell the source code about your board's pinmap.
4747
- The `<BOARD_NAME>` folder is where the overlay and pinmap file resides. Inorder to understand how to write DT overlays, lookup `Documentation/overlays.md`. To understand the `<boardname_pinmap.h>` file, go through the existing `variants/ARDUINO_NANO33BLE/arduino_nano_ble_sense_pinmap.h` which shows how to use the overlay nodes inside our C programs using zephyr macros like `GPIO_DT_SPEC_GET`. The zephyr-project documentation on this is pretty extensive as well and worth reading.
4848

4949
## Guide to Writing Overlays
@@ -193,7 +193,7 @@ One example of a change that you may find useful is mapping additional pins. For
193193
example, the LEDs on the nRF52840 are not connected to any of the Arduino header
194194
pins. To define a built-in LED for this board, a 22nd pin definition was added.
195195

196-
Your pinmap header file must be added to the variants.h file by adding three
196+
Your pinmap header file must be added to the variant.h file by adding three
197197
lines using this format:
198198

199199
```c

0 commit comments

Comments
 (0)