Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:48 09 May 2024 Privacy Policy
Jump to

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: Australia
Posts: 1387
Posted: 12:37am 03 Aug 2017
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9070
Posted: 01:19am 03 Aug 2017
Copy link to clipboard 
Print this post

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: Australia
Posts: 3165
Posted: 03:01am 03 Aug 2017
Copy link to clipboard 
Print this post

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: Australia
Posts: 1387
Posted: 11:53am 03 Aug 2017
Copy link to clipboard 
Print this post

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. Edited by KeepIS 2017-08-04
It's all too hard.
Mike.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024