Skip to content

Commit f7369a3

Browse files
committed
Update network includes and minor code improvements
Replaced legacy network header includes with 'network.h' in displayudf.h and dmxconfigudp.h. Updated function calls to use the new network namespace. Fixed a flag constant in gd32_dma_memcpy32.h and corrected function naming and formatting in gd32_enet.h.
1 parent 8ffe40e commit f7369a3

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

lib-displayudf/include/displayudf.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
#include "display.h"
3333
#include "firmwareversion.h"
3434
#if !defined(NO_EMAC)
35-
#include "net.h"
36-
#include "netif.h"
35+
#include "network.h"
3736
#include "net/protocol/dhcp.h"
3837
#endif
3938
#if defined(NODE_ARTNET_MULTI)
@@ -180,7 +179,7 @@ class DisplayUdf final : public Display
180179
{
181180
ClearEndOfLine();
182181
Printf(labels_[static_cast<uint32_t>(displayudf::Labels::kIp)], "" IPSTR "/%d %c", IP2STR(net::GetPrimaryIp()), net::GetNetmaskCIDR(),
183-
netif::GetAddressingMode());
182+
network::iface::AddressingMode());
184183
}
185184

186185
void ShowNetmask()
@@ -199,7 +198,7 @@ class DisplayUdf final : public Display
199198
void ShowHostName()
200199
{
201200
ClearEndOfLine();
202-
Write(labels_[static_cast<uint32_t>(displayudf::Labels::kHostname)], netif::GetHostName());
201+
Write(labels_[static_cast<uint32_t>(displayudf::Labels::kHostname)], network::iface::GetHostName());
203202
}
204203

205204
void ShowDhcpStatus(net::dhcp::State state)

lib-dmx/include/dmxconfigudp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <cassert>
3232

3333
#include "dmxconst.h"
34-
#include "net/udp.h"
34+
#include "network.h"
3535
#include "dmx.h"
3636

3737
#include "firmware/debug/debug_debug.h"

lib-gd32/include/gd32_dma_memcpy32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ inline void StartDma(const void* destination, const void* source, uint32_t lengt
6262
DMA_CHPADDR(DMA1, DMA_CH0) = reinterpret_cast<uint32_t>(source);
6363
DMA_CHCNT(DMA1, DMA_CH0) = length;
6464

65-
dma_chctl |= (DMA_CHXCTL_CHEN | DMA_INT_FTF);
65+
dma_chctl |= (DMA_CHXCTL_CHEN | DMA_CHXCTL_FTFIE);
6666
DMA_CHCTL(DMA1, DMA_CH0) = dma_chctl;
6767
#endif
6868
}

lib-gd32/include/gd32_enet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ inline void Gd32EnetClearDmaTxFlagsAndResume()
204204
if ((0 != kDmaTbuFlag) || (0 != kDmaTuFlag))
205205
{
206206
ENET_DMA_STAT = (kDmaTbuFlag | kDmaTuFlag); ///< Clear TBU and TU flags
207-
ENET_DMA_TPEN = 0; ///< Resume DMA transmission
207+
ENET_DMA_TPEN = 0; ///< Resume DMA transmission
208208
}
209209
}
210210
#endif
@@ -241,7 +241,7 @@ inline void Gd32EnetHandleRxBufferUnavailable()
241241
#endif
242242

243243
#if defined(GD32H7XX)
244-
inline void gd32_enet_reset_hash()
244+
inline void Gd32EnetResetHash()
245245
{
246246
ENET_MAC_HLH(ENETx) = 0;
247247
ENET_MAC_HLL(ENETx) = 0;
@@ -312,4 +312,4 @@ inline void Gd32EnetFilterSetHash(uint32_t hash)
312312
}
313313
#endif
314314

315-
#endif // GD32_ENET_H_
315+
#endif // GD32_ENET_H_

0 commit comments

Comments
 (0)