From 2b342d75b9c122510d1073827211f923f77508a1 Mon Sep 17 00:00:00 2001 From: korolev Date: Fri, 31 Jan 2025 11:32:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=81=D1=82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B8=20GSM=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=BE=20=D0=BC=D1=8C=D1=8E=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D0=B0=D0=BC,=20=D0=BF=D1=80=D0=B8=D1=87=D0=B8?= =?UTF-8?q?=D0=BD=D0=B0=20-=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D1=82=D0=BE=D0=BA=D0=BE=D0=B2?= =?UTF-8?q?,=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=B2=D1=80=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BE=D0=B1=D1=80=D0=B0=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA=20=D0=90=D0=A2=20=D0=B8=D0=BD?= =?UTF-8?q?=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D1=83=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=BC=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainModesArbiter.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/MainModesArbiter.c b/MainModesArbiter.c index 69eb6a1..54ef064 100644 --- a/MainModesArbiter.c +++ b/MainModesArbiter.c @@ -39,7 +39,7 @@ void TELEMATICA_STOP(tMma *env) { SystemDelayMs(100); } - Gsm_SetProfileERA(&env->egtsProcessing); + Gsm_SetProfileERA(&env->gsmWithGnss.gsmAt, &env->storage.nvm.deviceTeledataStorageData); } } @@ -91,16 +91,21 @@ void Mma_Shutdown(tMma *env) { } void Mma_EcallPrepare(tMma *env) { - AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); - SystemDelayMs(1000); - GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 12); - SystemDelayMs(1000); - GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 22); - SystemDelayMs(1000); - GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 25); - SystemDelayMs(1000); - AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); - AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt, 0); + if (osMutexAcquire(env->gsmWithGnss.gsmAt.access, 5000) == osOK) { + AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); + SystemDelayMs(1000); + GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 12); + SystemDelayMs(1000); + GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 22); + SystemDelayMs(1000); + GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 25); + SystemDelayMs(1000); + AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt); + AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt, 0); + osMutexRelease(env->gsmWithGnss.gsmAt.access); + } else { + LoggerErrorStatic(LOGGER, LOG_SIGN, "Захватить мьютэкс Mma_EcallPrepare не удалось") + } }