From bd72aace92ea457afbdeac25b21d11d49f385c17 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 5 Mar 2023 01:28:55 -0500 Subject: [PATCH] progress: bringing simulator closer to real code only:hellen-honda-k --- firmware/hw_layer/hardware.cpp | 7 ++++++- simulator/simulator/rusEfiFunctionalTest.cpp | 15 ++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 4db2d43a55..c87639b054 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -560,7 +560,12 @@ void initHardware() { initMax31855(engineConfiguration->max31855spiDevice, engineConfiguration->max31855_cs); #endif /* EFI_MAX_31855 */ -#if EFI_CAN_SUPPORT && EFI_PROD_CODE +#if EFI_CAN_SUPPORT +#if EFI_SIMULATOR + // Set CAN device name + CAND1.deviceName = "can0"; +#endif + initCan(); #endif /* EFI_CAN_SUPPORT */ diff --git a/simulator/simulator/rusEfiFunctionalTest.cpp b/simulator/simulator/rusEfiFunctionalTest.cpp index 2059eba803..29f13b2b2f 100644 --- a/simulator/simulator/rusEfiFunctionalTest.cpp +++ b/simulator/simulator/rusEfiFunctionalTest.cpp @@ -96,12 +96,8 @@ void rusEfiFunctionalTest(void) { startLoggingProcessor(); - - initializeConsole(); - - initStatusLoop(); initDataStructures(); - + initializeConsole(); // todo: reduce code duplication with initEngineController @@ -119,6 +115,7 @@ void rusEfiFunctionalTest(void) { startLua(); + initStatusLoop(); /** * !!!! TESTS ! @@ -136,14 +133,6 @@ void rusEfiFunctionalTest(void) { engineConfiguration->enableVerboseCanTx = true; -#if HAL_USE_CAN - // Set CAN device name - CAND1.deviceName = "can0"; - - initCan(); -#endif // HAL_USE_CAN - - initPeriodicEvents(); extern bool main_loop_started;