Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1be3fb2
fix: warnings during compiletime.
Vavat Sep 5, 2020
75aed92
fix: remove generated files from the repository.
Vavat Sep 5, 2020
72bae33
feature: add gitignore to automatically ignore generated files.
Vavat Sep 5, 2020
c58ff7b
fix: add settings to ignored folders
Vavat Sep 5, 2020
f4fc946
fix: code style clean up. Need linter.
Vavat Sep 5, 2020
9f07e08
fix: run code style
Vavat Sep 5, 2020
4b77869
fix: remove entire Debug folder from repo.
Vavat Sep 6, 2020
b322000
fix: reformat all custom source code. No code style changes.
Vavat Sep 6, 2020
e8d9d57
docs: add sections on coding style and code formatting.
Vavat Sep 6, 2020
fb541fc
comment: mark potential bug.
Vavat Sep 6, 2020
d7458c3
fix: minor correction.
Vavat Sep 6, 2020
1c749b3
feature: rather aggressive style reformat using clang-formatter.
Vavat Sep 6, 2020
de51b31
feature: add clang-format rules file to ensure consistent formatting …
Vavat Sep 6, 2020
02cd931
add comments to questionable areas of code.
Vavat Sep 6, 2020
0249dda
docs: add code style definitions
Vavat Sep 7, 2020
537979c
code-style: increase tab size to 4
Vavat Sep 7, 2020
2a8d0cc
code-style: increase tab size to 4.
Vavat Sep 7, 2020
0cdbafb
docs: add notes on cppstyle extension.
Vavat Sep 7, 2020
c9e66ab
Merge branch 'feature/srm_clant-format_radical_edits' into feature/sr…
Vavat Sep 7, 2020
a5c4d5a
feature: add tracealyzer source code to the project.
Vavat Sep 7, 2020
5232e83
feature: integrate tracealyzer with codebase in snapshot mode.
Vavat Sep 7, 2020
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
168 changes: 168 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
- Regex: '^<.*'
Priority: 2
SortPriority: 0
- Regex: '.*'
Priority: 3
SortPriority: 0
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Auto
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
...

84 changes: 44 additions & 40 deletions .cproject

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Debug/
Release/
.settings/
27 changes: 0 additions & 27 deletions .settings/language.settings.xml

This file was deleted.

6 changes: 5 additions & 1 deletion Core/Inc/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,14 @@ standard names. */
/* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick,
to prevent overwriting SysTick_Handler defined within STM32Cube HAL */

#define xPortSysTickHandler SysTick_Handler
//#define xPortSysTickHandler SysTick_Handler

/* USER CODE BEGIN Defines */
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
/* USER CODE END Defines */

#if (configUSE_TRACE_FACILITY == 1)
#include "trcRecorder.h"
#endif

#endif /* FREERTOS_CONFIG_H */
67 changes: 31 additions & 36 deletions Core/Inc/MESCBLDC.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
**
******************************************************************************
* @file : MESCBLDC.h
* @brief : BLDC running code
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2020 David Molony.
* All rights reserved.</center></h2>
*
* This software component is licensed under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
**
******************************************************************************
* @file : MESCBLDC.h
* @brief : BLDC running code
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2020 David Molony.
* All rights reserved.</center></h2>
*
* This software component is licensed under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************

* MESCBLDC.h
*
Expand All @@ -23,37 +23,32 @@
*/
#include "stm32f3xx_hal.h"


#ifndef INC_MESCBLDC_H_
#define INC_MESCBLDC_H_


#endif /* INC_MESCBLDC_H_ */

typedef struct
{
float ReqCurrent;
int BLDCduty;
int BLDCEstate;
int CurrentChannel;
float currentCurrent;
int pGain;
int iGain;
}MESCBLDCVars_s;
typedef struct {
float ReqCurrent;
int BLDCduty;
int BLDCEstate;
int CurrentChannel;
float currentCurrent;
int pGain;
int iGain;
} MESCBLDCVars_s;

MESCBLDCVars_s BLDCVars;

typedef enum
{
BLDC_FORWARDS=1,
BLDC_BACKWARDS=2,
BLDC_IDLE=3,
BLDC_BRAKE=4
}MESCBLDCState_e;
typedef enum {
BLDC_FORWARDS = 1,
BLDC_BACKWARDS = 2,
BLDC_IDLE = 3,
BLDC_BRAKE = 4
} MESCBLDCState_e;

MESCBLDCState_e BLDCState;


/* Function prototypes -----------------------------------------------*/
void BLDCInit();
void BLDCCommuteHall();
Expand Down
Loading