[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] TimerA interrupt handler



Try something like this for your handler.

void __attribute__ ((interrupt)) vblHandler ()
{   
   
}


On 03/01/2013 16:17, Miro Kropáček wrote:

You have to acknowlege the interrupt in software-EOI mode.

> I suspect the 'automatic end-of-interrupt mode' bit settings, as
> there's no way how to set it via a C function, AFAIK. Any ideas?

Since the EOI mode is global to all interrupts served by the MFP it is a
bad idea to change it.
OK, this is as far as I could get with my 'deassemblerize' mission:

Xbtimer( XB_TIMERA, 1<<3, 1, asm_timer_a ); // event count mode, count to '1'
Supexec( enableTimerASei ); // enable software end of interrupt
Jenabint( MFP_TIMERA );

and the handler:

_asm_timer_a:
  movem.l d0-d1/a0-a1,-(sp)
  jsr _timerA
  movem.l (sp)+,d0-d1/a0-a1
  rte

There are two problems with the handler: GCC by default doesn't save d0/d1/a0/a1 registers (nor the Xbtimer initialization does) and the handler must end with 'rte'. Any way out of this? (I deliberately ignore the fact that some MFP regs are irretrievably lost).

--
MiKRO / Mystic Bytes
http://mikro.atari.org