Board index » cppbuilder » Getting Undefined symbol error
Maurice Anderson
![]() CBuilder Developer |
Getting Undefined symbol error2005-02-20 03:52:10 PM cppbuilder48 Hello, I received some code from the net. When I compile it I receive a "Undefined symbol P2DIR" for line: high(SDA); In the code it looks like P2DIR is defined so I don't know whats going on. Can someone tell me what's going on and maybe how to work around it so I can compile and run the code? Thanks. // Macros to access SDA/SCL lines readably #define high(a) P2DIR &= ~(a) #define low(a) P2DIR |= (a) #define read(a) (P2IN & (a)) char readByte(void){ int i; char byte; int inputbit; high(SDA); byte = 0; for (i = 0; i < 8; i++) { high(SCL); inputbit = read(SDA); byte = byte << 1; if(inputbit){ byte = byte + 1; } low(SCL); } return byte; } |