auto-sync

This commit is contained in:
rusEfi 2014-09-10 23:02:50 -05:00
parent 444e7b4703
commit 69d6fe324b
5 changed files with 36 additions and 18 deletions

View File

@ -368,6 +368,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels) {
tsOutputChannels->mass_air_flow = getMaf();
tsOutputChannels->air_fuel_ratio = getAfr();
tsOutputChannels->v_batt = getVBatt();
tsOutputChannels->tsConfigVersion = TS_FILE_VERSION;
tsOutputChannels->tpsADC = getTPS10bitAdc();
tsOutputChannels->atmospherePressure = getBaroPressure();
tsOutputChannels->manifold_air_pressure = getMap();

View File

@ -11,6 +11,12 @@
#ifndef TUNERSTUDIO_CONFIGURATION_H_
#define TUNERSTUDIO_CONFIGURATION_H_
/**
* this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version
*/
#define TS_FILE_VERSION 20140910
/**
* please be aware that current "stable" version of TunerStudio does not
* support 'float' (F32) type. You would need a beta version to handle floats
@ -56,7 +62,8 @@ typedef struct {
unsigned int isCltError : 1; // bit 1
unsigned int isMapError : 1; // bit 2
unsigned int isIatError : 1; // bit 3
int unused[8];
int tsConfigVersion;
int unused[7];
} TunerStudioOutputChannels;
#endif /* TUNERSTUDIO_CONFIGURATION_H_ */

View File

@ -213,16 +213,13 @@ typedef struct {
* todo: re-arrange this structure one we have a stable code version
*/
typedef struct {
float injectorLag; // size 4, offset 0
// WARNING: by default, our small enums are ONE BYTE. but if the are surrounded by non-enums - alignments do the trick
engine_type_e engineType;
/**
* cc/min, cubic centimeter per minute
*
* By the way, g/s = 0.125997881 * (lb/hr)
* g/s = 0.125997881 * (cc/min)/10.5
* g/s = 0.0119997981 * cc/min
*
* this magic number is used to make sure that what we read from Flash is in fact some configuration
*/
float injectorFlow; // size 4, offset 4
int headerMagicValue;
float battInjectorLagCorrBins[VBAT_INJECTOR_CURVE_SIZE]; // size 32, offset 8
float battInjectorLagCorr[VBAT_INJECTOR_CURVE_SIZE]; // size 32, offset 40
@ -277,8 +274,8 @@ typedef struct {
*/
float fixedModeTiming;
// WARNING: by default, our small enums are ONE BYTE. but if the are surrounded by non-enums - alignments do the trick
engine_type_e engineType;
float injectorLag; // size 4, offset 0
float fuelLoadBins[FUEL_LOAD_COUNT]; //
// RPM is float and not integer in order to use unified methods for interpolation
@ -409,8 +406,17 @@ typedef struct {
bool needSecondTriggerInput : 1; // bit 4
int digitalChartSize;
/**
* cc/min, cubic centimeter per minute
*
* By the way, g/s = 0.125997881 * (lb/hr)
* g/s = 0.125997881 * (cc/min)/10.5
* g/s = 0.0119997981 * cc/min
*
*/
float injectorFlow; // size 4
int unused3[7];
int unused3[6];
} engine_configuration_s;

View File

@ -11,7 +11,7 @@
#include "engine_configuration.h"
#define FLASH_DATA_VERSION 4560
#define FLASH_DATA_VERSION 4615
#ifdef __cplusplus
extern "C"

View File

@ -1,7 +1,5 @@
; this is TunerStudio project for www.rusefi.com DIY engine management system
; version 20140906
; this should stop TS from looking for the CAN ID in the 2nd byte location and allow the page reads to work correctly.
enable2ndByteCanID = false
@ -40,8 +38,7 @@ enable2ndByteCanID = false
; name = array, type, offset, shape, units, scale, translate, lo, hi, digits
; name = scalar, type, offset, units, scale, translate, lo, hi, digits
injectorLag = scalar, F32, 0, "msec", 1, 0, -10, 25.50, 2; size 4
injectorFlow = scalar, F32, 4, "cm3/min", 1, 0, 0, 1000, 2; size 4
engineType = bits, U32, 0, [0:2], "AUDI_AAN", "DODGE_NEON_1995", "FORD_ASPIRE_1996", "FORD_FIESTA", "NISSAN_PRIMERA", "HONDA_ACCORD", "FORD_INLINE_6_1995", "GY6_139QMB"
battInjectorLagCorrBins = array, F32, 8, [8], "V", 1, 0, 0.0, 20.0, 2; size 32
battInjectorLagCorr = array, F32, 40, [8], "ms/V", 1, 0, 0.0, 50.0, 2; size 32
@ -106,7 +103,7 @@ enable2ndByteCanID = false
crankingChargeAngle = scalar, F32, 776, "RPM", 1, 0, 0, 3000.0, 0 ; size 4
timingMode = bits, U32, 780, [0:0], "dynamic", "fixed"
fixedModeTiming = scalar, U32, 784, "RPM", 1, 0, 0, 3000.0, 0 ; size 4
engineType = bits, U32, 788, [0:2], "AUDI_AAN", "DODGE_NEON_1995", "FORD_ASPIRE_1996", "FORD_FIESTA", "NISSAN_PRIMERA", "HONDA_ACCORD", "FORD_INLINE_6_1995", "GY6_139QMB"
injectorLag = scalar, F32, 788, "msec", 1, 0, -10, 25.50, 2; size 4
fuelKeyBins = array, F32, 792, [16], "V", 1, 0, 0.0, 300.0, 2; size 132
fuelRpmBins = array, F32, 856, [16], "RPM", 1, 0, 0.0, 25500.0, 2; size 92
@ -295,8 +292,12 @@ enable2ndByteCanID = false
secondTriggerChannelEnabled= bits, U32, 5892, [3:3], "false", "true"
needSecondTriggerInput = bits, U32, 5892, [4:4], "false", "true"
digitalChartSize = scalar, U32, 5896, "count", 1, 0, 0, 300, 0 ; size 4
injectorFlow = scalar, F32, 5900, "cm3/min", 1, 0, 0, 1000, 2; size 4
[OutputChannels]
fileVersion = { 20140910 }
ochGetCommand = "O"
@ -347,6 +348,7 @@ enable2ndByteCanID = false
ind_clt_error = bits, U32, 80, [1:1], "true", "false";
ind_map_error = bits, U32, 80, [2:2], "true", "false";
ind_iat_error = bits, U32, 80, [3:3], "true", "false";
firmwareTsVersion = scalar,U32, 84, "version", 1, 0
time = { timeNow }
engineLoad = { fuelAlgorithm == 0 ? MAF : TPS }
@ -479,9 +481,11 @@ enable2ndByteCanID = false
; = expression, off-label, on-label, off-bg, off-fg, on-bg, on-fg
; important status
indicator = { firmwareTsVersion == fileVersion }, "NOT COMPATIBLE", "", red, black, green, black
indicator = { ind_check_engine }, "ok", "Check engine", green, black, red, black
indicator = { ind_ignition_enabled}, "no ignition", "ignition", red, black, green, black
indicator = { ind_injection_enabled}, "no injection", "injection", red, black, green, black
; minor info
indicator = { ind_fan}, "no fan", "fan", white, black, green, black