Skip to content

Commit b9d79b6

Browse files
committed
Rename/relocate serialnumber; remove lib-hal console
Add CONFIG_CLIB_USE_UART0 to Makefile.GD32 and adjust board checks to use CONFIG_CLIB_USE_NULL. Move/rename serial number API from lib-hal to lib-gd32 (hal_serialnumber.h -> serialnumber.h and hal_serialnumber.cpp -> serialnumber.cpp), update include guards, copyright years, remove the hal namespace, and export kSnSize/SerialNumber accordingly. Remove lib-hal console implementations and headers (console i2c/null/uart0 and console.h variants). Update rdm_device_base to include the new serialnumber.h and call SerialNumber() (no hal:: namespace).
1 parent 86b699d commit b9d79b6

13 files changed

Lines changed: 21 additions & 659 deletions

File tree

gd32_emac_e131_dmx_multi/Makefile.GD32

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ DEFINES+=DISPLAY_UDF
1616

1717
DEFINES+=ENABLE_HTTPD
1818

19+
DEFINES+=CONFIG_CLIB_USE_UART0
20+
1921
DEFINES+=DISABLE_RTC
2022
DEFINES+=DISABLE_FS
2123

lib-gd32/include/board/bw_opidmx4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# error This file should be included later
3535
#endif
3636

37-
#if !(defined(CONSOLE_I2C) || defined(CONSOLE_NULL) || defined(CONFIG_USE_SOFTUART0))
37+
#if !(defined(CONSOLE_I2C) || defined(CONFIG_CLIB_USE_NULL) || defined(CONFIG_USE_SOFTUART0))
3838
# error USART0 is used for console
3939
#endif
4040

lib-gd32/include/board/dmx4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# error This file should be included later
3535
#endif
3636

37-
#if !(defined(CONSOLE_I2C) || defined(CONSOLE_NULL) || defined(CONFIG_USE_SOFTUART0))
37+
#if !(defined(CONSOLE_I2C) || defined(CONFIG_CLIB_USE_NULL) || defined(CONFIG_USE_SOFTUART0))
3838
# error USART0 is used for console
3939
#endif
4040

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @file hal_serialnumber.h
2+
* @file serialnumber.h
33
*
44
*/
5-
/* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
5+
/* Copyright (C) 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
@@ -22,16 +22,12 @@
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
* THE SOFTWARE.
2424
*/
25-
26-
#ifndef HAL_SERIALNUMBER_H_
27-
#define HAL_SERIALNUMBER_H_
25+
#ifndef SERIALNUMBER_H_
26+
#define SERIALNUMBER_H_
2827

2928
#include <cstdint>
3029

31-
namespace hal
32-
{
33-
inline static constexpr uint32_t kSnSize = 4;
30+
inline constexpr uint32_t kSnSize = 4;
3431
void SerialNumber(uint8_t sn[kSnSize]);
35-
} // namespace hal
3632

37-
#endif // HAL_SERIALNUMBER_H_
33+
#endif // SERIALNUMBER_H_
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @file hal_serialnumber.cpp
2+
* @file serialnumber.cpp
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
@@ -25,9 +25,8 @@
2525

2626
#include <cstdint>
2727

28-
#include "hal_serialnumber.h"
28+
#include "serialnumber.h"
2929

30-
namespace hal {
3130
void SerialNumber(uint8_t sn[kSnSize]) {
3231
#if defined(GD32H7XX)
3332
const auto kMacaddressHigh = *reinterpret_cast<volatile uint32_t*>(0x1FF0F7E8);
@@ -42,4 +41,3 @@ void SerialNumber(uint8_t sn[kSnSize]) {
4241
sn[2] = static_cast<uint8_t>((kMacaddressHigh >> 16) & 0xFF);
4342
sn[3] = static_cast<uint8_t>((kMacaddressHigh >> 24) & 0xFF);
4443
}
45-
} // namespace hal

0 commit comments

Comments
 (0)