CODE
uint8_t resultFast ;
......
if (mainFlags & FLAGS_USE_HIGH_NIBBLE)
{
__swap_nibbles(resultFast); /* we need high nibble */
}
resultFast &= 0x0F; /* remove the nibble we don't need */
.....
......
if (mainFlags & FLAGS_USE_HIGH_NIBBLE)
{
__swap_nibbles(resultFast); /* we need high nibble */
}
resultFast &= 0x0F; /* remove the nibble we don't need */
.....
После компиляции __swap_nibbles просто нет в коде (optimization = max speed, IAR 5.30). Чтобы вернуть функциональность нужно написать:
CODE
if (mainFlags & FLAGS_USE_HIGH_NIBBLE)
{
resultFast >>= 4; /* сейчас код больше */
}
{
resultFast >>= 4; /* сейчас код больше */
}
Вопрос - как сказать компилятору не удалять __swap_nibbles() при оптимизации?