root / proj / src / timer.c @ 234
History | View | Annotate | Download (407 Bytes)
1 | 146 | up20180655 | #include <lcom/lcf.h> |
---|---|---|---|
2 | |||
3 | #include "timer.h" |
||
4 | 187 | up20180655 | #include "graph.h" |
5 | #include "sprite.h" |
||
6 | 146 | up20180655 | |
7 | #include "i8254.h" |
||
8 | |||
9 | int (subscribe_timer_interrupt)(uint8_t interrupt_bit, int *interrupt_id) { |
||
10 | if (interrupt_id == NULL) return 1; |
||
11 | *interrupt_id = interrupt_bit; |
||
12 | return (sys_irqsetpolicy(TIMER0_IRQ, IRQ_REENABLE, interrupt_id));
|
||
13 | } |
||
14 | |||
15 | uint32_t no_interrupts = 0;
|
||
16 | void (timer_int_handler)() {
|
||
17 | no_interrupts++; |
||
18 | } |