hip9011: fixe debug

This commit is contained in:
Andrey Gusakov 2024-07-10 23:55:01 +03:00 committed by rusefillc
parent 0983cfc622
commit edda861246
3 changed files with 8 additions and 2 deletions

View File

@ -626,8 +626,9 @@ static void showHipInfo() {
instance.getBand(PASS_HIP_PARAMS),
instance.bandIdx);
efiPrintf(" Integrator idx 0x%x",
instance.intergratorIdx);
efiPrintf(" Integrator %d uS idx 0x%x RPM %d",
instance.getIntegrationTimeByIndex(instance.intergratorIdx),
instance.intergratorIdx, instance.rpmLookup[INT_LOOKUP_SIZE - 1 - instance.intergratorIdx]);
efiPrintf(" Gain %.2f idx 0x%x",
engineConfiguration->hip9011Gain,

View File

@ -137,6 +137,10 @@ int HIP9011::getIntegrationIndexByRpm(float rpm) {
return i == -1 ? INT_LOOKUP_SIZE - 1 : INT_LOOKUP_SIZE - i - 1;
}
int HIP9011::getIntegrationTimeByIndex(int index) {
return integratorValues[index & 0x1f];
}
void HIP9011::setAngleWindowWidth(DEFINE_HIP_PARAMS) {
float new_angleWindowWidth = GET_CONFIG_VALUE(knockSamplingDuration);
if (new_angleWindowWidth < 0) {

View File

@ -92,6 +92,7 @@ public:
int readValueAndHandleChannel(DEFINE_HIP_PARAMS);
float getBand(DEFINE_HIP_PARAMS);
int getIntegrationIndexByRpm(float rpm);
int getIntegrationTimeByIndex(int index);
int getBandIndex(DEFINE_HIP_PARAMS);
int getGainIndex(DEFINE_HIP_PARAMS);