HW_CHECK_MODE

This commit is contained in:
rusefi 2020-05-20 22:15:47 -04:00
parent 61d481d40e
commit 416855c2f1
6 changed files with 36 additions and 5 deletions

View File

@ -3,7 +3,8 @@ cd ../../..
set PROJECT_BOARD=microrusefi set PROJECT_BOARD=microrusefi
set PROJECT_CPU=ARCH_STM32F4 set PROJECT_CPU=ARCH_STM32F4
set DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=MRE_BOARD_TEST set DEFAULT_ENGINE_TYPE=-DDEFAULT_ENGINE_TYPE=MRE_BOARD_TEST
set EXTRA_PARAMS=-DHW_CHECK_MODE=TRUE
call config/boards/common_make.bat call config/boards/common_make.bat

View File

@ -862,9 +862,15 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin
break; break;
#endif /* ENABLE_PERF_TRACE */ #endif /* ENABLE_PERF_TRACE */
case TS_GET_CONFIG_ERROR: case TS_GET_CONFIG_ERROR: {
sr5SendResponse(tsChannel, TS_CRC, reinterpret_cast<const uint8_t*>(getFirmwareError()), strlen(getFirmwareError())); #if HW_CHECK_MODE
#define configError "FACTORY_MODE_PLEASE_CONTACT_SUPPORT"
#else
char * configError = getFirmwareError();
#endif // HW_CHECK_MODE
sr5SendResponse(tsChannel, TS_CRC, reinterpret_cast<const uint8_t*>(configError), strlen(configError));
break; break;
}
default: default:
tunerStudioError("ERROR: ignoring unexpected command"); tunerStudioError("ERROR: ignoring unexpected command");
return false; return false;

View File

@ -67,7 +67,7 @@ typedef struct {
#define TS_PAGE_COMMAND 'P' // 0x50 #define TS_PAGE_COMMAND 'P' // 0x50
#define TS_COMMAND_F 'F' // 0x46 #define TS_COMMAND_F 'F' // 0x46
#define TS_GET_FIRMWARE_VERSION 'V' // versionInfo #define TS_GET_FIRMWARE_VERSION 'V' // versionInfo
#define TS_GET_CONFIG_ERROR 'e' // returns getFirmwareError() #define TS_GET_CONFIG_ERROR 'e' // returns getFirmwareError(), works together with ind_hasFatalError
// High speed logger commands // High speed logger commands
#define TS_SET_LOGGER_MODE 'l' #define TS_SET_LOGGER_MODE 'l'

View File

@ -602,6 +602,11 @@ class CommunicationBlinkingTask : public PeriodicTimerController {
setAllLeds(0); setAllLeds(0);
} else if (counter % 2 == 0) { } else if (counter % 2 == 0) {
enginePins.communicationLedPin.setValue(0); enginePins.communicationLedPin.setValue(0);
#if HW_CHECK_MODE
// we have to do anything possible to help users notice FACTORY MODE
enginePins.errorLedPin.setValue(1);
enginePins.runningLedPin.setValue(1);
#endif // HW_CHECK_MODE
if (!lowVBatt) { if (!lowVBatt) {
enginePins.warningLedPin.setValue(0); enginePins.warningLedPin.setValue(0);
} }
@ -623,6 +628,12 @@ class CommunicationBlinkingTask : public PeriodicTimerController {
} }
enginePins.communicationLedPin.setValue(1); enginePins.communicationLedPin.setValue(1);
#if HW_CHECK_MODE
// we have to do anything possible to help users notice FACTORY MODE
enginePins.errorLedPin.setValue(0);
enginePins.runningLedPin.setValue(0);
#endif // HW_CHECK_MODE
#if EFI_ENGINE_CONTROL #if EFI_ENGINE_CONTROL
if (lowVBatt || isTriggerErrorNow() || isIgnitionTimingError() || consoleByteArrived) { if (lowVBatt || isTriggerErrorNow() || isIgnitionTimingError() || consoleByteArrived) {
consoleByteArrived = false; consoleByteArrived = false;
@ -814,7 +825,11 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->knockCount = engine->knockCount; tsOutputChannels->knockCount = engine->knockCount;
tsOutputChannels->knockLevel = engine->knockVolts; tsOutputChannels->knockLevel = engine->knockVolts;
#if HW_CHECK_MODE
tsOutputChannels->hasCriticalError = 1;
#else
tsOutputChannels->hasCriticalError = hasFirmwareError(); tsOutputChannels->hasCriticalError = hasFirmwareError();
#endif // HW_CHECK_MODE
tsOutputChannels->isWarnNow = engine->engineState.warnings.isWarningNow(timeSeconds, true); tsOutputChannels->isWarnNow = engine->engineState.warnings.isWarningNow(timeSeconds, true);
#if EFI_HIP_9011 #if EFI_HIP_9011

View File

@ -717,6 +717,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0) if (initBootloader() != 0)
return 123; return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */ #endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20200515; return 20200520;
} }
#endif /* EFI_UNIT_TEST */ #endif /* EFI_UNIT_TEST */

View File

@ -190,6 +190,15 @@ void runRusEfi(void) {
*/ */
readConfiguration(&sharedLogger); readConfiguration(&sharedLogger);
#endif /* EFI_INTERNAL_FLASH */ #endif /* EFI_INTERNAL_FLASH */
#if HW_CHECK_MODE
// we need a special binary for final assembly check. We cannot afford to require too much software or too many steps
// to be executed at the place of assembly
engine->directSelfStimulation = true;
#endif // HW_CHECK_MODE
#ifndef EFI_ACTIVE_CONFIGURATION_IN_FLASH #ifndef EFI_ACTIVE_CONFIGURATION_IN_FLASH
// TODO: need to fix this place!!! should be a version of PASS_ENGINE_PARAMETER_SIGNATURE somehow // TODO: need to fix this place!!! should be a version of PASS_ENGINE_PARAMETER_SIGNATURE somehow
prepareVoidConfiguration(&activeConfiguration); prepareVoidConfiguration(&activeConfiguration);