comparison Discovery/Src/data_exchange_main.c @ 51:8f8ea3a32e82

Resolved warnings pointing to possible invalid memory access
author Ideenmodellierer
date Tue, 31 Jul 2018 22:28:21 +0200
parents 5f11787b4f42
children a6f0881074a4 65a6e352ce08
comparison
equal deleted inserted replaced
50:6310a27fd6d3 51:8f8ea3a32e82
736 } 736 }
737 pStateReal->lifeData.HUD_battery_voltage_V = get_HUD_battery_voltage_V(); 737 pStateReal->lifeData.HUD_battery_voltage_V = get_HUD_battery_voltage_V();
738 738
739 739
740 // wireless - �ltere daten aufr�umen 740 // wireless - �ltere daten aufr�umen
741 for(int i=0;i<=(2*NUM_GASES+1);i++) 741 for(int i=0;i<(2*NUM_GASES+1);i++)
742 { 742 {
743 if(pStateReal->lifeData.bottle_bar[i]) 743 if(pStateReal->lifeData.bottle_bar[i])
744 { 744 {
745 if((pStateReal->lifeData.bottle_bar_age_MilliSeconds[i] == 0) || (pStateReal->lifeData.bottle_bar_age_MilliSeconds[i] > 60000)) 745 if((pStateReal->lifeData.bottle_bar_age_MilliSeconds[i] == 0) || (pStateReal->lifeData.bottle_bar_age_MilliSeconds[i] > 60000))
746 { 746 {
813 float ambient, surface, density, meter; 813 float ambient, surface, density, meter;
814 SSettings *pSettings; 814 SSettings *pSettings;
815 815
816 /* uint8_t IAmStolenPleaseKillMe; 816 /* uint8_t IAmStolenPleaseKillMe;
817 */ 817 */
818 if(settingsGetPointer()->IAmStolenPleaseKillMe > 3) 818 pSettings = settingsGetPointer();
819
820 if(pSettings->IAmStolenPleaseKillMe > 3)
819 { 821 {
820 pSettings->salinity = 0; 822 pSettings->salinity = 0;
821 dataIn.data[dataIn.boolPressureData].surface_mbar = 999; 823 dataIn.data[dataIn.boolPressureData].surface_mbar = 999;
822 dataIn.data[dataIn.boolPressureData].pressure_mbar = 98971; 824 dataIn.data[dataIn.boolPressureData].pressure_mbar = 98971;
823 dataIn.mode = MODE_DIVE; 825 dataIn.mode = MODE_DIVE;
824 } 826 }
825 827
826 pSettings = settingsGetPointer(); 828
827 ambient = dataIn.data[dataIn.boolPressureData].pressure_mbar / 1000.0f; 829 ambient = dataIn.data[dataIn.boolPressureData].pressure_mbar / 1000.0f;
828 surface = dataIn.data[dataIn.boolPressureData].surface_mbar / 1000.0f; 830 surface = dataIn.data[dataIn.boolPressureData].surface_mbar / 1000.0f;
829 831
830 density = ((float)( 100 + pSettings->salinity)) / 100.0f; 832 density = ((float)( 100 + pSettings->salinity)) / 100.0f;
831 meter = (ambient - surface); 833 meter = (ambient - surface);