Skip to content

Commit 3e8ee58

Browse files
committed
Refactor RDM device APIs
Large refactor introducing RDM discovery and stabilising device APIs. Added new RDM headers (rdm_device_base.h, rdm_device_info.h, rdm_discovery.h) and renamed the old rdmdiscovery to rdm_discovery_statemachine with namespace and constant updates. Reworked RDM device access to use rdm::device::Base/Info types and adjusted callers (UID/SN/label handling). Updated configuration store layout and API: replaced set_list fields with flags, added RdmDeviceCopyArray helper, and fixed array update signatures and sizes (label -> port_name). Renamed/moved utility and dmxnode symbols (dmxnode_utils -> common/utils/utils_port.h, kLabelNameLength -> kPortNameLength, GetShortName -> GetPortName, port label buffer sizes). Miscellaneous: bump copyright years, remove firmware version id from FirmwareVersion ctor, drop some hal constants, add timestamp define in Timestamp.mk, and various JSON and firmware callsite updates to match API changes.
1 parent 9c99340 commit 3e8ee58

36 files changed

Lines changed: 1247 additions & 784 deletions
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@
2323
* THE SOFTWARE.
2424
*/
2525

26-
#ifndef DMXNODE_UTILS_H_
27-
#define DMXNODE_UTILS_H_
26+
#ifndef COMMON_UTILS_UTILS_PORT_H_
27+
#define COMMON_UTILS_UTILS_PORT_H_
2828

2929
#include <cstdint>
3030

31-
namespace json
31+
namespace common
3232
{
33-
template <class S> static void PortSet(uint32_t port_index, S s, uint16_t& n)
33+
template <class S> void PortSet(uint32_t port_index, S s, uint16_t& n)
3434
{
3535
uint16_t value = n; // Create a local copy
3636
value &= static_cast<uint16_t>(~(0x3 << (port_index * 2)));
3737
value |= static_cast<uint16_t>((static_cast<uint32_t>(s) & 0x3) << (port_index * 2));
3838
n = value; // Write back to the original field
3939
}
4040

41-
template <class S> static S PortGet(uint32_t port_index, uint16_t n)
41+
template <class S> S PortGet(uint32_t port_index, uint16_t n)
4242
{
4343
return static_cast<S>((n >> (port_index * 2)) & 0x3);
4444
}
45-
} // namespace json
45+
} // namespace common
4646

47-
#endif // DMXNODE_UTILS_H_
47+
#endif // COMMON_UTILS_UTILS_PORT_H_

common/make/Timestamp.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ $(info "Timestamp.mk")
22

33
ifneq ($(findstring _TIME_STAMP_YEAR_,$(DEFINES)), _TIME_STAMP_YEAR_)
44
DEFINES += \
5-
-D_TIME_STAMP_YEAR_=$(shell date +"%Y") \
5+
-D_TIME_STAMP_=$(shell date "+%s") \
6+
-D_TIME_STAMP_YEAR_=$(shell date +"%Y") \
67
-D_TIME_STAMP_MONTH_=$(shell date +"%m" | sed 's/^0*//') \
78
-D_TIME_STAMP_DAY_=$(shell date +"%d" | sed 's/^0*//')
89
endif

