Less magic numbers in PIT code

This commit is contained in:
Jasmine Iwanek
2024-08-06 18:01:13 -04:00
parent 834bcd09c1
commit 837c16f546
4 changed files with 10 additions and 8 deletions

View File

@@ -19,6 +19,8 @@
#ifndef EMU_PIT_H
#define EMU_PIT_H
#define NUM_COUNTERS 3
typedef struct ctr_t {
uint8_t m;
uint8_t ctrl;
@@ -68,7 +70,7 @@ typedef struct PIT {
int clock;
pc_timer_t callback_timer;
ctr_t counters[3];
ctr_t counters[NUM_COUNTERS];
uint8_t ctrl;

View File

@@ -68,7 +68,7 @@ typedef struct ctrf_t {
typedef struct pitf_t {
int flags;
ctrf_t counters[3];
ctrf_t counters[NUM_COUNTERS];
uint8_t ctrl;