Set PIT constant on PIT init.

This commit is contained in:
OBattler 2024-03-23 06:18:11 +01:00
parent 2466da2161
commit 4884f8664c
2 changed files with 5 additions and 0 deletions

View file

@ -910,6 +910,8 @@ pit_init(const device_t *info)
pit_t *dev = (pit_t *) malloc(sizeof(pit_t));
pit_reset(dev);
pit_set_pit_const(dev, PITCONST);
if (!(dev->flags & PIT_PS2) && !(dev->flags & PIT_CUSTOM_CLOCK)) {
timer_add(&dev->callback_timer, pit_timer_over, (void *) dev, 0);
timer_set_delay_u64(&dev->callback_timer, dev->pit_const >> 1ULL);

View file

@ -696,6 +696,9 @@ static void *
pitf_init(const device_t *info)
{
pitf_t *dev = (pitf_t *) malloc(sizeof(pitf_t));
pitf_set_pit_const(dev, PITCONST);
pitf_reset(dev);
dev->flags = info->local;