mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
3330cb314b
commit
9fe7324a3e
|
@ -140,14 +140,9 @@ static void reportSensorI(Logging *log, bool fileFormat, const char *caption, co
|
|||
}
|
||||
}
|
||||
|
||||
static const char* boolean2string(int value) {
|
||||
return value ? "YES" : "NO";
|
||||
}
|
||||
|
||||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
|
||||
void printSensors(Logging *log, bool fileFormat) {
|
||||
// current time, in milliseconds
|
||||
int nowMs = currentTimeMillis();
|
||||
|
@ -663,7 +658,7 @@ void startStatusThreads(Engine *engine) {
|
|||
}
|
||||
|
||||
void setFullLog(int value) {
|
||||
print("Setting full logging: %s\r\n", boolean2string(value));
|
||||
print("Setting full logging: %s\r\n", boolToString(value));
|
||||
printMsg(&logger, "%s%d", FULL_LOGGING_KEY, value);
|
||||
fullLog = value;
|
||||
}
|
||||
|
|
|
@ -29,17 +29,19 @@ static Pid altPid(10, 0, 0, 10, 90);
|
|||
|
||||
static THD_WORKING_AREA(alternatorControlThreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||
|
||||
static float currentAltDuty;
|
||||
|
||||
static msg_t AltCtrlThread(int param) {
|
||||
chRegSetThreadName("AlternatorController");
|
||||
while (true) {
|
||||
chThdSleepMilliseconds(100);
|
||||
|
||||
float result = altPid.getValue(14, getVBatt(engineConfiguration), 1);
|
||||
currentAltDuty = altPid.getValue(14, getVBatt(engineConfiguration), 1);
|
||||
if (boardConfiguration->isVerboseAlternator) {
|
||||
scheduleMsg(logger, "alt duty: %f", result);
|
||||
scheduleMsg(logger, "alt duty: %f/vbatt=%f", currentAltDuty, getVBatt(engineConfiguration));
|
||||
}
|
||||
|
||||
alternatorControl.setSimplePwmDutyCycle(result / 100);
|
||||
alternatorControl.setSimplePwmDutyCycle(currentAltDuty / 100);
|
||||
}
|
||||
#if defined __GNUC__
|
||||
return -1;
|
||||
|
@ -60,6 +62,11 @@ static void applyAlternatorPinState(PwmConfig *state, int stateIndex) {
|
|||
output->setValue(value);
|
||||
}
|
||||
|
||||
static void showAltInfo(void) {
|
||||
scheduleMsg(logger, "atl=%s", boolToString(engineConfiguration->isAlternatorControlEnabled));
|
||||
scheduleMsg(logger, "vbatt=%f/duty=%f", getVBatt(engineConfiguration), currentAltDuty);
|
||||
}
|
||||
|
||||
void initAlternatorCtrl(Logging *sharedLogger) {
|
||||
logger = sharedLogger;
|
||||
if (boardConfiguration->alternatorControlPin == GPIO_UNASSIGNED)
|
||||
|
@ -72,4 +79,5 @@ void initAlternatorCtrl(Logging *sharedLogger) {
|
|||
(tfunc_t) AltCtrlThread, NULL);
|
||||
|
||||
addConsoleActionF("alt_pid", setAltPid);
|
||||
addConsoleAction("altinfo", showAltInfo);
|
||||
}
|
||||
|
|
|
@ -98,6 +98,9 @@ static void printOutputs(engine_configuration_s *engineConfiguration) {
|
|||
|
||||
scheduleMsg(&logger, "mainRelay: mode %s @ %s", getPin_output_mode_e(boardConfiguration->mainRelayPinMode),
|
||||
hwPortname(boardConfiguration->mainRelayPin));
|
||||
|
||||
scheduleMsg(&logger, "alternator field: mode %s @ %s", getPin_output_mode_e(boardConfiguration->alternatorControlPinMode),
|
||||
hwPortname(boardConfiguration->alternatorControlPin));
|
||||
}
|
||||
|
||||
EXTERN_ENGINE
|
||||
|
|
|
@ -276,5 +276,5 @@ int getRusEfiVersion(void) {
|
|||
return 1; // this is here to make the compiler happy about the unused array
|
||||
if (UNUSED_CCM_SIZE[0] == 0)
|
||||
return 1; // this is here to make the compiler happy about the unused array
|
||||
return 20150311;
|
||||
return 20150313;
|
||||
}
|
||||
|
|
|
@ -85,12 +85,8 @@ public class SensorCentral {
|
|||
for (SensorListener listener : listeners)
|
||||
listener.onSensorUpdate(value);
|
||||
|
||||
|
||||
ResponseImpl r = new ResponseImpl();
|
||||
|
||||
|
||||
|
||||
|
||||
LoggerData d = new LoggerData() {
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -99,7 +95,7 @@ public class SensorCentral {
|
|||
|
||||
@Override
|
||||
public String getId() {
|
||||
return sensor.getName();
|
||||
return sensor.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<table type="3D" name="Ignition Advance" storageaddress="24B8" sizex="16" sizey="16" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1" />
|
||||
<table type="X Axis" storageaddress="28B8" storagetype="float" endian="big" logparam="engineload">
|
||||
<table type="X Axis" storageaddress="28B8" storagetype="float" endian="big" logparam="engine_load">
|
||||
<scaling units="degree" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1" />
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="28F8" storagetype="float" endian="big" logparam="rpm">
|
||||
|
@ -28,7 +28,7 @@
|
|||
|
||||
<table type="3D" name="Fuel Table" storageaddress="2038" sizex="16" sizey="16" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1" />
|
||||
<table type="X Axis" storageaddress="2438" storagetype="float" endian="big" logparam="engineload">
|
||||
<table type="X Axis" storageaddress="2438" storagetype="float" endian="big" logparam="engine_load">
|
||||
<scaling units="degree" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1" />
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="2478" storagetype="float" endian="big" logparam="rpm">
|
||||
|
|
Loading…
Reference in New Issue