[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] [PATCH] use static callbacks instead of template pa
From: |
panic |
Subject: |
Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg |
Date: |
Sat, 17 Jun 2017 19:08:00 +0000 |
panic:
> Hi,
>
> Michael Hennebry:
>> The PINx toggle of PORTx bits is not a new feature.
>> simulavr must support this.
>> A RMW implementation of SBI also does not work on registers with interrupt
>> flags.
>
> At least according to avrlibc doc, this is not recommended for interrupt
> flags:
>
> http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_intbits
> http://www.atmel.com/webdoc/avrlibcreferencemanual/FAQ_1faq_intbits.html
The actual motivation might be that some interrupt flag registers are
also located above 0x20 and cannot be used together with SBI. Thusly,
"|=" would be evaluated to in/eor/out possibly clearing too many flags.
A programmer would have to look up whether the register with the flag to
clear is above or below 0x20 and then use = or |=. Hence, the
recommendation to never use |= to clear interrupt flags.
For registers below 0x20, |= via SBI instruction should work though.
On the other hand, the PINx registers are always located below 0x20.
Cheers,
panic
- [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/15
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, Klaus Rudolph, 2017/06/16
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/16
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/16
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, Klaus Rudolph, 2017/06/17
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/17
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, Michael Hennebry, 2017/06/17
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/17
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg,
panic <=
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/17
- [Simulavr-devel] SBI vs. PINx and interrupt flag registers, Michael Hennebry, 2017/06/19
- Re: [Simulavr-devel] SBI vs. PINx and interrupt flag registers, panic, 2017/06/19
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, Michael Hennebry, 2017/06/19
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/19
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/25
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/29
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, Michael Hennebry, 2017/06/29
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, Klaus Rudolph, 2017/06/30
- Re: [Simulavr-devel] [PATCH] use static callbacks instead of template param for IOReg, panic, 2017/06/30