Skip to content

Commit c89db53

Browse files
Merge pull request #7 from RIT-EVT/feature/diegolhendrix/state-machine
2 parents f2cc898 + f95aa80 commit c89db53

24 files changed

Lines changed: 1163 additions & 658 deletions

File tree

.clang-format

Lines changed: 163 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,215 @@
11
# Generated from CLion C/C++ Code Style settings
2+
Language: Cpp
23
BasedOnStyle: LLVM
34
AccessModifierOffset: -4
45
AlignAfterOpenBracket: Align
5-
AlignConsecutiveAssignments: None
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveAssignments:
8+
Enabled: true
9+
AcrossEmptyLines: false
10+
AcrossComments: false
11+
AlignCompound: false
12+
PadOperators: false
13+
AlignConsecutiveBitFields:
14+
Enabled: true
15+
AcrossEmptyLines: false
16+
AcrossComments: false
17+
AlignCompound: true
18+
PadOperators: true
19+
AlignConsecutiveDeclarations:
20+
Enabled: false
21+
AcrossEmptyLines: false
22+
AcrossComments: false
23+
AlignCompound: false
24+
PadOperators: false
25+
AlignConsecutiveMacros:
26+
Enabled: true
27+
AcrossEmptyLines: false
28+
AcrossComments: false
29+
AlignCompound: true
30+
PadOperators: false
31+
AlignEscapedNewlines: Left
632
AlignOperands: DontAlign
7-
AllowAllArgumentsOnNextLine: false
8-
AllowAllConstructorInitializersOnNextLine: false
33+
AlignTrailingComments: true
34+
AllowAllArgumentsOnNextLine: true
35+
#AllowAllConstructorInitializersOnNextLine: false (Deprecated -> PackConstructorInitializers)
936
AllowAllParametersOfDeclarationOnNextLine: false
1037
AllowShortBlocksOnASingleLine: Always
11-
AllowShortCaseLabelsOnASingleLine: true
12-
AllowShortFunctionsOnASingleLine: All
38+
AllowShortCaseLabelsOnASingleLine: false
39+
AllowShortEnumsOnASingleLine: false
40+
AllowShortFunctionsOnASingleLine: Empty
1341
AllowShortIfStatementsOnASingleLine: Never
1442
AllowShortLambdasOnASingleLine: All
1543
AllowShortLoopsOnASingleLine: false
44+
AlwaysBreakAfterDefinitionReturnType: None
1645
AlwaysBreakAfterReturnType: None
17-
AlwaysBreakTemplateDeclarations: MultiLine
18-
BreakBeforeBraces: Custom
46+
AlwaysBreakBeforeMultilineStrings: false
47+
AlwaysBreakTemplateDeclarations: Yes
48+
AttributeMacros:
49+
- __capability
50+
BinPackArguments: false
51+
BinPackParameters: true
1952
BraceWrapping:
2053
AfterCaseLabel: false
2154
AfterClass: false
2255
AfterControlStatement: Never
2356
AfterEnum: false
2457
AfterFunction: false
2558
AfterNamespace: false
59+
AfterObjCDeclaration: false
60+
AfterStruct: false
2661
AfterUnion: false
62+
AfterExternBlock: false
2763
BeforeCatch: false
2864
BeforeElse: false
65+
BeforeLambdaBody: false
66+
BeforeWhile: false
2967
IndentBraces: false
3068
SplitEmptyFunction: false
3169
SplitEmptyRecord: true
70+
SplitEmptyNamespace: true
3271
BreakBeforeBinaryOperators: NonAssignment
33-
BreakBeforeTernaryOperators: false
34-
BreakConstructorInitializers: BeforeColon
72+
BreakBeforeConceptDeclarations: Always
73+
BreakBeforeBraces: Attach
74+
BreakBeforeInheritanceComma: false
3575
BreakInheritanceList: BeforeColon
36-
ColumnLimit: 0
76+
BreakBeforeTernaryOperators: true
77+
BreakConstructorInitializersBeforeComma: false
78+
BreakConstructorInitializers: BeforeColon
79+
BreakAfterJavaFieldAnnotations: false
80+
BreakStringLiterals: true
81+
ColumnLimit: 120
82+
CommentPragmas: '^ IWYU pragma:'
83+
QualifierAlignment: Leave
3784
CompactNamespaces: false
85+
ConstructorInitializerIndentWidth: 4
3886
ContinuationIndentWidth: 4
87+
Cpp11BracedListStyle: true
88+
DeriveLineEnding: true
89+
DerivePointerAlignment: false
90+
DisableFormat: false
91+
EmptyLineAfterAccessModifier: Never
92+
EmptyLineBeforeAccessModifier: LogicalBlock
93+
ExperimentalAutoDetectBinPacking: false
94+
PackConstructorInitializers: BinPack
95+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
96+
AllowAllConstructorInitializersOnNextLine: false
97+
FixNamespaceComments: true
98+
ForEachMacros:
99+
- foreach
100+
- Q_FOREACH
101+
- BOOST_FOREACH
102+
IfMacros:
103+
- KJ_IF_MAYBE
104+
IncludeBlocks: Preserve
105+
IncludeCategories:
106+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
107+
Priority: 2
108+
SortPriority: 0
109+
CaseSensitive: false
110+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
111+
Priority: 3
112+
SortPriority: 0
113+
CaseSensitive: false
114+
- Regex: '.*'
115+
Priority: 1
116+
SortPriority: 0
117+
CaseSensitive: false
118+
IncludeIsMainRegex: '(Test)?$'
119+
IncludeIsMainSourceRegex: ''
120+
IndentAccessModifiers: false
121+
IndentCaseBlocks: false
39122
IndentCaseLabels: false
123+
IndentExternBlock: AfterExternBlock
124+
IndentGotoLabels: true
40125
IndentPPDirectives: BeforeHash
126+
127+
IndentRequiresClause: true
41128
IndentWidth: 4
129+
IndentWrappedFunctionNames: false
130+
InsertBraces: false
131+
InsertTrailingCommas: None
132+
JavaScriptQuotes: Leave
133+
JavaScriptWrapImports: true
42134
KeepEmptyLinesAtTheStartOfBlocks: true
135+
LambdaBodyIndentation: Signature
136+
MacroBlockBegin: ''
137+
MacroBlockEnd: ''
43138
MaxEmptyLinesToKeep: 1
44139
NamespaceIndentation: None
140+
ObjCBinPackProtocolList: Auto
141+
ObjCBlockIndentWidth: 2
142+
ObjCBreakBeforeNestedBlockParam: true
45143
ObjCSpaceAfterProperty: false
46144
ObjCSpaceBeforeProtocolList: true
145+
PenaltyBreakAssignment: 2
146+
PenaltyBreakBeforeFirstCallParameter: 19
147+
PenaltyBreakComment: 300
148+
PenaltyBreakFirstLessLess: 120
149+
PenaltyBreakOpenParenthesis: 0
150+
PenaltyBreakString: 1000
151+
PenaltyBreakTemplateDeclaration: 10
152+
PenaltyExcessCharacter: 1000000
153+
PenaltyReturnTypeOnItsOwnLine: 60
154+
PenaltyIndentedWhitespace: 0
47155
PointerAlignment: Left
48-
ReflowComments: false
156+
PPIndentWidth: -1
157+
ReferenceAlignment: Pointer
158+
ReflowComments: true
159+
RemoveBracesLLVM: false
160+
RequiresClausePosition: OwnLine
161+
SeparateDefinitionBlocks: Leave
162+
ShortNamespaceLines: 1
163+
SortIncludes: CaseSensitive
164+
SortJavaStaticImport: Before
165+
SortUsingDeclarations: true
49166
SpaceAfterCStyleCast: true
50167
SpaceAfterLogicalNot: false
51168
SpaceAfterTemplateKeyword: false
52169
SpaceBeforeAssignmentOperators: true
170+
SpaceBeforeCaseColon: false
53171
SpaceBeforeCpp11BracedList: false
54172
SpaceBeforeCtorInitializerColon: true
55173
SpaceBeforeInheritanceColon: true
56174
SpaceBeforeParens: ControlStatements
175+
SpaceBeforeParensOptions:
176+
AfterControlStatements: true
177+
AfterForeachMacros: true
178+
AfterFunctionDefinitionName: false
179+
AfterFunctionDeclarationName: false
180+
AfterIfMacros: true
181+
AfterOverloadedOperator: false
182+
AfterRequiresInClause: false
183+
AfterRequiresInExpression: false
184+
BeforeNonEmptyParentheses: false
185+
SpaceAroundPointerQualifiers: Default
57186
SpaceBeforeRangeBasedForLoopColon: true
187+
SpaceInEmptyBlock: false
58188
SpaceInEmptyParentheses: false
59-
SpacesBeforeTrailingComments: 0
60-
SpacesInAngles: false
61-
SpacesInCStyleCastParentheses: false
189+
SpacesBeforeTrailingComments: 1
190+
SpacesInAngles: Never
191+
SpacesInConditionalStatement: false
62192
SpacesInContainerLiterals: false
193+
SpacesInCStyleCastParentheses: false
194+
SpacesInLineCommentPrefix:
195+
Minimum: 1
196+
Maximum: -1
63197
SpacesInParentheses: false
64198
SpacesInSquareBrackets: false
199+
SpaceBeforeSquareBrackets: false
200+
BitFieldColonSpacing: Both
201+
Standard: Latest
202+
StatementAttributeLikeMacros:
203+
- Q_EMIT
204+
StatementMacros:
205+
- Q_UNUSED
206+
- QT_REQUIRE_VERSION
65207
TabWidth: 4
208+
UseCRLF: false
66209
UseTab: Never
210+
WhitespaceSensitiveMacros:
211+
- STRINGIZE
212+
- PP_STRINGIZE
213+
- BOOST_PP_STRINGIZE
214+
- NS_SWIFT_NAME
215+
- CF_SWIFT_NAME

