Project

General

Profile

Statistics
| Revision:

root / lab3 / timer.c @ 321

History | View | Annotate | Download (363 Bytes)

1 60 up20180642
#include <lcom/lcf.h>
2
3
#include "timer.h"
4
5
#include "i8254.h"
6
7
int (subscribe_timer_interrupt)(uint8_t interrupt_bit, int *interrupt_id) {
8
    if (interrupt_id == NULL) return 1;
9
    *interrupt_id = interrupt_bit;
10
    return (sys_irqsetpolicy(TIMER0_IRQ, IRQ_REENABLE, interrupt_id));
11
}
12
13
int no_interrupts = 0;
14
void (timer_int_handler)() {
15
    no_interrupts++;
16
}