Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Thread Closed: Issue successfully resolved

???
07/21/04 06:46
Read: times


 
Msg Score: +1
 +1 Good Question
#74533 - WD in lengthy functions
Dear friends,
Hello, I was reading previous posts about watchdogs and I noticed that most experienced users strongly recommended that WD should only be updated in the main function. In cases that functions return immediately or with short delays to the main that’s doable but what about functions that should wait for a long time (many seconds) for an event or function that are inherently long like functions that should drive motors for a specified time. In my current project I have plenty of them ( I tried to shrink functions as far as possible). I came with two ideas:
1- multitasking- this leads to very ugly main function with many global or main variables which are not very nice as well.
2- update WD in the lengthy function but with condition! After a lengthy function has been called it sets a global byte to an appropriate value. This global byte is decremented in a timer ISR each second and WD only updates if this bytes is unequal to zero.
I like the second idea but I would like to know your opinions. Is it safe enough? better idea?

Another question, a while back mr.erik malund said that he uses a crash routine in case of a crash. I'm going to use the idea in my current project, but apart from keeping wd from updating should this routine do other jobs ?

Thank you very much
Reza Fallahati



List of 55 messages in thread
TopicAuthorDate
WD in lengthy functions            01/01/70 00:00      
   RE: WD in lengthy functions            01/01/70 00:00      
      RE: WD in lengthy functions            01/01/70 00:00      
         Watchdogs in general            01/01/70 00:00      
            RE: Watchdogs in general            01/01/70 00:00      
               RE: Watchdogs in general            01/01/70 00:00      
                  RE: Watchdogs in general            01/01/70 00:00      
                     RE: Watchdogs in general            01/01/70 00:00      
                  RE: Watchdogs in general            01/01/70 00:00      
                     RE: Watchdogs in general            01/01/70 00:00      
                        RE: Watchdogs in general            01/01/70 00:00      
                           RE: Watchdogs in general            01/01/70 00:00      
            RE: Watchdogs in general            01/01/70 00:00      
               RE: Watchdogs in general            01/01/70 00:00      
         RE: WD in lengthy functions            01/01/70 00:00      
      RE: WD in lengthy functions            01/01/70 00:00      
         RE: WD in lengthy functions            01/01/70 00:00      
            RE: WD in lengthy functions            01/01/70 00:00      
               RE: WD in lengthy functions            01/01/70 00:00      
                  RE: WD in lengthy functions            01/01/70 00:00      
                     RE: WD in lengthy functions            01/01/70 00:00      
                        RE: WD in lengthy functions            01/01/70 00:00      
                           RE: WD in lengthy functions            01/01/70 00:00      
                              RE: WD in lengthy functions            01/01/70 00:00      
               RE: WD in lengthy functions            01/01/70 00:00      
                  RE: WD in lengthy functions            01/01/70 00:00      
                  RE: WD in lengthy functions            01/01/70 00:00      
                     RE: WD in lengthy functions            01/01/70 00:00      
         RE: WD in lengthy functions            01/01/70 00:00      
      RE: WD in lengthy functions            01/01/70 00:00      
         RE: infinite loop error trapping            01/01/70 00:00      
            RE: infinite loop error trapping            01/01/70 00:00      
               RE: infinite loop error trapping            01/01/70 00:00      
                  RE: infinite loop error trapping            01/01/70 00:00      
                     RE: infinite loop error trapping            01/01/70 00:00      
         RE: WD in lengthy functions            01/01/70 00:00      
            RE: WD in lengthy functions            01/01/70 00:00      
               RE: adding a detail            01/01/70 00:00      
            RE: WD in lengthy functions            01/01/70 00:00      
               RE: WD in lengthy functions            01/01/70 00:00      
                  RE: WD in lengthy functions            01/01/70 00:00      
      RE: WD in lengthy functions            01/01/70 00:00      
         RE: WD in lengthy functions            01/01/70 00:00      
            RE: WD in lengthy functions            01/01/70 00:00      
               RE: WD in lengthy functions            01/01/70 00:00      
                  RE: WD in lengthy functions            01/01/70 00:00      
                     RE: WD in lengthy functions            01/01/70 00:00      
                        RE: WD in lengthy functions            01/01/70 00:00      
                           RE: WD in lengthy functions            01/01/70 00:00      
               RE: WD in lengthy functions            01/01/70 00:00      
                  RE: WD in lengthy functions            01/01/70 00:00      
                     RE: WD in lengthy functions            01/01/70 00:00      
                        RE: WD in lengthy functions            01/01/70 00:00      
                           RE: WD in lengthy functions            01/01/70 00:00      
   RE: WD in lengthy functions            01/01/70 00:00      

Back to Subject List