Skip to content

Commit

Permalink
etb: use convertVoltageTo10bitADC in auto-cal
Browse files Browse the repository at this point in the history
  • Loading branch information
nmschulte committed Jun 13, 2024
1 parent 253578d commit 1c74a86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firmware/controllers/actuators/electronic_throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,17 +723,17 @@ struct EtbImpl final : public TBase {

// Write out the learned values to TS, waiting briefly after setting each to let TS grab it
engine->outputChannels.calibrationMode = (uint8_t)functionToCalModePriMax(myFunction);
engine->outputChannels.calibrationValue = primaryMax * TPS_TS_CONVERSION;
engine->outputChannels.calibrationValue = convertVoltageTo10bitADC(primaryMax);
chThdSleepMilliseconds(500);
engine->outputChannels.calibrationMode = (uint8_t)functionToCalModePriMin(myFunction);
engine->outputChannels.calibrationValue = primaryMin * TPS_TS_CONVERSION;
engine->outputChannels.calibrationValue = convertVoltageTo10bitADC(primaryMin);
chThdSleepMilliseconds(500);

engine->outputChannels.calibrationMode = (uint8_t)functionToCalModeSecMax(myFunction);
engine->outputChannels.calibrationValue = secondaryMax * TPS_TS_CONVERSION;
engine->outputChannels.calibrationValue = convertVoltageTo10bitADC(secondaryMax);
chThdSleepMilliseconds(500);
engine->outputChannels.calibrationMode = (uint8_t)functionToCalModeSecMin(myFunction);
engine->outputChannels.calibrationValue = secondaryMin * TPS_TS_CONVERSION;
engine->outputChannels.calibrationValue = convertVoltageTo10bitADC(secondaryMin);
chThdSleepMilliseconds(500);

engine->outputChannels.calibrationMode = (uint8_t)TsCalMode::None;
Expand Down

0 comments on commit 1c74a86

Please sign in to comment.