如何为每个函数将编译器(xc16)的优化级别切换到不同的级别?
例如:
void _ISR _T1Interrupt //compile with O0
{
.....
}
int_16_t main (void) //compile with O2
{
.....
}
答案 0 :(得分:0)
我找到了解决方法:
__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
{
.....
}