wonx/UNIXTimerP.h
Hiroaki Sakai 0f43e6d6ee Added interrupt handling. Timer interrupt support.
(UNIXTimer, WWInterrupt, WWTimer, WonxSystem addition)
According to interrupt support, compatibility functions are replaced with UNIXTimer_Pause (), UNIXTimer_Unpause ()
It hung around.
UNIXTimer, WWTimer, WonxSystem's callback functions,
It is necessary to check finely whether there are bugs peculiar to interrupts.
(The setting of the interrupt in the callback function may change, or from the callback function
It is necessary to check whether the callback function is called or not)

Version 0.2 beta - from wonx-b02.tar.gz
2018-03-07 23:05:54 +00:00

50 lines
1.9 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _UNIXTimerP_h_INCLUDED_
#define _UNIXTimerP_h_INCLUDED_
/*****************************************************************************/
/* ここから */
/*****************************************************************************/
#include "UNIXTimer.h"
/*****************************************************************************/
/* クラスの定義 */
/*****************************************************************************/
typedef struct _UNIXTimer {
int timer_on; /* タイマを動作させるかどうかのフラグ */
/*
* タイマの一時停止.停止中にタイマの時間が来た場合には,
* 時間が来たことだけ記憶しておき,一時停止の解除時にコールバック関数が
* 呼び出される.
* Wonx では X サーバとの通信中にタイマ割り込みが入って,さらに X サーバとの
* 通信が発生したりすると,通信の整合性がとれなくなるような気がするので,
* それを防ぐために,一部の関数内部ではタイマ割り込みを停止させる.
*/
int pause;
/*
* タイマ割り込みの一時停止中に割り込みがかかった場合には,このフラグを
* セットして,一時停止の解除時にコールバック関数を呼ぶ.
*/
int interrupt_in_pause;
int auto_preset; /* オートプリセット1 だとオートプリセットを行う */
int interval; /* タイマのインターバル.マイクロ秒で指定 */
void * parameter; /* コールバック関数の呼び出し時のパラメータ */
UNIXTimerCallBack callback; /* コールバック関数 */
} _UNIXTimer;
/*****************************************************************************/
/* ここまで */
/*****************************************************************************/
#endif
/*****************************************************************************/
/* End of File. */
/*****************************************************************************/