From 8df5c69bf0ec09cb20a2fdd60ea7e4b85973438d Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Sat, 6 Jan 2024 07:25:45 -0300 Subject: [PATCH] Using normal wait in LinkWireless --- examples/LinkWireless_demo/src/main.cpp | 2 +- lib/LinkWireless.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/LinkWireless_demo/src/main.cpp b/examples/LinkWireless_demo/src/main.cpp index 865a796..73877e6 100644 --- a/examples/LinkWireless_demo/src/main.cpp +++ b/examples/LinkWireless_demo/src/main.cpp @@ -462,7 +462,7 @@ void wait(u32 verticalLines) { while (count < verticalLines) { if (REG_VCOUNT != vCount) { - count += max((int)REG_VCOUNT - (int)vCount, 0); + count++; vCount = REG_VCOUNT; } }; diff --git a/lib/LinkWireless.hpp b/lib/LinkWireless.hpp index bbf43b8..e63bfbd 100644 --- a/lib/LinkWireless.hpp +++ b/lib/LinkWireless.hpp @@ -1612,7 +1612,7 @@ class LinkWireless { bool timeout(u32 limit, u32& lines, u32& vCount) { if (REG_VCOUNT != vCount) { - lines += std::max((int)REG_VCOUNT - (int)vCount, 0); + lines += max((int)REG_VCOUNT - (int)vCount, 0); vCount = REG_VCOUNT; } @@ -1625,7 +1625,7 @@ class LinkWireless { while (count < verticalLines) { if (REG_VCOUNT != vCount) { - count += std::max((int)REG_VCOUNT - (int)vCount, 0); + count++; vCount = REG_VCOUNT; } };