1

Use InterruptService in PIT.cc, Keyboard.cc

This commit is contained in:
2022-12-08 02:22:40 +01:00
parent 13c17ddc82
commit 6851746d76
2 changed files with 12 additions and 6 deletions

View File

@ -10,7 +10,9 @@
#include "Keyboard.h"
#include "kernel/system/Globals.h"
#include "kernel/service/InterruptService.h"
#include "Key.h"
#include "kernel/system/System.h"
namespace Device {
@ -334,8 +336,9 @@ void Keyboard::set_led(char led, bool on) {
// Registriert die Tastatur ISR im IntDispatcher
// und erlaubt den keyboard interrupt im PIC
void Keyboard::plugin() {
Kernel::intdis.assign(Kernel::IntDispatcher::keyboard, *this);
PIC::allow(PIC::keyboard);
auto &interruptService = Kernel::System::getService<Kernel::InterruptService>();
interruptService.assignInterrupt(Kernel::IntDispatcher::KEYBOARD, *this);
interruptService.allowInterrupt(PIC::KEYBOARD);
}
void Keyboard::trigger() {

View File

@ -10,6 +10,8 @@
#include "PIT.h"
#include "kernel/system/Globals.h"
#include "kernel/system/System.h"
#include "kernel/service/InterruptService.h"
namespace Device {
@ -44,13 +46,14 @@ void PIT::interval(uint32_t us) {
* wird bei Ablauf des definierten Zeitintervalls die *
* Methode 'trigger' aufgerufen. *
*****************************************************************************/
// TODO: Use interruptservice
// TODO: Use interruptservice
void PIT::plugin() {
/* hier muss Code eingefuegt werden */
Kernel::intdis.assign(Kernel::IntDispatcher::timer, *this);
PIC::allow(PIC::timer);
auto &interruptService = Kernel::System::getService<Kernel::InterruptService>();
interruptService.assignInterrupt(Kernel::IntDispatcher::TIMER, *this);
interruptService.allowInterrupt(PIC::TIMER);
}
/*****************************************************************************
@ -61,7 +64,7 @@ void PIT::plugin() {
* aktualisieren und Thread wechseln durch Setzen der *
* Variable 'forceSwitch', wird in 'int_disp' behandelt. *
*****************************************************************************/
// TODO: Use timeservice + timeprovider
// TODO: Use timeservice + timeprovider
void PIT::trigger() {
/* hier muss Code eingefuegt werden */