gd32_dmx_usb_pro/firmware/main.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file main.cpp
33
*
44
*/
5-
/* Copyright (C) 2021-2025 by Arjan van Vught mailto:info@gd32-dmx.org
5+
/* Copyright (C) 2021-2026 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
@@ -46,7 +46,7 @@ static constexpr char kWidgetModeNames[4][12] ALIGNED =
4646
"RDM_SNIFFER"
4747
};
4848

49-
static constexpr rdm::DeviceInfoData kDeviceLabel ALIGNED =
49+
static constexpr rdm::device::InfoData kDeviceLabel ALIGNED =
5050
{
5151
const_cast<char*>("GD32F103RC DMX USB Pro"),
5252
22
@@ -64,20 +64,19 @@ int main() // NOLINT
6464
widget_params.Load();
6565
widget_params.Set();
6666

67-
auto& rdm_device = RdmDevice::Get();
67+
auto& rdm_device = rdm::device::Device::Instance();
6868
rdm_device.SetLabel(&kDeviceLabel);
69-
rdm_device.Init();
7069

71-
const auto* rdm_device_uid = rdm_device.GetUID();
72-
struct rdm::DeviceInfoData rdm_device_label;
73-
rdm_device.GetLabel(&rdm_device_label);
70+
const auto* uid = rdm::device::Base::Instance().GetUID();
71+
struct rdm::device::InfoData label;
72+
rdm_device.GetLabel(&label);
7473
const auto kWidgetMode = widget_params.GetMode();
7574

7675
uint8_t hw_text_length;
7776
printf("[V%s] %s Compiled on %s at %s\n", SOFTWARE_VERSION, hal::BoardName(hw_text_length), __DATE__, __TIME__);
7877
printf("RDM Controller with USB [Compatible with Enttec USB Pro protocol], Widget mode : %d (%s)\n", kWidgetMode, kWidgetModeNames[static_cast<uint32_t>(kWidgetMode)]);
79-
printf("Device UUID : %.2x%.2x:%.2x%.2x%.2x%.2x, ", rdm_device_uid[0], rdm_device_uid[1], rdm_device_uid[2], rdm_device_uid[3], rdm_device_uid[4], rdm_device_uid[5]);
80-
printf("Label : %.*s\n", static_cast<int>(rdm_device_label.length), reinterpret_cast<const char*>(rdm_device_label.data));
78+
printf("Device UUID : %.2x%.2x:%.2x%.2x%.2x%.2x, ", uid[0], uid[1], uid[2], uid[3], uid[4], uid[5]);
79+
printf("Label : %.*s\n", static_cast<int>(label.length), reinterpret_cast<const char*>(label.data));
8180

8281
hal::WatchdogInit();
8382

gd32_rdm_responder/Common.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
DEFINES+=CONFIG_RDM_ENABLE_SELF_TEST
22
DEFINES+=CONFIG_RDM_ENABLE_MANUFACTURER_PIDS
33

4+
DEFINES+=RDM_DEVICE_PRODUCT_CATEGORY=E120_PRODUCT_CATEGORY_FIXTURE
5+
DEFINES+=RDM_DEVICE_PRODUCT_DETAIL=E120_PRODUCT_DETAIL_LED
6+
47
DEFINES+=CONFIG_DMXNODE_PIXEL_MAX_PORTS=1
58
DEFINES+=OUTPUT_DMX_PIXEL
69

gd32_rdm_responder/firmware/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ int main() // NOLINT
8181

8282
PixelDmxParamsRdm pixeldmx_paramsrdm;
8383

84-
auto& rdm_device = RdmDevice::Get();
85-
rdm_device.SetProductCategory(E120_PRODUCT_CATEGORY_FIXTURE);
86-
rdm_device.SetProductDetail(E120_PRODUCT_DETAIL_LED);
87-
8884
#if defined(CONFIG_RDM_MANUFACTURER_PIDS_SET)
8985
static constexpr auto kPersonalityCount = static_cast<uint32_t>(pixel::Type::UNDEFINED);
9086
RDMPersonality* personalities[kPersonalityCount];

lib-configstore/include/configstore.h

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file configstore.h
33
*
44
*/
5-
/* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
5+
/* Copyright (C) 2025-2026 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
@@ -211,9 +211,9 @@ class ConfigStore : StoreDevice
211211
void SetFlagDmxSend(uint32_t flag) { SetFlagInternal(GetStore()->dmx_send, &common::store::DmxSend::flags, flag); }
212212
void SetFlagDmxLed(uint32_t flag) { SetFlagInternal(GetStore()->dmx_led, &common::store::DmxLed::flags, flag); }
213213
void SetFlagDmxPwm(uint32_t flag) { SetFlagInternal(GetStore()->dmx_pwm, &common::store::DmxPwm::flags, flag); }
214-
void SetFlagDmxSerial(uint32_t flag) { SetFlagInternal(GetStore()->dmx_serial, &common::store::DmxSerial::set_list, flag); }
215-
void SetFlagDmxMonitor(uint32_t flag) { SetFlagInternal(GetStore()->dmx_monitor, &common::store::DmxMonitor::set_list, flag); }
216-
void SetFlagRdmDevice(uint32_t flag) { SetFlagInternal(GetStore()->rdm_device, &common::store::RdmDevice::set_list, flag); }
214+
void SetFlagDmxSerial(uint32_t flag) { SetFlagInternal(GetStore()->dmx_serial, &common::store::DmxSerial::flags, flag); }
215+
void SetFlagDmxMonitor(uint32_t flag) { SetFlagInternal(GetStore()->dmx_monitor, &common::store::DmxMonitor::flags, flag); }
216+
void SetFlagRdmDevice(uint32_t flag) { SetFlagInternal(GetStore()->rdm_device, &common::store::RdmDevice::flags, flag); }
217217
void SetFlagShowFile(uint32_t flag) { SetFlagInternal(GetStore()->show_file, &common::store::ShowFile::flags, flag); }
218218
void SetFlagLtc(uint32_t flag) { SetFlagInternal(GetStore()->ltc, &common::store::Ltc::flags, flag); }
219219
void SetFlagLtcDisplay(uint32_t flag) { SetFlagInternal(GetStore()->ltc_display, &common::store::LtcDisplay::flags, flag); }
@@ -233,9 +233,9 @@ class ConfigStore : StoreDevice
233233
void ClearFlagDmxSend(uint32_t flag) { ClearFlagInternal(GetStore()->dmx_send, &common::store::DmxSend::flags, flag); }
234234
void ClearFlagDmxLed(uint32_t flag) { ClearFlagInternal(GetStore()->dmx_led, &common::store::DmxLed::flags, flag); }
235235
void ClearFlagDmxPwm(uint32_t flag) { ClearFlagInternal(GetStore()->dmx_pwm, &common::store::DmxPwm::flags, flag); }
236-
void ClearFlagDmxSerial(uint32_t flag) { ClearFlagInternal(GetStore()->dmx_serial, &common::store::DmxSerial::set_list, flag); }
237-
void ClearFlagDmxMonitor(uint32_t flag) { ClearFlagInternal(GetStore()->dmx_monitor, &common::store::DmxMonitor::set_list, flag); }
238-
void ClearFlagRdmDevice(uint32_t flag) { ClearFlagInternal(GetStore()->rdm_device, &common::store::RdmDevice::set_list, flag); }
236+
void ClearFlagDmxSerial(uint32_t flag) { ClearFlagInternal(GetStore()->dmx_serial, &common::store::DmxSerial::flags, flag); }
237+
void ClearFlagDmxMonitor(uint32_t flag) { ClearFlagInternal(GetStore()->dmx_monitor, &common::store::DmxMonitor::flags, flag); }
238+
void ClearFlagRdmDevice(uint32_t flag) { ClearFlagInternal(GetStore()->rdm_device, &common::store::RdmDevice::flags, flag); }
239239
void ClearFlagShowFile(uint32_t flag) { ClearFlagInternal(GetStore()->show_file, &common::store::ShowFile::flags, flag); }
240240
void ClearFlagLtc(uint32_t flag) { ClearFlagInternal(GetStore()->ltc, &common::store::Ltc::flags, flag); }
241241
void ClearFlagLtcDisplay(uint32_t flag) { ClearFlagInternal(GetStore()->ltc_display, &common::store::LtcDisplay::flags, flag); }
@@ -255,9 +255,9 @@ class ConfigStore : StoreDevice
255255
bool IsFlagSetDmxSend(uint32_t flag) const { return IsFlagSetInternal(GetStore()->dmx_send, &common::store::DmxSend::flags, flag); }
256256
bool IsFlagSetDmxLed(uint32_t flag) const { return IsFlagSetInternal(GetStore()->dmx_led, &common::store::DmxLed::flags, flag); }
257257
bool IsFlagSetDmxPwm(uint32_t flag) const { return IsFlagSetInternal(GetStore()->dmx_pwm, &common::store::DmxPwm::flags, flag); }
258-
bool IsFlagSetDmxSerial(uint32_t flag) const { return IsFlagSetInternal(GetStore()->dmx_serial, &common::store::DmxSerial::set_list, flag); }
259-
bool IsFlagSetDmxMonitor(uint32_t flag) const { return IsFlagSetInternal(GetStore()->dmx_monitor, &common::store::DmxMonitor::set_list, flag); }
260-
bool IsFlagSetRdmDevice(uint32_t flag) const { return IsFlagSetInternal(GetStore()->rdm_device, &common::store::RdmDevice::set_list, flag); }
258+
bool IsFlagSetDmxSerial(uint32_t flag) const { return IsFlagSetInternal(GetStore()->dmx_serial, &common::store::DmxSerial::flags, flag); }
259+
bool IsFlagSetDmxMonitor(uint32_t flag) const { return IsFlagSetInternal(GetStore()->dmx_monitor, &common::store::DmxMonitor::flags, flag); }
260+
bool IsFlagSetRdmDevice(uint32_t flag) const { return IsFlagSetInternal(GetStore()->rdm_device, &common::store::RdmDevice::flags, flag); }
261261
bool IsFlagSetShowFile(uint32_t flag) const { return IsFlagSetInternal(GetStore()->show_file, &common::store::ShowFile::flags, flag); }
262262
bool IsFlagSetLtc(uint32_t flag) const { return IsFlagSetInternal(GetStore()->ltc, &common::store::Ltc::flags, flag); }
263263
bool IsFlagSetLtcDisplay(uint32_t flag) const { return IsFlagSetInternal(GetStore()->ltc_display, &common::store::LtcDisplay::flags, flag); }
@@ -289,10 +289,16 @@ class ConfigStore : StoreDevice
289289
static_assert(N == common::store::ltc::display::kMaxInfoMessage, "Size mismatch");
290290
memcpy(dest, (GetStore()->ltc_display.*field), N);
291291
}
292+
293+
template <std::size_t N> void RdmDeviceCopyArray(uint8_t (&dest)[N], const uint8_t (common::store::RdmDevice::*field)[N]) const
294+
{
295+
static_assert(N == common::store::rdmdevice::kLabelMaxLength, "Size mismatch");
296+
memcpy(dest, (GetStore()->rdm_device.*field), N);
297+
}
292298

293-
template <std::size_t N> void RdmDeviceUpdateArray(uint8_t (common::store::RdmDevice::*field)[N], const char* src, uint32_t length)
299+
template <std::size_t N> void RdmDeviceUpdateArray(uint8_t (common::store::RdmDevice::*field)[N], const uint8_t* src, uint32_t length)
294300
{
295-
UpdateArray(GetStore()->rdm_device, field, reinterpret_cast<const uint8_t*>(src), length);
301+
UpdateArray(GetStore()->rdm_device, field, src, length);
296302
}
297303

298304
uint8_t RdmSensorsIndexedGetType(uint32_t index) const
@@ -329,7 +335,7 @@ class ConfigStore : StoreDevice
329335
template <std::size_t N>
330336
void DmxNodeUpdateLabel(uint8_t (common::store::DmxNode::*field)[common::store::dmxnode::kParamPorts][N], uint32_t index, const char* src, uint32_t length)
331337
{
332-
static_assert(N == common::store::dmxnode::kLabelNameLength, "Label size mismatch");
338+
static_assert(N == common::store::dmxnode::kPortNameLength, "Label size mismatch");
333339
assert(index < common::store::dmxnode::kParamPorts);
334340
assert(src != nullptr);
335341

lib-configstore/include/configurationstore.h

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file configurationstore.h
33
*
44
*/
5-
/* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
5+
/* Copyright (C) 2025-2026 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
@@ -149,7 +149,7 @@ namespace dmxnode
149149
{
150150
inline constexpr uint32_t kParamPorts = 4;
151151
inline constexpr uint32_t kNodeNameLength = 64;
152-
inline constexpr uint32_t kLabelNameLength = 18;
152+
inline constexpr uint32_t kPortNameLength = 18;
153153

154154
struct Flags
155155
{
@@ -174,8 +174,8 @@ struct DmxNode
174174
uint16_t merge_mode;
175175
uint8_t output_style;
176176
uint8_t fail_safe;
177-
uint8_t long_name[dmxnode::kNodeNameLength];
178-
uint8_t label[dmxnode::kParamPorts][dmxnode::kLabelNameLength];
177+
uint8_t node_name[dmxnode::kNodeNameLength];
178+
uint8_t port_name[dmxnode::kParamPorts][dmxnode::kPortNameLength];
179179
uint8_t reserved1[2];
180180
uint16_t protocol;
181181
uint16_t rdm;
@@ -340,7 +340,7 @@ static_assert(sizeof(DmxPwm) == kDmxPwmSize);
340340

341341
struct DmxSerial
342342
{
343-
uint32_t set_list;
343+
uint32_t flags;
344344
uint8_t type;
345345
uint8_t reserved1[3];
346346
uint32_t baud;
@@ -361,7 +361,7 @@ static_assert(sizeof(DmxSerial) == kDmxSerialSize);
361361

362362
struct DmxMonitor
363363
{
364-
uint32_t set_list;
364+
uint32_t flags;
365365
uint16_t dmx_start_address;
366366
uint16_t dmx_max_channels;
367367
uint8_t format;
@@ -377,16 +377,12 @@ inline constexpr uint32_t kLabelMaxLength = 32;
377377

378378
struct RdmDevice
379379
{
380-
uint32_t set_list;
380+
uint32_t flags;
381381
uint8_t device_root_label[rdmdevice::kLabelMaxLength];
382382
uint8_t device_root_label_length;
383-
uint8_t reserved;
384-
uint16_t product_category;
385-
uint16_t product_detail;
386-
uint8_t reserved2[6];
383+
uint8_t reserved2[11];
387384
} PACKED;
388385

389-
static_assert(offsetof(RdmDevice, product_category) % alignof(uint16_t) == 0, "product_category must be uint16_t-aligned");
390386
static_assert(sizeof(RdmDevice) == kRdmDeviceSize);
391387

392388
namespace rdm::sensors
@@ -619,7 +615,8 @@ struct Gps
619615

620616
static_assert(sizeof(Gps) == kGpsSize);
621617

622-
namespace midi {
618+
namespace midi
619+
{
623620
struct Flags
624621
{
625622
enum class Flag : uint32_t
@@ -629,7 +626,7 @@ struct Flags
629626

630627
static constexpr bool Has(uint32_t value, Flag flag) noexcept { return (value & static_cast<uint32_t>(flag)) != 0; }
631628
};
632-
} // namespace midi
629+
} // namespace midi
633630

634631
struct Midi
635632
{
@@ -705,7 +702,7 @@ struct SlotInfo
705702
namespace mode
706703
{
707704
inline constexpr uint16_t kMaxDmxFootprint = 4;
708-
705+
709706
struct Flags
710707
{
711708
enum class Flag : uint32_t
@@ -749,8 +746,8 @@ struct Flags
749746
};
750747

751748
static constexpr bool Has(uint32_t value, Flag flag) noexcept { return (value & static_cast<uint32_t>(flag)) != 0; }
752-
};
753-
} // namespace l6470
749+
};
750+
} // namespace l6470
754751

755752
struct L6470
756753
{
@@ -788,7 +785,7 @@ struct Store
788785
static_assert(offsetof(Store, mode) % alignof(uint32_t) == 0, "mode must be uint32_t-aligned");
789786
static_assert(offsetof(Store, l6470) % alignof(uint32_t) == 0, "l6470 must be uint32_t-aligned");
790787
static_assert(offsetof(Store, motor) % alignof(uint32_t) == 0, "motor must be uint32_t-aligned");
791-
} // namespace l6470dmx
788+
} // namespace l6470dmx
792789

793790
struct DmxL6470
794791
{
@@ -851,4 +848,4 @@ static_assert(offsetof(ConfigurationStore, global) == 16, "Wrong offset: global"
851848
#undef PACKED
852849
#endif
853850

854-
#endif // CONFIGURATIONSTORE_H_
851+
#endif // CONFIGURATIONSTORE_H_

lib-dmxnode/include/dmxnode.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file dmxnode.h
33
*/
4-
/* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
4+
/* Copyright (C) 2025-2026 by Arjan van Vught mailto:info@gd32-dmx.org
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -41,10 +41,10 @@ inline constexpr uint8_t kDmxMaxValue = 255;
4141
/*
4242
* Art-Net
4343
*/
44-
inline constexpr uint32_t kNodeNameLength = 64; // LongName
44+
inline constexpr uint32_t kNodeNameLength = 64; // Long Name
4545
static_assert(common::store::dmxnode::kNodeNameLength == kNodeNameLength);
46-
inline constexpr uint32_t kLabelNameLength = 18; // ShortName
47-
static_assert(common::store::dmxnode::kLabelNameLength == kLabelNameLength);
46+
inline constexpr uint32_t kPortNameLength = 18; // Port Name
47+
static_assert(common::store::dmxnode::kPortNameLength == kPortNameLength);
4848
/*
4949
* sACN E1.31
5050
*/
@@ -326,20 +326,20 @@ class DmxNode
326326

