1 Reply Latest reply on Sep 22, 2016 1:35 AM by JoMe_264151

    Pointer to io port?

      Given that GPIOs are defined in PSoCGPIOINT.h as, e.g.:

      #pragma ioport LED0_Data_ADDR:    0x0 BYTE           LED0_Data_ADDR; #define LED0_MASK 0x2



      I tried doing something like this in my code:



      void SetLED(BYTE *address, BYTE mask) {     *address |= mask; }  ...  SetLED(&LED0_Data_ADDR, LED0_MASK); 

      That compiled fine, but did not have any effect. It seems like the variables with #pragma ioport can't be referenced and dereferenced like that.


      I can't find any in-depth information about #pragma ioport and I/O memory. Is there any way I can qualify pointers to work as intended? Or do pointers to io memory not work in this compiler?