From 9547711cc2e148b7efe01b807bde350f37734ed0 Mon Sep 17 00:00:00 2001 From: korolev Date: Thu, 19 Dec 2024 15:34:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=B0=D0=BD=20=D1=80=D0=B5=D0=B6=D0=B8=D0=BC=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F,?= =?UTF-8?q?=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20=D0=B1=D0=BB=D0=BE?= =?UTF-8?q?=D0=BA=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=B7=D0=B0=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D1=82=D0=B0=20=D1=80=D0=B5=D0=B3=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D1=80=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D1=8B=D1=85=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D1=85,=20=D0=B7=D0=B0=D0=B3=D0=BB?= =?UTF-8?q?=D1=83=D1=88=D0=BA=D0=B8=20=D0=B1=D1=8B=D0=BB=D0=B8=20=D0=B2?= =?UTF-8?q?=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainModesArbiter.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/MainModesArbiter.c b/MainModesArbiter.c index 83151d5..0365e61 100644 --- a/MainModesArbiter.c +++ b/MainModesArbiter.c @@ -90,6 +90,20 @@ void Mma_Shutdown(tMma *env) { LoggerErrorStatic(LOGGER, LOG_SIGN, "Этой строчки не должно быть! Критическая ошибка!") } +void Mma_EcallPrepare(tMma *env) { + AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); + SystemDelayMs(1000); + GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 12); + SystemDelayMs(3000); + GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 22); + SystemDelayMs(3000); + GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 25); + SystemDelayMs(3000); + AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); + AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt, 0); +} + + void Mma_CheckShutdownIsBattary(tMma *env) { bool statShutdown = Pwm_IsShutdownRequired(&env->power); if ((env->indication.mode != DEVICE_MODE_TESTING) && (env->indication.mode != DEVICE_MODE_UVEOS_GARAG)) { @@ -231,15 +245,8 @@ void Mma_NetworkAndAudioRequire(tMma *env) { Pwm_SetMute(&env->power, true); LoggerInfoStatic(LOGGER, LOG_SIGN, "Включаем регистрацию в сети"); - - Mma_SetNetworkRegistration(env, true); - LoggerInfoStatic(LOGGER, LOG_SIGN, "Ждем сеть..."); - - if (Mma_WaitNetworkRegistration(env)) { - LoggerInfoStatic(LOGGER, LOG_SIGN, "зарегестрировались"); - } else { - LoggerErrorStatic(LOGGER, LOG_SIGN, "нет сети"); - }; + Mma_EcallPrepare(env); + GsmWithGnss_NetworkEnableInnaterups(&env->gsmWithGnss, 5, 250000); } static void Mma_NetworkAndAudioRelease(tMma *env) { @@ -249,18 +256,6 @@ static void Mma_NetworkAndAudioRelease(tMma *env) { while (t > SystemGetMs()) {} } -void Mma_EcallPrepare(tMma *env) { - AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); - SystemDelayMs(1000); - GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 12); - SystemDelayMs(3000); - GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 22); - SystemDelayMs(3000); - GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 25); - SystemDelayMs(3000); - AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); - AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt, 0); -} void Mma_EcallManual(tMma *env) { EraGlonassUveos_SetTimings(&env->uveos); @@ -335,7 +330,7 @@ void Mma_EcallAutomatic(tMma *env, tUveosEmergencyEvent emergencyEvent) { Mma_SetMode(env, DEVICE_MODE_UVEOS_CALL_INITIATE); Mma_EcallPrepare(env); GsmWithGnss_NetworkEnableInnaterups(&env->gsmWithGnss, 5, 250000); - Mma_NetworkAndAudioRequireKz(env); + Mma_NetworkAndAudioRequire(env); GpioPinEnable(&env->power.pins->main.ecall); Mma_AudioSignal(env, 1, 500); @@ -683,7 +678,7 @@ static _Noreturn void Mma_Thread(tMma *env) { #ifdef UVEOS_ADD_TELEMATICA TELEMATICA_STOP(env); #endif - Mma_EcallManualKZ(env); + Mma_EcallManual(env); } else if (UserInputButtonEventIsBetween(buttonEvent, UI_BUTTON_ADDITIONAL, RAISE, 3000, 10000)) { #ifdef UVEOS_ADD_TELEMATICA