Project

General

Profile

Statistics
| Revision:

root / lab5 / timer.c @ 193

History | View | Annotate | Download (368 Bytes)

1
#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
uint32_t no_interrupts = 0;
14
void (timer_int_handler)() {
15
    no_interrupts++;
16
}