From 064477291afc408d593818077e7b65f0bed4722d Mon Sep 17 00:00:00 2001 From: TT Date: Sat, 28 Sep 2019 22:28:00 +0900 Subject: [PATCH] fixed: freeze device by clicking pause --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 63177b15..a9adaf09 100644 --- a/main.c +++ b/main.c @@ -72,10 +72,12 @@ static THD_FUNCTION(Thread1, arg) __WFI(); } + chMtxLock(&mutex); + ui_process(); + chMtxUnlock(&mutex); + if (sweep_enabled) { chMtxLock(&mutex); - ui_process(); - if (vbat != -1) { adc_stop(ADC1); vbat = adc_vbat_read(ADC1);