Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion video/vdp_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@

#define VDPSerial Serial2

void vdp_serial_half_duplex ()
{
VDPSerial.setHwFlowCtrlMode(HW_FLOWCTRL_RTS); // default to half-duplex
}
void vdp_serial_full_duplex ()
{
VDPSerial.setHwFlowCtrlMode(HW_FLOWCTRL_CTS_RTS); // set to full-duplex when EZ80 OS indicates this
}

void setupVDPProtocol() {
VDPSerial.end();
VDPSerial.setRxBufferSize(UART_RX_SIZE); // Can't be called when running
VDPSerial.begin(UART_BR, SERIAL_8N1, UART_RX, UART_TX);
VDPSerial.setHwFlowCtrlMode(HW_FLOWCTRL_RTS, 64); // Can be called whenever
VDPSerial.setPins(UART_NA, UART_NA, UART_CTS, UART_RTS); // Must be called after begin
vdp_serial_half_duplex ();
}

// TODO remove the following - it's only here for cursor.h to send escape key when doing paged mode handling
Expand Down
5 changes: 5 additions & 0 deletions video/vdu_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ void VDUStreamProcessor::sendGeneralPoll() {
uint8_t packet[] = {
(uint8_t) (b & 0xFF),
};
// for EZ80 OS-es with ID>1 assume full_duplex
// this includes MOS hw-cts-rts branch and ElectronOS
// for fast error-free reads and writes to EZ80
if (b>1)
vdp_serial_full_duplex ();
send_packet(PACKET_GP, sizeof packet, packet);
initialised = true;
}
Expand Down
4 changes: 2 additions & 2 deletions video/video.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
#define RC 0

#define DEBUG 0 // Serial Debug Mode: 1 = enable
#define SERIALBAUDRATE 115200
#define SERIALBAUDRATE 500000

HardwareSerial DBGSerial(0);

bool terminalMode = false; // Terminal mode (for CP/M)
bool consoleMode = false; // Serial console mode (0 = off, 1 = console enabled)
bool consoleMode = true; // Serial console mode (0 = off, 1 = console enabled)

#include "agon.h" // Configuration file
#include "agon_ps2.h" // Keyboard support
Expand Down