327327
if ((name == nullptr) || (name[0] == '\0')) return SetShortNameDefault(port_index);
328328

329-
strncpy(port.label, name, dmxnode::kLabelNameLength - 1);
330-
port.label[dmxnode::kLabelNameLength - 1] = '\0';
329+
strncpy(port.label, name, dmxnode::kPortNameLength - 1);
330+
port.label[dmxnode::kPortNameLength - 1] = '\0';
331331
}
332332

333333
void SetShortNameDefault(uint32_t port_index)
334334
{
335335
assert(port_index < dmxnode::kMaxPorts);
336336
auto& port = port_[port_index];
337337

338-
snprintf(port.label, dmxnode::kLabelNameLength - 1, "Port %u", (1U + port_index));
339-
port.label[dmxnode::kLabelNameLength - 1] = '\0';
338+
snprintf(port.label, dmxnode::kPortNameLength - 1, "Port %u", (1U + port_index));
339+
port.label[dmxnode::kPortNameLength - 1] = '\0';
340340
}
341341

342-
const char* GetShortName(uint32_t port_index) const
342+
const char* GetPortName(uint32_t port_index) const
343343
{
344344
assert(port_index < dmxnode::kMaxPorts);
345345
const auto& port = port_[port_index];
@@ -363,7 +363,7 @@ class DmxNode
363363
{
364364
dmxnode::PortDirection port_direction{dmxnode::PortDirection::kDisable};
365365
bool is_transmitting{false};
366-
char label[dmxnode::kLabelNameLength];
366+
char label[dmxnode::kPortNameLength];
367367
} port_[dmxnode::kMaxPorts];
368368
};
369369

