auto-sync
This commit is contained in:
parent
5e4d368659
commit
f905fcb1a9
|
@ -209,6 +209,7 @@
|
|||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/config/boards}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/config/system}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/console}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/console/tunerstudio}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/console_util}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/controllers}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/controllers/math}""/>
|
||||
|
|
|
@ -8,7 +8,8 @@ CHIBIOS = chibios
|
|||
|
||||
# Compiler options here.
|
||||
ifeq ($(USE_OPT),)
|
||||
USE_OPT = $(RFLAGS) -O1 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers
|
||||
# USE_OPT = $(RFLAGS) -O1 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers
|
||||
USE_OPT = $(RFLAGS) -O1 -fgnu89-inline -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers
|
||||
endif
|
||||
|
||||
# C specific options here (added to USE_OPT).
|
||||
|
|
|
@ -24,6 +24,10 @@ void setBmwE43(engine_configuration_s *engineConfiguration) {
|
|||
engineConfiguration->injectionMode = IM_SIMULTANEOUS;
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
|
||||
// emulating this 60-0 takes some resources, let's keep it slow by default
|
||||
// rpm 200
|
||||
boardConfiguration->triggerSimulatorFrequency = 200;
|
||||
|
||||
setConstantDwell(engineConfiguration, 3); // a bit shorter dwell
|
||||
engineConfiguration->useConstantDwellDuringCranking = true;
|
||||
engineConfiguration->ignitionDwellForCrankingMs = 5;
|
||||
|
|
|
@ -62,6 +62,28 @@ void printSpiState(Logging *logger, board_configuration_s *boardConfiguration) {
|
|||
|
||||
extern board_configuration_s *boardConfiguration;
|
||||
|
||||
static void printOutputs(engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2) {
|
||||
scheduleMsg(&logger, "injectionPins: mode %s", pinModeToString(boardConfiguration->injectionPinMode));
|
||||
for (int i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
brain_pin_e brainPin = boardConfiguration->injectionPins[i];
|
||||
scheduleMsg(&logger, "injection #%d @ %s", (1 + i), hwPortname(brainPin));
|
||||
}
|
||||
|
||||
scheduleMsg(&logger, "ignitionPins: mode %s", pinModeToString(boardConfiguration->ignitionPinMode));
|
||||
for (int i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
brain_pin_e brainPin = boardConfiguration->ignitionPins[i];
|
||||
scheduleMsg(&logger, "ignition #%d @ %s", (1 + i), hwPortname(brainPin));
|
||||
}
|
||||
|
||||
scheduleMsg(&logger, "idlePin: mode %s @ %s freq=%d", getPin_output_mode_e(boardConfiguration->idleValvePinMode),
|
||||
hwPortname(boardConfiguration->idleValvePin), boardConfiguration->idleSolenoidFrequency);
|
||||
scheduleMsg(&logger, "malfunctionIndicatorn: %s mode=%s", hwPortname(boardConfiguration->malfunctionIndicatorPin),
|
||||
pinModeToString(boardConfiguration->malfunctionIndicatorPinMode));
|
||||
|
||||
scheduleMsg(&logger, "fuelPumpPin: mode %s @ %s", getPin_output_mode_e(boardConfiguration->fuelPumpPinMode),
|
||||
hwPortname(boardConfiguration->fuelPumpPin));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prints current engine configuration to human-readable console.
|
||||
*/
|
||||
|
@ -133,26 +155,7 @@ void printConfiguration(engine_configuration_s *engineConfiguration, engine_conf
|
|||
|
||||
scheduleMsg(&logger, "analogInputDividerCoefficient: %f", engineConfiguration->analogInputDividerCoefficient);
|
||||
|
||||
scheduleMsg(&logger, "idlePin: mode %s @ %s freq=%d", getPin_output_mode_e(boardConfiguration->idleValvePinMode),
|
||||
hwPortname(boardConfiguration->idleValvePin), boardConfiguration->idleSolenoidFrequency);
|
||||
scheduleMsg(&logger, "malfunctionIndicatorn: %s mode=%s", hwPortname(boardConfiguration->malfunctionIndicatorPin),
|
||||
pinModeToString(boardConfiguration->malfunctionIndicatorPinMode));
|
||||
|
||||
scheduleMsg(&logger, "fuelPumpPin: mode %s @ %s", getPin_output_mode_e(boardConfiguration->fuelPumpPinMode),
|
||||
hwPortname(boardConfiguration->fuelPumpPin));
|
||||
|
||||
scheduleMsg(&logger, "injectionPins: mode %s", pinModeToString(boardConfiguration->injectionPinMode));
|
||||
for (int i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
brain_pin_e brainPin = boardConfiguration->injectionPins[i];
|
||||
|
||||
scheduleMsg(&logger, "injection #%d @ %s", (1 + i), hwPortname(brainPin));
|
||||
}
|
||||
|
||||
scheduleMsg(&logger, "ignitionPins: mode %s", pinModeToString(boardConfiguration->ignitionPinMode));
|
||||
for (int i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
brain_pin_e brainPin = boardConfiguration->ignitionPins[i];
|
||||
scheduleMsg(&logger, "ignition #%d @ %s", (1 + i), hwPortname(brainPin));
|
||||
}
|
||||
printOutputs(engineConfiguration, engineConfiguration2);
|
||||
|
||||
scheduleMsg(&logger, "boardTestModeJumperPin: %s", hwPortname(boardConfiguration->boardTestModeJumperPin));
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ static void executorCallback(void *arg) {
|
|||
|
||||
Executor::Executor() {
|
||||
reentrantLock = false;
|
||||
queue.setLateDelay(US2NT(100));
|
||||
}
|
||||
|
||||
void Executor::lock(void) {
|
||||
|
@ -59,7 +60,7 @@ void Executor::schedule2(const char *prefix, scheduling_s *scheduling, uint64_t
|
|||
// this would guard the queue and disable interrupts
|
||||
lock();
|
||||
}
|
||||
queue.insertTask(scheduling, timeUs, callback, param);
|
||||
queue.insertTask(scheduling, US2NT(timeUs), callback, param);
|
||||
if (!reentrantLock) {
|
||||
doExecute();
|
||||
unlock();
|
||||
|
@ -97,14 +98,14 @@ void Executor::doExecute() {
|
|||
/**
|
||||
* It's worth noting that that the actions might be adding new actions into the queue
|
||||
*/
|
||||
uint64_t nowUs = getTimeNowUs();
|
||||
shouldExecute = queue.executeAll(nowUs);
|
||||
uint64_t nowNt = getTimeNowNt();
|
||||
shouldExecute = queue.executeAll(nowNt);
|
||||
}
|
||||
if (!isLocked()) {
|
||||
firmwareError("Someone has stolen my lock");
|
||||
return;
|
||||
}
|
||||
uint64_t nowUs = getTimeNowUs();
|
||||
uint64_t nowNt = getTimeNowNt();
|
||||
reentrantLock = false;
|
||||
/**
|
||||
* 'executeAll' is potentially invoking heavy callbacks, let's grab fresh time value?
|
||||
|
@ -112,11 +113,12 @@ void Executor::doExecute() {
|
|||
/**
|
||||
* Let's set up the timer for the next execution
|
||||
*/
|
||||
uint64_t nextEventTime = queue.getNextEventTime(nowUs);
|
||||
efiAssertVoid(nextEventTime > nowUs, "setTimer constraint");
|
||||
if (nextEventTime == EMPTY_QUEUE)
|
||||
uint64_t nextEventTimeNt = queue.getNextEventTime(nowNt);
|
||||
efiAssertVoid(nextEventTimeNt > nowNt, "setTimer constraint");
|
||||
if (nextEventTimeNt == EMPTY_QUEUE)
|
||||
return; // no pending events in the queue
|
||||
setHardwareUsTimer(nextEventTime - nowUs);
|
||||
uint64_t delayUs = NT2US(nextEventTimeNt - nowNt);
|
||||
setHardwareUsTimer(delayUs == 0 ? 1 : delayUs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* We need to limit the number of iterations in order to avoid precision loss while calculating
|
||||
* next toggle time
|
||||
*/
|
||||
#define ITERATION_LIMIT 10000
|
||||
#define ITERATION_LIMIT 1000
|
||||
|
||||
SimplePwm::SimplePwm() {
|
||||
wave.init(pinStates);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "data_buffer.h"
|
||||
#include "histogram.h"
|
||||
#include "wave_chart.h"
|
||||
#include "pwm_generator_logic.h"
|
||||
|
||||
#include "rpm_calculator.h"
|
||||
#if EFI_PROD_CODE
|
||||
|
@ -188,6 +189,10 @@ static void triggerShapeInfo(Engine *engine) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
extern PwmConfig triggerSignal;
|
||||
#endif /* #if EFI_PROD_CODE */
|
||||
|
||||
static void triggerInfo(Engine *engine) {
|
||||
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
|
||||
|
||||
|
@ -211,13 +216,18 @@ static void triggerInfo(Engine *engine) {
|
|||
engineConfiguration2->triggerShape.dutyCycle[1]);
|
||||
|
||||
scheduleMsg(&logger, "isError %d", isTriggerDecoderError());
|
||||
|
||||
#endif
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
scheduleMsg(&logger, "primary trigger simulator: %s %s", hwPortname(boardConfiguration->triggerSimulatorPins[0]),
|
||||
pinModeToString(boardConfiguration->triggerSimulatorPinModes[0]));
|
||||
scheduleMsg(&logger, "secondary trigger simulator: %s %s", hwPortname(boardConfiguration->triggerSimulatorPins[1]),
|
||||
pinModeToString(boardConfiguration->triggerSimulatorPinModes[1]));
|
||||
scheduleMsg(&logger, "primary trigger simulator: %s %s freq=%d", hwPortname(boardConfiguration->triggerSimulatorPins[0]),
|
||||
pinModeToString(boardConfiguration->triggerSimulatorPinModes[0]),
|
||||
boardConfiguration->triggerSimulatorFrequency
|
||||
);
|
||||
scheduleMsg(&logger, "secondary trigger simulator: %s %s phase=%d", hwPortname(boardConfiguration->triggerSimulatorPins[1]),
|
||||
pinModeToString(boardConfiguration->triggerSimulatorPinModes[1]),
|
||||
triggerSignal.safe.phaseIndex
|
||||
);
|
||||
scheduleMsg(&logger, "3rd trigger simulator: %s %s", hwPortname(boardConfiguration->triggerSimulatorPins[2]),
|
||||
pinModeToString(boardConfiguration->triggerSimulatorPinModes[2]));
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// This file was generated by Version2Header
|
||||
// Mon Nov 10 08:51:36 EST 2014
|
||||
// Mon Nov 10 13:43:19 EST 2014
|
||||
#ifndef VCS_VERSION
|
||||
#define VCS_VERSION "5255"
|
||||
#define VCS_VERSION "5261"
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue