rusEFI online engine crc

This commit is contained in:
rusefi 2020-05-09 22:43:39 -04:00
parent c59271c669
commit fcbba66e89
3 changed files with 11 additions and 2 deletions

View File

@ -765,8 +765,6 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->totalTriggerErrorCounter = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
// 132
tsOutputChannels->orderingErrorCounter = engine->triggerCentral.triggerState.orderingErrorCounter;
// 134 we take 2 bytes of crc32, no idea if it's right to call it crc16 or not
tsOutputChannels->engineMakeCodeNameCrc16 = crc32(engineConfiguration->engineMake, 3 * VEHICLE_INFO_SIZE);
// 68
tsOutputChannels->baroCorrection = engine->engineState.baroCorrection;
// 140

View File

@ -27,6 +27,10 @@
#include "sensor.h"
#include "gppwm.h"
#if EFI_TUNER_STUDIO
#include "tunerstudio_configuration.h"
#endif /* EFI_TUNER_STUDIO */
#if EFI_PROD_CODE
#include "bench_test.h"
#else
@ -238,11 +242,17 @@ void Engine::reset() {
* so that we can prepare some helper structures
*/
void Engine::preCalculate(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// todo: start using this 'adcToVoltageInputDividerCoefficient' micro-optimization or... throw it away?
#if HAL_USE_ADC
adcToVoltageInputDividerCoefficient = adcToVolts(1) * engineConfiguration->analogInputDividerCoefficient;
#else
adcToVoltageInputDividerCoefficient = engineConfigurationPtr->analogInputDividerCoefficient;
#endif
#if EFI_TUNER_STUDIO
// we take 2 bytes of crc32, no idea if it's right to call it crc16 or not
tsOutputChannels.engineMakeCodeNameCrc16 = crc32(engineConfiguration->engineMake, 3 * VEHICLE_INFO_SIZE);
#endif /* EFI_TUNER_STUDIO */
}
#if EFI_SHAFT_POSITION_INPUT

View File

@ -1406,6 +1406,7 @@ void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (engineConfiguration->adcVcc > 5.0f || engineConfiguration->adcVcc < 1.0f) {
engineConfiguration->adcVcc = 3.0f;
}
engine->preCalculate(PASS_ENGINE_PARAMETER_SIGNATURE);
}
void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_SUFFIX) {