fsio_setting to use human indexes
This commit is contained in:
parent
bf1834cdcc
commit
e954b16138
|
@ -465,7 +465,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
|
||||||
#if EFI_FSIO || defined(__DOXYGEN__)
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
// /**
|
// /**
|
||||||
// * set_fsio_setting 0 0.55
|
// * set_fsio_setting 1 0.55
|
||||||
// */
|
// */
|
||||||
// boardConfiguration->fsio_setting[0] = 0.55;
|
// boardConfiguration->fsio_setting[0] = 0.55;
|
||||||
// setFsioExt(0, GPIOE_5, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
|
// setFsioExt(0, GPIOE_5, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
|
||||||
|
|
|
@ -227,19 +227,19 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
// VICS solenoid
|
// VICS solenoid
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 0 5000
|
* set_fsio_setting 1 5000
|
||||||
*/
|
*/
|
||||||
boardConfiguration->fsio_setting[0] = 5000;
|
boardConfiguration->fsio_setting[0] = 5000;
|
||||||
// set_rpn_expression 1 "rpm 0 fsio_setting >"
|
// set_rpn_expression 1 "rpm 0 fsio_setting >"
|
||||||
setFsioExt(0, GPIOE_3, "rpm 0 fsio_setting >", 150 PASS_ENGINE_PARAMETER);
|
setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting >", 150 PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
|
|
||||||
// warning light
|
// warning light
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 1 1800
|
* set_fsio_setting 2 1800
|
||||||
* set_fsio_setting 2 95
|
* set_fsio_setting 3 95
|
||||||
* set_fsio_setting 3 14
|
* set_fsio_setting 4 14
|
||||||
*
|
*
|
||||||
* set_rpn_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
* set_rpn_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
||||||
* eval "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
* eval "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
||||||
|
@ -248,7 +248,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
boardConfiguration->fsio_setting[2] = 90; // CLT threshold
|
boardConfiguration->fsio_setting[2] = 90; // CLT threshold
|
||||||
boardConfiguration->fsio_setting[3] = 13.5; // voltage threshold
|
boardConfiguration->fsio_setting[3] = 13.5; // voltage threshold
|
||||||
|
|
||||||
setFsio(1, GPIOC_13, "rpm 1 fsio_setting > coolant 2 fsio_setting > | vbatt 3 fsio_setting < |" PASS_ENGINE_PARAMETER);
|
setFsio(1, GPIOC_13, "rpm 2 fsio_setting > coolant 3 fsio_setting > | vbatt 4 fsio_setting < |" PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
|
|
||||||
config->ignitionRpmBins[0] = 800;
|
config->ignitionRpmBins[0] = 800;
|
||||||
|
|
|
@ -52,10 +52,10 @@ void setLadaKalina(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
// starter relay solenoid
|
// starter relay solenoid
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 0 5000
|
* set_fsio_setting 1 5000
|
||||||
*/
|
*/
|
||||||
engineConfiguration->bc.fsio_setting[0] = 500;
|
engineConfiguration->bc.fsio_setting[0] = 500;
|
||||||
// set_rpn_expression 1 "rpm 0 fsio_setting <"
|
// set_rpn_expression 1 "rpm 0 fsio_setting <"
|
||||||
setFsioExt(0, GPIOE_3, "rpm 0 fsio_setting <", 0 PASS_ENGINE_PARAMETER);
|
setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting <", 0 PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,28 +167,29 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
// warning light
|
// warning light
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 0 1800
|
* set_fsio_setting 1 1800
|
||||||
* set_fsio_setting 1 95
|
* set_fsio_setting 2 95
|
||||||
* set_fsio_setting 3 14
|
* set_fsio_setting 4 14
|
||||||
*
|
*
|
||||||
* set_rpn_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
* set_rpn_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
||||||
* rpn_eval "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
* rpn_eval "rpm 1 fsio_setting > coolant 2 fsio_setting > | vbatt 4 fsio_setting < |"
|
||||||
*/
|
*/
|
||||||
boardConfiguration->fsio_setting[0] = 6400; // RPM threshold
|
boardConfiguration->fsio_setting[0] = 6400; // RPM threshold
|
||||||
boardConfiguration->fsio_setting[1] = 100; // CLT threshold
|
boardConfiguration->fsio_setting[1] = 100; // CLT threshold, fsio_setting #2
|
||||||
boardConfiguration->fsio_setting[2] = 13.0; // voltage threshold
|
boardConfiguration->fsio_setting[2] = 13.0; // voltage threshold, fsio_setting #3
|
||||||
|
|
||||||
// set_fsio_setting 3 3000
|
// set_fsio_setting 4 3000
|
||||||
boardConfiguration->fsio_setting[3] = 3000; // oil pressure RPM
|
boardConfiguration->fsio_setting[3] = 3000; // oil pressure RPM, fsio_setting #4
|
||||||
// set_fsio_setting 4 0.52
|
// set_fsio_setting 5 0.52
|
||||||
boardConfiguration->fsio_setting[4] = 0.52; // oil pressure threshold
|
boardConfiguration->fsio_setting[4] = 0.52; // oil pressure threshold, fsio_setting #5
|
||||||
|
|
||||||
// * set_rpn_expression 1 "rpm 3 fsio_setting >"
|
// * set_rpn_expression 1 "rpm 3 fsio_setting >"
|
||||||
// rpn_eval "rpm 3 fsio_setting >"
|
// rpn_eval "rpm 1 fsio_setting >"
|
||||||
// rpn_eval "fsio_input"
|
// rpn_eval "fsio_input"
|
||||||
|
|
||||||
// set_rpn_expression 0 "rpm 3 fsio_setting > fsio_input 4 fsio_setting < & rpm 0 fsio_setting | > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
// set_fsio_expression 0 "((rpm > fsio_setting(4) & (fsio_input < fsio_setting(5)) | rpm > fsio_setting(1) | (coolant > fsio_setting(2) > | (vbatt < fsio_setting(3)"
|
||||||
|
|
||||||
|
// todo: convert
|
||||||
setFsio(0, GPIOC_13, "rpm 3 fsio_setting > fsio_input 4 fsio_setting < & rpm 0 fsio_setting | > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |" PASS_ENGINE_PARAMETER);
|
setFsio(0, GPIOC_13, "rpm 3 fsio_setting > fsio_input 4 fsio_setting < & rpm 0 fsio_setting | > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |" PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
|
boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
|
||||||
|
|
|
@ -83,7 +83,7 @@ void setMazdaMiataNb1EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
// VICS solenoid
|
// VICS solenoid
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 0 5000
|
* set_fsio_setting 1 5000
|
||||||
*/
|
*/
|
||||||
boardConfiguration->fsio_setting[0] = 5000;
|
boardConfiguration->fsio_setting[0] = 5000;
|
||||||
// (self and (rpm > 4800)) OR (rpm > 5000)
|
// (self and (rpm > 4800)) OR (rpm > 5000)
|
||||||
|
|
|
@ -129,7 +129,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
engineConfiguration->auxPidFrequency[0] = 300;
|
engineConfiguration->auxPidFrequency[0] = 300;
|
||||||
engineConfiguration->auxPidPins[0] = GPIOE_3; // VVT solenoid control
|
engineConfiguration->auxPidPins[0] = GPIOE_3; // VVT solenoid control
|
||||||
// /**
|
// /**
|
||||||
// * set_fsio_setting 0 0.55
|
// * set_fsio_setting 1 0.55
|
||||||
// */
|
// */
|
||||||
boardConfiguration->fsio_setting[0] = 0.0;
|
boardConfiguration->fsio_setting[0] = 0.0;
|
||||||
// setFsioExt(0, GPIOE_3, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
|
// setFsioExt(0, GPIOE_3, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
|
||||||
|
|
|
@ -255,8 +255,8 @@ bool LECalculator::processElement(Engine *engine, LEElement *element) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LE_METHOD_FSIO_SETTING: {
|
case LE_METHOD_FSIO_SETTING: {
|
||||||
float i = pop(LE_METHOD_FSIO_SETTING);
|
float humanIndex = pop(LE_METHOD_FSIO_SETTING);
|
||||||
int index = (int) i;
|
int index = (int) humanIndex - 1;
|
||||||
if (index >= 0 && index < LE_COMMAND_COUNT) {
|
if (index >= 0 && index < LE_COMMAND_COUNT) {
|
||||||
push(element->action, engine->engineConfiguration->bc.fsio_setting[index]);
|
push(element->action, engine->engineConfiguration->bc.fsio_setting[index]);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -325,7 +325,11 @@ static void setFsioFrequency(int index, int frequency) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boardConfiguration->fsioFrequency[index] = frequency;
|
boardConfiguration->fsioFrequency[index] = frequency;
|
||||||
scheduleMsg(logger, "Setting FSIO frequency %d on #%d", frequency, index + 1);
|
if (frequency == 0) {
|
||||||
|
scheduleMsg(logger, "FSIO output #%d@%s set to on/off mode", index + 1, hwPortname(boardConfiguration->fsioPins[index]));
|
||||||
|
} else {
|
||||||
|
scheduleMsg(logger, "Setting FSIO frequency %dHz on #%d@%s", frequency, index + 1, hwPortname(boardConfiguration->fsioPins[index]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void runFsio(void) {
|
void runFsio(void) {
|
||||||
|
@ -426,16 +430,16 @@ static void showFsioInfo(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set_fsio_setting 0 0.11
|
* set_fsio_setting 1 0.11
|
||||||
*/
|
*/
|
||||||
static void setFsioSetting(float indexF, float value) {
|
static void setFsioSetting(float indexF, float value) {
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
int index = (int)indexF;
|
int humanIndex = (int)indexF;
|
||||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
if (humanIndex < 1 || humanIndex > LE_COMMAND_COUNT) {
|
||||||
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
scheduleMsg(logger, "invalid FSIO index: %d", humanIndex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
engineConfiguration->bc.fsio_setting[index] = value;
|
engineConfiguration->bc.fsio_setting[humanIndex] = value;
|
||||||
showFsioInfo();
|
showFsioInfo();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue