Skip to content

Commit 1233e33

Browse files
committed
Adding missing documents and Format code
1 parent 78d2a99 commit 1233e33

File tree

101 files changed

+33218
-27380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+33218
-27380
lines changed

.clang-format

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
AccessModifierOffset: -1
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: true
7+
AlignConsecutiveAssignments: true
8+
AlignConsecutiveDeclarations: false
9+
AlignEscapedNewlines: Left
10+
AlignOperands: true
11+
AlignTrailingComments: true
12+
AllowAllArgumentsOnNextLine: true
13+
AllowAllConstructorInitializersOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: Never
16+
AllowShortCaseLabelsOnASingleLine: false
17+
AllowShortFunctionsOnASingleLine: false
18+
AllowShortLambdasOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: WithoutElse
20+
AllowShortLoopsOnASingleLine: true
21+
AlwaysBreakAfterDefinitionReturnType: None
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: true
24+
AlwaysBreakTemplateDeclarations: Yes
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BraceWrapping:
28+
AfterCaseLabel: false
29+
AfterClass: false
30+
AfterControlStatement: false
31+
AfterEnum: false
32+
AfterFunction: false
33+
AfterNamespace: false
34+
AfterObjCDeclaration: false
35+
AfterStruct: false
36+
AfterUnion: false
37+
AfterExternBlock: false
38+
BeforeCatch: false
39+
BeforeElse: false
40+
IndentBraces: false
41+
SplitEmptyFunction: true
42+
SplitEmptyRecord: true
43+
SplitEmptyNamespace: true
44+
BreakBeforeBinaryOperators: None
45+
BreakBeforeBraces: Attach
46+
BreakBeforeInheritanceComma: false
47+
BreakInheritanceList: BeforeColon
48+
BreakBeforeTernaryOperators: true
49+
BreakConstructorInitializersBeforeComma: false
50+
BreakConstructorInitializers: BeforeColon
51+
BreakAfterJavaFieldAnnotations: false
52+
BreakStringLiterals: true
53+
ColumnLimit: 80
54+
CommentPragmas: '^ IWYU pragma:'
55+
CompactNamespaces: false
56+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
57+
ConstructorInitializerIndentWidth: 4
58+
ContinuationIndentWidth: 4
59+
Cpp11BracedListStyle: true
60+
DeriveLineEnding: true
61+
DerivePointerAlignment: true
62+
DisableFormat: false
63+
ExperimentalAutoDetectBinPacking: false
64+
FixNamespaceComments: true
65+
ForEachMacros:
66+
- foreach
67+
- Q_FOREACH
68+
- BOOST_FOREACH
69+
IncludeBlocks: Regroup
70+
IncludeCategories:
71+
- Regex: '^<ext/.*\.h>'
72+
Priority: 2
73+
SortPriority: 0
74+
- Regex: '^<.*\.h>'
75+
Priority: 1
76+
SortPriority: 0
77+
- Regex: '^<.*'
78+
Priority: 2
79+
SortPriority: 0
80+
- Regex: '.*'
81+
Priority: 3
82+
SortPriority: 0
83+
IncludeIsMainRegex: '([-_](test|unittest))?$'
84+
IncludeIsMainSourceRegex: ''
85+
IndentCaseLabels: true
86+
IndentGotoLabels: true
87+
IndentPPDirectives: None
88+
IndentWidth: 4
89+
IndentWrappedFunctionNames: false
90+
JavaScriptQuotes: Leave
91+
JavaScriptWrapImports: true
92+
KeepEmptyLinesAtTheStartOfBlocks: false
93+
MacroBlockBegin: ''
94+
MacroBlockEnd: ''
95+
MaxEmptyLinesToKeep: 1
96+
NamespaceIndentation: None
97+
ObjCBinPackProtocolList: Never
98+
ObjCBlockIndentWidth: 2
99+
ObjCSpaceAfterProperty: false
100+
ObjCSpaceBeforeProtocolList: true
101+
PenaltyBreakAssignment: 2
102+
PenaltyBreakBeforeFirstCallParameter: 1
103+
PenaltyBreakComment: 300
104+
PenaltyBreakFirstLessLess: 120
105+
PenaltyBreakString: 1000
106+
PenaltyBreakTemplateDeclaration: 10
107+
PenaltyExcessCharacter: 1000000
108+
PenaltyReturnTypeOnItsOwnLine: 200
109+
PointerAlignment: Left
110+
RawStringFormats:
111+
- Language: Cpp
112+
Delimiters:
113+
- cc
114+
- CC
115+
- cpp
116+
- Cpp
117+
- CPP
118+
- 'c++'
119+
- 'C++'
120+
CanonicalDelimiter: ''
121+
BasedOnStyle: google
122+
- Language: TextProto
123+
Delimiters:
124+
- pb
125+
- PB
126+
- proto
127+
- PROTO
128+
EnclosingFunctions:
129+
- EqualsProto
130+
- EquivToProto
131+
- PARSE_PARTIAL_TEXT_PROTO
132+
- PARSE_TEST_PROTO
133+
- PARSE_TEXT_PROTO
134+
- ParseTextOrDie
135+
- ParseTextProtoOrDie
136+
CanonicalDelimiter: ''
137+
BasedOnStyle: google
138+
ReflowComments: true
139+
SortIncludes: false
140+
SortUsingDeclarations: true
141+
SpaceAfterCStyleCast: false
142+
SpaceAfterLogicalNot: false
143+
SpaceAfterTemplateKeyword: true
144+
SpaceBeforeAssignmentOperators: true
145+
SpaceBeforeCpp11BracedList: false
146+
SpaceBeforeCtorInitializerColon: true
147+
SpaceBeforeInheritanceColon: true
148+
SpaceBeforeParens: ControlStatements
149+
SpaceBeforeRangeBasedForLoopColon: true
150+
SpaceInEmptyBlock: false
151+
SpaceInEmptyParentheses: false
152+
SpacesBeforeTrailingComments: 2
153+
SpacesInAngles: false
154+
SpacesInConditionalStatement: false
155+
SpacesInContainerLiterals: true
156+
SpacesInCStyleCastParentheses: false
157+
SpacesInParentheses: false
158+
SpacesInSquareBrackets: false
159+
SpaceBeforeSquareBrackets: false
160+
Standard: Auto
161+
StatementMacros:
162+
- Q_UNUSED
163+
- QT_REQUIRE_VERSION
164+
TabWidth: 4
165+
UseCRLF: false
166+
UseTab: Never
167+
...
168+

