Output pin init/deinit needs a linked list #1803

This commit is contained in:
rusefi 2020-09-18 13:29:17 -04:00
parent fbdd1b0cb0
commit dfbbdff4b1
1 changed files with 4 additions and 2 deletions

View File

@ -63,15 +63,17 @@ RegisteredOutputPin::RegisteredOutputPin(const char *name, short pinOffset,
}
void RegisteredOutputPin::unregister() {
#if EFI_PROD_CODE
brain_pin_e curPin = *(brain_pin_e *) ((void *) (&((char*)&activeConfiguration)[pinOffset]));
brain_pin_e newPin = *(brain_pin_e *) ((void *) (&((char*) engineConfiguration)[pinOffset]));
pin_output_mode_e curMode = *(pin_output_mode_e *) ((void *) (&((char*)&activeConfiguration)[pinOffset]));
pin_output_mode_e newMode = *(pin_output_mode_e *) ((void *) (&((char*) engineConfiguration)[pinOffset]));
pin_output_mode_e curMode = *(pin_output_mode_e *) ((void *) (&((char*)&activeConfiguration)[pinModeOffset]));
pin_output_mode_e newMode = *(pin_output_mode_e *) ((void *) (&((char*) engineConfiguration)[pinModeOffset]));
if (curPin != newPin || curMode != newMode) {
unregisterOutput(curPin);
}
#endif // EFI_PROD_CODE
}
EnginePins::EnginePins() :