Исправлена прединициализация перед запуском задачи
This commit is contained in:
parent
6c947a0476
commit
5fa0a934cc
|
|
@ -17,6 +17,7 @@
|
|||
#define LOGGER &env->slog.logger
|
||||
|
||||
#ifdef UVEOS_ADD_TELEMATICA
|
||||
|
||||
void TELEMATICA_START(tMma *env) {
|
||||
env->storage.runtime.EGTS_FLEET_ON = true;
|
||||
}
|
||||
|
|
@ -36,6 +37,7 @@ void TELEMATICA_STOP(tMma *env) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -249,7 +251,7 @@ void Mma_EcallPrepare(tMma *env) {
|
|||
GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 25);
|
||||
SystemDelayMs(3000);
|
||||
AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt);
|
||||
AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt,0);
|
||||
AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt, 0);
|
||||
}
|
||||
|
||||
void Mma_EcallManual(tMma *env) {
|
||||
|
|
@ -273,7 +275,7 @@ void Mma_EcallManualKZ(tMma *env) {
|
|||
Mma_SetMode(env, DEVICE_MODE_UVEOS_CALL_INITIATE);
|
||||
Mma_NetworkAndAudioRequireKz(env);
|
||||
Mma_EcallPrepare(env);
|
||||
GsmWithGnss_NetworkEnableInnaterups(&env->gsmWithGnss, 5,250000);
|
||||
GsmWithGnss_NetworkEnableInnaterups(&env->gsmWithGnss, 5, 250000);
|
||||
GpioPinEnable(&env->power.pins->main.ecall);
|
||||
env->uveos.currentMsd->msd.MSD_Data.msgId = 1;
|
||||
EraGlonassUveos_ManualEmergencyCall(&env->uveos, true);
|
||||
|
|
@ -324,7 +326,7 @@ void Mma_EcallAutomatic(tMma *env, tUveosEmergencyEvent emergencyEvent) {
|
|||
Pwm_AudioEnable(&env->power);
|
||||
Mma_SetMode(env, DEVICE_MODE_UVEOS_CALL_INITIATE);
|
||||
Mma_EcallPrepare(env);
|
||||
GsmWithGnss_NetworkEnableInnaterups(&env->gsmWithGnss, 5,250000);
|
||||
GsmWithGnss_NetworkEnableInnaterups(&env->gsmWithGnss, 5, 250000);
|
||||
Mma_NetworkAndAudioRequireKz(env);
|
||||
|
||||
GpioPinEnable(&env->power.pins->main.ecall);
|
||||
|
|
@ -536,25 +538,23 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
|||
} else {
|
||||
LoggerInfoStatic(LOGGER, LOG_SIGN, "Сеть или сим-чип отсутствует");
|
||||
}
|
||||
} else {
|
||||
|
||||
#ifdef UVEOS_ADD_TELEMATICA
|
||||
TELEMATICA_START(env);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Pwm_AudioDisable(&env->power);
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Звуковой усилитель отключён")
|
||||
AtGsm_OperatorSelectionDeregister(&env->gsmWithGnss.gsmAt);
|
||||
SystemDelayMs(2000);
|
||||
AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt,0);
|
||||
AtGsmTelitLe910_GnssEcallOnlyMode(&env->gsmWithGnss.gsmAt, 0);
|
||||
SystemDelayMs(2000);
|
||||
GsmWithGnss_SelectStandartNetwork(&env->gsmWithGnss.gsmAt, 25);
|
||||
|
||||
#ifdef UVEOS_ADD_TELEMATICA
|
||||
if (noSendMsdCount == 0) {
|
||||
TELEMATICA_START(env);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Mma_StartTestThreadStart(env);
|
||||
*/
|
||||
SystemDelayMs(100);
|
||||
|
||||
for (;;) {
|
||||
|
||||
|
|
@ -566,8 +566,8 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
|||
} else {
|
||||
|
||||
indicationState = GsmWithGnss_IsGnssReady(&env->gsmWithGnss) ?
|
||||
DEVICE_MODE_UVEOS_ERA_GNSS_READY :
|
||||
DEVICE_MODE_UVEOS_ERA_WAIT_GNSS;
|
||||
DEVICE_MODE_UVEOS_ERA_GNSS_READY :
|
||||
DEVICE_MODE_UVEOS_ERA_WAIT_GNSS;
|
||||
|
||||
if (osMutexAcquire(env->gsmWithGnss.gsmAt.access, 1000) == osOK) {
|
||||
AtGsm_Gsnss_GetNMEA_Pack(&env->gsmWithGnss, 400);
|
||||
|
|
@ -600,16 +600,16 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
|||
#endif
|
||||
|
||||
#ifndef UVEOS_ADD_TELEMATICA
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Начало итерации главного цикла")
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Проверяем нужна ли сеть...")
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Начало итерации главного цикла")
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Проверяем нужна ли сеть...")
|
||||
|
||||
if (EraGlonassUveos_IsRequireNetwork(&env->uveos)) {
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Нужна, подключаемся")
|
||||
Mma_SetNetworkRegistration(env, true);
|
||||
} else {
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Ненужна, отключаемся")
|
||||
Mma_SetNetworkRegistration(env, false);
|
||||
}
|
||||
if (EraGlonassUveos_IsRequireNetwork(&env->uveos)) {
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Нужна, подключаемся")
|
||||
Mma_SetNetworkRegistration(env, true);
|
||||
} else {
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Ненужна, отключаемся")
|
||||
Mma_SetNetworkRegistration(env, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Выполняем постоянный тест")
|
||||
|
|
@ -657,12 +657,12 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
|||
#endif
|
||||
|
||||
#ifndef UVEOS_ADD_TELEMATICA
|
||||
checkLastInMemTransmit(env);
|
||||
checkLastInMemTransmit(env);
|
||||
#endif
|
||||
|
||||
LoggerTraceStatic(LOGGER, LOG_SIGN, "Проверяем экстренное событие")
|
||||
if (UveosEmergencyEvent_GetNext(&env->crashDetect.emergencyEvents, &emergencyEvent, 0)) {
|
||||
if(env->storage.nvm.gost.CRASH_SIGNAL_INTERNAL == 1) {
|
||||
if (env->storage.nvm.gost.CRASH_SIGNAL_INTERNAL == 1) {
|
||||
LoggerInfoStatic(LOGGER, LOG_SIGN, "Экстренное событие получено");
|
||||
Mma_EcallAutomatic(env, emergencyEvent);
|
||||
}
|
||||
|
|
@ -680,9 +680,7 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
|||
TELEMATICA_STOP(env);
|
||||
#endif
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue