Skip to content

Commit

Permalink
feat(docs): Add warning to new shield docs how Kconfig treats whitspaces
Browse files Browse the repository at this point in the history
Added a warning to the shield section explaining that Kconfig does
not ignore whitespaces on function calls and therefore adding whitespaces
after the comma will break functionality.
  • Loading branch information
huber-th authored and caksoylar committed Mar 5, 2024
1 parent db7b197 commit 37af94e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/docs/development/new-shield.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ config SHIELD_MY_BOARD
def_bool $(shields_list_contains,my_board)
```

:::warning
Kconfig uses only commas for delimiters, and keeps all whitespaces in the function call. Therefore do not add a whitespace after the comma when configuring your shield as this would be treated as <code>&nbsp;my_board</code> (with a leading whitespace) and will cause issues.
:::

This will make sure that a new configuration value named `SHIELD_MY_BOARD` is set to true whenever `my_board` is used as the shield name, either as the `SHIELD` variable [in a local build](build-flash.mdx) or in your `build.yaml` file [when using Github Actions](../customization). Note that this configuration value will be used in `Kconfig.defconfig` to set other properties about your shield, so make sure that they match.

**For split boards**, you will need to add configurations for the left and right sides. For example, if your split halves are named `my_board_left` and `my_board_right`, it would look like this:
Expand Down

0 comments on commit 37af94e

Please sign in to comment.