lib-hal/include/firmwareversion.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file firmwareversion.h
33
*/
4-
/* Copyright (C) 2019-2025 by Arjan van Vught mailto:info@gd32-dmx.org
4+
/* Copyright (C) 2019-2026 by Arjan van Vught mailto:info@gd32-dmx.org
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -56,8 +56,7 @@ struct Info
5656
class FirmwareVersion
5757
{
5858
public:
59-
explicit FirmwareVersion(const char* software_version, const char* date, const char* time, uint32_t software_version_id = 0)
60-
: kSoftwareVersionId(software_version_id)
59+
explicit FirmwareVersion(const char* software_version, const char* date, const char* time)
6160
{
6261
assert(software_version != nullptr);
6362
assert(date != nullptr);
@@ -90,12 +89,10 @@ class FirmwareVersion
9089
const struct firmwareversion::Info* GetVersion() { return &s_firmware_version; }
9190
const char* GetPrint() { return s_print; }
9291
const char* GetSoftwareVersion() { return s_firmware_version.software_version; }
93-
uint32_t GetVersionId() const { return kSoftwareVersionId; }
9492

9593
static FirmwareVersion* Get() { return s_this; }
9694

9795
private:
98-
const uint32_t kSoftwareVersionId;
9996
static inline firmwareversion::Info s_firmware_version;
10097
static inline char s_print[64];
10198
static inline FirmwareVersion* s_this;

0 commit comments

Comments
 (0)