comparison Small_CPU/Src/scheduler.c @ 955:9b29995d6619 Evo_2_23 tip

GNSS backup position: In the previous implementation a position had to be provided by the module in order to be stored in the log. This may cause a wrong position entry (default) in the log, for example if signal is lost while preparing for the dive in the water. To avoid this the last received position will be used for ~2 hours => Diver may take the dive side position before starting with the dive preparation. The last known position will be display in the GNSS position search window as well.
author Ideenmodellierer
date Wed, 01 Jan 2025 20:37:17 +0100
parents e9c37071933b
children
comparison
equal deleted inserted replaced
954:4e4fbd73e329 955:9b29995d6619
1792 global.dataSendToMaster.boolADCO2Data |= boolCO2Buffer; 1792 global.dataSendToMaster.boolADCO2Data |= boolCO2Buffer;
1793 } 1793 }
1794 1794
1795 void copyGNSSdata(void) 1795 void copyGNSSdata(void)
1796 { 1796 {
1797 RTC_TimeTypeDef sTimeNow;
1798
1797 global.dataSendToMaster.data[0].gnssInfo.coord.fLat = GNSS_Handle.fLat; 1799 global.dataSendToMaster.data[0].gnssInfo.coord.fLat = GNSS_Handle.fLat;
1798 global.dataSendToMaster.data[0].gnssInfo.coord.fLon = GNSS_Handle.fLon; 1800 global.dataSendToMaster.data[0].gnssInfo.coord.fLon = GNSS_Handle.fLon;
1799 global.dataSendToMaster.data[0].gnssInfo.fixType = GNSS_Handle.fixType; 1801 global.dataSendToMaster.data[0].gnssInfo.fixType = GNSS_Handle.fixType;
1800 global.dataSendToMaster.data[0].gnssInfo.numSat = GNSS_Handle.numSat; 1802 global.dataSendToMaster.data[0].gnssInfo.numSat = GNSS_Handle.numSat;
1801 global.dataSendToMaster.data[0].gnssInfo.DateTime.year = (uint8_t) (GNSS_Handle.year - 2000); 1803 global.dataSendToMaster.data[0].gnssInfo.DateTime.year = (uint8_t) (GNSS_Handle.year - 2000);
1805 global.dataSendToMaster.data[0].gnssInfo.DateTime.min = GNSS_Handle.min; 1807 global.dataSendToMaster.data[0].gnssInfo.DateTime.min = GNSS_Handle.min;
1806 global.dataSendToMaster.data[0].gnssInfo.DateTime.sec = GNSS_Handle.sec; 1808 global.dataSendToMaster.data[0].gnssInfo.DateTime.sec = GNSS_Handle.sec;
1807 1809
1808 global.dataSendToMaster.data[0].gnssInfo.alive = GNSS_Handle.alive; 1810 global.dataSendToMaster.data[0].gnssInfo.alive = GNSS_Handle.alive;
1809 1811
1812 if(( GNSS_Handle.fixType < 2) && (GNSS_Handle.alive & GNSS_ALIVE_BACKUP_POS)) /* fallback to last known position ? */
1813 {
1814 RTC_GetTime(&sTimeNow);
1815 if(GNSS_Handle.last_hour > sTimeNow.Hours)
1816 {
1817 sTimeNow.Hours += 24; /* compensate date change */
1818 }
1819 if(sTimeNow.Hours - GNSS_Handle.last_hour > 2)
1820 {
1821 GNSS_Handle.alive &= ~GNSS_ALIVE_BACKUP_POS; /* position outdated */
1822 }
1823 else
1824 {
1825 global.dataSendToMaster.data[0].gnssInfo.coord.fLat = GNSS_Handle.last_fLat;
1826 global.dataSendToMaster.data[0].gnssInfo.coord.fLon = GNSS_Handle.last_fLon;
1827 }
1828 }
1810 memcpy(&global.dataSendToMaster.data[0].gnssInfo.signalQual,&GNSS_Handle.statSat, sizeof(GNSS_Handle.statSat)); 1829 memcpy(&global.dataSendToMaster.data[0].gnssInfo.signalQual,&GNSS_Handle.statSat, sizeof(GNSS_Handle.statSat));
1811 } 1830 }
1812 1831
1813 1832
1814 typedef enum 1833 typedef enum