comparison Discovery/Src/t7.c @ 379:0dbf550dc743 MotionDetection

Added missing customerview selection In the previous version only 6 out of 10 custom views could be configurated => Added a second page for the dive menu system tab In case all views are deactivated the none / debug page will be set as default
author ideenmodellierer
date Mon, 16 Sep 2019 22:49:34 +0200
parents ef1b8579166c
children 14fd5f35cb50
comparison
equal deleted inserted replaced
378:834e087505ec 379:0dbf550dc743
1499 selection_customview = settingsGetPointer()->tX_customViewPrimary; 1499 selection_customview = settingsGetPointer()->tX_customViewPrimary;
1500 } 1500 }
1501 1501
1502 uint8_t t7_GetEnabled_customviews() 1502 uint8_t t7_GetEnabled_customviews()
1503 { 1503 {
1504 int8_t i;
1504 uint8_t *pViews; 1505 uint8_t *pViews;
1505 uint8_t increment = 1; 1506 uint8_t increment = 1;
1506 1507
1507 uint8_t enabledViewCnt = 0; 1508 uint8_t enabledViewCnt = 0;
1508 uint32_t cv_config = settingsGetPointer()->cv_configuration; 1509 uint32_t cv_config = settingsGetPointer()->cv_configuration;
1514 1515
1515 while((*pViews != CVIEW_END)) 1516 while((*pViews != CVIEW_END))
1516 { 1517 {
1517 increment = 1; 1518 increment = 1;
1518 /* check if view is enabled */ 1519 /* check if view is enabled */
1519 for(int i=0;i<6;i++) 1520 i=0;
1520 { 1521 do
1521 if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(cv_config, (1 << cv_changelist[i]))) 1522 {
1523 if(*pViews == cv_changelist[i])
1522 { 1524 {
1523 increment = 0; 1525 if(!CHECK_BIT_THOME(cv_config, cv_changelist[i]))
1524 break; 1526 {
1527 increment = 0;
1528 }
1529 break;
1525 } 1530 }
1526 } 1531 i++;
1532 } while(cv_changelist[i] != CVIEW_END);
1533 if(cv_changelist[i] == CVIEW_END)
1534 {
1535 increment = 0;
1536 }
1527 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && 1537 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) &&
1528 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) 1538 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0)))
1529 { 1539 {
1530 increment = 0; 1540 increment = 0;
1531 } 1541 }
1536 return enabledViewCnt; 1546 return enabledViewCnt;
1537 } 1547 }
1538 1548
1539 void t7_change_customview(uint8_t action) 1549 void t7_change_customview(uint8_t action)
1540 { 1550 {
1551 int8_t i;
1541 uint8_t *pViews; 1552 uint8_t *pViews;
1542 uint8_t *pStartView,*pCurView, *pLastView; 1553 uint8_t *pStartView,*pCurView, *pLastView;
1543 _Bool cv_disabled = 0; 1554 _Bool cv_disabled = 0;
1544 1555
1545 if(stateUsed->mode == MODE_DIVE) 1556 if(stateUsed->mode == MODE_DIVE)
1583 } 1594 }
1584 1595
1585 do 1596 do
1586 { 1597 {
1587 cv_disabled = 0; 1598 cv_disabled = 0;
1588 for(int i=0;i<6;i++) 1599 i=0;
1600 while(cv_changelist[i] != CVIEW_END)
1589 { 1601 {
1590 if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i])) 1602 if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i]))
1591 { 1603 {
1592 cv_disabled = 1; 1604 cv_disabled = 1;
1593 break; 1605 break;
1594 } 1606 }
1607 i++;
1595 } 1608 }
1596 1609
1597 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && 1610 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) &&
1598 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) 1611 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0)))
1599 { 1612 {