emseedee
Member
I have a simple project to manage the watering system in my greenhouse. I want the system to reset every time any one of a number of conditions occurs: Water level low, reset button pressed, etc, etc.
My code includes
And the ISR is:
It seems that only the last attachInterupt instruction is working - the system doesn't reset on any of the other events.
Is this normal behaviour - does each attachInterrupt overwrite previous ones?
Thanks
Mike
My code includes
Code:
attachInterrupt(digitalPinToInterrupt(reset_switch),rst_ISR, FALLING); // catch reset switch event
attachInterrupt(digitalPinToInterrupt(prime_switch),rst_ISR, CHANGE); // catch prime switch event
attachInterrupt(digitalPinToInterrupt(empty_switch),rst_ISR, CHANGE); // catch change in empty switch
attachInterrupt(digitalPinToInterrupt(disp_present),rst_ISR, CHANGE); // catch display being plugged in or removed
And the ISR is:
Code:
void rst_ISR()
/*
* Perform a software reset when the reset button is pressed or empty switch changes state
*/
{
SCB_AIRCR = 0x05FA0004;
}
It seems that only the last attachInterupt instruction is working - the system doesn't reset on any of the other events.
Is this normal behaviour - does each attachInterrupt overwrite previous ones?
Thanks
Mike