.github/workflows/clang-format-check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ jobs:
88
matrix:
99
path:
1010
- check: './' # path to include
11-
exclude: '' # path to exclude
11+
exclude: '(utility|RFID|HEART)' # path to exclude
1212
# - check: 'src'
13-
# exclude: ''
13+
# exclude: '(Fonts)' # Exclude file paths containing "Fonts"
1414
# - check: 'examples'
1515
# exclude: ''
1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Run clang-format style check for C/C++/Protobuf programs.
19-
uses: jidicula/clang-format-action@v4.5.0
19+
uses: jidicula/clang-format-action@v4.8.0
2020
with:
2121
clang-format-version: '13'
2222
check-path: ${{ matrix.path['check'] }}
23-
exclude-regex: ${{ matrix.path['exclude'] }}
23+
exclude-regex: ${{ matrix.path['exclude'] }}

examples/Advanced/AXP192/BtnIrq/BtnIrq.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ static void clear_mpu6880IRQ() {
66
M5.Mpu6886.ClearAllIRQ();
77
}
88

9-
static void clear_200qIRQ() { M5.I2C.writeByte(0x6C, 0x13, 0xe0); }
9+
static void clear_200qIRQ() {
10+
M5.I2C.writeByte(0x6C, 0x13, 0xe0);
11+
}
1012

1113
void setup() {
1214
M5.begin();

examples/Advanced/AXP192/PowerWake/PowerWake.ino

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,24 @@ void setup() {
1313

1414
void loop() {
1515
loopTime = millis();
16-
if(startTime < (loopTime - 5000))
17-
{
18-
if(M5.Axp.GetWarningLevel())
19-
{
16+
if (startTime < (loopTime - 5000)) {
17+
if (M5.Axp.GetWarningLevel()) {
2018
sleep_count++;
2119
M5.Lcd.fillScreen(WHITE);
2220
M5.Lcd.setCursor(0, 20, 2);
2321
M5.Lcd.setTextColor(RED, WHITE);
2422
M5.Lcd.printf("Warning: low battery");
25-
//delay(3000);
26-
if(sleep_count >= 2)
27-
{
23+
// delay(3000);
24+
if (sleep_count >= 2) {
2825
sleep_count = 0;
2926
M5.Axp.SetSleep();
3027
}
31-
}
32-
else
33-
{
28+
} else {
3429
M5.Lcd.fillScreen(WHITE);
3530
}
3631
startTime = loopTime;
3732
}
38-
33+
3934
M5.Lcd.setCursor(0, 0, 1);
4035
M5.Lcd.setTextColor(BLACK, WHITE);
4136
M5.Lcd.printf("vbat:%.3fV\r\n", M5.Axp.GetBatVoltage());

examples/Advanced/AXP192/sleep/sleep.ino

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <M5StickC.h>
22

33
void setup() {
4-
// put your setup code here, to run once:
4+
// put your setup code here, to run once:
55
M5.begin();
66
M5.Lcd.setRotation(3);
77
M5.Lcd.fillScreen(BLACK);
@@ -12,17 +12,16 @@ void setup() {
1212
void loop() {
1313
M5.update();
1414

15-
if(M5.BtnA.wasPressed())
16-
{
15+
if (M5.BtnA.wasPressed()) {
1716
M5.Lcd.drawCentreString("Go light sleep (5s wakeup)", 80, 30, 1);
1817
delay(2000);
1918

20-
// close tft lcd
19+
// close tft lcd
2120
M5.Axp.SetLDO2(false);
2221
// 6MA
2322
M5.Axp.LightSleep(SLEEP_SEC(5));
2423
// open tft lcd
25-
M5.Axp.SetLDO2(true);
24+
M5.Axp.SetLDO2(true);
2625

2726
M5.Lcd.fillScreen(BLACK);
2827
M5.Lcd.drawCentreString("Week up from light sleep", 80, 30, 1);
@@ -38,8 +37,7 @@ void loop() {
3837
M5.Axp.DeepSleep(SLEEP_SEC(20));
3938
}
4039

41-
if(M5.BtnB.wasPressed())
42-
{
40+
if (M5.BtnB.wasPressed()) {
4341
// will close esp32, can`t wakeup by timer
4442
M5.Axp.PowerOff();
4543
}

0 commit comments

Comments
 (0)