Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several improvements and fixes #285

Merged
merged 36 commits into from
Nov 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7a0894a
Moved *ParamsConst to C++20 style
vanvught Oct 19, 2024
bab159a
Moved ARM related include files to directory /arm
vanvught Oct 19, 2024
5aeda7f
Converted malloc.c to malloc.cpp
vanvught Oct 19, 2024
bdd937e
TCNet is now header file only
vanvught Oct 19, 2024
bc15291
W.I.P. #186
vanvught Oct 19, 2024
3e285d9
Introduced callback handler for UDP packets
vanvught Oct 19, 2024
b9118f2
RDMNet LLRP fixed issue with GetDefaultRoute
vanvught Oct 19, 2024
c87f41a
Minor code cleanup
vanvught Oct 19, 2024
a82f112
Updates for previous commits
vanvught Oct 19, 2024
b59bf80
Fix for GD32
vanvught Oct 19, 2024
40f4149
Fix for workflow run
vanvught Oct 19, 2024
1645a65
Improved ArtNetNode::SendPollReply
vanvught Oct 20, 2024
57cfb8f
Added support for SPI LCD driver ST7735S
vanvught Nov 8, 2024
f5e8148
Updated Eclipse project settings
vanvught Nov 8, 2024
b744eb4
Added optimize ("-fprefetch-loop-arrays")
vanvught Nov 8, 2024
cded66a
Added defines DEBUG_EMAC and DEBUG_NET_PHY
vanvught Nov 8, 2024
69a9dd8
Moved timers.h to softwaretimers.h
vanvught Nov 8, 2024
e833856
Minor code cleanup
vanvught Nov 8, 2024
04a7d22
Added atexit.cpp
vanvught Nov 8, 2024
7c8d48c
Changed compiler setting -O2 to -Os
vanvught Nov 10, 2024
9e540e8
Updated Eclipse project settings
vanvught Nov 10, 2024
7cfcc63
Major cleanup spi_flash.cpp
vanvught Nov 11, 2024
bc3b560
Fixed issue with pixel multi and dmx sync
vanvught Nov 11, 2024
e738921
Removed rdmsoftwareversion.cpp
vanvught Nov 11, 2024
5577fc9
Added CONFIG_CLIB_ASSERT_REBOOT
vanvught Nov 11, 2024
7dbaedd
Removed pragma GCC optimize ("Os")
vanvught Nov 11, 2024
b9537f7
Fixed issue with pixel multi and dmx sync
vanvught Nov 11, 2024
d0f6882
Minor code cleanup
vanvught Nov 11, 2024
8d8e71d
Fixed issue with pixel multi and dmx sync
vanvught Nov 11, 2024
60f7858
Added support for bitbang SPI
vanvught Nov 11, 2024
1d3ac61
Removed #include "networkconst.h"
vanvught Nov 11, 2024
0a4bd13
Updated build_h3-firmware.sh
vanvught Nov 12, 2024
aa5e3ec
Updated SOFTWARE_VERSION[]
vanvught Nov 12, 2024
b3dba55
Moved RDM E1.37-2 code from network.cpp to rdmhandlere137.cpp
vanvught Nov 16, 2024
950cce5
Updated make files
vanvught Nov 16, 2024
ed4468e
Fix for Sync
vanvught Nov 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added defines DEBUG_EMAC and DEBUG_NET_PHY
  • Loading branch information
vanvught committed Nov 8, 2024
commit cded66a022682a000ea2f646b6ea8e3ffbdc073a
4 changes: 4 additions & 0 deletions lib-network/src/emac/gd32/emac.cpp
Original file line number Diff line number Diff line change
@@ -23,6 +23,10 @@
* THE SOFTWARE.
*/

#if defined (DEBUG_EMAC)
# undef NDEBUG
#endif

#include <cstdint>
#include <cstdio>

21 changes: 17 additions & 4 deletions lib-network/src/emac/gd32/net_phy.cpp
Original file line number Diff line number Diff line change
@@ -23,6 +23,10 @@
* THE SOFTWARE.
*/

#if defined (DEBUG_NET_PHY)
# undef NDEBUG
#endif

#include <cstdint>

#include "emac/phy.h"
@@ -58,13 +62,13 @@ bool phy_config(const uint32_t nAddress) {
DEBUG_ENTRY

#if defined (GD32H7XX)
uint32_t reg = ENET_MAC_PHY_CTL(ENETx);
auto reg = ENET_MAC_PHY_CTL(ENETx);
#else
uint32_t reg = ENET_MAC_PHY_CTL;
auto reg = ENET_MAC_PHY_CTL;
#endif
reg &= ~ENET_MAC_PHY_CTL_CLR;

const uint32_t ahbclk = rcu_clock_freq_get(CK_AHB);
const auto ahbclk = rcu_clock_freq_get(CK_AHB);

DEBUG_PRINTF("ahbclk=%u", ahbclk);

@@ -78,6 +82,7 @@ bool phy_config(const uint32_t nAddress) {
} else if ((ENET_RANGE(ahbclk, 90000000U, 108000000U)) || (108000000U == ahbclk)) {
reg |= ENET_MDC_HCLK_DIV62;
} else {
DEBUG_EXIT
return false;
}
#elif defined GD32F20X
@@ -90,6 +95,7 @@ bool phy_config(const uint32_t nAddress) {
} else if ((ENET_RANGE(ahbclk, 100000000U, 120000000U)) || (120000000U == ahbclk)) {
reg |= ENET_MDC_HCLK_DIV62;
} else {
DEBUG_EXIT
return false;
}
#elif defined GD32F4XX
@@ -104,6 +110,7 @@ bool phy_config(const uint32_t nAddress) {
} else if ((ENET_RANGE(ahbclk, 150000000U, 240000000U)) || (240000000U == ahbclk)) {
reg |= ENET_MDC_HCLK_DIV102;
} else {
DEBUG_EXIT
return false;
}
#elif defined GD32H7XX
@@ -124,8 +131,11 @@ bool phy_config(const uint32_t nAddress) {
} else if ((ENET_RANGE(ahbclk, 350000000U, 400000000U)) || (400000000U == ahbclk)) {
reg |= ENET_MDC_HCLK_DIV162;
} else {
DEBUG_EXIT
return false;
}
#else
# error
#endif

#if defined (GD32H7XX)
@@ -136,6 +146,7 @@ bool phy_config(const uint32_t nAddress) {

if (!phy_write(nAddress, mmi::REG_BMCR, mmi::BMCR_RESET)) {
DEBUG_PUTS("PHY reset failed");
DEBUG_EXIT
return false;
}

@@ -148,9 +159,10 @@ bool phy_config(const uint32_t nAddress) {
const auto nMillis = Hardware::Get()->Millis();
uint16_t nValue;

while (Hardware::Get()->Millis() - nMillis < 500) {
while (Hardware::Get()->Millis() - nMillis < 500U) {
if (!phy_read(nAddress, mmi::REG_BMCR, nValue)) {
DEBUG_PUTS("PHY status read failed");
DEBUG_EXIT
return false;
}

@@ -163,6 +175,7 @@ bool phy_config(const uint32_t nAddress) {

if (nValue & mmi::BMCR_RESET) {
DEBUG_PUTS("PHY reset timed out");
DEBUG_EXIT
return false;
}

4 changes: 4 additions & 0 deletions lib-network/src/emac/phy/net_phy.cpp
Original file line number Diff line number Diff line change
@@ -23,6 +23,10 @@
* THE SOFTWARE.
*/

#if defined (DEBUG_NET_PHY)
# undef NDEBUG
#endif

#include <cstdint>
#include <cassert>
#include <cstdio>