1

update vorgabe04

This commit is contained in:
churl
2022-06-05 15:25:52 +02:00
parent 24535f8ff7
commit 2ae21b274a
5 changed files with 64 additions and 25 deletions

24
c_os/lib/Input.cc Normal file
View File

@ -0,0 +1,24 @@
/*****************************************************************************
* *
* I N P U T *
* *
*---------------------------------------------------------------------------*
* Beschreibung: Hilfsfunktion zum Warten bis auf der Tastatur die Ein- *
* -gabetaste gedrückt wird. *
* *
* Autor: Michael Schoettner, HHU, 2.05.2022 *
*****************************************************************************/
#include "devices/Keyboard.h"
#include "kernel/Globals.h"
void waitForReturn() {
// Warten bis <ENTER> gedrueckt wird
kb.lastkey = '\0'; // lastKey loeschen
while (kb.lastkey != 10) {};
}
char getch() {
kb.lastkey = '\0'; // lastKey loeschen
while (kb.lastkey == '\0') {};
return kb.lastkey;
}

17
c_os/lib/Input.h Normal file
View File

@ -0,0 +1,17 @@
/*****************************************************************************
* *
* I N P U T *
* *
*---------------------------------------------------------------------------*
* Beschreibung: Hilfsfunktion zum Warten bis auf der Tastatur die Ein- *
* -gabetaste gedrückt wird. *
* *
* Autor: Michael Schoettner, HHU, 2.05.2022 *
*****************************************************************************/
#ifndef __Input_include__
#define __Input_include__
char getch();
void waitForReturn();
#endif