This commit is contained in:
rusefi 2017-08-28 22:55:29 -04:00
parent 5ce4fe3157
commit b39e245a37
7 changed files with 32 additions and 14 deletions

View File

@ -201,6 +201,10 @@ static void printSensors(Logging *log, bool fileFormat) {
reportSensorF(log, fileFormat, "IAT", "C", getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE), 2); // log column #7
}
reportSensorF(log, fileFormat, GAUGE_NAME_ACCEL_X, "G", engine->sensors.accelerometer.x, 3);
reportSensorF(log, fileFormat, GAUGE_NAME_ACCEL_Y, "G", engine->sensors.accelerometer.y, 3);
if (hasMafSensor()) {
reportSensorF(log, fileFormat, "maf", "V", getMaf(PASS_ENGINE_PARAMETER_SIGNATURE), 2);
reportSensorF(log, fileFormat, "mafr", "kg/hr", getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE), 2);

View File

@ -1583,6 +1583,9 @@
#define GAUGE_NAME_VBAT "VBatt"
#define GAUGE_NAME_ENGINE_LOAD "Engine Load"
#define GAUGE_NAME_CPU_TEMP "CPU Temperature"
#define GAUGE_NAME_ACCEL_X "Acceleration: X"
#define GAUGE_NAME_ACCEL_Y "Acceleration: Y"
#define GAUGE_NAME_ACCEL_Z "Acceleration: Z"
#define INDICATOR_NAME_CLUTCH_UP "clutch: up"
#define INDICATOR_NAME_CLUTCH_DOWN "clutch: down"
#define INDICATOR_NAME_BRAKE_DOWN "brake: down"

View File

@ -64,6 +64,7 @@ static msg_t ivThread(int param) {
// todo: migrate to async SPI API?
engine->sensors.accelerometer.x = (int8_t)lis302dlReadRegister(driver, LIS302DL_OUTX);
engine->sensors.accelerometer.y = (int8_t)lis302dlReadRegister(driver, LIS302DL_OUTY);
chThdSleepMilliseconds(20);
}
#if defined __GNUC__

View File

@ -907,6 +907,11 @@ end_struct
#define GAUGE_NAME_ENGINE_LOAD "Engine Load"
#define GAUGE_NAME_CPU_TEMP "CPU Temperature"
#define GAUGE_NAME_ACCEL_X "Acceleration: X"
#define GAUGE_NAME_ACCEL_Y "Acceleration: Y"
#define GAUGE_NAME_ACCEL_Z "Acceleration: Z"
#define INDICATOR_NAME_CLUTCH_UP "clutch: up"
#define INDICATOR_NAME_CLUTCH_DOWN "clutch: down"
#define INDICATOR_NAME_BRAKE_DOWN "brake: down"

View File

@ -63,7 +63,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Aug 28 21:53:25 EDT 2017
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Aug 28 22:50:54 EDT 2017
pageSize = 16376
page = 1
@ -1025,8 +1025,8 @@ fileVersion = { 20161225 }
firmwareVersion = scalar,U32, 264, "version_f", 1, 0
fuelPidCorrection = scalar, F32, 268, "ms", 1, 0
coilDutyCycle = scalar, F32, 272, "perc", 1, 0
accelerationX = scalar, S16, 276, "acc", 100, 0
accelerationY = scalar, S16, 276, "acc", 100, 0
accelerationX = scalar, S16, 276, "G", 0.01, 0
accelerationY = scalar, S16, 276, "G", 0.01, 0
; todo: generate this section programatically
LM_PLAIN_MAF = {0},
@ -1352,8 +1352,8 @@ gaugeCategory = Sensors
internalMcuTemperatureGauge = internalMcuTemperature, "internal temperature", "C", 0, 100, 0, 0, 100, 100, 0, 0
VSSGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1
pedalPositionGauge = pedalPosition,"Throttle Pedal Position", "%", 0, 120, 10, 10, 100, 100, 1, 1
accelerationXGauge = accelerationX, "accel X", "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationYGauge = accelerationY, "accel Y", "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationXGauge = accelerationX, "Acceleration: X", "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationYGauge = accelerationY, "Acceleration: Y", "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
gaugeCategory = Spark Data
ignadvGauge = ignitionAdvance, "Ignition Advance 1", "degrees", -100, 100, -999, -999, 999, 999, 1, 1
@ -1463,8 +1463,8 @@ gaugeCategory = Fuel Data
entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f"
entry = currentTargetAfr,"fuel: target AFR", float,"%.3f"
entry = accelerationX, "acc X", float,"%.2f"
entry = accelerationY, "acc Y", float,"%.2f"
entry = accelerationX, "Acceleration: X", float,"%.2f"
entry = accelerationY, "Acceleration: Y", float,"%.2f"
entry = engineLoadAccelExtra, "fuel: engine load acceleration extra fuel",float, "%.3f"
entry = engineLoadDelta, "fuel: load change",float, "%.3f"
@ -2203,6 +2203,7 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
field = "SPI3 MOSI", spi3mosiPin, {is_enabled_spi_3 == 1}
field = "SPI3 MISO", spi3misoPin, {is_enabled_spi_3 == 1}
field = "SPI3 SCK", spi3sckPin, {is_enabled_spi_3 == 1}
field = "LIS302DLCsPin", LIS302DLCsPin, {is_enabled_spi_1 == 1}
dialog = fuelClosedLoopDialog, "Fuel closed-loop correction"
field = "Enabled", fuelClosedLoopCorrectionEnabled

