Tool/software: TI C/C++ Compiler
Hello,
In UART ISR I'm using the following code:
switch (__even_in_range(iv, USCI_UART_UCTXCPTIFG)) {
case USCI_NONE:
break;
case USCI_UART_UCRXIFG:
//code
break;
case USCI_UART_UCTXIFG:
//code
break;
case USCI_UART_UCSTTIFG:
break;
case USCI_UART_UCTXCPTIFG:
//code
break;
default:
__never_executed();
break;
}
If I compile this code with small code memory model option then I get in the result optimized version, similar to:
005cb6: 5210 036E ADD.W &USCI_UART_UCTXCPTIFG,PC 005cba: 3C23 JMP ($C$L9) 005cbc: 3C1E JMP ($C$L8)
(...)
If I use the large code memory model then I get "normal" switch version:
MOV.W &USCI_UART_UCTXCPTIFG,R15 TST.W R15 JEQ ($C$L7) DECD.W R15 JEQ ($C$L6) DECD.W R15 JEQ ($C$L5) DECD.W R15
(...)
Is it possible to force compiler to use optimized version?
I found the similar thread is in MSP Low-Power Microcontroller Forum but there is no answer.
Best regards,
Mateusz
PS. I apologize in advance for possible language errors.