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

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

RE: [avr-libc-dev] Ordered todo.


From: José Ildefonso Camargo Tolosa
Subject: RE: [avr-libc-dev] Ordered todo.
Date: Mon, 16 Dec 2002 10:52:41 -0500

Hi!

I have been reading through all the discution about moving some definitions to 
one place.  About that, I would only like to say that: according to what I have 
saw on atmel devices, the use to change things from one place to another REALLY 
easily, I mean, in the ATmega169 they changed the eeprom address.  So, my 
suggestion is: keep the definitions for each device inside the device's file, 
even if the definition is the same in all devices.  Why?, well, just because it 
is easier to add new devices, even if they differ a lot.  This comment is based 
on my own experience adding new devices to avr-libc, about two months ago I 
added support for ATmega16 to the avr-libc that I had (I had not found the 
savannah site then), and I found it really easy because I only had to add one 
file and modify some makefiles.

Additionally, I would like to suggest that you add some definitions for 
"inter-device" compatibility.  For example, in the ATmega16 the UBRR register 
pair is: UBRRL and UBRRH, but in the ATmega128, due that it have two USARTs, it 
have UBRR0L and UBRR0H and UBRR1L and UBRR1H.  So, for the ATmega16 (or any 
other that have just one USART), I would define:

#ifdef UBRRL   //UBRRL would be defined ONLY if there is just one USART
#define UBRR0L UBRRL
#define UBRR0H UBRRH
#endif

So that one can just use UBRR0L and UBRR0H to use the first (or unique) USART 
on any device.  This kind of definitios, for any periferical of this type would 
help to keep code as portable as posible.

Well, I hope that my comments can be of help to you, 

Sincerely,

Ildefonso Camargo
address@hidden
address@hidden


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/



reply via email to

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