14 lines
354 B
C
14 lines
354 B
C
|
#include <stdio.h>
|
||
|
#include <time.h>
|
||
|
#include "pit.h"
|
||
|
|
||
|
void PitSetFrequency(uint32 frequency)
|
||
|
{
|
||
|
uint32 divisor = 1193180 / frequency; // Calculate the divisor
|
||
|
outportb(0x43, 0x36); // Set our command byte 0x36
|
||
|
outportb(0x40, divisor & 0xff); // Set low byte
|
||
|
outportb(0x40, divisor>>8); // Set high byte
|
||
|
|
||
|
TimeSetInternalFrequency(frequency);
|
||
|
}
|