Fix issue with LED indicator not working when MC33810 was in use

This commit is contained in:
Josh Stewart 2023-12-12 10:00:47 +11:00
parent f7ee4c6415
commit af2815d818
1 changed files with 6 additions and 5 deletions

View File

@ -2970,6 +2970,7 @@ void setPinMapping(byte boardID)
if( (ignitionOutputControl == OUTPUT_CONTROL_MC33810) || (injectorOutputControl == OUTPUT_CONTROL_MC33810) ) if( (ignitionOutputControl == OUTPUT_CONTROL_MC33810) || (injectorOutputControl == OUTPUT_CONTROL_MC33810) )
{ {
initMC33810(); initMC33810();
pinMode(LED_BUILTIN, OUTPUT); //This is required on as the LED pin can otherwise be reset to an input
} }
//CS pin number is now set in a compile flag. //CS pin number is now set in a compile flag.
@ -3187,11 +3188,6 @@ void initialiseTriggers(void)
pinMode(pinTrigger2, INPUT); pinMode(pinTrigger2, INPUT);
pinMode(pinTrigger3, INPUT); pinMode(pinTrigger3, INPUT);
#if defined(CORE_TEENSY41)
//Teensy 4 requires a HYSTERESIS flag to be set on the trigger pins to prevent false interrupts
setTriggerHysteresis();
#endif
detachInterrupt(triggerInterrupt); detachInterrupt(triggerInterrupt);
detachInterrupt(triggerInterrupt2); detachInterrupt(triggerInterrupt2);
detachInterrupt(triggerInterrupt3); detachInterrupt(triggerInterrupt3);
@ -3649,6 +3645,11 @@ void initialiseTriggers(void)
else { attachInterrupt(triggerInterrupt, triggerHandler, FALLING); } else { attachInterrupt(triggerInterrupt, triggerHandler, FALLING); }
break; break;
} }
#if defined(CORE_TEENSY41)
//Teensy 4 requires a HYSTERESIS flag to be set on the trigger pins to prevent false interrupts
setTriggerHysteresis();
#endif
} }
static inline bool isAnyFuelScheduleRunning(void) { static inline bool isAnyFuelScheduleRunning(void) {