Skip to content
Merged

V2.2 #10

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
226774e
Fix Makefile errors
PharosMarcusB Jun 18, 2025
0f224d0
Add VSCode build tasks
PharosMarcusB Jun 18, 2025
3555051
Fix lib-rdm debug build
PharosMarcusB Jun 18, 2025
6a0a4a5
Remove redundant header
PharosMarcusB Jun 20, 2025
debaa4c
Merge pull request #6 from PharosMarcusB/pharos_development
vanvught Jun 23, 2025
f28b327
Improve DMX RX
PharosMarcusB Jun 20, 2025
f5c08f5
Merge pull request #7 from PharosMarcusB/dmx_rx
vanvught Jun 23, 2025
9eb6adc
Set the device model ID by define
PharosMarcusB Jun 23, 2025
f4a6702
Allow GD32_BOARD_NAME to be set by Makefile
PharosMarcusB Jun 23, 2025
499e217
Merge pull request #8 from PharosMarcusB/model_id
vanvught Jun 23, 2025
9daff99
Merge with Arjan's local development
vanvught Jul 5, 2025
3a5f110
Applying Google C++ Style Guide
vanvught Jul 16, 2025
c18da38
Restructure and migrate network, properties, and params
vanvught Nov 12, 2025
7a33344
Use GCC MD/MP flags to Track Dependencies
docsteer Nov 14, 2025
8e2717f
Merge pull request #9 from docsteer/makefile_dependencies
vanvught Nov 14, 2025
8b68e9f
Applying Google C++ Style Guide
vanvught Nov 15, 2025
710967e
Fixed newline in puts
vanvught Nov 16, 2025
73efb8d
Removed DMX configuration from lib-dmx
vanvught Nov 21, 2025
033c33a
Moved hardfault_handler.c to hardfault_handler.cpp
vanvught Nov 21, 2025
730cff7
Applying Google C++ Style Guide
vanvught Nov 21, 2025
57d7d78
Applying Google C++ Style Guide
vanvught Nov 21, 2025
c0b76ca
Add include guards to header files and update Makefiles
vanvught Dec 4, 2025
36c6eae
Refactor include guards and move debug utilities to headers
vanvught Dec 5, 2025
0eff9f8
Refactor PixelDmx to use PixelOutputType by value
vanvught Dec 7, 2025
e1df2f4
Refactor and clean up GD32 library structure and code
vanvught Dec 13, 2025
9b020df
Refactor debug macros to use function-style and update calls
vanvught Dec 14, 2025
30749bd
Fix missing parentheses in DEBUG_ENTRY and DEBUG_EXIT calls
vanvught Dec 14, 2025
11f9adf
Refactor debug header and update includes
vanvught Dec 15, 2025
25d3cf5
Refactor HwClock and logic_analyzer, fix snprintf/printf
vanvught Dec 17, 2025
c002c8d
Refactor RTC handling and update logic analyzer pins
vanvught Dec 24, 2025
8ffe40e
Refactor RDM device handling and unify device info
vanvught Dec 27, 2025
f7369a3
Update network includes and minor code improvements
vanvught Dec 27, 2025
6290e42
Update gen_compile_commands.sh
vanvught Dec 29, 2025
0d89708
Update software_version.h
vanvught Jan 3, 2026
7b468f4
Delete handleroled.h
vanvught Jan 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 29 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BasedOnStyle: Google
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 240

PointerAlignment: Left
ReferenceAlignment: Left

AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false

AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true

BreakBeforeBraces: Allman

DerivePointerAlignment: false

SpacesBeforeTrailingComments: 1

SortIncludes: false
IncludeBlocks: Preserve

Cpp11BracedListStyle: true

AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: MultiLine
82 changes: 82 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Checks: >
google-*,
readability-identifier-naming,
modernize-redundant-void-arg,
modernize-concat-nested-namespaces,
modernize-use-nullptr,
modernize-use-default-member-init,
modernize-use-override,
-google-runtime-references,
-clang-analyzer-*,
-misc-unused-include

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase

- key: readability-identifier-naming.StructCase
value: CamelCase

- key: readability-identifier-naming.FunctionCase
value: CamelCase

- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: 'true'

- key: readability-identifier-naming.IgnoreOverrideFunctions
value: 'true'

- key: readability-identifier-naming.FunctionIgnoredRegexp
value: '^([A-Za-z0-9_]+_(IRQHandler|Handler))$'

- key: readability-identifier-naming.VariableCase
value: lower_case

- key: readability-identifier-naming.ParameterCase
value: lower_case

- key: readability-identifier-naming.PrivateMemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberSuffix
value: _

- key: readability-identifier-naming.PublicMemberCase
value: lower_case

- key: readability-identifier-naming.ConstantCase
value: CamelCase
- key: readability-identifier-naming.ConstantPrefix
value: k

