From 4deef3f8af0b9d515114a3f75d2b8a7378b7f5db Mon Sep 17 00:00:00 2001 From: GearsProgress Date: Thu, 23 Apr 2026 16:44:01 -0400 Subject: [PATCH] Reworking single byte sending --- include/link_handler.h | 2 ++ source/link_handler.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/link_handler.h b/include/link_handler.h index 20130e4..51857c1 100644 --- a/include/link_handler.h +++ b/include/link_handler.h @@ -71,6 +71,8 @@ struct LinkState byte data_packet[PACKET_SIZE]; + bool irq_enabled = true; // Stores if the IRQ is currently enabled, used for pausing and sending one byte at a time + // This is info that was passed in via handleIncomingByte byte *box_data_storage; byte *curr_payload; diff --git a/source/link_handler.cpp b/source/link_handler.cpp index 9bc5bb1..46274bb 100644 --- a/source/link_handler.cpp +++ b/source/link_handler.cpp @@ -400,6 +400,24 @@ ConnectionState prevConState; void handshake() { + if (g_debug_options.print_link_data && key_hit(KEY_SELECT)) + { + currLinkState->irq_enabled = false; + } + + else if (g_debug_options.print_link_data && key_hit(KEY_START)) + { + currLinkState->irq_enabled = true; + } + + if (!currLinkState->irq_enabled) + { + if (!(g_debug_options.print_link_data && key_hit(KEY_A))) + { + return; + } + } + prevConState = currLinkState->conState; // The con state can change in handleIncomingByte - we want to display what it was before running that function int timeout_frames = 10;