From 09bf24cbc955377e69738284335b39086a06915b Mon Sep 17 00:00:00 2001 From: Emilio Corigliano <emilio.corigliano@skywarder.eu> Date: Sat, 5 Oct 2024 16:48:14 +0200 Subject: [PATCH] [Rovie] Refactored a bit entrypoint --- .../rovie-groundstation-entry.cpp | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/entrypoints/Groundstation/rovie-groundstation-entry.cpp b/src/entrypoints/Groundstation/rovie-groundstation-entry.cpp index be6064a41..b52aaa1cd 100644 --- a/src/entrypoints/Groundstation/rovie-groundstation-entry.cpp +++ b/src/entrypoints/Groundstation/rovie-groundstation-entry.cpp @@ -79,27 +79,35 @@ int main() // Ok now start them - ok &= serial->start(); - if (!ok) + if (!serial->start()) { + ok &= false; printf("[error] Failed to start serial!\n"); } - ok &= ethernet->start(); - if (!ok) + if (!ethernet->start()) { + ok &= false; printf("[error] Failed to start ethernet!\n"); } - ok &= radioRig->start(); - if (!ok) + if (!radioRig->start()) { + ok &= false; printf("[error] Failed to start RIG radio!\n"); + } + + if (ok) + { + printf("All good!\n"); + led1On(); + idleLoop(); + } + else + { + printf("Something didn't initialize!\n"); errorLoop(); } - printf("All good!\n"); - led1On(); - idleLoop(); return 0; } \ No newline at end of file -- GitLab