Cache drive select and motor on moving it out of Greaseweazle #53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds caching of the drive select and motor states in Adafruit_FloppyBase since it and its child classes manage these signals.
Update Greaseweazle code to use these new cached versions instead of its own version and only try to stop the motor in a loop() timeout if the drive is currently selected. The existing code may try to move head to track 0 and turn off the motor after a previous greaseweazle command or the last timeout deselected the drive resulting in the operation failing as attempting to seek track 0 will fail unless the drive is first selected. On SA400 drives, the head needs to load before seeks can be done and the track 0 signal becomes active and that makes a clacking sound each time which is unnecessary every few seconds.