From c363460ab23c83b9a2c340f06046abb2db5d1499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 15 Mar 2021 13:59:51 +0100 Subject: [PATCH] application: check target voltage before determining type --- application.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application.c b/application.c index 9fe5ae4..8e5d693 100644 --- a/application.c +++ b/application.c @@ -271,8 +271,13 @@ static void command_voltages(void* argument) static void command_types(void* argument) { (void)argument; // we won't use the argument - float* voltages; print_target(); // print target voltage (also sets measurement conditions) + float* voltages = measure_voltages(); // measure voltages + if (voltages[1] < 0.5) { // check target voltage connection + puts("connect target voltage to test channel type\n"); + return; + } + puts("signal voltage pulled pull-up pulled pull-down signal\n"); puts(" name raw (V) down (V) (kOhm) up (V) (kOhm) type \n");