root / lab3 / timer_func.c @ 48
History | View | Annotate | Download (367 Bytes)
1 |
#include "timer_func.h" |
---|---|
2 |
|
3 |
#include <lcom/lcf.h> |
4 |
#include "i8254.h" |
5 |
|
6 |
int (subscribe_timer_interrupt)(uint8_t interrupt_bit, int *interrupt_id) { |
7 |
if (interrupt_id == NULL) return 1; |
8 |
*interrupt_id = interrupt_bit; |
9 |
return (sys_irqsetpolicy(TIMER0_IRQ, IRQ_REENABLE, interrupt_id));
|
10 |
} |
11 |
|
12 |
int no_interrupts = 0; |
13 |
void (timer_int_handler)() {
|
14 |
no_interrupts++; |
15 |
} |