Skip to content

Commit d91938a

Browse files
authored
Initial commit
0 parents  commit d91938a

File tree

7 files changed

+428
-0
lines changed

7 files changed

+428
-0
lines changed

.clang-format

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
AccessModifierOffset: -4
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: true
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: Custom
46+
BreakBeforeInheritanceComma: false
47+
BreakInheritanceList: BeforeColon
48+
BreakBeforeTernaryOperators: true
49+
BreakConstructorInitializersBeforeComma: false
50+
BreakConstructorInitializers: BeforeColon
51+
BreakAfterJavaFieldAnnotations: false
52+
BreakStringLiterals: true
53+
ColumnLimit: 120
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+
...

.github/ISSUE_TEMPLATE/bug-report.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Source:
2+
# https://github.com/Tinyu-Zhao/M5-Depends/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml
3+
# See:
4+
# https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
5+
6+
name: Bug report
7+
description: Report a problem with the code in this repository.
8+
labels:
9+
- "type: bug"
10+
body:
11+
- type: markdown
12+
attributes:
13+
value: "Thank you for opening an issue on an M5Stack Arduino library repository.\n\
14+
To improve the speed of resolution please review the following guidelines and common troubleshooting steps below before creating the issue:\n\
15+
If you have any UIFLOW questions you can ask in the [special board](https://community.m5stack.com/category/5/uiflow), there will be many enthusiastic friends to help you.\n\
16+
Do not use GitHub issues for troubleshooting projects and issues. Instead use the forums at https://community.m5stack.com to ask questions and troubleshoot why something isn't working as expected. In many cases the problem is a common issue that you will more quickly receive help from the forum community. GitHub issues are meant for known defects in the code. If you don't know if there is a defect in the code then start with troubleshooting on the forum first."
17+
- type: textarea
18+
id: description
19+
attributes:
20+
label: Describe the bug
21+
description: A clear and concise description of what the bug is.
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: reproduce
26+
attributes:
27+
label: To reproduce
28+
description: Provide the specific set of steps we can follow to reproduce the problem.
29+
placeholder: |
30+
1. In this environment...
31+
2. With this config...
32+
3. Run '...'
33+
4. See error...
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: expected
38+
attributes:
39+
label: Expected behavior
40+
description: What would you expect to happen after following those instructions?
41+
validations:
42+
required: true
43+
- type: textarea
44+
id: screenshots
45+
attributes:
46+
label: Screenshots
47+
description: If applicable, add screenshots to help explain your problem.
48+
validations:
49+
required: false
50+
- type: textarea
51+
id: information
52+
attributes:
53+
label: Environment
54+
description: |
55+
If applicable, add screenshots to help explain your problem.
56+
examples:
57+
- **OS**: Ubuntu 20.04
58+
- **IDE & IDE Version**: Arduino 1.8.19 Or Platform IO v2.5.0
59+
- **Repository Version**: 0.4.0
60+
value: |
61+
- OS:
62+
- IDE &IDE Version:
63+
- Repository Version:
64+
validations:
65+
required: false
66+
- type: textarea
67+
id: additional
68+
attributes:
69+
label: Additional context
70+
description: Add any additional information here.
71+
validations:
72+
required: false
73+
- type: checkboxes
74+
id: checklist
75+
attributes:
76+
label: Issue checklist
77+
description: Please double-check that you have done each of the following things before submitting the issue.
78+
options:
79+
- label: I searched for previous reports in [the issue tracker](https://github.com/m5stack/M5Stack/issues?q=)
80+
required: true
81+
- label: My report contains all necessary details
82+
required: true
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Arduino Lint Check
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
jobs:
8+
lint:
9+
name: Lint Check
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: arduino/arduino-lint-action@v1
14+
with:
15+
library-manager: update
16+
compliance: strict
17+
project-type: all
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: clang-format Check
2+
3+
env:
4+
INCLUDE_REGEX: ^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$))|(inl|ino|pde|proto|cu))$
5+
6+
on:
7+
push:
8+
tags-ignore:
9+
- '*.*.*'
10+
- 'v*.*.*'
11+
branches:
12+
- '*'
13+
paths:
14+
- '*'
15+
- '**.ino'
16+
- '**.cpp'
17+
- '**.hpp'
18+
- '**.h'
19+
- '**.c'
20+
- '**.inl'
21+
- '**clang-format-check.yml'
22+
- '**.clang-format'
23+
pull_request:
24+
paths:
25+
- '**.ino'
26+
- '**.cpp'
27+
- '**.hpp'
28+
- '**.h'
29+
- '**.c'
30+
- '**.inl'
31+
- '**clang-format-check.yml'
32+
- '**.clang-format'
33+
workflow_dispatch:
34+
35+
jobs:
36+
formatting-check:
37+
name: Formatting Check
38+
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
path:
42+
- check: './' # path to include
43+
exclude: '' # path to exclude
44+
#- check: 'src'
45+
# exclude: '(Fonts)' # Exclude file paths containing "Fonts"
46+
#- check: 'examples'
47+
# exclude: ''
48+
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
with:
53+
ref: ${{ github.event.pull_request.head.sha }}
54+
55+
- name: Run clang-format style check for C/C++/Protobuf programs.
56+
uses: jidicula/[email protected] # Using include-regex 10.x or later
57+
with:
58+
clang-format-version: '13'
59+
check-path: ${{ matrix.path['check'] }}
60+
exclude-regex: ${{ matrix.path['exclude'] }}
61+
include-regex: ${{ env.INCLUDE_REGEX }}

.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 M5Stack Technology CO LTD
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)