G'day folks

I am trying to write some code for an lcd module to put in a library. I 
seem to need to be able to read/write from a port in the library.  I 
would like to be able to refer to it as, say lcdport so different 
hardware set-ups can use the same code.  I can create a lcd structure thus:
typedef union {
        struct{
            unsigned char :1;
            unsigned char rs:1;
            unsigned char rw:1;
            unsigned char e:1;
            unsigned char d:4;
        };
}lcd_t;

as the pic14 header files do for their ports.  If I allow the linker to 
assign the location:
lcd_t lcd;
everything compiles fine.  The lcd structure, is of course, not at the 
port address. If I
volatile lcd_t __at (PORTB_ADDR);
I get an error saying "multiple sections using address 0x6"

But, I can declare:
__sfr PORTB;
_PORTB_bits_t PPORTB_bits;
and use them as expected.

What I don't understand (among a quadzillion things) is why can I use 
PORTB and PORTB_bits and not get that error, but if I use lcd to refer 
to port b bits, I get the above error. ggggrrr!!

So, as the Beach Boys once said, help me Rhonda, help help me Rhonda!!!!!!

Any reply will be deeply appreciated, thanks.


But please, flame me gently, I am fairly new to all this.

pete

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to