Message-ID: <38A71683.49D04557@online.de> Date: Sun, 13 Feb 2000 21:39:31 +0100 From: Gero Timann X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en,de,fr MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Timer Interrupt Routine References: <885sgn$m27$1 AT ac1 DOT ewetel DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: a4439.pppool.de X-Original-NNTP-Posting-Host: a4439.pppool.de X-Trace: 13 Feb 2000 15:04:51 -0600, a4439.pppool.de Lines: 37 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, What's about using the other PC-Timer, the Realtime-Clock, at int 0x70 (CPU-View) - 0x8 (PIC-View). If you need some code-snipsets, send me a mail. Yours, Gero Thorsten Erdmann wrote: > Hi, > > I have a little bit tricky problem. I want to pass data from a file to a > special hardware in the background. I have to poll the hardware, if it says > ready I transfer a byte. I want to do this via a timer subroutine. The > problem is the file access. Because the files are very big I cannot load > them completely to RAM. So I think of using a buffer, lets say 16kB. The > Timer ISR gets a byte from the buffer and sends it to the hardware device. > When the buffer is nearly empty it triggers a second routine which loads new > data from file to the buffer. > > The problem is that this second routine runs much more longer that the timer > interval, so it cannot be an Timer-ISR, too. How can I trigger this routine, > without using a polling loop in the main program. It is no problem that the > main program gets interrupted during running of that disk routine, but I > don't want to do anything special during the main program to check if there > is data needed. > > Do you understand the problem? What can I do ? > In assembler I would manipulate the stack, so the ISR "returnes" to the disk > routine, that one then returns to the main program. How can I do that in > plain C. > > Thanks > Thorsten