From cb2712cbf4ff72a2f2395bf912e177ea26a7322f Mon Sep 17 00:00:00 2001 From: Ry Date: Fri, 11 Mar 2022 11:52:05 -0800 Subject: [PATCH] fox32: Exit on CPU halt --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 079ff7d..660f438 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,7 +169,13 @@ fn main() { let mut shared_memory_lock = shared_memory.lock().expect("failed to lock the shared memory mutex"); //shared_memory_lock[0x01FFFFFF] = shared_memory_lock[0x01FFFFFF].overflowing_add(1).0; // increment vsync counter - let _ = interrupt_sender.send(Interrupt::Request(0xFF)); // vsync interrupt + match interrupt_sender.send(Interrupt::Request(0xFF)) { // vsync interrupt + Ok(_) => {}, + Err(_) => { + *control_flow = ControlFlow::Exit; + return; + } + }; display.update(&mut *shared_memory_lock); drop(shared_memory_lock); window.request_redraw();