Cleanup SerialOut
This commit is contained in:
@ -4,23 +4,19 @@
|
|||||||
#include "IOport.h"
|
#include "IOport.h"
|
||||||
#include "lib/string/String.h"
|
#include "lib/string/String.h"
|
||||||
#include "lib/string/StringView.h"
|
#include "lib/string/StringView.h"
|
||||||
|
#include "lib/util/RestrictedConstructors.h"
|
||||||
|
|
||||||
// NOTE: I took this code from https://wiki.osdev.org/Serial_Ports
|
// NOTE: I took this code from https://wiki.osdev.org/Serial_Ports
|
||||||
|
|
||||||
namespace Device {
|
namespace Device {
|
||||||
|
|
||||||
class SerialOut {
|
class SerialOut {
|
||||||
private:
|
|
||||||
static const IOport com1;
|
|
||||||
|
|
||||||
static int serial_received();
|
|
||||||
|
|
||||||
static int is_transmit_empty();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SerialOut();
|
SerialOut();
|
||||||
|
|
||||||
SerialOut(const SerialOut ©) = delete;
|
MakeUncopyable(SerialOut)
|
||||||
|
|
||||||
|
MakeUnmovable(SerialOut)
|
||||||
|
|
||||||
// Can't make singleton because atexit
|
// Can't make singleton because atexit
|
||||||
|
|
||||||
@ -29,6 +25,13 @@ public:
|
|||||||
static void write(char a);
|
static void write(char a);
|
||||||
|
|
||||||
static void write(String::string_view a);
|
static void write(String::string_view a);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const IOport com1;
|
||||||
|
|
||||||
|
static int serial_received();
|
||||||
|
|
||||||
|
static int is_transmit_empty();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user