mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-29 12:50:28 +00:00
Adds defences against double calls to end writing.
This commit is contained in:
parent
98751e6ac8
commit
a85909198f
@ -104,9 +104,11 @@ void Controller::begin_writing(bool clamp_to_index_hole) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Controller::end_writing() {
|
void Controller::end_writing() {
|
||||||
|
if(!is_reading_) {
|
||||||
is_reading_ = true;
|
is_reading_ = true;
|
||||||
get_drive().end_writing();
|
get_drive().end_writing();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Controller::is_reading() {
|
bool Controller::is_reading() {
|
||||||
return is_reading_;
|
return is_reading_;
|
||||||
|
@ -237,6 +237,7 @@ void Drive::write_bit(bool value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Drive::end_writing() {
|
void Drive::end_writing() {
|
||||||
|
if(!is_reading_) {
|
||||||
is_reading_ = true;
|
is_reading_ = true;
|
||||||
|
|
||||||
if(!patched_track_) {
|
if(!patched_track_) {
|
||||||
@ -250,3 +251,4 @@ void Drive::end_writing() {
|
|||||||
cycles_since_index_hole_ %= get_input_clock_rate();
|
cycles_since_index_hole_ %= get_input_clock_rate();
|
||||||
invalidate_track();
|
invalidate_track();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user