live data for wastegate and launch control #3588

This commit is contained in:
rusefillc 2021-12-16 14:47:00 -05:00
parent 655f12b45d
commit 81759802d0
5 changed files with 48 additions and 39 deletions

View File

@ -253,7 +253,9 @@ uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 0, 0
! we have some unused bytes to allow compatible TS changes
uint8_t[154 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
uint8_t[150 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
bit launchSpeedCondition
uint8_t TEMPLOG_MAP_AT_CYCLE_COUNT;;"", 1, 0, -10000, 10000, 3
uint8_t unused11;;"", 1, 0, -10000, 10000, 3

View File

@ -97,15 +97,20 @@ bool LaunchControlBase::isLaunchConditionMet(int rpm) {
return speedCondition && activateSwitchCondition && rpmCondition && tpsCondition;
}
LaunchControlBase::LaunchControlBase() {
launchActivatePinState = false;
isLaunchCondition = false;
}
void LaunchControlBase::update() {
if (!engineConfiguration->launchControlEnabled) {
return;
}
int rpm = GET_RPM();
bool combinedConditions = isLaunchConditionMet(rpm);
combinedConditions = isLaunchConditionMet(rpm);
//and still recalculat in case user changed the values
//and still recalculate in case user changed the values
retardThresholdRpm = engineConfiguration->launchRpm + (engineConfiguration->enableLaunchRetard ?
engineConfiguration->launchAdvanceRpmRange : 0) + engineConfiguration->hardCutRpmRange;

View File

@ -8,11 +8,13 @@
#pragma once
#include "timer.h"
#include "launch_control_state_generated.h"
void initLaunchControl();
class LaunchControlBase {
class LaunchControlBase : public launch_control_state_s {
public:
LaunchControlBase();
// Update the state of the launch control system
void update();
@ -25,10 +27,6 @@ public:
bool isLaunchSparkRpmRetardCondition() const;
bool isLaunchFuelRpmRetardCondition() const;
int retardThresholdRpm;
bool launchActivatePinState = false;
bool isLaunchCondition = false;
private:
bool isLaunchRpmRetardCondition() const;

View File

@ -6,6 +6,10 @@ bit combinedConditions
bit launchActivatePinState
bit isLaunchCondition
bit activateSwitchCondition;
bit rpmCondition;
bit speedCondition;
bit tpsCondition;
end_struct

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/launch_control_state.txt Thu Dec 16 14:29:02 EST 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/launch_control_state.txt Thu Dec 16 14:44:22 EST 2021
// by class com.rusefi.output.CHeaderConsumer
// begin
#pragma once
@ -20,93 +20,93 @@ struct launch_control_state_s {
bool isLaunchCondition : 1 {};
/**
offset 4 bit 3 */
bool unusedBit_4_3 : 1 {};
bool activateSwitchCondition : 1 {};
/**
offset 4 bit 4 */
bool unusedBit_4_4 : 1 {};
bool rpmCondition : 1 {};
/**
offset 4 bit 5 */
bool unusedBit_4_5 : 1 {};
bool speedCondition : 1 {};
/**
offset 4 bit 6 */
bool unusedBit_4_6 : 1 {};
bool tpsCondition : 1 {};
/**
offset 4 bit 7 */
bool unusedBit_4_7 : 1 {};
bool unusedBit_8_7 : 1 {};
/**
offset 4 bit 8 */
bool unusedBit_4_8 : 1 {};
bool unusedBit_8_8 : 1 {};
/**
offset 4 bit 9 */
bool unusedBit_4_9 : 1 {};
bool unusedBit_8_9 : 1 {};
/**
offset 4 bit 10 */
bool unusedBit_4_10 : 1 {};
bool unusedBit_8_10 : 1 {};
/**
offset 4 bit 11 */
bool unusedBit_4_11 : 1 {};
bool unusedBit_8_11 : 1 {};
/**
offset 4 bit 12 */
bool unusedBit_4_12 : 1 {};
bool unusedBit_8_12 : 1 {};
/**
offset 4 bit 13 */
bool unusedBit_4_13 : 1 {};
bool unusedBit_8_13 : 1 {};
/**
offset 4 bit 14 */
bool unusedBit_4_14 : 1 {};
bool unusedBit_8_14 : 1 {};
/**
offset 4 bit 15 */
bool unusedBit_4_15 : 1 {};
bool unusedBit_8_15 : 1 {};
/**
offset 4 bit 16 */
bool unusedBit_4_16 : 1 {};
bool unusedBit_8_16 : 1 {};
/**
offset 4 bit 17 */
bool unusedBit_4_17 : 1 {};
bool unusedBit_8_17 : 1 {};
/**
offset 4 bit 18 */
bool unusedBit_4_18 : 1 {};
bool unusedBit_8_18 : 1 {};
/**
offset 4 bit 19 */
bool unusedBit_4_19 : 1 {};
bool unusedBit_8_19 : 1 {};
/**
offset 4 bit 20 */
bool unusedBit_4_20 : 1 {};
bool unusedBit_8_20 : 1 {};
/**
offset 4 bit 21 */
bool unusedBit_4_21 : 1 {};
bool unusedBit_8_21 : 1 {};
/**
offset 4 bit 22 */
bool unusedBit_4_22 : 1 {};
bool unusedBit_8_22 : 1 {};
/**
offset 4 bit 23 */
bool unusedBit_4_23 : 1 {};
bool unusedBit_8_23 : 1 {};
/**
offset 4 bit 24 */
bool unusedBit_4_24 : 1 {};
bool unusedBit_8_24 : 1 {};
/**
offset 4 bit 25 */
bool unusedBit_4_25 : 1 {};
bool unusedBit_8_25 : 1 {};
/**
offset 4 bit 26 */
bool unusedBit_4_26 : 1 {};
bool unusedBit_8_26 : 1 {};
/**
offset 4 bit 27 */
bool unusedBit_4_27 : 1 {};
bool unusedBit_8_27 : 1 {};
/**
offset 4 bit 28 */
bool unusedBit_4_28 : 1 {};
bool unusedBit_8_28 : 1 {};
/**
offset 4 bit 29 */
bool unusedBit_4_29 : 1 {};
bool unusedBit_8_29 : 1 {};
/**
offset 4 bit 30 */
bool unusedBit_4_30 : 1 {};
bool unusedBit_8_30 : 1 {};
/**
offset 4 bit 31 */
bool unusedBit_4_31 : 1 {};
bool unusedBit_8_31 : 1 {};
/** total size 8*/
};
// end
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/launch_control_state.txt Thu Dec 16 14:29:02 EST 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/launch_control_state.txt Thu Dec 16 14:44:22 EST 2021