This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi everyone,
I hope you're doing well.
I have a few questions regarding the **interrupt_ex1_external** example and would really appreciate your insights:
1. Why is the letter **L** used with floating-point numbers when it is typically associated with integers?
2. Why are global variables declared with the **volatile** keyword?
I have attached a screenshot for reference. Looking forward to your valuable explanations.
Thank you in advance.
Best Regards,
Sameer
Hi Sameer,
So the "L" after the number is used to indicate Float Point Literal. In this case, it is used to represent an float constant, L
suffix specifies a float type.
The term 'volatile' is to provide a hint to the compiler not to make certain assumptions about a variable. The volatile keyword must be used when accessing memory locations that represent memory mapped peripherals. C2000 Optimization Guide
Check out this forum post for more information on volatile use cases:
Regards,
Ozino
Hi Sameer,
Glad to hear the suggestion answered your question. Thank you for the feedback. All the best with your development efforts!
Regards,
Ozino