View File

@ -253,8 +253,8 @@ fileVersion = { 20161225 }
firmwareVersion = scalar,U32, 264, "version_f", 1, 0
fuelPidCorrection = scalar, F32, 268, "ms", 1, 0
coilDutyCycle = scalar, F32, 272, "perc", 1, 0
accelerationX = scalar, S16, 276, "acc", 100, 0
accelerationY = scalar, S16, 276, "acc", 100, 0
accelerationX = scalar, S16, 276, "G", 0.01, 0
accelerationY = scalar, S16, 276, "G", 0.01, 0
; todo: generate this section programatically
LM_PLAIN_MAF = {0},
@ -580,8 +580,8 @@ gaugeCategory = Sensors
internalMcuTemperatureGauge = internalMcuTemperature, "internal temperature", "C", 0, 100, 0, 0, 100, 100, 0, 0
VSSGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1
pedalPositionGauge = pedalPosition,"Throttle Pedal Position", "%", 0, 120, 10, 10, 100, 100, 1, 1
accelerationXGauge = accelerationX, "accel X", "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationYGauge = accelerationY, "accel Y", "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationXGauge = accelerationX, @@GAUGE_NAME_ACCEL_X@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationYGauge = accelerationY, @@GAUGE_NAME_ACCEL_Y@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
gaugeCategory = Spark Data
ignadvGauge = ignitionAdvance, "Ignition Advance 1", "degrees", -100, 100, -999, -999, 999, 999, 1, 1
@ -691,8 +691,8 @@ gaugeCategory = Fuel Data
entry = coilDutyCycle, @@GAUGE_NAME_DWELL_DUTY@@, float,"%.3f"
entry = currentTargetAfr,@@GAUGE_NAME_TARGET_AFR@@, float,"%.3f"
entry = accelerationX, "acc X", float,"%.2f"
entry = accelerationY, "acc Y", float,"%.2f"
entry = accelerationX, @@GAUGE_NAME_ACCEL_X@@, float,"%.2f"
entry = accelerationY, @@GAUGE_NAME_ACCEL_Y@@, float,"%.2f"
entry = engineLoadAccelExtra, @@GAUGE_NAME_FUEL_EL_EXTRA@@,float, "%.3f"
entry = engineLoadDelta, "fuel: load change",float, "%.3f"
@ -1431,6 +1431,7 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
field = "SPI3 MOSI", spi3mosiPin, {is_enabled_spi_3 == 1}
field = "SPI3 MISO", spi3misoPin, {is_enabled_spi_3 == 1}
field = "SPI3 SCK", spi3sckPin, {is_enabled_spi_3 == 1}
field = "LIS302DLCsPin", LIS302DLCsPin, {is_enabled_spi_1 == 1}
dialog = fuelClosedLoopDialog, "Fuel closed-loop correction"
field = "Enabled", fuelClosedLoopCorrectionEnabled

View File

@ -1,6 +1,6 @@
package com.rusefi.config;
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Aug 28 20:53:46 EDT 2017
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Aug 28 22:50:54 EDT 2017
public class Fields {
public static final int LE_COMMAND_LENGTH = 200;
public static final int BLOCKING_FACTOR = 400;
@ -1085,6 +1085,9 @@ public class Fields {
public static final String GAUGE_NAME_VBAT = "VBatt";
public static final String GAUGE_NAME_ENGINE_LOAD = "Engine Load";
public static final String GAUGE_NAME_CPU_TEMP = "CPU Temperature";
public static final String GAUGE_NAME_ACCEL_X = "Acceleration: X";
public static final String GAUGE_NAME_ACCEL_Y = "Acceleration: Y";
public static final String GAUGE_NAME_ACCEL_Z = "Acceleration: Z";
public static final String INDICATOR_NAME_CLUTCH_UP = "clutch: up";
public static final String INDICATOR_NAME_CLUTCH_DOWN = "clutch: down";
public static final String INDICATOR_NAME_BRAKE_DOWN = "brake: down";