auto-sync

This commit is contained in:
rusEfi 2015-05-21 20:05:52 -04:00
parent d575a7f647
commit e60df30f56
7 changed files with 13 additions and 10 deletions

View File

@ -391,6 +391,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->HD44780width = 20;
engineConfiguration->HD44780height = 4;
engineConfiguration->alternatorOffset = 0;
engineConfiguration->alternatorControlPFactor = 30;
boardConfiguration->alternatorDT = 100;

View File

@ -1,4 +1,4 @@
// this section was generated by config_definition.jar on Wed May 13 20:30:29 EDT 2015
// this section was generated by config_definition.jar on Thu May 21 19:13:37 EDT 2015
// begin
#include "rusefi_types.h"
typedef struct {
@ -896,7 +896,7 @@ typedef struct {
/**
* offset 604
*/
float unused596;
float alternatorOffset;
/**
* @see hasBaroSensor
* offset 608
@ -1302,4 +1302,4 @@ typedef struct {
} persistent_config_s;
// end
// this section was generated by config_definition.jar on Wed May 13 20:30:29 EDT 2015
// this section was generated by config_definition.jar on Thu May 21 19:13:37 EDT 2015

View File

@ -192,7 +192,7 @@
#define afr_v2_offset_hex 254
#define afr_value2_offset 600
#define afr_value2_offset_hex 258
#define unused596_offset 604
#define alternatorOffset_offset 604
#define baroSensor_offset 608
#define baroSensor_offset_hex 260
#define baroSensor_valueAt0_offset 608

View File

@ -36,7 +36,7 @@ static msg_t AltCtrlThread(int param) {
while (true) {
chThdSleepMilliseconds(boardConfiguration->alternatorDT);
currentAltDuty = altPid.getValue(boardConfiguration->targetVBatt, getVBatt(engineConfiguration), 1);
currentAltDuty = engineConfiguration->alternatorOffset + altPid.getValue(boardConfiguration->targetVBatt, getVBatt(engineConfiguration), 1);
if (boardConfiguration->isVerboseAlternator) {
scheduleMsg(logger, "alt duty: %f/vbatt=%f/p=%f/i=%f/d=%f int=%f", currentAltDuty, getVBatt(engineConfiguration),
altPid.getP(), altPid.getI(), altPid.getD(), altPid.getIntegration());
@ -57,8 +57,8 @@ void showAltInfo(void) {
scheduleMsg(logger, "alt=%s @%s t=%dms", boolToString(engineConfiguration->isAlternatorControlEnabled),
hwPortname(boardConfiguration->alternatorControlPin),
boardConfiguration->alternatorDT);
scheduleMsg(logger, "p=%f/i=%f/d=%f", engineConfiguration->alternatorControlPFactor,
0, 0); // todo: i & d
scheduleMsg(logger, "p=%f/i=%f/d=%f offset=%f", engineConfiguration->alternatorControlPFactor,
0, 0, engineConfiguration->alternatorOffset); // todo: i & d
scheduleMsg(logger, "vbatt=%f/duty=%f/target=%f", getVBatt(engineConfiguration), currentAltDuty,
boardConfiguration->targetVBatt);
}

View File

@ -946,6 +946,8 @@ static void setValue(const char *paramStr, const char *valueStr) {
boardConfiguration->alternatorDT = valueI;
}
showAltInfo();
} else if (strEqualCaseInsensitive(paramStr, "alt_offset")) {
engineConfiguration->alternatorOffset = valueI;
} else if (strEqualCaseInsensitive(paramStr, "alt_p")) {
setAltPFactor(valueF);
#endif

View File

@ -278,7 +278,7 @@ end_struct
afr_sensor_s afr;@see hasAfrSensor
float unused596;
float alternatorOffset;
air_pressure_sensor_config_s baroSensor;@see hasBaroSensor

View File

@ -40,7 +40,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated by ConfigDefinition.jar on Fri May 15 16:06:31 EDT 2015
; this section was generated by ConfigDefinition.jar on Thu May 21 19:13:38 EDT 2015
pageSize = 15288
page = 1
@ -143,7 +143,7 @@ page = 1
afr_value1 = scalar, F32, 592, "AFR", 1, 0.0, 0, 1000.0, 2
afr_v2 = scalar, F32, 596, "volts", 1, 0.0, 0, 10.0, 2
afr_value2 = scalar, F32, 600, "AFR", 1, 0.0, 0, 1000.0, 2
;skipping unused596 offset 604
;skipping alternatorOffset offset 604
baroSensor_valueAt0 = scalar, F32, 608, "kpa", 1, 0, 0, 450, 2
baroSensor_valueAt5 = scalar, F32, 612, "kpa", 1, 0, 0, 450, 2
baroSensor_type = bits, U32, 616, [0:2] "Custom", "DENSO183", "MPX4250", "HONDA3BAR", "NEON_2003", "22012AA090", "INVALID", "INVALID"