.github/workflows/cmake.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,17 @@ jobs:
2626
ref: ${{ github.event.pull_request.head.ref }}
2727
submodules: recursive
2828

29-
# Install the gcc-arm tools and clang-format, and ensure clang-format 12 is being used
29+
# Install the gcc-arm tools and clang-format, and ensure clang-format 15 is being used
3030
- name: Install Compiler and Linter
3131
run: |
3232
sudo apt-get install gcc-arm-none-eabi
33-
sudo apt-get install clang-format-12
34-
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-12 10000
33+
sudo apt-get install clang-format-15
34+
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 10000
3535
3636
# Build the code for all supported chips
37-
- name: F302 Build
37+
- name: Project Build
3838
run: |
39-
cmake -DTARGET_DEV=STM32F302x8 -B ${{github.workspace}}/build
40-
cmake --build ${{github.workspace}}/build
41-
42-
- name: F334 Build
43-
run: |
44-
cmake -DTARGET_DEV=STM32F334x8 -B ${{github.workspace}}/build
39+
cmake -B ${{github.workspace}}/build
4540
cmake --build ${{github.workspace}}/build
4641
4742
# Apply clang-format formatting to the branch and create a new commit if any files are changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ add_library(${PROJECT_NAME} STATIC
6464
target_sources(${PROJECT_NAME} PRIVATE
6565
src/LVSS.cpp
6666
src/dev/ACS71240.cpp
67-
src/dev/TPS2HB50BQ1.cpp
67+
src/dev/TPS2HB35BQ.cpp
6868
)
6969

