Skip to content

Commit

Permalink
[media][atx] tolerance.
Browse files Browse the repository at this point in the history
  • Loading branch information
tschak909 committed Jul 27, 2023
1 parent 7c93262 commit 71e27e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/media/atari/diskTypeAtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#define ATX_MAGIC_HEADER 0x41543858 // "AT8X"
#define ATX_DEFAULT_NUMTRACKS 40
#define HEAD_TOLERANCE 2

/*
Assuming 288RPM:
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71e27e5

Please sign in to comment.