OSDN Git Service

(none)
[hos/hos-v4a.git] / aplfw / sample / win / win32 / ostimer.c
1 /** 
2  *  Sample program for Hyper Operating System V4 Advance
3  *
4  * @file  ostimer.c
5  * @brief %jp{OSタイマ}%en{OS timer}
6  *
7  * Copyright (C) 1998-2006 by Project HOS
8  * http://sourceforge.jp/projects/hos/
9  */
10
11
12 #include "kernel.h"
13 #include "ostimer.h"
14 #include "wintimer.h"
15 #include "system/sysapi/sysapi.h"
16
17
18 #define OSTIMER_TIMER_INHNO             1                       /**< %jp{割り込みハンドラ番号} */
19
20
21 static void OsTimer_IrqHandler(VP_INT exinf);           /**< %jp{タイマ割り込みハンドラ} */
22
23
24 /** %jp{OS用タイマ初期化ルーチン} */
25 void OsTimer_Initialize(VP_INT exinf)
26 {
27 #if 0
28         T_DINH dfinh;
29         
30         /* %jp{割り込みハンドラ定義} */
31         dfinh.inthdr = (FP)OsTimer_IrqHandler;
32         def_inh(OSTIMER_TIMER_INHNO, &dfinh);
33 #else
34         T_CISR cisr;
35         cisr.isratr = TA_HLNG;
36         cisr.intno  = OSTIMER_TIMER_INHNO;
37         cisr.isr    = (FP)OsTimer_IrqHandler;
38         cisr.exinf  = (VP_INT)0x1234;
39         acre_isr(&cisr);
40 #endif
41         return;
42         
43         /* %jp{タイマ動作開始} */
44         WinTimer_Start(OSTIMER_TIMER_INHNO, 10);
45 }
46
47
48 /** %jp{タイマ割り込みハンドラ} */
49 void OsTimer_IrqHandler(VP_INT exinf)
50 {
51         isig_tim();
52 }
53
54
55 /* end of file */