Skip to content

Commit 384cbaf

Browse files
committed
Use DMX debug macros in gd32 dmx driver
Replace the generic debug header and DEBUG_* calls in `lib-dmx/src/gd32/dmx.cpp` with the DMX-specific debug interface (`dmx_debug.h` and `DMX_DEBUG_*`). This aligns logging/trace output with the DMX module’s debug conventions and keeps debug dependencies scoped to the subsystem.
1 parent 5e9419a commit 384cbaf

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

common/.settings/language.settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
66
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
77
<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="1069578116264638190" 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">
8+
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1457537185416989293" 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">
99
<language-scope id="org.eclipse.cdt.core.gcc"/>
1010
<language-scope id="org.eclipse.cdt.core.g++"/>
1111
</provider>

lib-dmx/src/gd32/dmx.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#if defined(LOGIC_ANALYZER)
5656
#include "logic_analyzer.h" // IWYU pragma: keep
5757
#endif
58-
#include "firmware/debug/debug_debug.h"
58+
#include "dmx_debug.h"
5959

6060
static_assert(dmx::buffer::kSize % 4 == 0); // multiple of uint32_t
6161

@@ -1555,7 +1555,7 @@ template <uint32_t kPortIndex, dmx::Direction kPortDirection, bool kEnableData>
15551555
}
15561556

15571557
void Dmx::DataEnable(uint32_t port_index) {
1558-
DEBUG_PRINTF("port_index=%u", port_index);
1558+
DMX_DEBUG_PRINTF("port_index=%u", port_index);
15591559
DMX_CHECK_PORT_INDEX_VOID(port_index);
15601560
assert(sv_port_state[port_index] == dmx::PortState::kIdle);
15611561

@@ -1639,7 +1639,7 @@ volatile dmx::TotalStatistics& Dmx::GetTotalStatistics(uint32_t port_index) {
16391639
#endif
16401640

16411641
void Dmx::Blackout() {
1642-
DEBUG_ENTRY();
1642+
DMX_DEBUG_ENTRY();
16431643

16441644
for (uint32_t port_index = 0; port_index < dmx::config::max::kPorts; port_index++) {
16451645
if (port_direction_[port_index] == dmx::Direction::kOutput) {
@@ -1649,11 +1649,11 @@ void Dmx::Blackout() {
16491649
}
16501650
}
16511651

1652-
DEBUG_EXIT();
1652+
DMX_DEBUG_EXIT();
16531653
}
16541654

16551655
void Dmx::FullOn() {
1656-
DEBUG_ENTRY();
1656+
DMX_DEBUG_ENTRY();
16571657

16581658
for (uint32_t port_index = 0; port_index < dmx::config::max::kPorts; port_index++) {
16591659
if (port_direction_[port_index] == dmx::Direction::kOutput) {
@@ -1673,7 +1673,7 @@ void Dmx::FullOn() {
16731673
}
16741674
}
16751675

1676-
DEBUG_EXIT();
1676+
DMX_DEBUG_EXIT();
16771677
}
16781678

16791679
// DMX Send
@@ -1944,7 +1944,7 @@ template <uint32_t kPortIndex> void StartRdmOutput() {
19441944

19451945
constexpr auto kUsartPeripheral = std::to_underlying(kDirGpio[kPortIndex].uart);
19461946

1947-
DEBUG_PRINTF("port_index=%u, uart=%p", kPortIndex, reinterpret_cast<void*>(kUsartPeripheral));
1947+
DMX_DEBUG_PRINTF("port_index=%u, uart=%p", kPortIndex, reinterpret_cast<void*>(kUsartPeripheral));
19481948
// USART_FLAG_TC is set after power on.
19491949
// The flag is cleared by DMA interrupt when maximum slots - 1 are transmitted.
19501950
// TODO(a): Do we need a timeout just to be safe?
@@ -2451,7 +2451,7 @@ void Dmx::SetTransmitPeriodTime(uint32_t period) {
24512451

24522452
s_dmx_transmit.inter_time = transmit_period_ - package_length_micro_seconds;
24532453

2454-
DEBUG_PRINTF("period=%u, nLengthMax=%u, m_nDmxTransmitPeriod=%u, nPackageLengthMicroSeconds=%u -> s_dmx_transmit.inter_time=%u", period, length_max, transmit_period_, package_length_micro_seconds, s_dmx_transmit.inter_time);
2454+
DMX_DEBUG_PRINTF("period=%u, nLengthMax=%u, m_nDmxTransmitPeriod=%u, nPackageLengthMicroSeconds=%u -> s_dmx_transmit.inter_time=%u", period, length_max, transmit_period_, package_length_micro_seconds, s_dmx_transmit.inter_time);
24552455
}
24562456

24572457
[[gnu::noinline]]
@@ -2908,7 +2908,7 @@ static void Timer4Config() {
29082908
#endif
29092909

29102910
Dmx::Dmx() {
2911-
DEBUG_ENTRY();
2911+
DMX_DEBUG_ENTRY();
29122912
assert(s_this == nullptr);
29132913
s_this = this;
29142914

@@ -2984,7 +2984,7 @@ Dmx::Dmx() {
29842984
NVIC_EnableIRQ(UART7_IRQn);
29852985
#endif
29862986

2987-
DEBUG_EXIT();
2987+
DMX_DEBUG_EXIT();
29882988
}
29892989

29902990
#pragma GCC pop_options

0 commit comments

Comments
 (0)