Further to Bruce's anwer, the family user's guide covers the general structure of the switch statement, but doesn't explain __even_in_range. The MSP430 Optimizing C/C++ Compiler User's Guide has a description of __even_in_range, but it's pretty terse (see section 5.11.27) __even_in_range is a compiler intrinsic function; intrinsics trigger special case behaviours in the compiler. In this case, the function just indicates to the compiler that the first parameter is an even number between zero and the second parameter (inclusive). switch(__even_in_range(TA0IV, TA0IV_TAIFG)) is equivalent to: switch(TA0IV) but using __even_in_range allows the compiler to generate more efficient code to handle the switch statement.
↧