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

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

Re: [avr-libc-dev] Bit number/mask, Part 3000


From: Markus Lampert
Subject: Re: [avr-libc-dev] Bit number/mask, Part 3000
Date: Wed, 5 Apr 2006 14:09:27 -0700 (PDT)

--- Ned Konz <address@hidden> wrote:
> That is, you can still use the _BV(num) expressions transparently,  
> but if you define NEW_STYLE_PORTBITS (or whatever it's called) then  
> you can write *either*:
> 
> the old style:
> TWCR |= (_BV(TWINT) | _BV(TWEA));
> 
> or the simplified usage:
> TWCR |= (TWINT | TWEA);
> 
> even in the same program, and we can use the same set of defines for  
> assembly language as well.

You can't have both in one file though, basically preventing inline assembler
code. Also, a lot of existing code would break because not everybody likes to
use macros. They write
  PORTA = (1<<PA6) | (1<<PA5) | (1<<PA1);
directly.

> That way you don't have to use new names.

I guess it comes down to expectations. For the last few years PA6 was the
equivalent to 0x06, and not 0x40. Changing that will pose a huge problem.
Depending on a global define (which you can inherit through a nested include
path) constants have different values. Not something I would prefer.

Markus

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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