arduino-lmic
arduino-lmic copied to clipboard
Easy way to restart arduino on `FAILURE`?
How can I make sure my arduino restarts after the library encountered a FAILURE
condition? I know of the asm volatile (" jmp 0");
, but how can I integrate it into the library?
I think the most reliable way would be to use watchdog, which will cause a real reset (but that requires a bootloader that clears MCUSR
as well).
In any case, you would need to modify the hal_failed()
function in hal.cpp
. Perhaps it makes sense to make that function weak, so you can just define your own in the sketch to override it.
Do you have any tips or pointers for me how I can make the hal_failed()
function weak? My C/C++ is really bad.
Add __attribute__((__weak__))
in its declaration IIRC (but Google should help with that).
@matthijskooijman I think it would be nice to declare it as weak as default in the library.
Do you have any tips or pointers for me how I can make the
hal_failed()
function weak? My C/C++ is really bad.
Do you have any tips or pointers for me how I can make the
hal_failed()
function weak? My C/C++ is really bad. Hi Gerald, do you have solved the reset function in FAILURE condition?
Sorry @geppoleppo, I didn't solve this
Thanks
Il giorno mar 22 ott 2019 alle ore 21:09 Gerald Pape < [email protected]> ha scritto:
Sorry @geppoleppo https://github.com/geppoleppo, I didn't solve this
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/matthijskooijman/arduino-lmic/issues/57?email_source=notifications&email_token=AD54VHLOOYWOOWEC3VUFFMLQP5FWBA5CNFSM4CW5GKB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB63N6I#issuecomment-545109753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD54VHMC4TN3CTR4CXEHEDDQP5FWBANCNFSM4CW5GKBQ .
--
ing. Silvano Pisoni Ingegnere civile ambientale M. +39 393 98 60 814
*TERA engineering s.r.l.*Via dei Solteri 37/1, Trento T. +39 0461 93 17 64 www.tera-group.it https://mail.google.com/mail/u/0/www.tera-group.it
Old thread but still open: it would be great if someone will give advice how to implement wdt with LMIC. Maybe with an example?