Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init: setup unity and code confg file for builtin library #297

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft
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
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
.vscode
pkg_build
build
.clang-format
**/__pycache__/
**/__pycache__/

# Code-check reports
clang-tidy-report.txt

scan-build-reports/

cppcheck_reports/
cppcheck.checkers
err.xml
26 changes: 26 additions & 0 deletions IFX_CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Develop Environment

## Develop on Windows
Clone the repository in arduino folder:
- Open Arduino and install any Infineon XMC library (e.g. 2.2.0)
- Open the library location in Arduino program folder
`C:\Users\"USERNAME"\AppData\Local\Arduino15\packages\Infineon\hardware\xmc`
- Open git bash, type command:
`git clone "HTTP_SSH_REPOSITORY" "LIBRARY_VERSION (e.g. 2.2.0)"`

This is a workaround for current local compilation/testing.

## Develop on WSL
To be able to use some tools (make, clang, gcc...) easier on Linux, WSL is needed.
Since now we still compile the code with arduino-cli.exe on windows, in order to useLinux commands/ build tools, a symbolic link is created to eunsure the changes are immediately reflected in the other.
In WSL, you can create a symbolic link pointing to your windows project folder:

`ln -s /mnt/c/Users/<YourUserName>/AppData/Local/Arduino15/packages/Infineon/hardware/xmc /home/<you-wsl-user>/project`

# Code checks
Refer to libraries\CAN\Makefile.codecheck

# Example and Unity tests
Refer to libraries\CAN\Makefile.test

XMC4700 Receiver has some issue.
26 changes: 26 additions & 0 deletions config/clang-format/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
LinjingZhang marked this conversation as resolved.
Show resolved Hide resolved
# We'll use defaults from the LLVM style, but with 4 columns indentation.
#BasedOnStyle: GNU
BasedOnStyle: LLVM
#BasedOnStyle: Google
#BasedOnStyle: Mozilla
#BasedOnStyle: Chromium
IndentWidth: 4
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -4
Standard: c++17
TabWidth: 2
UseTab: Never
ColumnLimit: 100
AlignAfterOpenBracket: Align
BinPackParameters: false
AlignEscapedNewlines: Left
AlwaysBreakTemplateDeclarations: Yes
PackConstructorInitializers: Never
BreakConstructorInitializersBeforeComma: false
IndentPPDirectives: BeforeHash
SortIncludes: Never
SeparateDefinitionBlocks: Always
...
54 changes: 54 additions & 0 deletions config/clang-tidy/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Checks: 'cppcoreguidelines-*,
performance-*,
modernize-*,
google-*,
misc-*
cert-*,
readability-*,
clang-analyzer-*,
-performance-unnecessary-value-param,
-modernize-use-trailing-return-type,
-google-runtime-references,
-misc-non-private-member-variables-in-classes,
-readability-braces-around-statements,
-google-readability-braces-around-statements,
-cppcoreguidelines-avoid-magic-numbers,
-readability-magic-numbers,
-readability-magic-numbers,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-avoid-c-arrays,
-modernize-avoid-c-arrays,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-readability-named-parameter,
-cert-env33-c
'


WarningsAsErrors: ''
HeaderFilterRegex: '.*'
#HeaderFilterRegex: '*spdlog/[^f].*'
#AnalyzeTemporaryDtors: false
FormatStyle: none

CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
4 changes: 4 additions & 0 deletions config/cppcheck/misra.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"script": "misra.py",
"args": [ "--rule-texts=config/cppcheck/misra.txt" ]
}
Loading
Loading