#22 Compile for PIC : problem with global/extern bit

closed
nobody
None
5
2006-11-23
2003-08-24
Anonymous
No

Hi,

I'm working on W2K. I'm trying to compile a simple .c file
for PIC 16f628.
I have problems with bit definitions in "16f628.h" (like
BIT_AT(VRCON_ADDR,7) VREN;).

When I use the binary build of sdcc, everything works
fine. Especially the previous "bit at" definition gives
in .asm "; global _VREN" which links without problem.

Now, I'm trying to compile sdcc from the cvs tree. No
problem during sdcc build.

But now the "bit at" definition gives in .asm "extern
_VREN" which leads to a missing ref during gplink.

Any idea of what could be the difference between the
sdcc night build and my compilation of the sdcc cvs tree
that could give this behaviour ?

Thanks,

Matthieu

Discussion

  • Raphael Neider
    Raphael Neider
    2006-11-23

    • status: open --> closed
     
  • Raphael Neider
    Raphael Neider
    2006-11-23

    Logged In: YES
    user_id=1115835
    Originator: NO

    The use of bit is discouraged and is (or will be?) removed from current SDCC/pic14 versions.
    Use bitfields instead:
    struct {
    unsigned char b0;
    unsigned char b1;
    unsigned char b2;
    unsigned char b3;
    unsigned char b4;
    unsigned char b5;
    unsigned char b6;
    unsigned char b7;
    } bitfield_t;

    Regards,
    Raphael