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.
Part Number: MSP-EXP430G2
Tool/software: Code Composer Studio
// ADC10 interrupt service routine #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=ADC10_VECTOR __interrupt void adc10_isr(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(ADC10_VECTOR))) adc10_isr(void) #else #error Compiler not supported! #endif { int data = ADC10MEM; uart_logger((data & 0x00FF)); // ULP Advisor > Rule 10.1 Minimize function calls from within ISRs } }
Hello, I was logging my ADC data. I wanted to send the LSB (lowest significant bit) via UART (115200 baud, no parity) after sampling.
I use the MSP-EXP430G2 launchpad and CCS 8 on Windows 10.
The ULP advisor says
"Instead of calling functions in the ISR, try to inline the instructions,
i.e. move the code instructions directly into the ISR,
or move the entire function call out of the ISR if possible (especially for processing intensive functions)."
I couldn't find how inline keywords are used for __TI_COMPILER_VERSION__ / __IAR_SYSTEMS_ICC__ / __GNUC__
Are there examples that use the inline or static inline keyword to solve this?
Thanks, Tomasz. You are meaning this link, right?
inline void foo(int x){ } __inline void foo(int x){ }
So this document is saying, when using CCS, either of them will be inlined by the compiler if you set --opt_level=3 or greater, is it?
What about other tools when using IAR or GCC?
David__ said:What about other tools when using IAR or GCC?
Check IAR and/or GCC manuals.