Skip to content

Commit d65c638

Browse files
authored
Merge pull request #10 from vanvught/development
V2.2
2 parents eef7367 + 7b468f4 commit d65c638

654 files changed

Lines changed: 38943 additions & 36260 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BasedOnStyle: Google
2+
IndentWidth: 4
3+
TabWidth: 4
4+
UseTab: Never
5+
ColumnLimit: 240
6+
7+
PointerAlignment: Left
8+
ReferenceAlignment: Left
9+
10+
AlignConsecutiveAssignments: false
11+
AlignConsecutiveDeclarations: false
12+
13+
AllowShortFunctionsOnASingleLine: Inline
14+
AllowShortIfStatementsOnASingleLine: true
15+
AllowShortLoopsOnASingleLine: true
16+
17+
BreakBeforeBraces: Allman
18+
19+
DerivePointerAlignment: false
20+
21+
SpacesBeforeTrailingComments: 1
22+
23+
SortIncludes: false
24+
IncludeBlocks: Preserve
25+
26+
Cpp11BracedListStyle: true
27+
28+
AlwaysBreakAfterReturnType: None
29+
AlwaysBreakTemplateDeclarations: MultiLine

.clang-tidy

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Checks: >
2+
google-*,
3+
readability-identifier-naming,
4+
modernize-redundant-void-arg,
5+
modernize-concat-nested-namespaces,
6+
modernize-use-nullptr,
7+
modernize-use-default-member-init,
8+
modernize-use-override,
9+
-google-runtime-references,
10+
-clang-analyzer-*,
11+
-misc-unused-include
12+
13+
CheckOptions:
14+
- key: readability-identifier-naming.ClassCase
15+
value: CamelCase
16+
17+
- key: readability-identifier-naming.StructCase
18+
value: CamelCase
19+
20+
- key: readability-identifier-naming.FunctionCase
21+
value: CamelCase
22+
23+
- key: readability-identifier-naming.IgnoreMainLikeFunctions
24+
value: 'true'
25+
26+
- key: readability-identifier-naming.IgnoreOverrideFunctions
27+
value: 'true'
28+
29+
- key: readability-identifier-naming.FunctionIgnoredRegexp
30+
value: '^([A-Za-z0-9_]+_(IRQHandler|Handler))$'
31+
32+
- key: readability-identifier-naming.VariableCase
33+
value: lower_case
34+
35+
- key: readability-identifier-naming.ParameterCase
36+
value: lower_case
37+
38+
- key: readability-identifier-naming.PrivateMemberCase
39+
value: lower_case
40+
- key: readability-identifier-naming.PrivateMemberSuffix
41+
value: _
42+
43+
- key: readability-identifier-naming.PublicMemberCase
44+
value: lower_case
45+
46+
- key: readability-identifier-naming.ConstantCase
47+
value: CamelCase
48+
- key: readability-identifier-naming.ConstantPrefix
49+
value: k
50+
51+
- key: readability-identifier-naming.GlobalConstantCase
52+
value: CamelCase
53+
- key: readability-identifier-naming.GlobalConstantPrefix
54+
value: k
55+
56+
- key: readability-identifier-naming.LocalConstantCase
57+
value: CamelCase
58+
- key: readability-identifier-naming.LocalConstantPrefix
59+
value: k
60+
61+
- key: readability-identifier-naming.EnumCase
62+
value: CamelCase
63+
64+
- key: readability-identifier-naming.EnumConstantCase
65+
value: CamelCase
66+
- key: readability-identifier-naming.EnumConstantPrefix
67+
value: k
68+
69+
- key: readability-identifier-naming.EnumConstantMemberCase
70+
value: CamelCase
71+
- key: readability-identifier-naming.EnumConstantMemberPrefix
72+
value: k
73+
74+
- key: readability-identifier-naming.MacroDefinitionCase
75+
value: UPPER_CASE
76+
77+
- key: readability-identifier-naming.TreatAsConstant
78+
value: 'constexpr'
79+
80+
WarningsAsErrors: ''
81+
HeaderFilterRegex: '.*'
82+
FormatStyle: none

