-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
20 changed files
with
317 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Note: The list of ForEachMacros can be obtained using: | ||
# | ||
# git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \ | ||
# | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$, - '\1'," \ | ||
# | sort | uniq | ||
# | ||
# References: | ||
# - https://clang.llvm.org/docs/ClangFormatStyleOptions.html | ||
|
||
--- | ||
BasedOnStyle: LLVM | ||
AlignConsecutiveMacros: AcrossComments | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortEnumsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AttributeMacros: | ||
- __aligned | ||
- __deprecated | ||
- __packed | ||
- __printf_like | ||
- __syscall | ||
- __subsystem | ||
BreakBeforeBraces: Linux | ||
ColumnLimit: 100 | ||
ConstructorInitializerIndentWidth: 8 | ||
ContinuationIndentWidth: 8 | ||
ForEachMacros: | ||
- 'FOR_EACH' | ||
- 'FOR_EACH_FIXED_ARG' | ||
- 'FOR_EACH_IDX' | ||
- 'FOR_EACH_IDX_FIXED_ARG' | ||
- 'FOR_EACH_NONEMPTY_TERM' | ||
- 'RB_FOR_EACH' | ||
- 'RB_FOR_EACH_CONTAINER' | ||
- 'SYS_DLIST_FOR_EACH_CONTAINER' | ||
- 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE' | ||
- 'SYS_DLIST_FOR_EACH_NODE' | ||
- 'SYS_DLIST_FOR_EACH_NODE_SAFE' | ||
- 'SYS_SFLIST_FOR_EACH_CONTAINER' | ||
- 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE' | ||
- 'SYS_SFLIST_FOR_EACH_NODE' | ||
- 'SYS_SFLIST_FOR_EACH_NODE_SAFE' | ||
- 'SYS_SLIST_FOR_EACH_CONTAINER' | ||
- 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE' | ||
- 'SYS_SLIST_FOR_EACH_NODE' | ||
- 'SYS_SLIST_FOR_EACH_NODE_SAFE' | ||
- '_WAIT_Q_FOR_EACH' | ||
- 'Z_FOR_EACH' | ||
- 'Z_FOR_EACH_ENGINE' | ||
- 'Z_FOR_EACH_EXEC' | ||
- 'Z_FOR_EACH_FIXED_ARG' | ||
- 'Z_FOR_EACH_FIXED_ARG_EXEC' | ||
- 'Z_FOR_EACH_IDX' | ||
- 'Z_FOR_EACH_IDX_EXEC' | ||
- 'Z_FOR_EACH_IDX_FIXED_ARG' | ||
- 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC' | ||
- 'Z_GENLIST_FOR_EACH_CONTAINER' | ||
- 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE' | ||
- 'Z_GENLIST_FOR_EACH_NODE' | ||
- 'Z_GENLIST_FOR_EACH_NODE_SAFE' | ||
IncludeBlocks: Regroup | ||
IncludeCategories: | ||
- Regex: '^".*\.h"$' | ||
Priority: 0 | ||
- Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|limits|locale|math|setjmp|signal|stdarg|stdbool|stddef|stdint|stdio|stdlib|string|tgmath|time|wchar|wctype)\.h>$' | ||
Priority: 1 | ||
- Regex: '^\<zephyr/.*\.h\>$' | ||
Priority: 2 | ||
- Regex: '.*' | ||
Priority: 3 | ||
IndentCaseLabels: false | ||
IndentWidth: 8 | ||
# SpaceBeforeParens: ControlStatementsExceptControlMacros # clang-format >= 13.0 | ||
UseTab: Always | ||
WhitespaceSensitiveMacros: | ||
- STRINGIFY | ||
- Z_STRINGIFY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# EditorConfig: https://editorconfig.org/ | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# All (Defaults) | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
max_line_length = 100 | ||
|
||
# Assembly | ||
[*.S] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# C | ||
[*.{c,h}] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# C++ | ||
[*.{cpp,hpp}] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# Linker Script | ||
[*.ld] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# Python | ||
[*.py] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Perl | ||
[*.pl] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# reStructuredText | ||
[*.rst] | ||
indent_style = space | ||
indent_size = 3 | ||
|
||
# YAML | ||
[*.{yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# Shell Script | ||
[*.sh] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Windows Command Script | ||
[*.cmd] | ||
end_of_line = crlf | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# Valgrind Suppression File | ||
[*.supp] | ||
indent_style = space | ||
indent_size = 3 | ||
|
||
# CMake | ||
[{CMakeLists.txt,*.cmake}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# Makefile | ||
[Makefile] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# Device tree | ||
[*.{dts,dtsi,overlay}] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
# Git commit messages | ||
[COMMIT_EDITMSG] | ||
max_line_length = 75 | ||
|
||
# Kconfig | ||
[Kconfig*] | ||
indent_style = tab | ||
indent_size = 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
add_subdirectory(drivers) | ||
add_subdirectory(lib) | ||
add_subdirectory(subsys) | ||
|
||
zephyr_include_directories(include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rsource "drivers/Kconfig" | ||
rsource "lib/Kconfig" | ||
rsource "subsys/Kconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# CHESTER Application: skeleton | ||
|
||
Create a directory for the **West** workspace and switch into it: | ||
|
||
``` | ||
mkdir skeleton && cd skeleton | ||
``` | ||
|
||
> Note: The word `skeleton` in the title and command above should be replaced with your workspace name (and preferrably match a path/name of your **Git** repository). If you only have one application in the workspace, the name should contain the application name. Once done, do not forget to delete this note to avoid any future confusion. | ||
Create **Python** virtual environment in the workspace: | ||
|
||
``` | ||
python3 -m venv venv | ||
``` | ||
|
||
> Note: If the command `python3` cannot be found on your system, use `python` instead. | ||
Activate the **Python** virtual environment: | ||
|
||
``` | ||
source venv/bin/activate | ||
``` | ||
|
||
> Note: This command should be `venv\Scripts\Activate.ps1` in **Windows Powershell**. Also, in case of the **Fish** shell, it is important to run the command as `source venv/bin/activate.fish`. | ||
Upgrade the **Python** package installer: | ||
|
||
``` | ||
pip install --upgrade pip | ||
``` | ||
|
||
Install the **West** tool: | ||
|
||
``` | ||
pip install west | ||
``` | ||
|
||
Initialize the **West** workspace: | ||
|
||
``` | ||
west init -m [email protected]:chester/skeleton.git --manifest-rev main | ||
``` | ||
|
||
Synchronize the **West** workspace: | ||
|
||
``` | ||
west update | ||
``` | ||
|
||
Configure the default board: | ||
|
||
``` | ||
west config build.board chester_nrf52840 | ||
``` | ||
|
||
Install the required **Python** packages: | ||
|
||
``` | ||
pip install -r zephyr/scripts/requirements.txt | ||
pip install -r nrf/scripts/requirements.txt | ||
pip install -r bootloader/mcuboot/scripts/requirements.txt | ||
pip install -r chester/scripts/requirements.txt | ||
``` | ||
|
||
Go to the application directory: | ||
|
||
``` | ||
cd vendor/application | ||
``` | ||
|
||
Build the application: | ||
|
||
``` | ||
west build | ||
``` | ||
|
||
Flash the application: | ||
|
||
``` | ||
west flash | ||
``` | ||
|
||
Debug the application: | ||
|
||
``` | ||
west debug | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(skeleton) | ||
|
||
target_sources(app PRIVATE src/main.c) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_CTR_DEFAULTS=y | ||
CONFIG_CTR_LOG=y | ||
CONFIG_CTR_SHELL=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <zephyr/kernel.h> | ||
#include <zephyr/logging/log.h> | ||
|
||
LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG); | ||
|
||
void main(void) | ||
{ | ||
LOG_INF("Build time: " __DATE__ " " __TIME__); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
menu "Drivers" | ||
|
||
endmenu |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
menu "Libraries" | ||
|
||
endmenu |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
menu "Subsystems" | ||
|
||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
manifest: | ||
version: "0.12" | ||
remotes: | ||
- name: hardwario-chester | ||
url-base: [email protected]:chester | ||
projects: | ||
- name: sdk.git | ||
remote: hardwario-chester | ||
revision: main | ||
path: chester | ||
import: true | ||
self: | ||
path: vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build: | ||
cmake: . | ||
kconfig: Kconfig | ||
settings: | ||
dts_root: . |