當前位置:編程學習大全網 - 編程軟體 - __even_in_range函數在MSP430裏是實現什麽功能的?

__even_in_range函數在MSP430裏是實現什麽功能的?

在IAR提供的庫函數裏有以下內容:\x0d\/*\x0d\ * Support for efficient switch:es. E.g. switch(__even_in_range(x, 10))\x0d\ *\x0d\ * Note that the value must be even and in the range from 0 to\x0d\ * __bound, inclusive. No code will be generated that checks this.\x0d\ *\x0d\ * This is typically used inside interrupt dispatch functions, to\x0d\ * switch on special processor registers like TAIV.\x0d\ */\x0d\原型為:\x0d\ __intrinsic unsigned short __even_in_range(unsigned short __value,\x0d\ unsigned short __bound);\x0d\在msp430裏經常被用在多源中斷的查詢中,\x0d\如 switch( __even_in_range(TAIV,10)\x0d\只有在TAIV的值是在0--10內的偶數時才會執行switch函數內的語句\x0d\其作用是提高switch語句的效率

  • 上一篇:沈陽環彩三維科技有限公司怎麽樣?
  • 下一篇:蘇州興眾和運動控制技術有限公司怎麽樣?
  • copyright 2024編程學習大全網