From bcc156c5fc010b8953b14ce549728f44fe716c09 Mon Sep 17 00:00:00 2001 From: catvayor Date: Tue, 15 Oct 2024 13:35:12 +0200 Subject: [PATCH] fix(agb02/control-box): gpio mapping and network wait --- machines/agb02/_configuration.nix | 2 ++ machines/agb02/agb/agb.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/machines/agb02/_configuration.nix b/machines/agb02/_configuration.nix index 699b08f..f069fef 100644 --- a/machines/agb02/_configuration.nix +++ b/machines/agb02/_configuration.nix @@ -25,6 +25,8 @@ in systemd.services."agb-control-box" = { wantedBy = [ "multi-user.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; unitConfig.Description = "The program of the control-box"; serviceConfig = { Restart = "always"; diff --git a/machines/agb02/agb/agb.cpp b/machines/agb02/agb/agb.cpp index 05692b9..022d132 100644 --- a/machines/agb02/agb/agb.cpp +++ b/machines/agb02/agb/agb.cpp @@ -18,8 +18,8 @@ constexpr double joystick_movement = 0.2; const gpiod::line::offsets drive_down = { 21, 13, 6 }; -const gpiod::line::offsets decoder = { 3, 4, 17, 27, 24, 23, 18, 15 }; // lsbf -const gpiod::line::offsets joystick = { 26, 19, 0, 5 }; // x+, y+, x-, y- +const gpiod::line::offsets decoder = { 3, 4, 17, 27, 24, 23, 18, 2 }; // lsbf +const gpiod::line::offsets joystick = { 19, 26, 5, 0 }; // x+, y+, x-, y- const gpiod::line::offset black_button = 20; const gpiod::line::offset white_button = 16;