Skip to content

Commit

Permalink
int rpm -> float rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Sep 25, 2024
1 parent b90f38a commit c880ba4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion firmware/controllers/actuators/vvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ expected<angle_t> VvtController::observePlant() const {
}

expected<angle_t> VvtController::getSetpoint() {
int rpm = Sensor::getOrZero(SensorType::Rpm);
float rpm = Sensor::getOrZero(SensorType::Rpm);
float load = getFuelingLoad();
float target = m_targetMap->getValue(rpm, load);

Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/accel_enrichment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ floatms_t TpsAccelEnrichment::getTpsEnrichment() {
// If disabled, return 0.
return 0;
}
int rpm = Sensor::getOrZero(SensorType::Rpm);
float rpm = Sensor::getOrZero(SensorType::Rpm);
if (rpm == 0) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/advance_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ angle_t getCylinderIgnitionTrim(size_t cylinderNumber, float rpm, float ignition
/**
* this method is used to build default advance map
*/
float getInitialAdvance(int rpm, float map, float advanceMax);
float getInitialAdvance(float rpm, float map, float advanceMax);

size_t getMultiSparkCount(float rpm);

Expand Down
4 changes: 2 additions & 2 deletions firmware/controllers/algo/defaults/default_ignition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static void setDefaultIatTimingCorrection() {
copyArray(config->ignitionIatCorrTable[2], {0, 0, 0, 0, 0, 0, -1, -2});
}

static float getAdvanceForRpm(int rpm, float advanceMax) {
static float getAdvanceForRpm(float rpm, float advanceMax) {
if (rpm >= 3000)
return advanceMax;
if (rpm < 600)
Expand All @@ -39,7 +39,7 @@ static float getAdvanceForRpm(int rpm, float advanceMax) {

#define round10(x) efiRound(x, 0.1)

float getInitialAdvance(int rpm, float map, float advanceMax) {
float getInitialAdvance(float rpm, float map, float advanceMax) {
map = minF(map, 100);
float advance = getAdvanceForRpm(rpm, advanceMax);

Expand Down

0 comments on commit c880ba4

Please sign in to comment.