Hello,
I swapped a "Classic" Nano for a Nano Every. Everything works great and everything is compatible except the function :
void(* resetFunc) (void) = 0;
I was using it to "reboot" the micro-controller, but this seems to freeze the Every more than anything else.
The function no longer works with Every? Is there another function I can use to achieve the same result?
Thank you !!!
That's a srsly ridiculous way to accomplish something that can, without a scintilla of an iota of a fraction of doubt be done with regular straightforward code that would work on any Arduino board.
depends how it's used. It's not unheard of that system auto-reboot in case of unrecoverable error (like on ESP the heavy use of the String class by some libraries could overtime lead to challenges)
J-M-L
Eventually it will work. I reduced the reaction time with WDTO_500MS. I inserted in my interrupt myDFPlayer.stop(); When the user presses the red button (reset), the device returns to the start and if an mp3 file is playing, the function myDFPlayer.stop(); stop it.
Hello alto777
I am not an experienced programmer. Rather a beginner. I learn little by little.
I used the function
void(* resetFunc) (void) = 0;
in an Interrupt to "reboot" the device.
I made a box with 4 buttons. 3 blue buttons are used to play 3 mp3 tracks. But if the user leaves after track 2, I want the new user to be able to start from the beginning. Then, by pressing the 4th button, the red one [= Interrupt + resetFunc ], the device "restarts" and starts all over again. Here is an example of my code...
That hack assumes the reset vector for the processor is located at address 0. For MANY processors that is incorrect. I have no clue what it is for the processor in question, but very likely it is one that has the reset vector located somewhere other than address 0.
And, that does NOT do an actual reset! The hardware almost certainly does NOT get reset, it simply attempts to re-start the software, which may, or may not, be reliable. Often, with that approach, an interrupt occurring at the wrong point during the re-initialization of the software will cause a crash, or memory corruption. It is a really lousy way to fake a reset.