/shark/trunk/drivers/linuxc26/shark_glue.c |
---|
57,14 → 57,26 |
} |
static int current_timer = 16; |
int get_free_timer_slot() |
{ |
int i = 16; |
int i = current_timer, count = 0; |
while(timer_table[i] != -1) |
if (i < MAX_INT_TABLE) i++; else return -1; |
while(timer_table[i] != -1) { |
if (i < MAX_INT_TABLE) { |
i++; |
count++; |
} else { |
i = 16; |
} |
if (count > 2) return -1; |
} |
current_timer = i+1; |
if (current_timer >= MAX_INT_TABLE) current_timer = 16; |
return i; |
} |