I have the following function:
void usbReceive(PBYTE Buffer, BYTE size);
usbReceive(&P2, 1);
usbReceive(P2, 1);
PBYTE, by its very definition in the manual, cannot possibly point to an SFR, because SFRs don't live in external memory. You might have more luck using DBYTE, but don't count on it --- SFR's can't be accessed by indirect addressing, which in terms of normal C means that a pointer to an SFR is impossible to do.
If you think that PBYTE is a pointer to xdata then claryfy me, please, how does this work:
void send_buffer(PBYTE buf, BYTE size) { BYTE s; for (s = 0; s < size; s++) send_byte(*buf++); } WORD w = 11; send_buf(&w, 2);
"If you think that PBYTE is a pointer to xdata then claryfy me" To find the explanation, open the online Manual and search for PBYTE.
View all questions in Keil forum