Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions FloppyDriveController.sketch/FloppyDriveController.sketch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
// Paula on the Amiga used to find the SYNC WORDS and then read 0x1900 further WORDS. A dos track is 11968 bytes in size, theritical revolution is 12800 bytes.
#define RAW_TRACKDATA_LENGTH (0x1900*2+0x440) // Paula assumed it was 12868 bytes, so we read that, plus thre size of a sectors

// The current track that the head is over
int currentTrack = 0;
// The current track that the head is over. Starts with -1 to identify an unknown head position.
int currentTrack = -1;

// If the drive has been switched on or not
bool driveEnabled = 0;
Expand Down Expand Up @@ -185,6 +185,7 @@ void setup() {
pinMode(PIN_MOTOR_STEP,OUTPUT);
pinMode(PIN_ACTIVITY_LED,OUTPUT);

digitalWrite(PIN_MOTOR_STEP, HIGH);
digitalWrite(PIN_ACTIVITY_LED,LOW);

// Disable all interrupts - we dont want them!
Expand Down Expand Up @@ -306,6 +307,9 @@ bool gotoTrackX() {
// Exit if its already been reached
if (track == currentTrack) return true;

// If current track is unknown go to track 0 first
if (currentTrack == -1) goToTrack0();

// And step the head until we reach this track number
if (currentTrack < track) {
digitalWrite(PIN_MOTOR_DIR,MOTOR_TRACK_INCREASE); // Move OUT
Expand Down