1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-10-28 07:25:06 +00:00

serial display (#30)

This commit is contained in:
Stephen Crane 2024-08-29 07:01:07 +01:00 committed by GitHub
parent 23bfa71c3e
commit 6a36272f5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 3 deletions

View File

@ -71,7 +71,7 @@ void hardware_init(CPU &cpu) {
_cpu = &cpu;
memory.begin();
#if defined(DEBUGGING) || defined(CPU_DEBUG)
#if defined(DEBUGGING) || defined(CPU_DEBUG) || defined(USE_SERIAL)
Serial.begin(TERMINAL_SPEED);
#endif

14
hw_serial_dsp.h Normal file
View File

@ -0,0 +1,14 @@
#if !defined(__HW_SERIAL_DSP_H__)
#define __HW_SERIAL_DSP_H__
class hw_serial_dsp: public serial_dsp {
public:
hw_serial_dsp(Print &p): _print(p) {}
void write(uint8_t b) { _print.write(b); }
private:
Print &_print;
};
#endif

View File

@ -1,7 +1,6 @@
#include <Arduino.h>
#include "hardware.h"
#if defined(HW_SERIAL_KBD)
#include "serial_kbd.h"
#include "hw_serial_kbd.h"
@ -25,4 +24,3 @@ bool hw_serial_kbd::available() {
void hw_serial_kbd::reset() {
_serial.begin(TERMINAL_SPEED);
}
#endif

View File

@ -19,5 +19,7 @@
#include "serial_kbd.h"
#include "ps2_serial_kbd.h"
#include "hw_serial_kbd.h"
#include "serial_dsp.h"
#include "hw_serial_dsp.h"
#endif

10
serial_dsp.h Normal file
View File

@ -0,0 +1,10 @@
#if !defined(__SERIAL_DSP_H__)
#define __SERIAL_DSP_H__
class serial_dsp {
public:
virtual void write(uint8_t) =0;
virtual void reset() {}
};
#endif