only:EPIC: Improve toolset for default tune canned tune generation #4871

This commit is contained in:
Andrey 2023-11-25 18:18:59 -05:00
parent d56d591c2d
commit 80b65f95fc
2 changed files with 17 additions and 3 deletions

View File

@ -53,6 +53,9 @@ ifeq ($(USE_OPT),)
endif
endif
# Pretend we are all different hardware so that all canned engine configs are included
USE_OPT += -DHW_HELLEN_HYUNDAI=1
# See explanation in main firmware Makefile for these three defines
USE_OPT += $(SIMULATOR_DEBUG_LEVEL_OPT) $(RUSEFI_OPT) -DEFI_UNIT_TEST=0 -DEFI_PROD_CODE=0 -DEFI_SIMULATOR=1

View File

@ -97,8 +97,8 @@ static void runCanGpioTest() {
}
// todo: reuse intFlashWrite method?
static void writeSimulatorTune() {
FILE *ptr = fopen(SIMULATOR_TUNE_BIN_FILE_NAME, "wb");
static void writeSimulatorTune(const char *fileName) {
FILE *ptr = fopen(fileName, "wb");
if (ptr == nullptr) {
printf("ERROR creating file: [%s]\n", SIMULATOR_TUNE_BIN_FILE_NAME);
printf("Please check folder exists and is writeable.");
@ -169,6 +169,17 @@ void rusEfiFunctionalTest(void) {
// todo: reduce code duplication with initRealHardwareEngineController
initFlash();
engineConfiguration->engineType = engine_type_e::HELLEN_154_HYUNDAI_COUPE_BK2;
resetConfigurationExt(engineConfiguration->engineType);
char fileName[3000];
sprintf(fileName, "%s_%d%s",
SIMULATOR_TUNE_BIN_FILE_NAME_PREFIX,
(int)engineConfiguration->engineType,
SIMULATOR_TUNE_BIN_FILE_NAME_SUFFIX
);
writeSimulatorTune(fileName);
// this here is really 'reset to default configuration'
loadConfiguration();
commonInitEngineController();
@ -179,7 +190,7 @@ void rusEfiFunctionalTest(void) {
enableTriggerStimulator(false);
#endif
writeSimulatorTune();
writeSimulatorTune(SIMULATOR_TUNE_BIN_FILE_NAME);
/**
* !!!! TESTS !