3 Replies Latest reply on Jun 12, 2012 7:22 AM by user_1377889

    Dumb question of the day, about pointers

    loren.snyder

      Hello all.

         

      In my isr_1.c file, I wish (for various reasons) to assign a pointer to a specific spot in the SRAM.

         

      What I'm doing is calculating an index (based on the number of times I've entered the ISR) and adding that to a static base address, as in:

         

      uint16 offset;

         

      uint8 *foo;

         

      foo = 0x20000000 + offset;

         

      The complier issues a warning, stating that I'm creating a pointer from an int without a cast.

         

      Is there a more "elegant" or "kosher" way to do this? I am intentionally putting things into this portion of SRAM in order to avoid conflicting with anything related to program execution.

         

      Your thoughts are appreciated, thanks.