1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

Add IRQHandler class that can be subclasses to handle an IRQ.

Also move Keyboard to a class implementation using this pattern.
This commit is contained in:
Andreas Kling 2018-10-22 12:58:29 +02:00
parent 8f941561b4
commit a9ca75c98b
8 changed files with 152 additions and 100 deletions

View file

@ -1,16 +1,16 @@
#pragma once
namespace Keyboard {
#include <AK/Types.h>
#include "IRQHandler.h"
enum class LED {
ScrollLock = 1 << 0,
NumLock = 1 << 1,
CapsLock = 1 << 2,
class Keyboard final : public IRQHandler {
public:
virtual ~Keyboard() override;
Keyboard();
private:
virtual void handleIRQ() override;
byte m_modifiers { 0 };
};
void initialize();
void setLED(LED);
void unsetLED(LED);
void handleInterrupt();
}