From 1aaf84bb27e84279ac9022bf8db018c9c7cefdd2 Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Mon, 19 Aug 2024 04:34:51 -0300 Subject: [PATCH] Reverting test code This reverts commit a8383a67eec7c82079d533c8a60f6202aeb3b059. --- examples/LinkMobile_demo/Makefile | 2 +- examples/LinkMobile_demo/src/main.cpp | 1 - lib/LinkMobile.hpp | 10 +++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/LinkMobile_demo/Makefile b/examples/LinkMobile_demo/Makefile index 984c9bc..fd6a029 100644 --- a/examples/LinkMobile_demo/Makefile +++ b/examples/LinkMobile_demo/Makefile @@ -141,7 +141,7 @@ LIBDIRS := $(TONCLIB) $(PWD)/../_lib/libugba # --- switches --- -bMB := 1 # Multiboot build +bMB := 0 # Multiboot build bTEMPS := 0 # Save gcc temporaries (.i and .s files) bDEBUG2 := 0 # Generate debug info (bDEBUG2? Not a full DEBUG flag. Yet) diff --git a/examples/LinkMobile_demo/src/main.cpp b/examples/LinkMobile_demo/src/main.cpp index e81639e..5b0f3da 100644 --- a/examples/LinkMobile_demo/src/main.cpp +++ b/examples/LinkMobile_demo/src/main.cpp @@ -533,7 +533,6 @@ std::string getErrorString(LinkMobile::Error error) { toHex(error.cmdId) + "\n CmdResult: " + getResultString(error.cmdResult) + "\n CmdErrorCode: " + std::to_string(error.cmdErrorCode) + - "\n TEST: " + toHex(error.notWaiting) + "\n ReqType: " + std::to_string(error.reqType) + "\n"; } diff --git a/lib/LinkMobile.hpp b/lib/LinkMobile.hpp index 0cf87b9..040d1e8 100644 --- a/lib/LinkMobile.hpp +++ b/lib/LinkMobile.hpp @@ -100,8 +100,8 @@ class LinkMobile { using u8 = unsigned char; static constexpr auto BASE_FREQUENCY = Link::_TM_FREQ_1024; - static constexpr int INIT_WAIT_FRAMES = 30; - static constexpr int INIT_TIMEOUT_FRAMES = 60; + static constexpr int INIT_WAIT_FRAMES = 7; + static constexpr int INIT_TIMEOUT_FRAMES = 30; static constexpr int PING_FREQUENCY_FRAMES = 60; static constexpr int ADAPTER_WAITING = 0xd2; static constexpr u32 ADAPTER_WAITING_32BIT = 0xd2d2d2d2; @@ -254,7 +254,6 @@ class LinkMobile { u8 cmdId = 0; CommandResult cmdResult = CommandResult::PENDING; u8 cmdErrorCode = 0; - u32 notWaiting = 0; bool cmdIsSending = false; int reqType = -1; }; @@ -831,7 +830,6 @@ class LinkMobile { u16 expectedChecksum; u8 errorCommandId; u8 errorCode; - u32 notWaiting = 0; bool isActive = false; void reset() { @@ -1530,9 +1528,9 @@ class LinkMobile { .cmdId = asyncCommand.relatedCommandId(), .cmdResult = asyncCommand.result, .cmdErrorCode = asyncCommand.errorCode, - .notWaiting = asyncCommand.notWaiting, .cmdIsSending = asyncCommand.direction == AsyncCommand::Direction::SENDING, + .reqType = userRequests.isEmpty() ? -1 : userRequests.peek().type}; _LMLOG_( @@ -1630,7 +1628,6 @@ class LinkMobile { asyncCommand.transferred >= mainSize + CHECKSUM_SIZE + 1; if (!isAcknowledgement && newData != ADAPTER_WAITING) { _LMLOG_("!! not waiting: %X", newData); - asyncCommand.notWaiting = newData; return asyncCommand.fail(CommandResult::NOT_WAITING); } @@ -1667,7 +1664,6 @@ class LinkMobile { if (!isAcknowledgement && newData != ADAPTER_WAITING && newData != ADAPTER_WAITING_32BIT) { _LMLOG_("!! not waiting: %X", newData); - asyncCommand.notWaiting = newData; return asyncCommand.fail(CommandResult::NOT_WAITING); }