avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] New device support


From: Dmitry K.
Subject: Re: [avr-libc-dev] New device support
Date: Mon, 16 Jul 2007 09:09:56 +1100
User-agent: KMail/1.5

On Monday 16 July 2007 07:07, Joerg Wunsch wrote:
> As Dmitry K. wrote:
> > >   TCCR0B = _BV(CS00) | _BV(CS02);
> > >
> > > would be rewritten as
> > >
> > >   TCCR0B_.byte = _BV(CS00) | _BV(CS02);
> >
> > A small note: the above expressions are *different*.
>
> No, they aren't.  The .byte union member simply access the entire
> 8-bit IO register the same way as the current definitions would do, so
> there's no read/modify/write behaviour.
[...]
> Of course, what *is* different is to write
>
>         TCCR0B_.bits.cs0 = CS0_1024;
>
> This yields:
>
>         in r24,69-0x20
>         andi r24,lo8(-8)
>         ori r24,lo8(5)
>         out 69-0x20,r24
>
> i.e. read/modify/write behaviour.

Yes, You are right, I was inattentive.

Dmitry.





reply via email to

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