【发布时间】:2018-07-13 06:36:43
【问题描述】:
如何将编译器 (xc16) 的优化级别切换到每个函数的不同级别?
例如:
void _ISR _T1Interrupt //compile with O0
{
.....
}
int_16_t main (void) //compile with O2
{
.....
}
【问题讨论】:
标签: optimization compiler-optimization xc16
如何将编译器 (xc16) 的优化级别切换到每个函数的不同级别?
例如:
void _ISR _T1Interrupt //compile with O0
{
.....
}
int_16_t main (void) //compile with O2
{
.....
}
【问题讨论】:
标签: optimization compiler-optimization xc16
我找到了解决办法:
__attribute__((optimize("-O0")) //optimization for the next function is O0
void _ISR _T1Interrupt //compile with O0
{
.....
}
__attribute__((optimize("-O2")) //optimization for the next function is O2
int_16_t main (void) //compile with O2
{
.....
}
【讨论】: