1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Apply changes on trailing edges only.

This commit is contained in:
Thomas Harte 2023-12-22 18:38:43 -05:00
parent 66bc1fd6fd
commit 54f1c31c94

View File

@ -175,8 +175,8 @@ void Chipset::DiskController::set_mtr_sel_side_dir_step(uint8_t value) {
const bool is_selected = !(value & select_mask); const bool is_selected = !(value & select_mask);
// Both the motor state and the ID shifter are affected upon // Both the motor state and the ID shifter are affected upon
// changes in drive selection only. // the trailing edge of changes in drive selection only.
if(difference & select_mask) { if(difference & select_mask & ~value) {
// If transitioning to inactive, shift the drive ID value; // If transitioning to inactive, shift the drive ID value;
// if transitioning to active, possibly reset the drive // if transitioning to active, possibly reset the drive
// ID and definitely latch the new motor state. // ID and definitely latch the new motor state.