refactoring, fancy: extract magic constant

This commit is contained in:
rusefillc 2023-03-30 10:01:51 -04:00
parent fddff7d042
commit f05a5fcd70
3 changed files with 7 additions and 3 deletions

View File

@ -28,6 +28,7 @@ void setDefaultBaseEngine() {
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
engineConfiguration->compressionRatio = 9;
engineConfiguration->vssFilterReciprocal = VSS_FILTER_MIN;
engineConfiguration->turbochargerFilter = 0.01f;

View File

@ -11,8 +11,8 @@ static VehicleSpeedConverter vehicleSpeedConverter;
void initVehicleSpeedSensor() {
int parameter = engineConfiguration->vssFilterReciprocal;
if (parameter < 3 || parameter > 200) {
parameter = 3;
if (parameter < VSS_FILTER_MIN || parameter > VSS_FILTER_MAX) {
parameter = VSS_FILTER_MIN;
}
float filterParameter = 1.0f / parameter;

View File

@ -123,6 +123,9 @@ struct_no_prefix engine_configuration_s
#define GEARS_COUNT 8
#define VSS_FILTER_MIN 3
#define VSS_FILTER_MAX 200
#define CAM_INPUTS_COUNT @@BANKS_COUNT@@*@@CAMS_PER_BANK@@
! https://github.com/rusefi/rusefi/issues/2010 shows the corner case wheel with huge depth requirement
@ -668,7 +671,7 @@ uint8_t autoscale knockRetardReapplyRate;After a knock event, reapply timing at
custom engineSyncCam_e 1 bits, S08, @OFFSET@, [0:1], @@engineSyncCam_enum@@
engineSyncCam_e engineSyncCam;Select which cam is used for engine sync. Other cams will be used only for VVT measurement, but not engine sync.
uint8_t vssFilterReciprocal;Set this so your vehicle speed signal is responsive, but not noisy. Larger value give smoother but slower response.;"", 1, 0, 2, 200, 0
uint8_t vssFilterReciprocal;Set this so your vehicle speed signal is responsive, but not noisy. Larger value give smoother but slower response.;"", 1, 0, @@VSS_FILTER_MIN@@, @@VSS_FILTER_MAX@@ 0
uint16_t autoscale vssGearRatio;Number of turns of your vehicle speed sensor per turn of the wheels. For example if your sensor is on the transmission output, enter your axle/differential ratio. If you are using a hub-mounted sensor, enter a value of 1.0.;"ratio", 0.001, 0, 0, 60, 3
uint8_t vssToothCount;Number of pulses output per revolution of the shaft where your VSS is mounted. For example, GM applications of the T56 output 17 pulses per revolution of the transmission output shaft.;"count", 1, 0, 1, 100, 0