X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=bootcensus;a=blobdiff_plain;f=src%2Ftimer.h;h=3da5802f8c98e18f746e4d6ad482e363a70ae118;hp=b71e62f6ca2682bd29fbd945f08b91e044a61ae2;hb=81c11bdd80190ec319a82b0402173cfb65fcbf72;hpb=7dcd5071e600f8cf48174d1fddb3dba57ec9476d diff --git a/src/timer.h b/src/timer.h index b71e62f..3da5802 100644 --- a/src/timer.h +++ b/src/timer.h @@ -1,6 +1,6 @@ /* -pcboot - bootable PC demo/game kernel -Copyright (C) 2018 John Tsiombikas +256boss - bootable launcher for 256byte intros +Copyright (C) 2018-2019 John Tsiombikas This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,8 @@ along with this program. If not, see . #ifndef _TIMER_H_ #define _TIMER_H_ +#include "config.h" + #define MSEC_TO_TICKS(ms) ((ms) * TICK_FREQ_HZ / 1000) #define TICKS_TO_MSEC(tk) ((tk) * 1000 / TICK_FREQ_HZ) @@ -25,7 +27,16 @@ volatile unsigned long nticks; void init_timer(void); +/* int sys_sleep(int sec); void sleep(unsigned long msec); +*/ + +/* schedule a function to be called 'msec' milliseconds into the future + * warning: this function will be called directly from the timer interrupt, and + * must be extremely quick. + */ +void set_alarm(unsigned long msec, void (*func)(void)); +void cancel_alarm(void (*func)(void)); #endif /* _TIMER_H_ */