comparison Discovery/Src/t7.c @ 482:230aed360da0

Merged in Ideenmodellierer/ostc4/Improve_Button_Sleep (pull request #45) Improve Button Sleep
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Tue, 19 May 2020 07:27:18 +0000
parents 89f6857276f8
children fa8b09544b3d
comparison
equal deleted inserted replaced
472:8a375f0544d9 482:230aed360da0
787 787
788 if(!DataEX_was_power_on() && !errorsInSettings) 788 if(!DataEX_was_power_on() && !errorsInSettings)
789 { 789 {
790 text[0] = '\001'; 790 text[0] = '\001';
791 text[1] = '\004'; 791 text[1] = '\004';
792 text[2] = TXT_2BYTE; 792 text[2] = '\016';
793 text[3] = TXT2BYTE_Sunday; 793 text[3] = '\016';
794 text[4] = 0; 794 text[4] = TXT_2BYTE;
795 text[5] = TXT2BYTE_Sunday;
796 text[6] = 0;
795 if(Sdate.WeekDay != RTC_WEEKDAY_SUNDAY) 797 if(Sdate.WeekDay != RTC_WEEKDAY_SUNDAY)
796 text[3] += Sdate.WeekDay; 798 text[5] += Sdate.WeekDay;
797 799
798 if(!(Stime.Seconds % 2) && (dateNotSet == 1)) 800 if(!(Stime.Seconds % 2) && (dateNotSet == 1))
799 text[1] = '\021'; 801 text[1] = '\021';
800 802
801 GFX_write_string(&FontT24,&t7surfaceR,text,4); 803 GFX_write_string(&FontT48,&t7surfaceR,text,4);
802 } 804 }
803 805
804 /* DEBUG uTick Pressure and Compass */ 806 /* DEBUG uTick Pressure and Compass */
805 /* 807 /*
806 snprintf(text,255,"\001%u",stateRealGetPointer()->pressure_uTick_new - stateRealGetPointer()->pressure_uTick_old); 808 snprintf(text,255,"\001%u",stateRealGetPointer()->pressure_uTick_new - stateRealGetPointer()->pressure_uTick_old);
826 text[bildschirmRefreshCount++] = 0; 828 text[bildschirmRefreshCount++] = 0;
827 GFX_write_string(&FontT42,&t7surfaceR,text,4); 829 GFX_write_string(&FontT42,&t7surfaceR,text,4);
828 */ 830 */
829 831
830 /* noFlyTime or DesaturationTime */ 832 /* noFlyTime or DesaturationTime */
831 833 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 { 834 {
834 SSurfacetime NoFlyTime = {0,0,0,0}; 835 SSurfacetime NoFlyTime = {0,0,0,0};
835 t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0); 836 t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0);
836 837
837 if(NoFlyTime.Days) 838 if(NoFlyTime.Days)
1319 count += stateUsed->warnings.ppO2Low; 1320 count += stateUsed->warnings.ppO2Low;
1320 count += stateUsed->warnings.ppO2High; 1321 count += stateUsed->warnings.ppO2High;
1321 //count += stateUsed->warnings.lowBattery; 1322 //count += stateUsed->warnings.lowBattery;
1322 count += stateUsed->warnings.sensorLinkLost; 1323 count += stateUsed->warnings.sensorLinkLost;
1323 count += stateUsed->warnings.fallback; 1324 count += stateUsed->warnings.fallback;
1325 #ifdef ENABLE_BOTTLE_SENSOR
1326 if(stateUsed->warnings.newPressure)
1327 {
1328 count++;
1329 }
1330 #endif
1324 return count; 1331 return count;
1325 } 1332 }
1326 1333
1327 1334
1328 uint8_t t7_test_customview_warnings_surface_mode(void) 1335 uint8_t t7_test_customview_warnings_surface_mode(void)
1329 { 1336 {
1330 uint8_t count = 0; 1337 uint8_t count = 0;
1331 count = 0; 1338 count = 0;
1332 count += stateUsed->cnsHigh_at_the_end_of_dive; 1339 count += stateUsed->cnsHigh_at_the_end_of_dive;
1333 count += stateUsed->decoMissed_at_the_end_of_dive; 1340 count += stateUsed->decoMissed_at_the_end_of_dive;
1341 #ifdef ENABLE_BOTTLE_SENSOR
1342 if(stateUsed->warnings.newPressure)
1343 {
1344 count++;
1345 }
1346 #endif
1334 return count; 1347 return count;
1335 } 1348 }
1336 1349
1337 1350
1338 void t7_show_customview_warnings_surface_mode(void) 1351 void t7_show_customview_warnings_surface_mode(void)
1367 text[textpointer++] = '\n'; 1380 text[textpointer++] = '\n';
1368 text[textpointer++] = '\r'; 1381 text[textpointer++] = '\r';
1369 text[textpointer] = 0; 1382 text[textpointer] = 0;
1370 lineFree--; 1383 lineFree--;
1371 } 1384 }
1385 #ifdef ENABLE_BOTTLE_SENSOR
1386 if(stateUsed->warnings.newPressure)
1387 {
1388 sprintf(&text[textpointer] ," %u Bar\n", stateUsed->warnings.newPressure);
1389 textpointer++;
1390 lineFree--;
1391 }
1392 #endif
1372 if(textpointer != 0) 1393 if(textpointer != 0)
1373 GFX_write_string(&FontT48,&t7cW,text,1); 1394 GFX_write_string(&FontT48,&t7cW,text,1);
1374 } 1395 }
1375 1396
1376 1397
1436 text[textpointer++] = '\n'; 1457 text[textpointer++] = '\n';
1437 text[textpointer++] = '\r'; 1458 text[textpointer++] = '\r';
1438 text[textpointer] = 0; 1459 text[textpointer] = 0;
1439 lineFree--; 1460 lineFree--;
1440 } 1461 }
1462 #ifdef ENABLE_BOTTLE_SENSOR
1463 if(stateUsed->warnings.newPressure)
1464 {
1465 sprintf(&text[textpointer]," %u Bar\n", stateUsed->warnings.newPressure);
1466 textpointer++;
1467 lineFree--;
1468 }
1469 #endif
1441 /* 1470 /*
1442 if(lineFree && stateUsed->warnings.lowBattery) 1471 if(lineFree && stateUsed->warnings.lowBattery)
1443 { 1472 {
1444 text[textpointer++] = TXT_2BYTE; 1473 text[textpointer++] = TXT_2BYTE;
1445 text[textpointer++] = TXT2BYTE_WarnBatteryLow; 1474 text[textpointer++] = TXT2BYTE_WarnBatteryLow;