I'm having a problem with a pointer to struct. I'm working with the PC16552 UART, (it has 2 UARTs), and I created a struct for each UART like this:
typedef struct _uart { uchar xdata *ucBuffer; uchar xdata *ucLineCt; uchar xdata *ucLineSt; } uart;
void int0(void) interrupt 0 { ... getByte(&Serial1); ... } void int1(void) interrupt 1 { ... getByte(&Serial2); ... } void getByte(uart *actualSerial) reentrant { unsigned char ucByte; ucByte = *actualSerial->ucBuffer; ... }
if(actualSerial == &Serial2) { if(i < 20) Dump[i++] = ucByte; }