Keil Logo

swatch

概要
void swatch (
  float seconds);   /* seconds to delay */
説明

swatch デバッガ関数は、指定数が経過するまでデバッガシグナル関数を遅延させます。この関数が遅延する間、ターゲットプログラムは実行を継続します。この関数は、スロークロックモードや省電力モードが用意されているデバイスでも正確に機能します。

  • swatch デバッガ関数は、シグナル関数内部からのみ呼び出されます。swatch 関数をシグナル関数外部から呼び出すことはできず、呼び出した場合、エラーメッセージが表示されます。
戻り値

なし。

関連項目

twatch

signal void int0_signal (void) {
  while (1) {
    PORT3 |= 0x04;             /* pull PORT 3.2 high   */
    swatch (0.05);             /* wait 50 milliseconds */
    PORT3 &= ~0x04;            /* pull PORT 3.2 low    */
    swatch (0.05);             /* wait 50 milliseconds */
  }
}

以下の呼び出しにより、ポート 3.2 を 50 ミリ秒ごとに切り替える上のシグナル関数が開始されます。

> int0_signal ();
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.