7070
###############################################################################

README.md

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,5 @@
1-
# Project Template
2-
3-
## Overview
4-
5-
### EVT-core
6-
For an overview of EVT please see the following links:
7-
8-
[EVT-core Documentation](https://evt-core.readthedocs.io/)
9-
10-
[EVT-core GitHub](https://github.com/RIT-EVT/EVT-core/)
11-
12-
### Template Project
13-
14-
This project-template serves as the skeleton template that is used for
15-
all EVT board repositories. It contains the following capabilities:
16-
17-
- Includes EVT-core as a submodule and compiled as a library for the board
18-
- Set up to contain code pertinent to the board to be built
19-
- Supports an arbitrary number of executable targets to be built and deployed onto a microcontroller
20-
- These contain targets to be run on a specific EVT custom PCB
21-
- Also contain utilities for validation and debugging
22-
- Provides a framework for auto-generated and built documentation using Sphinx and hosted on
23-
`readthedocs.io`
24-
25-
## Steps to Set Up a New Project
26-
27-
1) Create a new repo based on the project-template
28-
1) From [project-template](https://github.com/RIT-EVT/project-template) click `Use this template`
29-
2) Set the owner of the repository to RIT-EVT
30-
3) Name the repo with the new board's acronym
31-
4) Set the privacy to Public
32-
5) Don't include all branches
33-
2) Clone the new repo and create a setup branch
34-
1) `git clone <URL>`
35-
2) `git checkout -b feature/<github-username>/inital-setup`
36-
3) Set the project template up as an upstream repository
37-
1) `git remote add upstream https://github.com/RIT-EVT/project-template`
38-
2) `git remote set-url --push upstream no-push`
39-
1) Confirm that this worked by running `git remote -v`
40-
2) This should produce output similar to this:
41-
```
42-
origin https://github.com/RIT-EVT/ABC.git (fetch)
43-
origin https://github.com/RIT-EVT/ABC.git (push)
44-
upstream https://github.com/RIT-EVT/project-template (fetch)
45-
upstream no-push (push)
46-
```
47-
3) `git fetch upstream`
48-
4) `git merge upstream/main --allow-unrelated-histories`
49-
50-
4) Update the EVT submodule
51-
1) `git submodule update --init --recursive && git pull`
52-
2) `cd ./libs/EVT-core`
53-
3) `git merge origin/main`
54-
4) `cd ../..`
55-
5) Import the project into Read the Docs, following the steps on
56-
[the wiki](https://wiki.rit.edu/display/EVT/Documentation+and+Organization+Standards)
57-
6) Update all instances of BOARD_NAME to match your project name
58-
1) `CMakeLists.txt:28`
59-
2) Directory `./targets/BIKE_NAME-BOARD_NAME`
60-
3) `targets/BIKE_NAME-BOARD_NAME/CMakeLists.txt:3`
61-
4) `src/BOARD_NAME.cpp`
62-
5) `include/BOARD_NAME.hpp`
63-
6) `docs/Doxyfile:35`
64-
7) `docs/source/index.rst:6`
65-
8) `docs/source/api/index.rst:4,12,15`
66-
9) `README.md:56`
67-
7) Sample files are included in `./src` and `./include`. Once proper functionality has been
68-
confirmed, these files should be deleted. There are placeholders to demonstrate the board library
69-
building functionality.
70-
8) Everything in this README from this final step up should be deleted, leaving only the content
71-
below. When finished, all the changes should be committed and pushed to the setup branch, and a PR
72-
should be created to merge into main.
73-
741
# REV3-LVSS
752

763
## Introduction
77-
78-
*One-paragraph summary of the board and its purpose on the bike*
4+
The Low Voltage Sub-System (LVSS) is a board designed to receive CANopen messages from the Vehicle Control Unit (VCU), indicating which boards on the bike needs to be turned on or off. The LVSS will include an STM32F446RE that works with a DCM4623TD2K13E0T70 Vicor DCM Power Module to take the battery pack voltage and step it down to multiple 12-volt signals. Utilizing the TPS2HB35BQ high-side power switches, a state machine will be able to send out the 12-volt signals to each individual board. The power switches can sense the current, temperature, and fault status and use these values to ensure the health of the LVSS.
5+
LVSS Node ID = 1
-284 KB
Binary file not shown.

0 commit comments

Comments
 (0)