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:
parent
8f941561b4
commit
a9ca75c98b
8 changed files with 152 additions and 100 deletions
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue