From 9d555c4a02906a91d4fb78f63bfc88022e155ce3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 25 Dec 2016 09:19:18 -0500 Subject: [PATCH] Let's try just declining to pump the PLL while in write mode. Added documentation to explain. --- Storage/Disk/DiskController.cpp | 4 ++-- Storage/Disk/DiskController.hpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Storage/Disk/DiskController.cpp b/Storage/Disk/DiskController.cpp index 99d97caa3..07c655f47 100644 --- a/Storage/Disk/DiskController.cpp +++ b/Storage/Disk/DiskController.cpp @@ -68,7 +68,7 @@ void Controller::run_for_cycles(int number_of_cycles) cycles_since_index_hole_ += (unsigned int)cycles_to_run_for; number_of_cycles -= cycles_to_run_for; - pll_->run_for_cycles(cycles_to_run_for); + if(is_reading_) pll_->run_for_cycles(cycles_to_run_for); TimedEventLoop::run_for_cycles(cycles_to_run_for); } } @@ -97,7 +97,7 @@ void Controller::process_next_event() switch(current_event_.type) { case Track::Event::FluxTransition: - pll_->add_pulse(); + if(is_reading_) pll_->add_pulse(); break; case Track::Event::IndexHole: printf("%p %d [/%d = %d]\n", this, cycles_since_index_hole_, clock_rate_multiplier_, cycles_since_index_hole_ / clock_rate_multiplier_); diff --git a/Storage/Disk/DiskController.hpp b/Storage/Disk/DiskController.hpp index d2d6cfba3..ca856fa99 100644 --- a/Storage/Disk/DiskController.hpp +++ b/Storage/Disk/DiskController.hpp @@ -62,9 +62,10 @@ class Controller: public DigitalPhaseLockedLoop::Delegate, public TimedEventLoop bool get_motor_on(); /*! - Begins write mode, initiating a PCM sampled region of data. During write mode, no events will - be reported. Bits should be written via @c write_bit. They will be written with the length set - via @c set_expected_bit_length. + Begins write mode, initiating a PCM sampled region of data. Bits should be written via + @c write_bit. They will be written with the length set via @c set_expected_bit_length. + It is acceptable to supply a backlog of bits. Flux transition events will not be reported + while writing. */ void begin_writing(); @@ -74,8 +75,7 @@ class Controller: public DigitalPhaseLockedLoop::Delegate, public TimedEventLoop void write_bit(bool value); /*! - Ends write mode, switching back to read mode. The drive will return to posting events based - on the recorded track. + Ends write mode, switching back to read mode. The drive will stop overwriting events. */ void end_writing();