OOStuBS - Technische Informatik II (TI-II)  2.4
pit.cc
gehe zur Dokumentation dieser Datei
1 /*---------------------------------------------------------------------------*
2  * Operating Systems I *
3  *---------------------------------------------------------------------------*
4  * *
5  * P I T *
6  * *
7  *---------------------------------------------------------------------------*/
8 
9 #include "machine/pit.h"
10 
16 }
17 
19 
20 }
21 
22 void PIT::interval(unsigned short us){
23  IO_Port value(counter0Port);
24  IO_Port ctrl(ctrl0Port);
25  if(us>maxUS)
26  us=maxUS;
27 
28  unsigned long temp = us * 1000;
29  temp/=timestep;
30 
31  ctrl.outb(pcb.ctrlByte);
32  value.outb(temp&0xFF);
33  value.outb((temp>>8)&0xFF);
34 
35  currIntervall=us;
36 }
37 
38 unsigned short PIT::interval(){
39  return currIntervall;
40 }