#116897 - GPFerror - Tue Jan 30, 2007 7:35 pm
"The interrupt dispatcher has now returned to the older method of acknowledging before entering the user handler. The convoluted method was based on a misunderstanding of a situation where it appeared user data was lost if the interrupt flag was cleared first" This is in the latest libnds release notes, maybe its related?
My fifo/irq has stopped working in latest release and not sure how to fix it yet.
here is my arm7 code
and the init code
and my arm9 code
and its init code
Any ideas on what I need to change it to for r20?
Thanks,
Troy(GPF)
http://gpf.dcemu.co.uk
My fifo/irq has stopped working in latest release and not sure how to fix it yet.
here is my arm7 code
Code: |
void VblankHandler(void) { //--------------------------------------------------------------------------------- u32 i; if(REG_IF & IRQ_VBLANK) { SoundVBlankIrq(); //sound code :) TransferSound *snd = IPC->soundData; IPC->soundData = 0; if (0 != snd) { for (i=0; i<snd->count; i++) { s32 chan = getFreeSoundChannel(); if (chan >= 0) { startSound(snd->data[i].rate, snd->data[i].data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format); } } } } if(REG_IF & IRQ_FIFO_NOT_EMPTY) { SoundFifoHandler(); } } |
and the init code
Code: |
irqInit();
irqSet(IRQ_VBLANK, VblankHandler); SetYtrigger(80); vcount = 80; irqSet(IRQ_VCOUNT, VcountHandler); REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR | IPC_FIFO_RECV_IRQ; irqSet(IRQ_FIFO_NOT_EMPTY, VblankHandler); irqEnable(IRQ_VBLANK | IRQ_VCOUNT|IRQ_FIFO_NOT_EMPTY); |
and my arm9 code
Code: |
void InterruptHandler(void)
{ u32 command,remain; //printdbg("InterruptHandler\n"); if(REG_IF & IRQ_VBLANK) { framecounter++; } if(REG_IF & IRQ_FIFO_NOT_EMPTY) { if(!(REG_IPC_FIFO_CR & IPC_FIFO_RECV_EMPTY)) { command = REG_IPC_FIFO_RX; switch(command) { case FIFO_NONE: break; case UPDATEON_ARM9: MixSound(); SendCommandToArm7(MIXCOMPLETE_ONARM9); break; } } } } |
and its init code
Code: |
irqInit();
irqSet(IRQ_VBLANK | IRQ_FIFO_NOT_EMPTY,&InterruptHandler); irqEnable(IRQ_FIFO_NOT_EMPTY); REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR | IPC_FIFO_RECV_IRQ; |
Any ideas on what I need to change it to for r20?
Thanks,
Troy(GPF)
http://gpf.dcemu.co.uk