Skip to content

Commit b5a02c9

Browse files
committed
Use ANSI colours; refactor display & console
Replace custom console colour handling with ansi_colour across display and console code, updating TextStatus and Status calls to use ansi::Colours. Modernize headers and style (brace and formatting changes), update copyright years to 2026, and tidy includes. Other API/bugfix changes: change OscClient::HandleLedMessage to accept uint32_t, remove/logless network::Error implementation and redefine ERROR macro, add hal::Init prototype, rename several variables (m_nSize -> size_, pBuffer -> buffer), adjust TFTP/remoteconfig flow (platform-specific TFTP handling, success flag rename), and various small fixes in remoteconfig, tftpfileserver, and display drivers. These changes unify colour output, fix type inconsistencies, and clean up code style.
1 parent a7f1199 commit b5a02c9

18 files changed

Lines changed: 297 additions & 560 deletions

File tree

gd32_emac_artnet_dmx_multi/Common.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ DEFINES+=ARTNET_HAVE_FAILSAFE_RECORD
55
DEFINES+=OUTPUT_DMX_SEND_MULTI
66
DEFINES+=OUTPUT_HAVE_STYLESWITCH
77

8+
#DEFINES+=NODE_RDMNET_LLRP_ONLY
9+
810
DEFINES+=RDM_CONTROLLER
911

1012
DEFINES+=CONFIG_STORE_USE_SPI

gd32_emac_artnet_dmx_multi/firmware/main.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
* THE SOFTWARE.
2424
*/
2525

26-
#include <cstdio>
27-
2826
#include "gd32/hal.h"
2927
#include "watchdog.h"
3028
#include "network.h"
@@ -71,11 +69,6 @@ int main() // NOLINT
7169
DmxNodeNode dmxnode_node;
7270
dmxnode_node.SetOutput(&dmx_send);
7371

74-
for (uint32_t port_index = 0; port_index < dmxnode::kMaxPorts; port_index++) {
75-
const auto kPortDirection = (dmxnode_node.PortDirection(port_index) == dmxnode::Direction::kOutput ? dmx::Direction::kOutput : dmx::Direction::kInput);
76-
dmx.SetPortDirection(port_index, kPortDirection, false);
77-
}
78-
7972
const auto kIsRdmEnabled = dmxnode_node.GetRdm();
8073

8174
#if defined(NODE_SHOWFILE)
@@ -99,9 +92,11 @@ int main() // NOLINT
9992

10093
RemoteConfig remote_config(kIsRdmEnabled ? remoteconfig::Output::RDM : remoteconfig::Output::DMX, kActivePorts);
10194

95+
display.TextStatus(DmxNodeMsgConst::START, ansi::Colours::Colour::kYellow);
96+
10297
dmxnode_node.Start();
10398

104-
puts("Running\n");
99+
display.TextStatus(DmxNodeMsgConst::STARTED, ansi::Colours::Colour::kGreen);
105100

106101
watchdog::Init();
107102

gd32_emac_e131_dmx_multi/firmware/main.cpp

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

26-
#include <cstdint>
27-
26+
#include "gd32/hal.h"
2827
#include "watchdog.h"
2928
#include "network.h"
3029
#include "displayudf.h"
@@ -70,11 +69,6 @@ int main() // NOLINT
7069
DmxNodeNode dmxnode_node;
7170
dmxnode_node.SetOutput(&dmx_send);
7271

73-
for (uint32_t port_index = 0; port_index < dmxnode::kMaxPorts; port_index++) {
74-
const auto kPortDirection = (dmxnode_node.PortDirection(port_index) == dmxnode::Direction::kOutput ? dmx::Direction::kOutput : dmx::Direction::kInput);
75-
dmx.SetPortDirection(port_index, kPortDirection, false);
76-
}
77-
7872
const auto kActivePorts = dmxnode_node.GetActiveInputPorts() + dmxnode_node.GetActiveOutputPorts();
7973

8074
#if defined(NODE_SHOWFILE)
@@ -96,9 +90,11 @@ int main() // NOLINT
9690

9791
RemoteConfig remote_config(remoteconfig::Output::DMX, kActivePorts);
9892

93+
display.TextStatus(DmxNodeMsgConst::START, ansi::Colours::Colour::kYellow);
94+
9995
dmxnode_node.Start();
10096

101-
display.TextStatus(DmxNodeMsgConst::STARTED, console::Colours::kConsoleGreen);
97+
display.TextStatus(DmxNodeMsgConst::STARTED, ansi::Colours::Colour::kGreen);
10298

10399
watchdog::Init();
104100

0 commit comments

Comments
 (0)