hellen on a bike: both TS and SD card logs report -32v on secondary TPS and secondary PPS #6376
only: work-around
This commit is contained in:
parent
294040c22a
commit
2519b3fa53
|
@ -86,10 +86,12 @@ static adcsample_t getAvgAdcValue(int index, adcsample_t *samples, int bufDepth,
|
||||||
uint32_t result = 0;
|
uint32_t result = 0;
|
||||||
for (int i = 0; i < bufDepth; i++) {
|
for (int i = 0; i < bufDepth; i++) {
|
||||||
adcsample_t sample = samples[index];
|
adcsample_t sample = samples[index];
|
||||||
if (sample > 0x1FFF) {
|
// if (sample > 0x1FFF) {
|
||||||
// 12bit ADC expected right now, make this configurable one day
|
// // 12bit ADC expected right now, make this configurable one day
|
||||||
criticalError("fast ADC unexpected sample %d", sample);
|
// criticalError("fast ADC unexpected sample %d", sample);
|
||||||
} else if (sample > 0xFFF) {
|
// } else
|
||||||
|
if (sample > 0xFFF) {
|
||||||
|
sample = sample & 0xFFF; // sad hack which works around https://github.com/rusefi/rusefi/issues/6376 which we do not understand
|
||||||
engine->outputChannels.adc13bitCounter++;
|
engine->outputChannels.adc13bitCounter++;
|
||||||
}
|
}
|
||||||
result += sample;
|
result += sample;
|
||||||
|
|
Loading…
Reference in New Issue