Skip to main content
julienlemellec9
Associate
June 3, 2013
Question

Atollic variables

  • June 3, 2013
  • 2 replies
  • 653 views
Posted on June 03, 2013 at 10:42

Hello, I'm currently programmed a STM32F4 Discovery with the IDE Atollic. In my program, I get two fonction, the first in the file ''stm32f4xx_it.c'' and the second in the file main.c and i want to known if i can transmit a variable betwen the two fonctions.

Sorry for my bad English !!

Thanks,

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    June 3, 2013
    Posted on June 03, 2013 at 13:02

    This isn't an Atollic issue, simply a C one.

    Define a global variable in one of the files, and refer to it with the ''extern'' keyword in the others. For variables you change in an interrupt consider also the ''volatile'' keyword.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    julienlemellec9
    Associate
    June 3, 2013
    Posted on June 03, 2013 at 15:29

    Ok, thanks, it's running !!!