simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] Re: interrupt flag/enable bits update


From: John Regehr
Subject: Re: [Simulavr-devel] Re: interrupt flag/enable bits update
Date: Sat, 29 Nov 2003 12:06:25 -0700 (MST)

>   if ((read (irq->enable.addr) & irq->enable.mask)

Just to document the idiom here I'd wrap this in a little function that'll
get inlined:

  int int_bit_set (IntBit intbit) {
    return ((read (intbit.addr) & intbit.mask) != 0);
  }

> I'm hoping that you are thinking about something like this for
> avr_core_check_interrupts():
>
>   if ((read (irq->enable.addr) & irq->enable.mask)
>       && ((irq->flag.mask == 0) ||
>           (read (irq->flag.addr) & irq->flag.mask)))
>   {
>       uint8_t clr_flag = read (irq->flag.addr) & ~irq->flag.mask;
>
>       /* vector in the irq */
>
>       write (irq->flag.addr, clf_flag);
>   }

Yes, that is what I was thinking.

John






reply via email to

[Prev in Thread] Current Thread [Next in Thread]