Fix
This commit is contained in:
parent
f2b49cf4e3
commit
b15c208097
|
|
@ -18,21 +18,14 @@ bool isRtc = false;
|
|||
void GsmWithGnss_Urc(tGsmWithGnss *env, tAtBuffer *buff) {
|
||||
|
||||
if (AtBufferBeginWithStatic(buff, "SRING: ")) {
|
||||
|
||||
if (osMutexAcquire(env->gsmAt.access, 2000) == osOK) {
|
||||
SocketSocketGsm_UrcProcessor_SRING(&env->socketGsm, buff);
|
||||
osMutexRelease(env->gsmAt.access);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (AtBufferBeginWithStatic(buff, "NO CARRIER")) {
|
||||
|
||||
if (osMutexAcquire(env->gsmAt.access, 2000) == osOK) {
|
||||
SocketSocketGsm_UrcProcessor_NO_CARRIER(&env->socketGsm, buff);
|
||||
osMutexRelease(env->gsmAt.access);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -50,7 +43,10 @@ void GsmWithGnss_Urc(tGsmWithGnss *env, tAtBuffer *buff) {
|
|||
if (env->gnss.currentRmc.time.second != 0) {
|
||||
if (isRtc == false) {
|
||||
isRtc = true;
|
||||
RtcSet(env->Rtc, (time_t *) &time);
|
||||
time_t timestamp;
|
||||
GnssTaskGetTime(env, ×tamp);
|
||||
RtcSet(env->Rtc, ×tamp);
|
||||
//RtcSet(env->Rtc, (time_t *) &time);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,20 +84,30 @@ void Gnss_GetFullNavData(tGsmWithGnss *env, tNmeaRmc *nmeaRmc) {
|
|||
|
||||
|
||||
void GsmWithGnss_GetNevData(tGsmWithGnss *env, uint32_t timeout) {
|
||||
GsmWithGnss_StartRMCThread(&env->gsmAt);
|
||||
/*
|
||||
if (osMutexAcquire(env->gsmAt.access, 1000) == osOK) {
|
||||
|
||||
uint32_t endTimeout = SystemGetMs() + timeout;
|
||||
env->gnss.currentRmc.time.second = 0;
|
||||
while (endTimeout > SystemGetMs()) {
|
||||
AtCmdProcessUnresolvedLines(&env->gsmAt);
|
||||
if(env->gnss.currentRmc.time.second != 0){
|
||||
GsmWithGnss_StopRMCThread(&env->gsmAt);
|
||||
return;
|
||||
GsmWithGnss_StartRMCThread(&env->gsmAt);
|
||||
|
||||
uint32_t endTimeout = SystemGetMs() + timeout;
|
||||
env->gnss.currentRmc.time.second = 0;
|
||||
while (endTimeout > SystemGetMs()) {
|
||||
AtCmdProcessUnresolvedLines(&env->gsmAt);
|
||||
if (env->gnss.currentRmc.time.second != 0) {
|
||||
GsmWithGnss_StopRMCThread(&env->gsmAt);
|
||||
osMutexRelease(env->gsmAt.access);
|
||||
return;
|
||||
}
|
||||
SystemDelayMs(2);
|
||||
}
|
||||
SystemDelayMs(2);
|
||||
}
|
||||
GsmWithGnss_StopRMCThread(&env->gsmAt);
|
||||
GsmWithGnss_StopRMCThread(&env->gsmAt);
|
||||
|
||||
|
||||
osMutexRelease(env->gsmAt.access);
|
||||
} else {
|
||||
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка захвата доступа GsmWithGnss_GetNevData")
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue