mirror of https://github.com/FOME-Tech/fome-fw.git
auto-sync
This commit is contained in:
parent
f72b8f37a7
commit
1955a7c220
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue