Mercurial > public > ostc4
diff Small_CPU/Src/scheduler.c @ 899:2225c467f1e9 Evo_2_23
Added data path and visualization for position data:
The GNSS data exchange is now initialized and triggered on a cyclic basis (once a second). RTE verion has been increased because of interface change. For now only the position data is shown in a T7 surface views. The functionality may be switched on/off using the compile switch ENABLE_GNSS.
author | Ideenmodellierer |
---|---|
date | Mon, 30 Sep 2024 21:56:05 +0200 |
parents | 5b675077ccfb |
children | 5736b2641cb0 |
line wrap: on
line diff
--- a/Small_CPU/Src/scheduler.c Thu Sep 26 18:40:41 2024 +0200 +++ b/Small_CPU/Src/scheduler.c Mon Sep 30 21:56:05 2024 +0200 @@ -43,7 +43,10 @@ #include "tm_stm32f4_otp.h" #include "externalInterface.h" #include "uart.h" +#include "GNSS.h" +#include "uartProtocol_GNSS.h" #include "math.h" +#include "configuration.h" /* uncomment to enable restoting of last known date in case of a power loss (RTC looses timing data) */ /* #define RESTORE_LAST_KNOWN_DATE */ @@ -101,6 +104,7 @@ void copyPICdata(void); void copyExtADCdata(); void copyExtCO2data(); +void copyGNSSdata(void); static void schedule_update_timer_helper(int8_t thisSeconds); static void evaluateAscentSpeed(void); uint32_t time_elapsed_ms(uint32_t ticksstart,uint32_t ticksnow); @@ -874,6 +878,11 @@ { adc_ambient_light_sensor_get_data(); copyAmbientLightData(); +#ifdef ENABLE_GNSS + uartGnss_ProcessData(); + uartGnss_Control(); +#endif + copyGNSSdata(); Scheduler.counterAmbientLight100msec++; } @@ -1734,6 +1743,24 @@ global.dataSendToMaster.boolADCO2Data |= boolCO2Buffer; } +void copyGNSSdata(void) +{ +#ifdef ENABLE_GNSS + global.dataSendToMaster.data[0].fLat = GNSS_Handle.fLat; + global.dataSendToMaster.data[0].fLon = GNSS_Handle.fLon; +#else + static float tmpLon = 0.0; + static float tmpLat= 100.0; + global.dataSendToMaster.data[0].fLat = tmpLat; + global.dataSendToMaster.data[0].fLon = tmpLon; + tmpLon += 0.15; + if(tmpLon > 360.0) tmpLon = 0.0; + tmpLat += 0.33; + if(tmpLat > 360.0) tmpLat = 0.0; +#endif +} + + typedef enum { SPI3_OK = 0x00,