From 1a541c71eaa142bb50a65bfea0a865fc6c754023 Mon Sep 17 00:00:00 2001 From: torque Date: Wed, 14 Aug 2024 15:26:06 -0700 Subject: [PATCH] main: full redraw on initial connection This seems to help if rotint is started before rotctld (which just crashes on mac). --- src/main.zig | 2 ++ src/networking.zig | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index 9eda383..09b96fc 100644 --- a/src/main.zig +++ b/src/main.zig @@ -121,6 +121,8 @@ pub const RotInt = struct { self.warn("rotator connected", .{}); self.sendRotatorCommand(.get_position); self.state = .rotator_connected; + self.vx.queueRefresh(); + self.draw() catch {}; }, .rotator_ready => if (self.state == .rotator_connected) { self.warn("rotator ready", .{}); diff --git a/src/networking.zig b/src/networking.zig index b542021..c6a4f87 100644 --- a/src/networking.zig +++ b/src/networking.zig @@ -218,7 +218,9 @@ pub const Client = struct { _ = result catch |err| { self.rotint.warn("connect failed {}", .{err}); - // retry bayeb + // Note: this loops instantaneously if the target address is on localhost + // and is not being listened on. Actually just straight up crashes on macOS. + // Probably need to use a timer to handle this better return .rearm; };