avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] port access with avr-gdb


From: Ned Konz
Subject: Re: [avr-gcc-list] port access with avr-gdb
Date: Fri, 18 Jun 2004 14:35:20 -0700
User-agent: KMail/1.6.2

On Friday 18 June 2004 12:40 pm, I wrote:
> On Sunday 13 June 2004 7:23 am, Dave Hylands wrote:
> > One way to get the registers to show up symbolically, is to create a
> > structure which has the same layout as the registers. Then you can access
> > through a null pointer. This would allow you to see the registers in GDB.
> > They still wouldn't show up I nthe linker map though.
> >
> > There are ways of making them show up in the linker map too. Just create
> > an asm file which has each of the registers named. On the C side you'd
> > have appropriate externs decalred.
>
> I rather like the way that Microchip's C18 compiler does it...

Here's an example; I haven't tried it out.

The important ideas:

* bits are named in anonymous struct members in unions
* can deal with multi-bit fields (like MUX0..4 in adc10.h here)
* factoring common peripherals out into separate files can ease code 
duplication and maintenance effort
* defines provide datasheet-compatible aliases but still safe

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE

reply via email to

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