.clangd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CompileFlags:
2+
CompilationDatabase: .
3+
4+
Diagnostics:
5+
ClangTidy:
6+
Add: []
7+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ Artnet*.*
7777
do-tftp.sh
7878
udp_send
7979

80+
/lib-pixel/jbc
81+
/.cache
82+
compile_commands.json

.vscode/tasks.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Build RDM Responder",
6+
"type": "shell",
7+
"group": {
8+
"kind": "build",
9+
"isDefault": true
10+
},
11+
"command": "make -f Makefile.GD32",
12+
"options": {
13+
"cwd": "${workspaceFolder}/gd32_rdm_responder/"
14+
}
15+
},
16+
{
17+
"label": "Clean RDM Responder",
18+
"type": "shell",
19+
"command": "make -f Makefile.GD32 clean",
20+
"options": {
21+
"cwd": "${workspaceFolder}/gd32_rdm_responder/"
22+
}
23+
},
24+
{
25+
"label": "Build DMX USB PRO",
26+
"type": "shell",
27+
"group": {
28+
"kind": "build"
29+
},
30+
"command": "make -f Makefile.GD32",
31+
"options": {
32+
"cwd": "${workspaceFolder}/gd32_dmx_usb_pro/"
33+
}
34+
},
35+
{
36+
"label": "Clean DMX USB PRO",
37+
"type": "shell",
38+
"group": {
39+
"kind": "build"
40+
},
41+
"command": "make -f Makefile.GD32 clean",
42+
"options": {
43+
"cwd": "${workspaceFolder}/gd32_dmx_usb_pro/"
44+
}
45+
}
46+
]
47+
}

common/.cproject

Lines changed: 149 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>lib-network</name>
3+
<name>common</name>
44
<comment></comment>
55
<projects>
66
</projects>

lib-lightset/.settings/language.settings.xml renamed to common/.settings/language.settings.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<project>
3-
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.563973127.940842621" name="GD32">
3+
<configuration id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.306944287" name="Default">
44
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
5-
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="655785089244954434" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
5+
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
6+
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
7+
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
8+
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="225383767331422835" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
69
<language-scope id="org.eclipse.cdt.core.gcc"/>
710
<language-scope id="org.eclipse.cdt.core.g++"/>
811
</provider>
9-
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
10-
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
11-
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
1212
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
1313
</extension>
1414
</configuration>
File renamed without changes.
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @file ieee.h
2+
* @file utils_array.h
33
*
44
*/
5-
/* Copyright (C) 2024 by Arjan van Vught mailto:info@gd32-dmx.org
5+
/* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -23,15 +23,17 @@
2323
* THE SOFTWARE.
2424
*/
2525

26-
#ifndef NET_PROTOCOL_IEEE_H_
27-
#define NET_PROTOCOL_IEEE_H_
26+
#ifndef COMMON_UTILS_UTILS_ARRAY_H_
27+
#define COMMON_UTILS_UTILS_ARRAY_H_
2828

29-
#include <cstdint>
29+
#include <cstddef>
3030

31-
enum ETHER_TYPE {
32-
ETHER_TYPE_IPv4 = 0x0800,
33-
ETHER_TYPE_ARP = 0x0806,
34-
ETHER_TYPE_PTP = 0x88F7 /* IEEE1588v2 (PTPv2) over Ethernet */
35-
};
31+
namespace common
32+
{
33+
template <typename T, size_t N> constexpr size_t ArraySize(const T (&)[N]) noexcept
34+
{
35+
return N;
36+
}
37+
} // namespace common
3638

37-
#endif /* NET_PROTOCOL_IEEE_H_ */
39+
#endif // COMMON_UTILS_UTILS_ARRAY_H_

0 commit comments

Comments
 (0)