See below: kernels_nz wrote: > Hi Alex, > > Thanks for the quick response, I understand what the code does, just > not why a bitwise AND is performed and what (1<<UDRE) "means". In my It means shift the '1' to the left UDRE places. It is common short hand in C. > baby-C, I would probably have written > > while (UCSRA.x != 0); Which is perfectly fine if UCSRA is defined to work that way. I often define structs for SFRs so that I'd do something like: while (UCSRAbits.UDRE != 0) > where x is the UDRE bit. Any advantages to the way it's done below ? Do it each way and see which one compiles to a smaller assembly block, and use that one. :) DLC > cheers > Hein B > > > --- In AVR-Chat@yahoogroups.com, "Alex Shepherd" <lists06@...> wrote: > >>>while ((UCSRA & (1<<UDRE))==0); >> >>Loop around checking the state of the UDRE bit in the UCSRA port > > until the > >>bit value is NOT 0 >> > > > > > > > > Yahoo! Groups Links > > > -- --------------------------------------- Dennis Clark TTT Enterprises ---------------------------------------
Message
Re: [AVR-Chat] Re: Some C help please !
2007-03-13 by Dennis Clark
Attachments
- No local attachments were found for this message.