From 71e27e5250630c3c31c5c8acaeaf5145a8842635 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 27 Jul 2023 09:34:34 -0500 Subject: [PATCH] [media][atx] tolerance. --- lib/media/atari/diskTypeAtx.cpp | 4 +++- src/main.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/media/atari/diskTypeAtx.cpp b/lib/media/atari/diskTypeAtx.cpp index 9322c950a..4c777c19b 100755 --- a/lib/media/atari/diskTypeAtx.cpp +++ b/lib/media/atari/diskTypeAtx.cpp @@ -20,6 +20,7 @@ #define ATX_MAGIC_HEADER 0x41543858 // "AT8X" #define ATX_DEFAULT_NUMTRACKS 40 +#define HEAD_TOLERANCE 2 /* Assuming 288RPM: @@ -205,13 +206,14 @@ void MediaTypeATX::_wait_head_position(uint16_t pos, uint16_t extra_delay) uint16_t current = _get_head_position(); // Debug_printv("pos: %d, current: %d - want to get current to pos\n", pos, extra_delay); + // Slightly reworked by Mark J. Fisher (fenrock) if (current == pos) { return; } // we want to wait until current is close to pos - while (abs(_get_head_position() - pos) > 1 ) + while (abs(_get_head_position() - pos) > HEAD_TOLERANCE ) { NOP(); } diff --git a/src/main.cpp b/src/main.cpp index d99bc2b87..00c13d1a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -347,7 +347,7 @@ extern "C" // Create a new high-priority task to handle the main loop // This is assigned to CPU1; the WiFi task ends up on CPU0 #ifdef BUILD_ATARI -#define MAIN_STACKSIZE 8192 +#define MAIN_STACKSIZE 10240 #define MAIN_PRIORITY 10 #else #define MAIN_STACKSIZE 32768