From 0ee48ab24d7cb6dadaa0622a9f9548e043e30d05 Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Fri, 19 Jan 2024 02:25:06 -0300 Subject: [PATCH] Adding warning about serial IRQ timing --- lib/LinkCable.hpp | 11 ++++++++--- lib/LinkUniversal.hpp | 12 +++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/LinkCable.hpp b/lib/LinkCable.hpp index 945b565..a64813d 100644 --- a/lib/LinkCable.hpp +++ b/lib/LinkCable.hpp @@ -27,9 +27,14 @@ // // ... // } // -------------------------------------------------------------------------- -// (*) libtonc's interrupt handler sometimes ignores interrupts due to a bug. -// That causes packet loss. You REALLY want to use libugba's instead. -// (see examples) +// (*1) libtonc's interrupt handler sometimes ignores interrupts due to a bug. +// That causes packet loss. You REALLY want to use libugba's instead. +// (see examples) +// -------------------------------------------------------------------------- +// (*2) The hardware is very sensitive to timing. Make sure your interrupt +// handlers are short, so `LINK_CABLE_ISR_SERIAL()` is called on time. +// Another option would be activating nested interrupts by setting +// `REG_IME=1` at the start of your interrupt handler. // -------------------------------------------------------------------------- // `send(...)` restrictions: // - 0xFFFF and 0x0 are reserved values, so don't send them! diff --git a/lib/LinkUniversal.hpp b/lib/LinkUniversal.hpp index fcbe6a9..bc61ebc 100644 --- a/lib/LinkUniversal.hpp +++ b/lib/LinkUniversal.hpp @@ -29,9 +29,15 @@ // // ... // } // -------------------------------------------------------------------------- -// (*) libtonc's interrupt handler sometimes ignores interrupts due to a bug. -// That causes packet loss. You REALLY want to use libugba's instead. -// (see examples) +// (*1) libtonc's interrupt handler sometimes ignores interrupts due to a bug. +// That causes packet loss. You REALLY want to use libugba's instead. +// (see examples) +// -------------------------------------------------------------------------- +// (*2) For CABLE mode: +// The hardware is very sensitive to timing. Make sure your interrupt +// handlers are short, so `LINK_UNIVERSAL_ISR_SERIAL()` is called on time. +// Another option would be activating nested interrupts by setting +// `REG_IME=1` at the start of your interrupt handler. // -------------------------------------------------------------------------- // `send(...)` restrictions: // - 0xFFFF and 0x0 are reserved values, so don't use them!