title: Accessing pointer variable of one .c file in another standalone .c file without using .h file
body: <p>Firstly the scenario, my host environment is Linux, target is MAX10 FPGA and running RISCV soft processor and writing software for that. I am writing a simple bootloader in which I have one file main.c where all the functions are defined and another file led.c which is a standalone application. Now I want to go from main.c to led.c using some address say 0x08000000. This is achieved by using following code!  </p>
  
  <pre><code>void (*func_ptr)(void);
  func_ptr = (void*)0x08000000;  //starting address of led routine                       
  func_ptr();
  </code></pre>
  
  <p>In this main.c I have addresses of two LEDS which are declared at the top like this</p>
  
  <pre><code>volatile int* ledr = (volatile int*)(0x10000010);
  volatile int* ledg = (volatile int*)(0x10000020);
  </code></pre>
  
  <p>I am converting this led.c to .srec format and downloading it to FPGA RAM after parsing.</p>
  
  <p>Till here it is working perfectly!! It is going to this application. But unfortunately in led.c, it doesn't know the address of leds where i have written blinking leds program. Although delay() function is working properly but as far as I can figure out till here is that led.c doesn't know addresses so that is why I am unable to see blinking leds on my FPGA. Blinking LEDS program is below which is complete led.c file   </p>
  
  <pre><code>volatile int* led0 = (volatile int*)(0x10000010);
  volatile int* led1 = (volatile int*)(0x10000020);
  
  static void delay ()
  {
    volatile int i;
    for(i=0; i&lt;1000000; i++)
    {
    }
  
  }
  
  int main(void)
  {
  
    *led0=0;
    *led1=0;
    while(1)
    { 
  
       *led0=1;
       delay();
       *led0=0;
       *led1=1;
       delay();
       *led1=0;
    }
  
  }
  </code></pre>
  
  <p>Anyone here who can give me idea that what is wrong here and what should I do? Your help will be appreciated!!</p>
  
  <p>P.S. When it goes in this application it remains in while loop and that means it is working properly, but not blinking leds. I have double checked this thing!</p>