Revision 18
Fix minor issue on set_frequency
timer.c | ||
---|---|---|
6 | 6 |
#include "i8254.h" |
7 | 7 |
|
8 | 8 |
int (timer_set_frequency)(uint8_t timer, uint32_t freq) { |
9 |
|
|
10 |
// Frequencies out this range are not supported (by limitation of hardware) |
|
11 |
if (freq > TIMER_FREQ || freq < TIMER_MIN_FREQ) return 1; |
|
12 |
|
|
9 | 13 |
uint8_t status = 0; |
10 | 14 |
if (timer_get_conf(timer, &status)) return 1; |
11 | 15 |
//Make command |
... | ... | |
41 | 45 |
if (sys_outb(timer_port, lsb)) return 1; |
42 | 46 |
if (sys_outb(timer_port, msb)) return 1; |
43 | 47 |
|
44 |
//if (sys_outw(timer_port, counter_init)) return 1; |
|
45 |
|
|
46 | 48 |
return 0; |
47 | 49 |
} |
48 | 50 |
|
Also available in: Unified diff