ethernet console as engine module (#453)

* infrastructure for engine modules in the build

* fully move fuel pump

* fan

* gear detector

* gear detect

* fan control cleanup

* trip odometer

* shuffle makefiles around a little

* move ethernet console to engine module

* oops

* s

* final

* dead line
This commit is contained in:
Matthew Kennedy 2024-07-23 20:52:37 -07:00 committed by GitHub
parent ff5e47c95d
commit 4b4d2ac4d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 23 additions and 17 deletions

View File

@ -4,7 +4,7 @@ DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
# Enable ethernet
LWIP = yes
DDEFS += -DEFI_ETHERNET=TRUE
include $(PROJECT_DIR)/controllers/modules/ethernet_console/ethernet_console.mk
# This is an F429!
IS_STM32F429 = yes

View File

@ -10,7 +10,7 @@ DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
# Enable ethernet
LWIP = yes
DDEFS += -DEFI_ETHERNET=TRUE
include $(PROJECT_DIR)/controllers/modules/ethernet_console/ethernet_console.mk
DDEFS += -DFIRMWARE_ID=\"nucleo_f767\"
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS

View File

@ -6,7 +6,7 @@ DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
# Enable ethernet
LWIP = yes
DDEFS += -DEFI_ETHERNET=TRUE
include $(PROJECT_DIR)/controllers/modules/ethernet_console/ethernet_console.mk
DDEFS += -DFIRMWARE_ID=\"nucleo_h743\"
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS

View File

@ -266,10 +266,10 @@
#define EFI_USE_COMPRESSED_INI_MSD
#define ENABLE_PERF_TRACE TRUE
#if EFI_ETHERNET
#if MODULE_ETHERNET_CONSOLE
// F4 ethernet needs some extra space
#define LUA_USER_HEAP 40000
#else // EFI_ETHERNET
#else // MODULE_ETHERNET_CONSOLE
#define LUA_USER_HEAP 50000
#endif
#else

View File

@ -9,7 +9,6 @@ CONSOLE_SRC_CPP = $(CONSOLE_COMMON_SRC_CPP) \
$(PROJECT_DIR)/console/connector_uart_dma.cpp \
$(PROJECT_DIR)/console/binary_log/binary_logging.cpp \
$(PROJECT_DIR)/console/binary_log/usb_console.cpp \
$(PROJECT_DIR)/console/binary_log/ethernet_console.cpp \
$(PROJECT_DIR)/console/wifi_console.cpp \

View File

@ -8,7 +8,12 @@
#pragma once
#include "engine_module.h"
void initializeConsole();
void startUsbConsole();
void startEthernetConsole();
void startWifiConsole();
struct EthernetConsoleModule final : public EngineModule {
void initNoConfiguration() override;
};

View File

@ -8,6 +8,9 @@
class EngineModule {
public:
// Called exactly once during boot, before configuration is loaded
virtual void initNoConfiguration() { }
// Called when 'Burn' is invoked
virtual void onConfigurationChange(engine_configuration_s const * /*previousConfig*/) { }

View File

@ -1,7 +1,5 @@
#include "pch.h"
#if EFI_ETHERNET
#include "lwipthread.h"
#include "lwip/sockets.h"
@ -80,8 +78,6 @@ struct EthernetThread : public TunerstudioThread {
static EthernetThread ethernetConsole;
void startEthernetConsole() {
void EthernetConsoleModule::initNoConfiguration() {
ethernetConsole.start();
}
#endif // EFI_ETHERNET

View File

@ -0,0 +1,4 @@
MODULES_CPPSRC += $(PROJECT_DIR)/controllers/modules/ethernet_console/ethernet_console.cpp
MODULES_LIST += EthernetConsoleModule,
DDEFS += -DMODULE_ETHERNET_CONSOLE=1

View File

@ -41,7 +41,7 @@
#define USB_USE_WAIT (EFI_FILE_LOGGING && EFI_USB_SERIAL)
// Ethernet
#define HAL_USE_MAC EFI_ETHERNET
#define HAL_USE_MAC MODULE_ETHERNET_CONSOLE
/*===========================================================================*/
/* Required rusEFI settings */

View File

@ -205,9 +205,9 @@ void runRusEfi() {
detectBoardType();
#if EFI_ETHERNET
startEthernetConsole();
#endif
engine->engineModules.apply_all([](auto & m) {
m.initNoConfiguration();
});
#if EFI_USB_SERIAL
startUsbConsole();

View File

@ -151,4 +151,3 @@
#define EFI_USE_OPENBLT FALSE
#define EFI_SOFTWARE_KNOCK FALSE
#define ENABLE_AUTO_DETECT_HSE FALSE
#define EFI_ETHERNET FALSE