parent
1f4a06e993
commit
5a4c7b38cd
|
@ -53,10 +53,8 @@ FsioState::FsioState() {
|
|||
|
||||
void Engine::eInitializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
|
||||
#if !EFI_UNIT_TEST
|
||||
// we have a confusing threading model so some synchronization would not hurt
|
||||
bool alreadyLocked = lockAnyContext();
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
TRIGGER_SHAPE(initializeTriggerShape(logger,
|
||||
engineConfiguration->ambiguousOperationMode,
|
||||
|
@ -86,11 +84,9 @@ void Engine::eInitializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMETER_SU
|
|||
engine->engineCycleEventCount = TRIGGER_SHAPE(getLength());
|
||||
}
|
||||
|
||||
#if !EFI_UNIT_TEST
|
||||
if (!alreadyLocked) {
|
||||
unlockAnyContext();
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
if (!TRIGGER_SHAPE(shapeDefinitionError)) {
|
||||
prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
|
|
@ -110,18 +110,15 @@ static bool isAveraging = false;
|
|||
static void startAveraging(void *arg) {
|
||||
(void) arg;
|
||||
efiAssertVoid(CUSTOM_ERR_6649, getCurrentRemainingStack() > 128, "lowstck#9");
|
||||
#if !EFI_UNIT_TEST
|
||||
|
||||
bool wasLocked = lockAnyContext();
|
||||
#endif
|
||||
// with locking we would have a consistent state
|
||||
mapAdcAccumulator = 0;
|
||||
mapMeasurementsCounter = 0;
|
||||
isAveraging = true;
|
||||
#if !EFI_UNIT_TEST
|
||||
if (!wasLocked) {
|
||||
unlockAnyContext();
|
||||
}
|
||||
#endif /* !EFI_UNIT_TEST */
|
||||
|
||||
mapAveragingPin.setHigh();
|
||||
}
|
||||
|
|
|
@ -100,4 +100,8 @@ void print(const char *fmt, ...);
|
|||
|
||||
#define CONFIG_PARAM(x) (x)
|
||||
|
||||
#define lockAnyContext() false
|
||||
|
||||
#define unlockAnyContext() {}
|
||||
|
||||
#endif /* GLOBAL_H_ */
|
||||
|
|
Loading…
Reference in New Issue