mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
hpet: get_counter and get_ticksperus
This commit is contained in:
@@ -44,6 +44,14 @@ static void wait_ticks(size_t ticks){
|
|||||||
while(readfromreg(REGISTER_COUNTER) < end) asm("pause");
|
while(readfromreg(REGISTER_COUNTER) < end) asm("pause");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time_t hpet_get_ticksperus(){
|
||||||
|
return ticksper100ns*10;
|
||||||
|
}
|
||||||
|
|
||||||
|
time_t hpet_get_counter(){
|
||||||
|
return readfromreg(REGISTER_COUNTER);
|
||||||
|
}
|
||||||
|
|
||||||
void hpet_wait_us(size_t us){
|
void hpet_wait_us(size_t us){
|
||||||
|
|
||||||
size_t usticks = ticksper100ns*10;
|
size_t usticks = ticksper100ns*10;
|
||||||
|
|||||||
@@ -2,11 +2,14 @@
|
|||||||
#define _HPET_H_INCLUDE
|
#define _HPET_H_INCLUDE
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
void hpet_init();
|
void hpet_init();
|
||||||
|
|
||||||
void hpet_wait_us(size_t us);
|
void hpet_wait_us(size_t us);
|
||||||
void hpet_wait_ms(size_t ms);
|
void hpet_wait_ms(size_t ms);
|
||||||
void hpet_wait_s(size_t s);
|
void hpet_wait_s(size_t s);
|
||||||
|
time_t hpet_get_counter();
|
||||||
|
time_t hpet_get_ticksperus();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user