Hello, I started to play with software I2C on 12F675 and found that TRISIO_bits definition is missing. Can somebody add following (or something similar) into pic12f675.h (and corresponding "volatile __TRISIO_bits_t .." line into .C file) ?
// ----- TRISIO bits -------------------- typedef union { struct { unsigned char IO0:1; unsigned char IO1:1; unsigned char IO2:1; unsigned char IO3:1; unsigned char IO4:1; unsigned char IO5:1; unsigned char :1; unsigned char :1; }; } __TRISIO_bits_t; extern volatile __TRISIO_bits_t __at(TRISIO_ADDR) TRISIO_bits; #ifndef NO_BIT_DEFINES #define TRISIO0 TRISIO_bits.IO0 #define TRISIO1 TRISIO_bits.IO1 #define TRISIO2 TRISIO_bits.IO2 #define TRISIO3 TRISIO_bits.IO3 #define TRISIO4 TRISIO_bits.IO4 #define TRISIO5 TRISIO_bits.IO5 #endif /* NO_BIT_DEFINES */ BTW, I tried following macros ( Raphael recommended them in 2007-12 ), but no success with the new SDCC: #define SETB(reg,bit) (reg) |= (1<<(bit)) #define CLRB(reg,bit) (reg) &= ~(1<<(bit)) #define LED1 GPIO,0 #define LED2 GPIO,2 SETB(LED1); I get following error (it looks like no expansion is done in preprocessor ? ) : main.c:100:17: error: macro "SETB" requires 2 arguments, but only 1 given main.c:100: error 20: Undefined identifier 'SETB' If I just try "SETB( LED1, 0)" I get "lvalue required for operation". So it looks like wrong expansion. Maybe problem of Win32 port ? I use sdcc -v SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.4 #5264 (Nov 11 2008) (MINGW32) Vaclav ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user