comparison Discovery/Src/t7.c @ 198:878dc9e0dbc5 div-fixes-cleaup-2

cleanup: another cleanup session (data_exchange_main.c) Cleanup all kinds of stuff in one of the core functions. Made local data static, with 1 already existing exception (the dataIn data). For this, a trivial change is made in t7.c. In addition, not used code, and commented out code that seems highly obsolete is removed. Another tiny step in code that is better to maintain in the future. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Thu, 21 Mar 2019 15:28:47 +0100
parents 2885628ab3ba
children b2a9e9b02df0
comparison
equal deleted inserted replaced
197:c853f5d23bb7 198:878dc9e0dbc5
1205 1205
1206 char TextL1[4*TEXTSIZE]; 1206 char TextL1[4*TEXTSIZE];
1207 uint32_t color; 1207 uint32_t color;
1208 // uint8_t gasIdFirst; 1208 // uint8_t gasIdFirst;
1209 SSettings* pSettings = settingsGetPointer(); 1209 SSettings* pSettings = settingsGetPointer();
1210 extern SDataExchangeSlaveToMaster dataIn; 1210 SDataExchangeSlaveToMaster *dataIn = get_dataInPointer();
1211 1211
1212 SWindowGimpStyle windowGimp; 1212 SWindowGimpStyle windowGimp;
1213 1213
1214 RTC_DateTypeDef Sdate; 1214 RTC_DateTypeDef Sdate;
1215 RTC_TimeTypeDef Stime; 1215 RTC_TimeTypeDef Stime;
1219 1219
1220 1220
1221 if(stateUsed->data_old__lost_connection_to_slave) 1221 if(stateUsed->data_old__lost_connection_to_slave)
1222 { 1222 {
1223 Gfx_write_label_var(&t7screen, 500,800, 0,&FontT42,CLUT_DiveMainLabel,"old"); 1223 Gfx_write_label_var(&t7screen, 500,800, 0,&FontT42,CLUT_DiveMainLabel,"old");
1224 snprintf(TextL1,TEXTSIZE,"%X %X %X %X",dataIn.header.checkCode[0],dataIn.header.checkCode[1],dataIn.header.checkCode[2],dataIn.header.checkCode[3]); 1224 snprintf(TextL1,TEXTSIZE,"%X %X %X %X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]);
1225 Gfx_write_label_var(&t7screen, 500,800, 45,&FontT48,CLUT_Font020,TextL1); 1225 Gfx_write_label_var(&t7screen, 500,800, 45,&FontT48,CLUT_Font020,TextL1);
1226 } 1226 }
1227 else 1227 else
1228 if(DataEX_lost_connection_count()) 1228 if(DataEX_lost_connection_count())
1229 { 1229 {
1259 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT); 1259 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT);
1260 Gfx_write_label_var(&t7screen, 0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure"); 1260 Gfx_write_label_var(&t7screen, 0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure");
1261 Gfx_write_label_var(&t7screen, 0,400,355,&FontT48,CLUT_Font020,TextL1); 1261 Gfx_write_label_var(&t7screen, 0,400,355,&FontT48,CLUT_Font020,TextL1);
1262 1262
1263 // gasIdFirst = stateUsed->lifeData.actualGas.GasIdInSettings; 1263 // gasIdFirst = stateUsed->lifeData.actualGas.GasIdInSettings;
1264 snprintf(TextL1,TEXTSIZE,"%u.%u",dataIn.RTE_VERSION_high,dataIn.RTE_VERSION_low); 1264 snprintf(TextL1,TEXTSIZE,"%u.%u",dataIn->RTE_VERSION_high,dataIn->RTE_VERSION_low);
1265 Gfx_write_label_var(&t7screen, 320,500,100,&FontT42,CLUT_DiveMainLabel,"RTE"); 1265 Gfx_write_label_var(&t7screen, 320,500,100,&FontT42,CLUT_DiveMainLabel,"RTE");
1266 Gfx_write_label_var(&t7screen, 320,500,145,&FontT48,CLUT_Font020,TextL1); 1266 Gfx_write_label_var(&t7screen, 320,500,145,&FontT48,CLUT_Font020,TextL1);
1267 1267
1268 Gfx_write_label_var(&t7screen, 500,800,100,&FontT42,CLUT_DiveMainLabel,"Battery"); 1268 Gfx_write_label_var(&t7screen, 500,800,100,&FontT42,CLUT_DiveMainLabel,"Battery");
1269 snprintf(TextL1,TEXTSIZE,"%01.4f V",stateUsed->lifeData.battery_voltage); 1269 snprintf(TextL1,TEXTSIZE,"%01.4f V",stateUsed->lifeData.battery_voltage);