delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/22/14:30:24

From: bgleich AT blitz DOT chemie DOT uni-ulm DOT de (Bernhard Gleich)
Subject: long timer interrupt
Newsgroups: comp.os.msdos.djgpp
NNTP-Posting-Host: tsunami.chemie.uni-ulm.de
Message-ID: <35df0db3.0@news.uni-ulm.de>
Date: 22 Aug 1998 20:28:03 +0100
Lines: 36
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi all.

Mayby someone can suggest a smart solution to the following problem:

I am doing some data aquisition and real time processing using DJGPP
and ALLEGRO. Most time, my real time restrictions are not that tight
and I have plenty of time to do the data displaying and storing
things. But some time I have to react very fast to an event. I can
predict this event to about 0.01s accuracy if it is still a long time
to go. (If I am close to the event, the accuracy of prediction becomes
better.) If the data, which indicate the event, are read, the program
should react within 1e-4 seconds (faster is better).

My solution now is to call a function that estimates how long it will
take to the event. If it is close it waits for the event and reacts to
it. Naturally this function has to be be called often enough which
becomes very painful in a still growing program.

A better solution would be to call this function by a timer
interrupt. There is only one problem. As the function waits a not
known time, some interrupts might be lost. So I could no more rely on
the clock.

Is there some easy solution for my problem, like counting the lost
interrupts by the dely routine and adding them afterwards to system
clock.

Some solution without reprograming the timer chip myself would be
prefered.

Thanks for your efford.

                                         Gru"s
                                          Bernhard Gleich


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019