Mail Archives: djgpp/1999/05/21/10:00:52
On Thu, 20 May 1999 16:07:52 -0500, Mark Phillips
<umphill5 AT cs DOT umanitoba DOT ca> wrote:
You might need to declare 'donePlaying' as volatile (eg volatile int
donePlaying;) or optimizations might mean its value is stored in a
register throughout the while loop. Thus, even when the 'in memory'
value changes, the while loop continues.
Know assembler? You could try compiling to an .s file and see what
code is produced (to see if the variable *is* being stored in a
register).
Alternatively, are you *sure* that your interrupt handler is being
called? Is there any way you could make it give some other signal
(write something to video memory, for instance).
Have you enabled sound card interrupts in the PIC?
Look at the FAQ for other things to try/other hints.
Davin.
> i'm trying to write a program that
>will play a buffer of data to the soundblaster, and then quit when it's
>done. it works fine, except that it doesn't quit when it's done. here's
>the loop it gets stuck in:
>
>while ( !donePlaying ) {}
>
>donePlaying is a global bool. my interrupt function looks like this:
>
>static void interrupt_handler()
>{
> inportb(interptAcknowlg8); // sb acknowledge
> donePlaying = true;
> outportb(0x20,0x20); // acknowledge interrupt
> outportb(0xA0,0x20);
>}
>
__________________________________________________________
*** davmac - sharkin'!! davmac AT iname DOT com ***
my programming page: http://yoyo.cc.monash.edu.au/~davmac/
- Raw text -