1

implement pcspk delay

This commit is contained in:
2022-07-04 17:11:39 +02:00
parent e2e2c4545e
commit 2fbecc3236
3 changed files with 7 additions and 20 deletions

View File

@ -56,23 +56,6 @@ void PCSPK::off() {
ppi.outb((status >> 2) << 2); // Lautsprecher ausschalten
}
/*****************************************************************************
* Methode: PCSPK::readCounter *
*---------------------------------------------------------------------------*
* Beschreibung: Zaehler von PIT Channel 0 auslesen. *
* (wird fuer delay benoetigt). *
* *
* Rückgabewerte: counter *
*****************************************************************************/
inline unsigned int PCSPK::readCounter() {
unsigned char lo, hi;
control.outb(0x0); // Latch Command
lo = data0.inb(); // Lobyte des Counters auslesen
hi = data0.inb(); // Hibyte des Counters auslesen
return (hi << 8) | lo;
}
/*****************************************************************************
* Methode: PCSPK::delay *
*---------------------------------------------------------------------------*
@ -84,6 +67,11 @@ inline void PCSPK::delay(int time) {
/* Hier muess Code eingefuegt werden */
unsigned long start_time = systime;
// systime is incremented in 10ms steps
while ((systime - start_time) * 10 < time) {}
}
/*****************************************************************************