comparison Discovery/Src/t7.c @ 477:5e6a612d03b5 Improve_Button_Sleep

Only switch between "no fly" and "desaturation" in case there is desaturation time left: In previous versions a switch between the times were performed even desaturation time were 0 causing an empty field (nothing) to be displayed. In that case the remaining no fly time is shown Development option only: Show Pressure update for a short time in the custom field (as warning)
author ideenmodellierer
date Tue, 12 May 2020 23:03:29 +0200
parents 4bd01f48c285
children 89f6857276f8
comparison
equal deleted inserted replaced
476:19cff811616d 477:5e6a612d03b5
826 text[bildschirmRefreshCount++] = 0; 826 text[bildschirmRefreshCount++] = 0;
827 GFX_write_string(&FontT42,&t7surfaceR,text,4); 827 GFX_write_string(&FontT42,&t7surfaceR,text,4);
828 */ 828 */
829 829
830 /* noFlyTime or DesaturationTime */ 830 /* noFlyTime or DesaturationTime */
831 831 if((stateUsed->lifeData.no_fly_time_minutes) && ((!display_count_high_time) || (stateUsed->lifeData.desaturation_time_minutes == 0)))
832 if((!display_count_high_time) && (stateUsed->lifeData.no_fly_time_minutes))
833 { 832 {
834 SSurfacetime NoFlyTime = {0,0,0,0}; 833 SSurfacetime NoFlyTime = {0,0,0,0};
835 t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0); 834 t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0);
836 835
837 if(NoFlyTime.Days) 836 if(NoFlyTime.Days)
1319 count += stateUsed->warnings.ppO2Low; 1318 count += stateUsed->warnings.ppO2Low;
1320 count += stateUsed->warnings.ppO2High; 1319 count += stateUsed->warnings.ppO2High;
1321 //count += stateUsed->warnings.lowBattery; 1320 //count += stateUsed->warnings.lowBattery;
1322 count += stateUsed->warnings.sensorLinkLost; 1321 count += stateUsed->warnings.sensorLinkLost;
1323 count += stateUsed->warnings.fallback; 1322 count += stateUsed->warnings.fallback;
1323 #ifdef ENABLE_BOTTLE_SENSOR
1324 if(stateUsed->warnings.newPressure)
1325 {
1326 count++;
1327 }
1328 #endif
1324 return count; 1329 return count;
1325 } 1330 }
1326 1331
1327 1332
1328 uint8_t t7_test_customview_warnings_surface_mode(void) 1333 uint8_t t7_test_customview_warnings_surface_mode(void)
1329 { 1334 {
1330 uint8_t count = 0; 1335 uint8_t count = 0;
1331 count = 0; 1336 count = 0;
1332 count += stateUsed->cnsHigh_at_the_end_of_dive; 1337 count += stateUsed->cnsHigh_at_the_end_of_dive;
1333 count += stateUsed->decoMissed_at_the_end_of_dive; 1338 count += stateUsed->decoMissed_at_the_end_of_dive;
1339 #ifdef ENABLE_BOTTLE_SENSOR
1340 if(stateUsed->warnings.newPressure)
1341 {
1342 count++;
1343 }
1344 #endif
1334 return count; 1345 return count;
1335 } 1346 }
1336 1347
1337 1348
1338 void t7_show_customview_warnings_surface_mode(void) 1349 void t7_show_customview_warnings_surface_mode(void)
1367 text[textpointer++] = '\n'; 1378 text[textpointer++] = '\n';
1368 text[textpointer++] = '\r'; 1379 text[textpointer++] = '\r';
1369 text[textpointer] = 0; 1380 text[textpointer] = 0;
1370 lineFree--; 1381 lineFree--;
1371 } 1382 }
1383 #ifdef ENABLE_BOTTLE_SENSOR
1384 if(stateUsed->warnings.newPressure)
1385 {
1386 sprintf(&text[textpointer] ," %u Bar\n", stateUsed->warnings.newPressure);
1387 textpointer++;
1388 lineFree--;
1389 }
1390 #endif
1372 if(textpointer != 0) 1391 if(textpointer != 0)
1373 GFX_write_string(&FontT48,&t7cW,text,1); 1392 GFX_write_string(&FontT48,&t7cW,text,1);
1374 } 1393 }
1375 1394
1376 1395
1436 text[textpointer++] = '\n'; 1455 text[textpointer++] = '\n';
1437 text[textpointer++] = '\r'; 1456 text[textpointer++] = '\r';
1438 text[textpointer] = 0; 1457 text[textpointer] = 0;
1439 lineFree--; 1458 lineFree--;
1440 } 1459 }
1460 #ifdef ENABLE_BOTTLE_SENSOR
1461 if(stateUsed->warnings.newPressure)
1462 {
1463 sprintf(&text[textpointer]," %u Bar\n", stateUsed->warnings.newPressure);
1464 textpointer++;
1465 lineFree--;
1466 }
1467 #endif
1441 /* 1468 /*
1442 if(lineFree && stateUsed->warnings.lowBattery) 1469 if(lineFree && stateUsed->warnings.lowBattery)
1443 { 1470 {
1444 text[textpointer++] = TXT_2BYTE; 1471 text[textpointer++] = TXT_2BYTE;
1445 text[textpointer++] = TXT2BYTE_WarnBatteryLow; 1472 text[textpointer++] = TXT2BYTE_WarnBatteryLow;