Project

General

Profile

Revision 25

fixed interrupt subscription, implemented interrupt handler

View differences:

timer.c
5 5

  
6 6
#include "i8254.h"
7 7

  
8
int no_interrupts = 0;
9

  
10 8
int (timer_set_frequency)(uint8_t timer, uint32_t freq) {
11 9

  
12 10
    // Frequencies out this range are not supported (by limitation of hardware)
......
53 51
int hook_id = 2;
54 52

  
55 53
int (timer_subscribe_int)(uint8_t *bit_no) {
54
    *bit_no = hook_id;
56 55
    if(sys_irqsetpolicy(TIMER0_IRQ, IRQ_REENABLE, &hook_id)) return 1;
57
    *bit_no = hook_id;
58 56
    return 0;
59 57
}
60 58

  
......
63 61
    return 0;
64 62
}
65 63

  
64
uint32_t no_interrupts = 0;
66 65
void (timer_int_handler)() {
67 66
    no_interrupts++;
68 67
}

Also available in: Unified diff