-
Notifications
You must be signed in to change notification settings - Fork 4
Refatora quase tudo #50
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
Open
Eduardo-Barreto
wants to merge
96
commits into
develop
Choose a base branch
from
the-great-refactor
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 62 commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
bd10771
🔧 Update CMakeLists to cpp
Eduardo-Barreto 0050396
⬆️ Update cube
Eduardo-Barreto f93583d
✨ Migrate mcu utility to cpp
Eduardo-Barreto aa33fbb
📝 Update README
Eduardo-Barreto b0b8248
📝 Update file header
Eduardo-Barreto 281e42c
✨ Update tests to CPP
Eduardo-Barreto 2b08065
✨ Readd C support
Eduardo-Barreto 693fe59
🔧 Set uncrustify as default formatter
Eduardo-Barreto 345a274
🎨 Function definitions inside namespace
Eduardo-Barreto 545a38e
🎨 Format with uncrustify
Eduardo-Barreto fd43d6c
📝 Fix guard macros name
Eduardo-Barreto 6689168
📝 Fix guard macros name comment
Eduardo-Barreto 42f102d
🩹 Rename C_Things to PROJECT_Things
Eduardo-Barreto c6497cd
🔥 Remove mcu led toggle
Eduardo-Barreto b84c4e1
Merge branch 'migrate/cpp' into the-great-refactor
Eduardo-Barreto 28c3444
🔧 Change Cube toolchain to CMake
Eduardo-Barreto 7b63f56
🔧 Change uncrustify to clang
Eduardo-Barreto 127c0e5
✨ Add linter
Eduardo-Barreto e969f47
♻️ Refactor structure to new cmake
Eduardo-Barreto e82cafa
🔇 Remove debug logs
Eduardo-Barreto 95d5d61
✨ Add test_all target
Eduardo-Barreto 7c7f99f
🚨 Fix linter warnings
Eduardo-Barreto 34d1f55
♻️ Update targets
Eduardo-Barreto ffd8dca
⬆️ Update extensions recommendations
Eduardo-Barreto 523b026
🚧 Add doxyfile
Eduardo-Barreto 800bc6d
✨ Add gpio and test
Eduardo-Barreto 23fbab4
♻️ Change uc to bluepill
Eduardo-Barreto af15935
✨🚧 Start to add docker
Eduardo-Barreto 99fd511
👷 Add CI
Eduardo-Barreto a6838dc
🚨 Initialize config members
Eduardo-Barreto 156c5e4
🚨🩹 Fix linter warnings with linter
Eduardo-Barreto f1bc47d
📝 Update helpme
Eduardo-Barreto c4c2131
🐛 Update launch.json template
Eduardo-Barreto 260d470
📝 Update README
Eduardo-Barreto a224f94
♻️ Update vscode settings
Eduardo-Barreto 438b87b
➖ Remove stm32-cmake submodule
Eduardo-Barreto 0102bdb
🔧 Set cube code as system
Eduardo-Barreto 342a1c3
🐛🔧 Remove system from cube sources
Eduardo-Barreto 221672a
♻️ Use pin and ports from cube
Eduardo-Barreto 2345177
🚨💩 Ignore lint error
Eduardo-Barreto 7732f61
🚨 Reorder includes
Eduardo-Barreto 686d0ea
🔧 Cube dont generate main()
Eduardo-Barreto 0b72d38
🔧🐛 Fix cube includes as system
Eduardo-Barreto faf2e7b
🎨 Make format
Eduardo-Barreto 41fc369
✨ Add blink
Eduardo-Barreto 6fe6569
🔧🐛 Link stm32cubemx
Eduardo-Barreto 4b681be
♻️🐛 Fix project sources
Eduardo-Barreto 7d2c7a8
♻️ Use led toggle
Eduardo-Barreto 1cc2e06
♻️🔧 Refactor to use project files as a library
Eduardo-Barreto eb07819
📝 omg micras mentioned
Eduardo-Barreto 4daf74f
🩹 Remove thunder_ on sources and headers
Eduardo-Barreto 13e17b6
🔧 Remove lib from format headers and sources
Eduardo-Barreto 7c1924b
🐛 Add whole archive flag to project lib
Eduardo-Barreto fbde763
📝♻️ Fix README
Eduardo-Barreto 168ef8f
🔥 Remove english section
Eduardo-Barreto 81c2918
:bug: Fix STM32 PROGRAMMER
jairchtq 7794ef6
🎨 Remove tab on else statement
Eduardo-Barreto 8db7e91
📝 Add acknowledgments section
Eduardo-Barreto 7a53420
🔥 Remove preload
Eduardo-Barreto a5ed64d
🚚 Move docker to .docker
Eduardo-Barreto 0a86681
💚 Fix docker path on workflows
Eduardo-Barreto 3708c99
💚 Fix erroneous .docker on image names
Eduardo-Barreto 2d38cb0
📝 Change make help to helpme
Eduardo-Barreto 6915d17
🩹 Remove redundant cmake build type
Eduardo-Barreto 5917056
🎨 Remove semicolon from namespace ending
Eduardo-Barreto 4aa7bee
📝 Change test led to test gpio
Eduardo-Barreto ad95f09
📝 Update doxystrings on files
Eduardo-Barreto 2e656c6
🔧 Remove date field from doxygen tempalte
Eduardo-Barreto 4c64dd2
🐛 Remove test includes
Eduardo-Barreto 3a06571
🚚 Rename docker compose to compose
Eduardo-Barreto 7555c90
🎨 Move project configuration up
Eduardo-Barreto 8b7d584
📝 Move ignored folders
Eduardo-Barreto b0892a6
⬆️ Set cpp version to 26
Eduardo-Barreto 8f2c9ec
🔧 Update build tools
Eduardo-Barreto 23c5e43
💚 Fix cube cmd on dockerfile
Eduardo-Barreto 20c9261
🔨 Add devcontainer
Eduardo-Barreto 6e581fd
📝 Add cubemx warning and docker installation
Eduardo-Barreto 27404d1
📝 Update README
Eduardo-Barreto d87cf74
📝 Update warning
Eduardo-Barreto 852f770
📝 Update windows path instructions
Eduardo-Barreto 2d6137d
🔇 Make docs in batch mode
Eduardo-Barreto 1394dfe
🐛 Fix CUBE_SOURCE_DIR assignment for WSL and Linux environments
Eduardo-Barreto 4ca3db8
🔥 Remove editorconfig
Eduardo-Barreto 4204ab0
🎨 Fix include orders
Eduardo-Barreto a6d880a
🎨 Fix line breaking
Eduardo-Barreto ebde7d4
🔧 Optimize clang-format rules
Eduardo-Barreto 20f7740
🙈 Ignore docs folder
Eduardo-Barreto 398e932
🔧 Optimize doxyfile
Eduardo-Barreto 625323f
✏️ Fix typo
Eduardo-Barreto 07ab85b
📝 Add english README
Eduardo-Barreto 3510d44
📄 Update LICENSE
Eduardo-Barreto 30676f7
♻️ Change githook to clang-format
Eduardo-Barreto 36abad5
🔥 Remove gitmodules file
Eduardo-Barreto dd4ba09
🩹 Use standard token reference
Eduardo-Barreto 98ecbc9
💚 Add ready for review trigger on pull request ci
Eduardo-Barreto 0120c51
🔧🐛 Support for basic and advanced code generation
Eduardo-Barreto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,186 @@ | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: LLVM | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: BlockIndent | ||
AlignArrayOfStructures: None | ||
AlignConsecutiveMacros: None | ||
AlignConsecutiveAssignments: None | ||
AlignConsecutiveBitFields: Consecutive | ||
AlignConsecutiveDeclarations: Consecutive | ||
AlignEscapedNewlines: Left | ||
AlignOperands: Align | ||
AlignTrailingComments: true | ||
AllowAllArgumentsOnNextLine: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortEnumsOnASingleLine: false | ||
AllowShortBlocksOnASingleLine: Empty | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: Yes | ||
AttributeMacros: | ||
- __capability | ||
BinPackArguments: true | ||
BinPackParameters: true | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterControlStatement: Never | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterObjCDeclaration: false | ||
AfterStruct: false | ||
AfterUnion: false | ||
AfterExternBlock: false | ||
BeforeCatch: false | ||
BeforeElse: false | ||
BeforeLambdaBody: false | ||
BeforeWhile: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeConceptDeclarations: true | ||
BreakBeforeBraces: Attach | ||
BreakBeforeInheritanceComma: false | ||
BreakInheritanceList: AfterColon | ||
BreakBeforeTernaryOperators: false | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakConstructorInitializers: AfterColon | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 120 | ||
CommentPragmas: '^ IWYU pragma:' | ||
QualifierAlignment: Leave | ||
CompactNamespaces: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DeriveLineEnding: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
EmptyLineAfterAccessModifier: Never | ||
EmptyLineBeforeAccessModifier: Always | ||
ExperimentalAutoDetectBinPacking: false | ||
PackConstructorInitializers: NextLine | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
AllowAllConstructorInitializersOnNextLine: true | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IfMacros: | ||
- KJ_IF_MAYBE | ||
IncludeBlocks: Preserve | ||
IncludeCategories: | ||
- Regex: '^<.*>' | ||
Priority: 1 | ||
SortPriority: 1 | ||
CaseSensitive: false | ||
- Regex: '^".*"' | ||
Priority: 2 | ||
SortPriority: 2 | ||
CaseSensitive: false | ||
IncludeIsMainRegex: '$' | ||
IncludeIsMainSourceRegex: '' | ||
IndentAccessModifiers: false | ||
IndentCaseLabels: true | ||
IndentCaseBlocks: false | ||
IndentGotoLabels: true | ||
IndentPPDirectives: BeforeHash | ||
IndentExternBlock: NoIndent | ||
IndentRequires: false | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: true | ||
InsertTrailingCommas: None | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
LambdaBodyIndentation: Signature | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBinPackProtocolList: Auto | ||
ObjCBlockIndentWidth: 2 | ||
ObjCBreakBeforeNestedBlockParam: true | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakOpenParenthesis: 0 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
PenaltyIndentedWhitespace: 0 | ||
PointerAlignment: Left | ||
PPIndentWidth: -1 | ||
ReferenceAlignment: Pointer | ||
ReflowComments: true | ||
RemoveBracesLLVM: false | ||
SeparateDefinitionBlocks: Always | ||
ShortNamespaceLines: 0 | ||
SortIncludes: Never | ||
SortJavaStaticImport: Before | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCaseColon: false | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeParensOptions: | ||
AfterControlStatements: true | ||
AfterForeachMacros: true | ||
AfterFunctionDefinitionName: false | ||
AfterFunctionDeclarationName: false | ||
AfterIfMacros: true | ||
AfterOverloadedOperator: false | ||
BeforeNonEmptyParentheses: false | ||
SpaceAroundPointerQualifiers: Default | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyBlock: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: Never | ||
SpacesInConditionalStatement: false | ||
SpacesInContainerLiterals: true | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInLineCommentPrefix: | ||
Minimum: 1 | ||
Maximum: -1 | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
SpaceBeforeSquareBrackets: false | ||
BitFieldColonSpacing: Both | ||
Standard: c++20 | ||
StatementAttributeLikeMacros: | ||
- Q_EMIT | ||
StatementMacros: | ||
- Q_UNUSED | ||
- QT_REQUIRE_VERSION | ||
TabWidth: 4 | ||
UseCRLF: false | ||
UseTab: Never | ||
WhitespaceSensitiveMacros: | ||
- STRINGIZE | ||
- PP_STRINGIZE | ||
- BOOST_PP_STRINGIZE | ||
- NS_SWIFT_NAME | ||
- CF_SWIFT_NAME | ||
... |
This file contains hidden or 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,60 @@ | ||
--- | ||
Checks: | ||
-*, | ||
bugprone-*, | ||
-bugprone-easily-swappable-parameters, | ||
-bugprone-narrowing-conversions, | ||
-bugprone-dynamic-static-initializers, | ||
clang-*, | ||
-clang-diagnostic-unused-command-line-argument, | ||
cppcoreguidelines-*, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-cppcoreguidelines-pro-bounds-pointer-arithmetic, | ||
-cppcoreguidelines-avoid-do-while, | ||
-cppcoreguidelines-pro-type-union-access, | ||
google-*, | ||
llvm-*, | ||
-llvm-header-guard, | ||
misc-*, | ||
-misc-include-cleaner, | ||
-misc-const-correctness, | ||
-misc-use-anonymous-namespace, | ||
modernize-*, | ||
-modernize-use-nodiscard, | ||
-modernize-use-trailing-return-type, | ||
performance-*, | ||
readability-*, | ||
-readability-duplicate-include, | ||
-readability-magic-numbers, | ||
WarningsAsErrors: '*' | ||
HeaderFileExtensions: | ||
- '' | ||
- h | ||
- hh | ||
- hpp | ||
- hxx | ||
ImplementationFileExtensions: | ||
- c | ||
- cc | ||
- cpp | ||
- cxx | ||
HeaderFilterRegex: '(include|config)/.*.hpp' | ||
FormatStyle: none | ||
CheckOptions: | ||
readability-magic-numbers.IgnorePowersOf2IntegerValues: true | ||
readability-magic-numbers.IgnoreBitFieldsWidths: true | ||
readability-magic-numbers.IgnoreUserDefinedLiterals: true | ||
readability-identifier-length.MinimumVariableNameLength: 2 | ||
readability-identifier-length.IgnoredVariableNames: ^[nxyz]$ | ||
readability-identifier-length.MinimumParameterNameLength: 2 | ||
readability-identifier-length.IgnoredParameterNames: ^[nxyz]$ | ||
misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true | ||
cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: false | ||
readability-function-cognitive-complexity.Threshold: 30 | ||
SystemHeaders: false | ||
ExtraArgsBefore: | ||
- '--target=arm-none-eabi' | ||
- '--sysroot=/usr/lib/arm-none-eabi/' | ||
- '-I/usr/lib/arm-none-eabi/include/c++/13.2.1/' | ||
- '-I/usr/lib/arm-none-eabi/include/c++/13.2.1/arm-none-eabi/' | ||
... |
This file contains hidden or 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,18 @@ | ||
.git/ | ||
.github/ | ||
.vscode/ | ||
.cache/ | ||
.idea/ | ||
build/ | ||
cube/ | ||
!**.ioc | ||
|
||
.devcontainer | ||
.gitignore | ||
.gitmodules | ||
Doxyfile | ||
LICENSE | ||
|
||
*.yaml | ||
*.md | ||
*.iml |
This file contains hidden or 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,37 @@ | ||
################################## | ||
# Base image for STM32 Template # | ||
################################## | ||
FROM thunderatz/stm32cubemx:6.13.0-f1 AS base | ||
|
||
RUN apt-get update -y > /dev/null && \ | ||
apt-get upgrade -y > /dev/null && \ | ||
apt-get install -y \ | ||
gcc-arm-none-eabi \ | ||
make \ | ||
cmake \ | ||
clang-tidy \ | ||
clang-format > /dev/null\ | ||
&& apt-get clean > /dev/null | ||
|
||
WORKDIR /project | ||
COPY ./cube/*.ioc /project/cube/ | ||
|
||
ENV DISPLAY=:10 | ||
ARG PROJECT_NAME=stm32_project_template | ||
|
||
RUN Xvfb :10 -ac & \ | ||
echo "config load /project/cube/${PROJECT_NAME}.ioc\nproject generate\nexit\n" > .cube && \ | ||
$CUBE_PATH/STM32CubeMX -q /project/.cube && \ | ||
rm .cube && \ | ||
pkill -f Xvfb | ||
|
||
RUN rm /tmp/.X10-lock | ||
|
||
RUN echo "trap 'chown -R ubuntu /project' EXIT" >> "/root/.bashrc" | ||
|
||
################################### | ||
# Build image for STM32 Template # | ||
################################### | ||
FROM base AS build | ||
|
||
COPY . /project |
This file contains hidden or 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,30 @@ | ||
#!/bin/bash | ||
|
||
BUILD_ARG=$1 | ||
|
||
rm -rf /project/build || exit 1 | ||
mkdir -p /project/build || exit 1 | ||
cd /project/build || exit 1 | ||
cmake .. -DBUILD_TYPE=Release $BUILD_ARG || exit 1 | ||
|
||
echo "Compiling main..." | sed 's/.*/\x1b[34m&\x1b[0m/' | ||
|
||
make -j | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Compilation successful." | sed 's/.*/\x1b[32m&\x1b[0m/' | ||
else | ||
echo "Compilation failed." | sed 's/.*/\x1b[31m&\x1b[0m/' | ||
exit 1 | ||
fi | ||
|
||
echo "Compiling tests..." | sed 's/.*/\x1b[34m&\x1b[0m/' | ||
|
||
make test_all -j | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Tests compiled successfully." | sed 's/.*/\x1b[32m&\x1b[0m/' | ||
else | ||
echo "Tests compilation failed." | sed 's/.*/\x1b[31m&\x1b[0m/' | ||
exit 1 | ||
fi |
This file contains hidden or 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,14 @@ | ||
#!/bin/bash | ||
|
||
FILES=$(find . \( -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" \) \ | ||
-not \( -path "*/cube/*" -o -path "*/build/*" -o -path "*/libs/*" \)) | ||
|
||
for FILE in $FILES; do | ||
clang-format -style=file -output-replacements-xml $FILE | grep "<replacement " >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "Code not properly formatted (File: $FILE). Please run make format." | sed 's/.*/\x1b[31m&\x1b[0m/' | ||
exit 1 | ||
fi | ||
done | ||
|
||
echo "Code properly formatted." | sed 's/.*/\x1b[32m&\x1b[0m/' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.