Hi all,
I'm using a teensy 3.2 as the brain of a Laser Power Supply. It essentially boots up, waits, powers up the laser when told, powers down when told. I want to use the watch dog timer as a backup just in case the teensy hangs or gets stuck, but depending on where the hang happens I'd need different behaviour. I'm therefore wondering if anyone can give me pointers on if this can be done, and the safest way to do it. My initial ideas are:
I could configure the WDT to either use or not use the ISR on timeout; giving me two options which would be better than none and still reasonably safe.
I could configure the ISR with a funciton pointer, and change what it points to in the code to change the function. That seems like a bad/unsafe idea.
As a side note, I was also wondering about what can/can't (or morelikely should/shouldn't) be done inside a WDT ISR. I'd need to modify the DAC, and i'd like to write to the EEPROM if I can.
Thanks for your help!
I'm using a teensy 3.2 as the brain of a Laser Power Supply. It essentially boots up, waits, powers up the laser when told, powers down when told. I want to use the watch dog timer as a backup just in case the teensy hangs or gets stuck, but depending on where the hang happens I'd need different behaviour. I'm therefore wondering if anyone can give me pointers on if this can be done, and the safest way to do it. My initial ideas are:
I could configure the WDT to either use or not use the ISR on timeout; giving me two options which would be better than none and still reasonably safe.
I could configure the ISR with a funciton pointer, and change what it points to in the code to change the function. That seems like a bad/unsafe idea.
As a side note, I was also wondering about what can/can't (or morelikely should/shouldn't) be done inside a WDT ISR. I'd need to modify the DAC, and i'd like to write to the EEPROM if I can.
Thanks for your help!