Mercurial > public > ostc4
comparison Discovery/Src/t7.c @ 365:c18aebb03fed MotionDetection
Bugfix: selection of current view not working
author | ideenmodellierer |
---|---|
date | Mon, 17 Jun 2019 19:53:01 +0200 |
parents | b111fc4250e9 |
children | 3c7030d6d67a |
comparison
equal
deleted
inserted
replaced
364:3014a698f46d | 365:c18aebb03fed |
---|---|
1479 selection_customview = settingsGetPointer()->tX_customViewPrimary; | 1479 selection_customview = settingsGetPointer()->tX_customViewPrimary; |
1480 } | 1480 } |
1481 | 1481 |
1482 void t7_change_customview(uint8_t action) | 1482 void t7_change_customview(uint8_t action) |
1483 { | 1483 { |
1484 const uint8_t *pViews; | 1484 uint8_t *pViews; |
1485 uint8_t *pStartView,*pCurView, *pLastView; | 1485 uint8_t *pStartView,*pCurView, *pLastView; |
1486 _Bool cv_disabled = 0; | 1486 _Bool cv_disabled = 0; |
1487 | 1487 |
1488 if(stateUsed->mode == MODE_DIVE) | 1488 if(stateUsed->mode == MODE_DIVE) |
1489 pViews = customviewsDive; | 1489 pViews = customviewsDive; |
1513 pViews = pStartView; | 1513 pViews = pStartView; |
1514 } | 1514 } |
1515 } | 1515 } |
1516 else | 1516 else |
1517 { | 1517 { |
1518 pViews--; | 1518 if(pViews == pStartView) |
1519 if(pViews = pStartView) | |
1520 { | 1519 { |
1521 pViews = pLastView - 1; | 1520 pViews = pLastView - 1; |
1522 } | 1521 } |
1523 } | 1522 else |
1524 if(stateUsed->mode == MODE_DIVE) | 1523 { |
1525 { | 1524 pViews--; |
1526 do | 1525 } |
1527 { | 1526 } |
1528 cv_disabled = 0; | 1527 |
1529 for(int i=0;i<6;i++) | 1528 do |
1530 { | 1529 { |
1531 if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i])) | 1530 cv_disabled = 0; |
1532 { | 1531 for(int i=0;i<6;i++) |
1533 cv_disabled = 1; | 1532 { |
1534 break; | 1533 if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i])) |
1535 } | 1534 { |
1536 } | 1535 cv_disabled = 1; |
1537 | 1536 break; |
1538 if ((*pViews == CVIEW_sensors || *pViews == CVIEW_sensors_mV) && | 1537 } |
1539 stateUsed->diveSettings.ppo2sensors_deactivated) | 1538 } |
1540 { | 1539 |
1541 cv_disabled = 1; | 1540 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && |
1542 } | 1541 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) |
1543 | 1542 { |
1544 if(cv_disabled) /* view is disabled => jump to next view */ | 1543 cv_disabled = 1; |
1545 { | 1544 } |
1545 | |
1546 if(cv_disabled) /* view is disabled => jump to next view */ | |
1547 { | |
1546 if((action == ACTION_BUTTON_ENTER) || (action == ACTION_SHAKE_POS)) | 1548 if((action == ACTION_BUTTON_ENTER) || (action == ACTION_SHAKE_POS)) |
1547 { | 1549 { |
1548 pViews++; | 1550 pViews++; |
1549 if(*pViews == CVIEW_END) | 1551 if(*pViews == CVIEW_END) |
1550 { | 1552 { |
1551 pViews = pStartView; | 1553 pViews = pStartView; |
1552 } | 1554 } |
1553 } | 1555 } |
1554 else | 1556 else |
1555 { | 1557 { |
1556 pViews--; | |
1557 if(pViews == pStartView) | 1558 if(pViews == pStartView) |
1558 { | 1559 { |
1559 pViews = pLastView - 1; | 1560 pViews = pLastView - 1; |
1561 } | |
1562 else | |
1563 { | |
1564 pViews--; | |
1560 } | 1565 } |
1561 } | 1566 } |
1562 } | 1567 } |
1563 } while(cv_disabled); | 1568 } while(cv_disabled); |
1564 } | 1569 } |