Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions src/ip30_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,27 +501,6 @@ impl OctaneMachine {
}
}

/// Host input into the UARTs, HEART's compare, and the flash written
/// back once the guest has stopped changing it.
fn service_loop(bus: Arc<Ip30Bus>, running: Arc<AtomicBool>, paused: Arc<AtomicBool>) {
let mut save_check = Instant::now();
while running.load(Ordering::Relaxed) {
if paused.load(Ordering::Relaxed) {
std::thread::sleep(Duration::from_millis(1));
continue;
}
bus.service();
if save_check.elapsed() >= Duration::from_secs(2) {
save_check = Instant::now();
bus.save();
}
// 1 ms, not the 100 µs this loop once paid: nothing it services
// (UART typing, the compare timer) is hurt by a millisecond, and
// a 10 kHz poll burns real CPU on small hosts for no return.
std::thread::sleep(Duration::from_millis(1));
}
}

/// Stop the CPU, then every device: their threads are joined and their
/// timers removed, so nothing touches memory or an interrupt line until
/// [`Self::restart_peripherals`]. HEART's counter holds still meanwhile
Expand Down
Loading