1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Attempts to pull drive ownership into DiskController.

For the sake of being more intelligent as to drive clocking, hopefully. And, eventually, to support multiple drive selection.
This commit is contained in:
Thomas Harte
2020-02-11 21:59:13 -05:00
parent 654f5b0478
commit 05bcd73f82
17 changed files with 157 additions and 138 deletions
+4 -2
View File
@@ -170,6 +170,7 @@ void Drive::set_motor_on(bool motor_is_on) {
// TODO: momentum.
if(motor_is_on) {
set_disk_is_rotating(true);
time_until_motor_transition = Cycles(0);
return;
}
@@ -431,9 +432,10 @@ void Drive::set_disk_is_rotating(bool is_rotating) {
disk_is_rotating_ = is_rotating;
if(observer_) {
observer_->set_drive_motor_status(drive_name_, motor_input_is_on_);
observer_->set_drive_motor_status(drive_name_, disk_is_rotating_);
if(announce_motor_led_) {
observer_->set_led_status(drive_name_, motor_input_is_on_);
printf("LED set: %s %d\n", drive_name_.c_str(), int(disk_is_rotating_));
observer_->set_led_status(drive_name_, disk_is_rotating_);
}
}