From 17697051bcdcb5bcd883386c818accbaef9ae2d6 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Mon, 14 Dec 2020 09:09:36 +0100 Subject: [PATCH] Solved vbat race condition --- main.c | 2 +- sa_core.c | 7 +++++-- ui.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index f5ff03a..6a72f70 100644 --- a/main.c +++ b/main.c @@ -2377,7 +2377,7 @@ static const VNAShellCommand commands[] = {"edelay" , cmd_edelay , 0}, #endif {"capture" , cmd_capture , CMD_WAIT_MUTEX}, - {"vbat" , cmd_vbat , 0}, + {"vbat" , cmd_vbat , CMD_WAIT_MUTEX}, // Uses same adc as touch!!!!! #ifdef ENABLE_VBAT_OFFSET_COMMAND {"vbat_offset" , cmd_vbat_offset , 0}, #endif diff --git a/sa_core.c b/sa_core.c index 0ec89f6..96f65fb 100644 --- a/sa_core.c +++ b/sa_core.c @@ -1,5 +1,4 @@ /* All rights reserved. - * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) @@ -3063,6 +3062,8 @@ void test_prepare(int i) setting.frequency_IF = DEFAULT_IF; // Default frequency setting.auto_IF = true; setting.auto_attenuation = false; + setting.spur_removal = S_OFF; + switch(test_case[i].setup) { // Prepare test conditions case TPH_SILENT: // No input signal set_mode(M_HIGH); @@ -3094,7 +3095,7 @@ common_silent: #ifdef TINYSA4 setting.spur_removal = S_AUTO_OFF; #else - setting.spur_removal = S_OFF; + setting.spur_removal = S_ON; #endif #endif common: @@ -3121,6 +3122,7 @@ common_silent: case TPH_30MHZ: set_mode(M_HIGH); set_refer_output(0); + setting.spur_removal = S_ON; goto common; } switch(test_case[i].setup) { // Prepare test conditions @@ -3216,6 +3218,7 @@ void self_test(int test) test_wait = true; if (!check_touched()) return; + sweep_mode = SWEEP_ENABLE; ili9341_clear_screen(); reset_settings(M_LOW); diff --git a/ui.c b/ui.c index 7df6114..5f1af56 100644 --- a/ui.c +++ b/ui.c @@ -2814,7 +2814,7 @@ ui_init() void wait_user(void) { adc_stop(); - touch_wait_release(); + touch_wait_released(); #if 0 operation_requested = OP_NONE; while (true) {