Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Question about Errors and watchdog-T.
Author | Message | ||||
KeepIS Guru Joined: 13/10/2014 Location: AustraliaPosts: 1387 |
I've got a test program with the watchdog enabled. Now I know I should be catching errors in every procedure and function, but when hacking a program together to test, and wanting to break at the error line in the editor, is there any way to disable the watchdog timer on error. I'm still getting used to MMBasic and I'm not sure if you can set a global error handler or something like that to stop the watchdog timer continually restarting the program on error. Hope that makes sense. It's all too hard. Mike. |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9070 |
Hiya. Type WATCHDOG OFF at the command prompt, as soon as your error occurs. I thought that the watchdog was disabled when you ran the editor? ...perhaps not. Smoke makes things work. When the smoke gets out, it stops! |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
The watchdog timer keeps running even on an error which causes the program to exit to the command prompt (this is why it is so useful). You don't need the watchdog timer when you are debugging so just comment it out or use something like this: IF debug THEN wdTiner = 99999999 ELSE wdTimer = 200 ... ... WATCHDOG wdTimer ... Geoff Graham - http://geoffg.net |
||||
KeepIS Guru Joined: 13/10/2014 Location: AustraliaPosts: 1387 |
Thanks, I just thought there may have been a way to have some type of hooked error interrupt. With typing WATCHDOG OFF at the prompt, that doesn't work if the error is generated a few hundred ms after program restart. I have a keyboard and CTRL-C handler and can usually kill it with that anyway. As you say, just have set to off in debug is simple. It's all too hard. Mike. |
||||
Print this page |