From 29c740d27566c44e3543b8d510d62d3102ce13b9 Mon Sep 17 00:00:00 2001 From: korolev Date: Wed, 18 Dec 2024 07:41:43 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BD=20=D0=B0=D0=BB?= =?UTF-8?q?=D0=B3=D0=BE=D1=80=D0=B8=D1=82=D0=BC=20=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=BA=D0=B8=20=D0=B4=D0=B2=D0=BE=D0=B9=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=BD=D0=B0=D0=B6=D0=B0=D1=82=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=B5=D1=80=D0=B2=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BF=D1=80=D0=BE=D0=B7=D0=B2=D0=BE=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=9A=D0=B0=D0=B7=D0=B0=D1=85=D1=81=D1=82=D0=B0=D0=BD?= =?UTF-8?q?=D0=B5,=20=D0=BF=D1=80=D0=B8=D1=87=D0=B8=D0=BD=D0=B0=20-=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BB=20=D1=80=D1=83=D0=B4=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=BE=D0=BC,=20=D1=82.=D0=BA.=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=BE=D1=81=D1=8C=20=D0=B7=D0=B0=D1=81=D1=82=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D1=83=D1=81=D1=82=D1=80=D0=BE=D0=B9=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=BE=20=D0=B2=D1=8B=D1=85=D0=BE=D0=B4=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BD=D0=B0=20=D0=AD=D0=92=D0=90=D0=9A=20=D0=B2=20?= =?UTF-8?q?=D1=88=D1=82=D0=B0=D1=82=D0=BD=D0=BE=D0=BC=20=D1=80=D0=B5=D0=B6?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainModesArbiter.c | 63 ++++------------------------------------------ 1 file changed, 5 insertions(+), 58 deletions(-) diff --git a/MainModesArbiter.c b/MainModesArbiter.c index 326cf76..2cfd393 100644 --- a/MainModesArbiter.c +++ b/MainModesArbiter.c @@ -642,70 +642,17 @@ static _Noreturn void Mma_Thread(tMma *env) { LoggerTraceStatic(LOGGER, LOG_SIGN, "Проверяем нажатия кнопок") if (UserButtons_GetNext(&env->userInput.buttonsInterface, &buttonEvent, 10)) { - if (env->kzModeBloc == false) { - if (UserInputButtonEventIsBetween( - buttonEvent, UI_BUTTON_EMERGENCY, RAISE, env->storage.nvm.gost.SOS_BUTTON_TIME, 0xFFFF - )) { - -#ifdef UVEOS_ADD_TELEMATICA - TELEMATICA_STOP(env); -#endif - - LoggerInfoStatic(LOGGER, LOG_SIGN, "Нажата кнопка экстренного вызова KZ 1") - uint32_t tmt = SystemGetMs() + 10000; - UserButtons_Clear(&env->userInput.buttonsInterface); - while (tmt > SystemGetMs()) { - if (UserButtons_GetNext(&env->userInput.buttonsInterface, &buttonEvent, 10)) { - if (UserInputButtonEventIsBetween( - buttonEvent, UI_BUTTON_EMERGENCY, RAISE, env->storage.nvm.gost.SOS_BUTTON_TIME, - 0xFFFF - )) { - -#ifdef UVEOS_ADD_TELEMATICA - TELEMATICA_STOP(env); -#endif - LoggerInfoStatic(LOGGER, LOG_SIGN, "Нажата кнопка экстренного вызова KZ 2") - EraGlonassUveos_SetTimings(&env->uveos); - Mma_SetMode(env, DEVICE_MODE_UVEOS_CALL_INITIATE); - Mma_NetworkAndAudioRequireKz(env); - GpioPinEnable(&env->power.pins->main.ecall); - env->uveos.currentMsd->msd.MSD_Data.msgId = 1; - - DeviceTesting_EcallKZ(&env->testing); -// Mma_EcallManualKZ(env); - env->kzModeBloc = true; - AtGsmTelitLe910_Gnss_ReStartReceiver(&env->gsmWithGnss.gsmAt, 0); - SystemDelayMs(500); - AtGsmTelitLe910_Gnss_ReStartReceiver(&env->gsmWithGnss.gsmAt, 1); - - Mma_NetworkAndAudioRelease(env); - } - } - SystemDelayMs(10); - } - if (env->kzModeBloc == false) { - -#ifdef UVEOS_ADD_TELEMATICA - TELEMATICA_STOP(env); -#endif - - LoggerInfoStatic(LOGGER, LOG_SIGN, "Нажата кнопка экстренного вызова_1") - Mma_EcallManualKZ(env); - } - UserButtons_Clear(&env->userInput.buttonsInterface); - } - } else if (UserInputButtonEventIsBetween( + if (UserInputButtonEventIsBetween( buttonEvent, UI_BUTTON_EMERGENCY, RAISE, env->storage.nvm.gost.SOS_BUTTON_TIME, 0xFFFF )) { - + LoggerTraceStatic(LOGGER, LOG_SIGN, "Нажата кнопка экстренного вызова") #ifdef UVEOS_ADD_TELEMATICA TELEMATICA_STOP(env); #endif - - LoggerInfoStatic(LOGGER, LOG_SIGN, "Нажата кнопка экстренного вызова_2") -// Mma_EcallManual(env); Mma_EcallManualKZ(env); - } else if (UserInputButtonEventIsBetween(buttonEvent, UI_BUTTON_ADDITIONAL, RAISE, 3000, 10000)) { + } else + + if (UserInputButtonEventIsBetween(buttonEvent, UI_BUTTON_ADDITIONAL, RAISE, 3000, 10000)) { #ifdef UVEOS_ADD_TELEMATICA TELEMATICA_STOP(env);