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.
工具/软件:Code Composer Studio
// ADC10中断服务例程 #if defined (__TI_Compiler_version__)|| Defined (__IAR_systems_ICC__) #pragma vector=ADC10_Vector __interrupt void ADC10_ISR (void) #Elif defined (__GNU__) void 编译器__attribute__((interrupt (interrupt (ADC10_ISR (void))#ADC10_ISR (void )#vector!ADC10_ISR (void)#error!ADC10_vector! #endif { INT DATA = ADC10MEM; UART_LOGGER ((DATA & 0x00FF)); // ULP Advisor >规则10.1最大程度地减少 ISR 内的函数调用 } }
大家好、我正在记录我的 ADC 数据。 采样后、我想通过 UART (115200波特、无奇偶校验)发送 LSB (最低有效位)。
我在 Windows 10上使用 MSP-EXP430G2 Launchpad 和 CCS 8。
ULP 顾问 说
"不是在 ISR 中调用函数、而是尝试内联指令、
即将代码指令直接移入 ISR、
或者、如果可能的话、将整个函数调用移出 ISR (特别是对于处理密集型函数)。"
我无法找到如何将内联关键字用于__TI_Compiler_version__/ __IAR_systems_ICC__/ __GNU_
是否有使用内联或静态内联关键字来解决此问题的示例?
谢谢、Tomasz。 您是指 该链接、对吧?
内联 void foo (int x){ } __inline void foo (int x){ }
那么、本文档说、 当使用 CCS 时、 如果您设置了-opt_level=3或更高版本、编译器将内联其中任何一个版本、是吗?
使用 IAR 或 GCC 时、其他工具如何?
[引用用户="David __"]使用 IAR 或 GCC 时,其他工具如何?
请查看 IAR 和/或 GCC 手册。