This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

scope of label

Is a label local or global? For instance, two functions aa1() and aa2() are in file aa. A label L is placed in aa1(). Another function bb() is located in bb file. Which function(s) can access the label L? Thank you for aswering my question.

chao.

Parents
  • Chao,

    You are really trying to make your life difficult! Please don't try and change the ISR return address or anything like that, you'll probably never get it working reliably (if at all).

    Do all analysis and display of data in functions called from main(). Set a flag in the ISR to indicate that a key has been pressed. Reset that flag in main(). Put all the logic that decides when and what should be displayed in main().

    I can't see any problem with doing things this way based on the information you have given. If you think there is a problem doing this please explain what it is and we'll try and help.

    Stefan

Reply
  • Chao,

    You are really trying to make your life difficult! Please don't try and change the ISR return address or anything like that, you'll probably never get it working reliably (if at all).

    Do all analysis and display of data in functions called from main(). Set a flag in the ISR to indicate that a key has been pressed. Reset that flag in main(). Put all the logic that decides when and what should be displayed in main().

    I can't see any problem with doing things this way based on the information you have given. If you think there is a problem doing this please explain what it is and we'll try and help.

    Stefan

Children
  • Stefan,

    Thank you very much. There is nothing wrong with your approach. Actually there are some disadvantages on the fixed return address approach and I am aware of that. My plan 2 is exactly what you pros (in both threads) suggested: place a flag in the ISR and let main() do the display thing.

    I try to evaluate the cons and pros on both approaches, fixed return address (if it is doable) and flag in ISR. It seems I have to go for the flag approach (don't say I didn't try). There is no perfect solution for this project based my limited knowledge. I have to give up something to gain something. It all depends on what is more important or significant to what. After all, perfection is not a solution at all.

    chao.