Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Re: Some C help please !

2007-03-22 by Dennis Clark

Mike,

   What makes the former syntax nicer is that it has no "magic numbers" 
embedded in the code.  UCSRA.5 does not mean as much as UCSRA.UDRE (if 
that is defined) or as UCSRA & (1<<UDRE) - The latter does not require a 
library of structures defining the bits, just a bunch of #defines. 
You'll pick it up as you go along.  :)

DLC

Mike Bronosky wrote:
> All this is fine. But for many of us hobbyists that know just enough about
> C, especially when it comes to AVRs, to be down-right-dangerous...
> 
> For me something like the following, is good, proper and works. It is not
> fully understood until I dissect.
> while ((UCSRA & (1<<UDRE))==0);
> 
> while(UCSRA.5 == 0);  //while(USART Data Register Empty)
> Haven't tried this but I think it should work and means "while the data
> register is empty sit right here".
> Now to the Xsperts may disagree. I'm a hobbiest, it works for me and best of
> all I understand why it works.
> 
> Mike
> 
> On 3/14/07, David Appleton <englsprogeny@yahoo.com> wrote:
> 
>>  I am going to learn so much from this group......
>>Glad I joined.
>>
>>
>>: )
>>
>>[Non-text portions of this message have been removed]
>>
>>
>>
> 
> 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 

-- 
---------------------------------------
Dennis Clark    TTT Enterprises
---------------------------------------

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.