start/stop progress
This commit is contained in:
parent
165160bb40
commit
31ef10fe1c
|
@ -915,6 +915,9 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
||||||
#endif // EFI_ENGINE_CONTROL
|
#endif // EFI_ENGINE_CONTROL
|
||||||
|
|
||||||
switch (engineConfiguration->debugMode) {
|
switch (engineConfiguration->debugMode) {
|
||||||
|
case DBG_START_STOP:
|
||||||
|
tsOutputChannels->debugIntField1 = engine->startStopStateToggleCounter;
|
||||||
|
break;
|
||||||
case DBG_AUX_TEMPERATURE:
|
case DBG_AUX_TEMPERATURE:
|
||||||
// // 68
|
// // 68
|
||||||
tsOutputChannels->debugFloatField1 = engine->sensors.auxTemp1;
|
tsOutputChannels->debugFloatField1 = engine->sensors.auxTemp1;
|
||||||
|
|
|
@ -176,6 +176,11 @@ public:
|
||||||
*/
|
*/
|
||||||
efitick_t stopEngineRequestTimeNt = 0;
|
efitick_t stopEngineRequestTimeNt = 0;
|
||||||
|
|
||||||
|
|
||||||
|
bool startStopState = false;
|
||||||
|
efitick_t startStopStateLastPushTime = 0;
|
||||||
|
int startStopStateToggleCounter = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This counter is incremented every time user adjusts ECU parameters online (either via rusEfi console or other
|
* This counter is incremented every time user adjusts ECU parameters online (either via rusEfi console or other
|
||||||
* tuning software)
|
* tuning software)
|
||||||
|
|
|
@ -246,6 +246,20 @@ static void resetAccel(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void slowStartStopButtonCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
if (CONFIG(startStopButtonPin) != GPIO_UNASSIGNED) {
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
bool startStopState = efiReadPin(CONFIG(startStopButtonPin));
|
||||||
|
|
||||||
|
if (startStopState && !engine->startStopState) {
|
||||||
|
// we are here on transition from 0 to 1
|
||||||
|
engine->startStopStateToggleCounter++;
|
||||||
|
}
|
||||||
|
engine->startStopState = startStopState;
|
||||||
|
#endif /* EFI_PROD_CODE */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
|
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
|
||||||
efiAssertVoid(CUSTOM_ERR_6661, getCurrentRemainingStack() > 64, "lowStckOnEv");
|
efiAssertVoid(CUSTOM_ERR_6661, getCurrentRemainingStack() > 64, "lowStckOnEv");
|
||||||
|
@ -253,6 +267,8 @@ static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
touchTimeCounter();
|
touchTimeCounter();
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
|
slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update engine RPM state if needed (check timeouts).
|
* Update engine RPM state if needed (check timeouts).
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -255,8 +255,9 @@ void turnOnHardware(Logging *sharedLogger) {
|
||||||
|
|
||||||
void stopSpi(spi_device_e device) {
|
void stopSpi(spi_device_e device) {
|
||||||
#if HAL_USE_SPI
|
#if HAL_USE_SPI
|
||||||
if (!isSpiInitialized[device])
|
if (!isSpiInitialized[device]) {
|
||||||
return; // not turned on
|
return; // not turned on
|
||||||
|
}
|
||||||
isSpiInitialized[device] = false;
|
isSpiInitialized[device] = false;
|
||||||
brain_pin_markUnused(getSckPin(device));
|
brain_pin_markUnused(getSckPin(device));
|
||||||
brain_pin_markUnused(getMisoPin(device));
|
brain_pin_markUnused(getMisoPin(device));
|
||||||
|
@ -309,17 +310,21 @@ void applyNewHardwareSettings(void) {
|
||||||
stopAuxPins();
|
stopAuxPins();
|
||||||
#endif /* EFI_AUX_PID */
|
#endif /* EFI_AUX_PID */
|
||||||
|
|
||||||
if (isConfigurationChanged(is_enabled_spi_1))
|
if (isConfigurationChanged(is_enabled_spi_1)) {
|
||||||
stopSpi(SPI_DEVICE_1);
|
stopSpi(SPI_DEVICE_1);
|
||||||
|
}
|
||||||
|
|
||||||
if (isConfigurationChanged(is_enabled_spi_2))
|
if (isConfigurationChanged(is_enabled_spi_2)) {
|
||||||
stopSpi(SPI_DEVICE_2);
|
stopSpi(SPI_DEVICE_2);
|
||||||
|
}
|
||||||
|
|
||||||
if (isConfigurationChanged(is_enabled_spi_3))
|
if (isConfigurationChanged(is_enabled_spi_3)) {
|
||||||
stopSpi(SPI_DEVICE_3);
|
stopSpi(SPI_DEVICE_3);
|
||||||
|
}
|
||||||
|
|
||||||
if (isConfigurationChanged(is_enabled_spi_4))
|
if (isConfigurationChanged(is_enabled_spi_4)) {
|
||||||
stopSpi(SPI_DEVICE_4);
|
stopSpi(SPI_DEVICE_4);
|
||||||
|
}
|
||||||
|
|
||||||
#if EFI_HD44780_LCD
|
#if EFI_HD44780_LCD
|
||||||
stopHD44780_pins();
|
stopHD44780_pins();
|
||||||
|
@ -328,8 +333,13 @@ void applyNewHardwareSettings(void) {
|
||||||
#if EFI_BOOST_CONTROL
|
#if EFI_BOOST_CONTROL
|
||||||
stopBoostPin();
|
stopBoostPin();
|
||||||
#endif
|
#endif
|
||||||
if (isPinOrModeChanged(clutchUpPin, clutchUpPinMode))
|
if (isPinOrModeChanged(clutchUpPin, clutchUpPinMode)) {
|
||||||
brain_pin_markUnused(activeConfiguration.clutchUpPin);
|
brain_pin_markUnused(activeConfiguration.clutchUpPin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPinOrModeChanged(startStopButtonPin, startStopButtonMode)) {
|
||||||
|
brain_pin_markUnused(activeConfiguration.startStopButtonPin);
|
||||||
|
}
|
||||||
|
|
||||||
enginePins.unregisterPins();
|
enginePins.unregisterPins();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue