better error handling
This commit is contained in:
parent
a1f1ecd072
commit
f1b65ed4aa
|
@ -65,7 +65,7 @@ float getRpmByAngleWindowAndTimeUs(int timeUs, float angleWindowWidth) {
|
|||
}
|
||||
|
||||
int getIntegrationIndexByRpm(float rpm) {
|
||||
int i = findIndex(rpmLookup, INT_LOOKUP_SIZE, (rpm));
|
||||
int i = findIndexMsg("getIbR", rpmLookup, INT_LOOKUP_SIZE, (rpm));
|
||||
return i == -1 ? INT_LOOKUP_SIZE - 1 : INT_LOOKUP_SIZE - i - 1;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ int getHip9011GainIndex(float gain) {
|
|||
* @param frequency knock frequencey, in kHz
|
||||
*/
|
||||
int getHip9011BandIndex(float frequency) {
|
||||
return findIndex(bandFreqLookup, BAND_LOOKUP_SIZE, frequency);
|
||||
return findIndexMsg("freq", bandFreqLookup, BAND_LOOKUP_SIZE, frequency);
|
||||
}
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
|
|
@ -25,7 +25,7 @@ int getHip9011GainIndex(float gain);
|
|||
int getHip9011BandIndex(float frequency);
|
||||
void prepareHip9011RpmLookup(float angleWindowWidth);
|
||||
|
||||
#define GAIN_INDEX(gain) (GAIN_LOOKUP_SIZE - 1 - findIndex(gainLookupInReverseOrder, GAIN_LOOKUP_SIZE, (gain)))
|
||||
#define GAIN_INDEX(gain) (GAIN_LOOKUP_SIZE - 1 - findIndexMsg("fGain", gainLookupInReverseOrder, GAIN_LOOKUP_SIZE, (gain)))
|
||||
#define BAND(bore) (900 / (PIF * (bore) / 2))
|
||||
|
||||
extern float rpmLookup[INT_LOOKUP_SIZE];
|
||||
|
|
Loading…
Reference in New Issue