PBYTE to sfr?

I have the following function:

void usbReceive(PBYTE Buffer, BYTE size);

and I want to pass an sfr to it:

usbReceive(&P2, 1);

I'm getting illegal pointer conversion
Nevertheless,
usbReceive(P2, 1);
does not compile also. How can I read directly into P2 sfr?

Parents
  • 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.

Reply
  • 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.

Children
More questions in this forum