- key: readability-identifier-naming.GlobalConstantCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantPrefix
value: k

- key: readability-identifier-naming.LocalConstantCase
value: CamelCase
- key: readability-identifier-naming.LocalConstantPrefix
value: k

- key: readability-identifier-naming.EnumCase
value: CamelCase

- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: k

- key: readability-identifier-naming.EnumConstantMemberCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantMemberPrefix
value: k

- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE

- key: readability-identifier-naming.TreatAsConstant
value: 'constexpr'

WarningsAsErrors: ''
HeaderFilterRegex: '.*'
FormatStyle: none
7 changes: 7 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CompileFlags:
CompilationDatabase: .

Diagnostics:
ClangTidy:
Add: []

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ Artnet*.*
do-tftp.sh
udp_send

/lib-pixel/jbc
/.cache
compile_commands.json
47 changes: 47 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build RDM Responder",
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"command": "make -f Makefile.GD32",
"options": {
"cwd": "${workspaceFolder}/gd32_rdm_responder/"
}
},
{
"label": "Clean RDM Responder",
"type": "shell",
"command": "make -f Makefile.GD32 clean",
"options": {
"cwd": "${workspaceFolder}/gd32_rdm_responder/"
}
},
{
"label": "Build DMX USB PRO",
"type": "shell",
"group": {
"kind": "build"
},
"command": "make -f Makefile.GD32",
"options": {
"cwd": "${workspaceFolder}/gd32_dmx_usb_pro/"
}
},
{
"label": "Clean DMX USB PRO",
"type": "shell",
"group": {
"kind": "build"
},
"command": "make -f Makefile.GD32 clean",
"options": {
"cwd": "${workspaceFolder}/gd32_dmx_usb_pro/"
}
}
]
}
149 changes: 149 additions & 0 deletions common/.cproject

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib-network/.project → common/.project
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>lib-network</name>
<name>common</name>
<comment></comment>
<projects>
</projects>
Expand Down
10 changes: 5 additions & 5 deletions lib-lightset/.settings/language.settings.xml → common/.settings/language.settings.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.563973127.940842621" name="GD32">
<configuration id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.306944287" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<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">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<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">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<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"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @file ieee.h
* @file utils_array.h
*
*/
/* Copyright (C) 2024 by Arjan van Vught mailto:info@gd32-dmx.org
/* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,15 +23,17 @@
* THE SOFTWARE.
*/

#ifndef NET_PROTOCOL_IEEE_H_
#define NET_PROTOCOL_IEEE_H_
#ifndef COMMON_UTILS_UTILS_ARRAY_H_
#define COMMON_UTILS_UTILS_ARRAY_H_

#include <cstdint>
#include <cstddef>

enum ETHER_TYPE {
ETHER_TYPE_IPv4 = 0x0800,
ETHER_TYPE_ARP = 0x0806,
ETHER_TYPE_PTP = 0x88F7 /* IEEE1588v2 (PTPv2) over Ethernet */
};
namespace common
{
template <typename T, size_t N> constexpr size_t ArraySize(const T (&)[N]) noexcept
{
return N;
}
} // namespace common

#endif /* NET_PROTOCOL_IEEE_H_ */
#endif // COMMON_UTILS_UTILS_ARRAY_H_
44 changes: 19 additions & 25 deletions lib-gd32/src/uart0.cpp → common/include/common/utils/utils_enum.h
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @file uart0.cpp
* @file utils_enum.h
*
*/
/* Copyright (C) 2023-2024 by Arjan van Vught mailto:info@gd32-dmx.org
/* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,32 +23,26 @@
* THE SOFTWARE.
*/

#include <cstdarg>
#include <cstdio>
#ifndef COMMON_UTILS_UTILS_ENUM_H_
#define COMMON_UTILS_UTILS_ENUM_H_

static char s_buffer[128];
#include <type_traits>

extern "C" {
void uart0_putc(int);
namespace common
{

int uart0_printf(const char *fmt, ...) {
va_list arp;

va_start(arp, fmt);

int i = vsnprintf(s_buffer, sizeof(s_buffer) - 1, fmt, arp);

va_end(arp);
/// Converts an enum class value to its underlying integer type.
template <typename Enum>
inline auto ToValue(Enum e) noexcept {
return static_cast<std::underlying_type_t<Enum>>(e);
}

char *s = s_buffer;
/// Converts an integer value to the corresponding enum class value.
template <typename Enum>
inline Enum FromValue(std::underlying_type_t<Enum> value) noexcept {
return static_cast<Enum>(value);
}

while (*s != '\0') {
if (*s == '\n') {
uart0_putc('\r');
}
uart0_putc(*s++);
}
} // namespace common

return i;
}
}
#endif // COMMON_UTILS_UTILS_ENUM_H_
Loading