indent formatting

This commit is contained in:
Matthew Kennedy 2023-06-01 11:09:30 -07:00
parent 2255399257
commit 8b5825adc4
13 changed files with 74 additions and 74 deletions

View File

@ -51,13 +51,13 @@ public:
DcHardware() : dcMotor(m_disablePin) {}
void start(bool useTwoWires,
brain_pin_e pinEnable,
brain_pin_e pinDir1,
brain_pin_e pinDir2,
brain_pin_e pinDisable,
bool isInverted,
ExecutorInterface* executor,
int frequency);
brain_pin_e pinEnable,
brain_pin_e pinDir1,
brain_pin_e pinDir2,
brain_pin_e pinDisable,
bool isInverted,
ExecutorInterface* executor,
int frequency);
TwoPinDcMotor dcMotor;

View File

@ -222,9 +222,9 @@ void EtbController::onConfigurationChange(pid_s* previousConfiguration) {
if (m_motor && !m_pid.isSame(previousConfiguration)) {
m_shouldResetPid = true;
}
m_dutyRocAverage.init(engineConfiguration->etbRocExpAverageLength);
m_dutyAverage.init(engineConfiguration->etbExpAverageLength);
doInitElectronicThrottle();
m_dutyRocAverage.init(engineConfiguration->etbRocExpAverageLength);
m_dutyAverage.init(engineConfiguration->etbExpAverageLength);
doInitElectronicThrottle();
}
void EtbController::showStatus() {
@ -297,9 +297,9 @@ expected<percent_t> EtbController::getSetpointEtb() {
percent_t targetPosition = idlePosition + getLuaAdjustment();
#if EFI_ANTILAG_SYSTEM
if (engine->antilagController.isAntilagCondition) {
targetPosition += engineConfiguration->ALSEtbAdd;
}
if (engine->antilagController.isAntilagCondition) {
targetPosition += engineConfiguration->ALSEtbAdd;
}
#endif /* EFI_ANTILAG_SYSTEM */
// Apply any adjustment that this throttle alone needs
@ -376,7 +376,7 @@ expected<percent_t> EtbController::getOpenLoop(percent_t target) {
if (m_function != DC_Wastegate) {
etbFeedForward = interpolate2d(target, config->etbBiasBins, config->etbBiasValues);
} else {
etbFeedForward = 0;
etbFeedForward = 0;
}
return etbFeedForward;
@ -541,10 +541,10 @@ bool EtbController::checkStatus() {
#endif /* EFI_TUNER_STUDIO */
if (!isEtbMode()) {
// no validation for h-bridge or idle mode
return true;
}
// ETB-specific code belo. The whole mix-up between DC and ETB is shameful :(
// no validation for h-bridge or idle mode
return true;
}
// ETB-specific code belo. The whole mix-up between DC and ETB is shameful :(
m_pid.iTermMin = engineConfiguration->etb_iTermMin;
m_pid.iTermMax = engineConfiguration->etb_iTermMax;
@ -596,7 +596,7 @@ bool EtbController::checkStatus() {
etbErrorCode = (int8_t)localReason;
return localReason == TpsState::None;
return localReason == TpsState::None;
}
void EtbController::update() {
@ -613,7 +613,7 @@ void EtbController::update() {
return;
}
bool isOk = checkStatus();
bool isOk = checkStatus();
if (!isOk) {
// If engine is stopped and so configured, skip the ETB update entirely

View File

@ -93,13 +93,13 @@ private:
// todo: rename to m_targetErrorAccumulator
ErrorAccumulator m_errorAccumulator;
/**
* @return true if OK, false if should be disabled
*/
bool checkStatus();
bool isEtbMode() {
return m_function == DC_Throttle1 || m_function == DC_Throttle2;
}
/**
* @return true if OK, false if should be disabled
*/
bool checkStatus();
bool isEtbMode() {
return m_function == DC_Throttle1 || m_function == DC_Throttle2;
}
ExpAverage m_dutyRocAverage;
ExpAverage m_dutyAverage;

View File

@ -318,7 +318,7 @@ float IdleController::getIdlePosition(float rpm) {
bool isAutomaticIdle = tps.Valid && engineConfiguration->idleMode == IM_AUTO;
isVerboseIAC = engineConfiguration->isVerboseIAC && isAutomaticIdle;
isVerboseIAC = engineConfiguration->isVerboseIAC && isAutomaticIdle;
if (isVerboseIAC) {
efiPrintf("Idle state %s", getIdle_state_e(idleState));
getIdlePid()->showPidStatus("idle");

View File

@ -159,9 +159,9 @@ void stopVvtControlPins() {
}
void initVvtActuators() {
if (engineConfiguration->vvtControlMinRpm < engineConfiguration->cranking.rpm) {
engineConfiguration->vvtControlMinRpm = engineConfiguration->cranking.rpm;
}
if (engineConfiguration->vvtControlMinRpm < engineConfiguration->cranking.rpm) {
engineConfiguration->vvtControlMinRpm = engineConfiguration->cranking.rpm;
}
vvtTable1.init(config->vvtTable1, config->vvtTable1LoadBins,
config->vvtTable1RpmBins);

View File

@ -53,15 +53,15 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
);
#if EFI_ANTILAG_SYSTEM
if (engine->antilagController.isAntilagCondition) {
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
if (engine->antilagController.isAntilagCondition) {
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
engine->antilagController.timingALSCorrection = interpolate3d(
config->ALSTimingRetardTable,
config->alsIgnRetardLoadBins, throttleIntent,
config->alsIgnRetardrpmBins, rpm
);
advanceAngle += engine->antilagController.timingALSCorrection;
}
}
#endif /* EFI_ANTILAG_SYSTEM */
// Add any adjustments if configured
@ -78,7 +78,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
// get advance from the separate table for Idle
#if EFI_IDLE_CONTROL
if (engineConfiguration->useSeparateAdvanceForIdle &&
engine->module<IdleController>()->isIdlingOrTaper()) {
engine->module<IdleController>()->isIdlingOrTaper()) {
float idleAdvance = interpolate2d(rpm, config->idleAdvanceBins, config->idleAdvance);
auto tps = Sensor::get(SensorType::DriverThrottleIntent);
@ -91,15 +91,15 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
#if EFI_LAUNCH_CONTROL
if (engine->launchController.isLaunchCondition && engineConfiguration->enableLaunchRetard) {
if (engineConfiguration->launchSmoothRetard) {
float launchAngle = engineConfiguration->launchTimingRetard;
int launchRpm = engineConfiguration->launchRpm;
int launchRpmWithTimingRange = launchRpm + engineConfiguration->launchTimingRpmRange;
if (engineConfiguration->launchSmoothRetard) {
float launchAngle = engineConfiguration->launchTimingRetard;
int launchRpm = engineConfiguration->launchRpm;
int launchRpmWithTimingRange = launchRpm + engineConfiguration->launchTimingRpmRange;
// interpolate timing from rpm at launch triggered to full retard at launch launchRpm + launchTimingRpmRange
return interpolateClamped(launchRpm, advanceAngle, launchRpmWithTimingRange, launchAngle, rpm);
} else {
return engineConfiguration->launchTimingRetard;
}
}
}
#endif /* EFI_LAUNCH_CONTROL */

View File

@ -69,12 +69,12 @@ bool AntilagSystemBase::isAntilagConditionMet(int rpm) {
ALSMaxThrottleIntentCondition = isALSMaxThrottleIntentCondition();
ALSSwitchCondition = isInsideALSSwitchCondition();
return ALSMinRPMCondition &&
ALSMaxRPMCondition &&
ALSMinCLTCondition &&
ALSMaxCLTCondition &&
ALSMaxThrottleIntentCondition &&
ALSSwitchCondition;
return ALSMinRPMCondition &&
ALSMaxRPMCondition &&
ALSMinCLTCondition &&
ALSMaxCLTCondition &&
ALSMaxThrottleIntentCondition &&
ALSSwitchCondition;
}
void AntilagSystemBase::update() {

View File

@ -74,7 +74,7 @@ trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) {
case VVT_BOSCH_QUICK_START:
return TT_VVT_BOSCH_QUICK_START;
case VVT_HONDA_K_EXHAUST:
return TT_HONDA_K_CAM_4_1;
return TT_HONDA_K_CAM_4_1;
case VVT_HONDA_K_INTAKE:
case VVT_FIRST_HALF:
case VVT_SECOND_HALF:
@ -85,7 +85,7 @@ trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) {
case VVT_BARRA_3_PLUS_1:
return TT_VVT_BARRA_3_PLUS_1;
case VVT_MAZDA_SKYACTIV:
return TT_VVT_MAZDA_SKYACTIV;
return TT_VVT_MAZDA_SKYACTIV;
case VVT_NISSAN_VQ:
return TT_VVT_NISSAN_VQ35;
case VVT_TOYOTA_4_1:

View File

@ -420,12 +420,12 @@ static void setDefaultEngineConfiguration() {
setDefaultEtbBiasCurve();
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
#if EFI_BOOST_CONTROL
setDefaultBoostParameters();
setDefaultBoostParameters();
#endif
// OBD-II default rate is 500kbps
engineConfiguration->canBaudRate = B500KBPS;
engineConfiguration->can2BaudRate = B500KBPS;
// OBD-II default rate is 500kbps
engineConfiguration->canBaudRate = B500KBPS;
engineConfiguration->can2BaudRate = B500KBPS;
engineConfiguration->mafSensorType = Bosch0280218037;
setBosch0280218037(config);
@ -504,7 +504,7 @@ static void setDefaultEngineConfiguration() {
engineConfiguration->launchRpm = 3000;
// engineConfiguration->launchTimingRetard = 10;
engineConfiguration->launchTimingRpmRange = 500;
engineConfiguration->launchSpeedThreshold = 30;
engineConfiguration->launchSpeedThreshold = 30;
engineConfiguration->hardCutRpmRange = 500;
engineConfiguration->engineSnifferRpmThreshold = 2500;
@ -978,8 +978,8 @@ void validateConfiguration() {
engineConfiguration->adcVcc = 3.3f;
}
if (engineConfiguration->instantRpmRange == 0) {
// todo: extract constant in instant_rpm_calculator.h?
engineConfiguration->instantRpmRange = 90;
// todo: extract constant in instant_rpm_calculator.h?
engineConfiguration->instantRpmRange = 90;
}
engine->preCalculate();
}

View File

@ -177,7 +177,7 @@ typedef enum __attribute__ ((__packed__)) {
// 84
HELLEN_121_NISSAN_4_CYL = 84,
HELLEN_121_NISSAN_8_CYL = 85,
HELLEN_121_NISSAN_8_CYL = 85,
HELLEN_NB2_36 = 86,
@ -195,14 +195,14 @@ typedef enum __attribute__ ((__packed__)) {
ET_UNUSED_93 = 93,
HELLEN_NB1_36 = 94,
HELLEN_NB1_36 = 94,
HELLEN_154_HYUNDAI_COUPE_BK2 = 95,
WASTEGATE_PROTEUS_TEST = 96,
WASTEGATE_PROTEUS_TEST = 96,
PROTEUS_MIATA_NA6 = 4,
ET_UNUSED_97 = 97,
ET_UNUSED_98 = 98,
ET_UNUSED_97 = 97,
ET_UNUSED_98 = 98,
ET_UNUSED_17 = 17,
ET_UNUSED_11 = 11,
ET_UNUSED_12 = 12,
@ -220,8 +220,8 @@ typedef enum __attribute__ ((__packed__)) {
TEST_101 = 101,
TEST_102 = 102,
// java code generator handles this value in a special way
// also looks like 2 enums are either 1 byte or 4 bytes
// java code generator handles this value in a special way
// also looks like 2 enums are either 1 byte or 4 bytes
Force_4_bytes_size_engine_type = 70000,
} engine_type_e;

View File

@ -394,17 +394,17 @@ float getBaroCorrection() {
percent_t getFuelALSCorrection(int rpm) {
#if EFI_ANTILAG_SYSTEM
if (engine->antilagController.isAntilagCondition) {
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
auto AlsFuelAdd = interpolate3d(
if (engine->antilagController.isAntilagCondition) {
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
auto AlsFuelAdd = interpolate3d(
config->ALSFuelAdjustment,
config->alsFuelAdjustmentLoadBins, throttleIntent,
config->alsFuelAdjustmentrpmBins, rpm
);
return AlsFuelAdd;
} else
);
return AlsFuelAdd;
} else
#endif /* EFI_ANTILAG_SYSTEM */
{
{
return 0;
}
}

View File

@ -113,7 +113,7 @@ void LaunchControlBase::update() {
or it is supposed to be referencing 'launchTimingRpmRange'?
+ (engineConfiguration->enableLaunchRetard ? engineConfiguration->launchAdvanceRpmRange : 0)
*/
+ engineConfiguration->hardCutRpmRange;
+ engineConfiguration->hardCutRpmRange;
if (!combinedConditions) {
// conditions not met, reset timer

View File

@ -204,12 +204,12 @@ void sendCanVerbose() {
auto base = engineConfiguration->verboseCanBaseAddress;
auto isExt = engineConfiguration->rusefiVerbose29b;
transmitStruct<Status> (base + 0, isExt);
transmitStruct<Speeds> (base + 1, isExt);
transmitStruct<PedalAndTps> (base + CAN_PEDAL_TPS_OFFSET, isExt);
transmitStruct<Status> (base + 0, isExt);
transmitStruct<Speeds> (base + 1, isExt);
transmitStruct<PedalAndTps> (base + CAN_PEDAL_TPS_OFFSET, isExt);
transmitStruct<Sensors1> (base + CAN_SENSOR_1_OFFSET, isExt);
transmitStruct<Sensors2> (base + 4, isExt);
transmitStruct<Fueling> (base + 5, isExt);
transmitStruct<Fueling> (base + 5, isExt);
transmitStruct<Fueling2> (base + 6, isExt);
transmitStruct<Fueling3> (base + 7, isExt);
transmitStruct<Cams> (base + 8, isExt);