auto-sync
This commit is contained in:
parent
309c93f038
commit
835ddb3e6e
|
@ -162,8 +162,8 @@ void firmwareError(const char *fmt, ...);
|
|||
* @notapi
|
||||
*/
|
||||
void dbg_check_enter_isr(void) {
|
||||
if (dbg_isr_cnt > 2)
|
||||
firmwareError("nesting3");
|
||||
if (dbg_isr_cnt > 1)
|
||||
firmwareError("nesting2");
|
||||
port_lock_from_isr();
|
||||
if ((dbg_isr_cnt < 0) || (dbg_lock_cnt != 0))
|
||||
chDbgPanic("SV#8");
|
||||
|
|
|
@ -46,11 +46,11 @@ float getBaseAdvance(int rpm, float engineLoad) {
|
|||
float getAdvance(int rpm, float engineLoad DECLATE_ENGINE_PARAMETER) {
|
||||
float angle;
|
||||
if (isCrankingR(rpm)) {
|
||||
angle = engineConfiguration->crankingTimingAngle;
|
||||
angle = -engineConfiguration->crankingTimingAngle;
|
||||
} else {
|
||||
angle = -getBaseAdvance(rpm, engineLoad);
|
||||
angle = getBaseAdvance(rpm, engineLoad);
|
||||
}
|
||||
return fixAngle(engineConfiguration, angle + engineConfiguration->ignitionOffset);
|
||||
return fixAngle(engineConfiguration, angle - engineConfiguration->ignitionOffset);
|
||||
}
|
||||
|
||||
void prepareTimingMap(void) {
|
||||
|
|
|
@ -793,7 +793,7 @@ void initSettings(engine_configuration_s *engineConfiguration) {
|
|||
addConsoleActionI("set_rpm_hard_limit", setRpmHardLimit);
|
||||
addConsoleActionI("set_firing_order", setFiringOrder);
|
||||
addConsoleActionI("set_algorithm", setAlgorithm);
|
||||
addConsoleActionI("stopengine", stopEngine);
|
||||
addConsoleAction("stopengine", stopEngine);
|
||||
|
||||
// todo: refactor this - looks like all boolean flags should be controlled with less code duplication
|
||||
addConsoleAction("enable_injection", enableInjection);
|
||||
|
|
|
@ -303,6 +303,7 @@ void onTriggerEvent(trigger_event_e ckpSignalType, uint32_t eventIndex, MainTrig
|
|||
return;
|
||||
}
|
||||
float advance = getAdvance(rpm, getEngineLoadT(engine) PASS_ENGINE_PARAMETER);
|
||||
|
||||
if (cisnan(advance)) {
|
||||
// error should already be reported
|
||||
return;
|
||||
|
@ -310,7 +311,7 @@ void onTriggerEvent(trigger_event_e ckpSignalType, uint32_t eventIndex, MainTrig
|
|||
|
||||
float dwellAngle = dwellMs / getOneDegreeTimeMs(rpm);
|
||||
|
||||
initializeIgnitionActions(advance, dwellAngle, engine->engineConfiguration2,
|
||||
initializeIgnitionActions(fixAngle(engineConfiguration, -advance), dwellAngle, engine->engineConfiguration2,
|
||||
&engine->engineConfiguration2->ignitionEvents[revolutionIndex] PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue