Address PR review feedback for Ethernet support

- Add #pragma once to SerialEthernetInterface.h
- Rename TCP_PORT to ETH_TCP_PORT with #ifndef guard
- Fix typos: "initalizing" → "initializing"
- Fix #elif without condition → #else for STM32 block
- Replace infinite loop on ETH init failure with halt()
- Remove heartbeat Serial.print(".") output
- Remove dead beginETH() call (ETH_ENABLED, not RAK_ETH_ENABLE)
- Comment out MESH_DEBUG and ETH_DEBUG_LOGGING build flags

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ryan Gregg 2026-03-09 15:15:21 -07:00
parent 70b51bd096
commit aea64e1f19
5 changed files with 16 additions and 26 deletions

View file

@ -12,7 +12,6 @@ static uint32_t _atoi(const char* sp) {
return n;
}
uint32_t tick_count = 0;
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
#include <InternalFileSystem.h>
@ -87,7 +86,7 @@ uint32_t tick_count = 0;
#ifdef ETH_ENABLED
#include <helpers/nrf52/SerialEthernetInterface.h>
SerialEthernetInterface serial_interface;
#elif
#else
#include <helpers/ArduinoSerialInterface.h>
ArduinoSerialInterface serial_interface;
#endif
@ -161,7 +160,7 @@ void setup() {
#ifdef BLE_PIN_CODE
serial_interface.begin(BLE_NAME_PREFIX, the_mesh.getNodePrefs()->node_name, the_mesh.getBLEPin());
#elif ETH_ENABLED
#elif defined(ETH_ENABLED)
Serial.print("Waiting for serial to connect...\n");
time_t timeout = millis();
@ -170,13 +169,11 @@ void setup() {
{
if ((millis() - timeout) < 5000) { delay(100); } else { break; }
}
Serial.print("Initalizing ethernet adapter....\n");
Serial.print("Initializing ethernet adapter....\n");
bool result = serial_interface.begin();
if (!result) {
while (true)
{
delay(1); // Do nothing, just love you.
}
Serial.println("ETH: Init failed, halting");
halt();
}
#else
serial_interface.begin(Serial);
@ -252,12 +249,6 @@ void loop() {
#endif
rtc_clock.tick();
// Debugging only... making sure something is alive.
tick_count++;
if (tick_count % 5000 == 0) {
Serial.print(".");
}
#ifdef ETH_ENABLED
serial_interface.maintain();
#endif