What is meaning of preceding c line

Discussion in 'Embedded Systems and Microcontrollers' started by ep.hobbyiest, Jul 8, 2015.

  1. ep.hobbyiest

    Thread Starter Member

    Aug 26, 2014
    91
    0
    #define VICIRQStatus (*((volatile unsigned long *) 0xFFFFF000))


    HI,
    can anyone explain me what is meaning of this line?
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    It is defining a variable at a known location to allow access to a mempry mapped register.

    This way the compiler knows that VICIRQStatus lives at address 0xFFFFF000, it is an unsigned long quantity, and it can change at any time (volatile).
     
  3. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    The meaning of this line is that all occurences of "VICIRQStatus" down the text should be replace with "(*((volatile unsigned long *) 0xFFFFF000))" before compiling.
     
  4. theonewho

    New Member

    Jul 9, 2015
    17
    2
    Both @ErnieM and @NorthGuy are correct... but in different ways since your question is open to some amount of interpretation.

    @NorthGuy answers as to the function of #define.
    @ErnieM answers as to the function of the code that is #defined.
     
Loading...