comparison Discovery/Src/tMenu.c @ 662:1b995079c045 Betatest

PSCR Mode
author heinrichs weikamp
date Tue, 14 Dec 2021 15:36:10 +0100
parents 4df22790dc0c
children 6169309d6eb9
comparison
equal deleted inserted replaced
661:87bee7cc77b3 662:1b995079c045
56 #define TAB_HEADER_HIGH 25 56 #define TAB_HEADER_HIGH 25
57 #define TAB_BAR_HIGH 5 57 #define TAB_BAR_HIGH 5
58 #define MENU_WDW_HIGH 390 58 #define MENU_WDW_HIGH 390
59 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */ 59 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */
60 60
61 #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */
62
61 typedef struct 63 typedef struct
62 { 64 {
63 uint32_t StartAddressForPage[MAXPAGES+1]; 65 uint32_t StartAddressForPage[MAXPAGES+1];
64 uint8_t lineMemoryForNavigationForPage[MAXPAGES+1]; 66 uint8_t lineMemoryForNavigationForPage[MAXPAGES+1];
65 uint8_t pageMemoryForNavigation; 67 uint8_t pageMemoryForNavigation;
528 // if((pSettings->dive_mode != DIVEMODE_Gauge) && (pSettings->dive_mode != DIVEMODE_Apnea)) 530 // if((pSettings->dive_mode != DIVEMODE_Gauge) && (pSettings->dive_mode != DIVEMODE_Apnea))
529 // { 531 // {
530 tM_add(StMDECOP); 532 tM_add(StMDECOP);
531 // } 533 // }
532 534
533 if((pSettings->dive_mode == DIVEMODE_CCR) || (stateUsed->diveSettings.ccrOption == 1)) 535 if((isLoopMode(pSettings->dive_mode)) || (stateUsed->diveSettings.ccrOption == 1))
534 { 536 {
535 tM_add(StMCG); 537 tM_add(StMCG);
536 tM_add(StMSP); 538 tM_add(StMSP);
537 if (actual_menu_content == MENU_SURFACE) /* StMOG is now accessed using StMCG in CCR mode*/ 539 if (actual_menu_content == MENU_SURFACE) /* StMOG is now accessed using StMCG in CCR mode*/
538 { 540 {
584 } 586 }
585 587
586 588
587 void tM_refresh_live_content(void) 589 void tM_refresh_live_content(void)
588 { 590 {
591 static uint8_t slowUpdate = SLOW_UPDATE_CNT;
589 uint8_t page = 0; 592 uint8_t page = 0;
590 char text[MAX_PAGE_TEXTSIZE]; 593 char text[MAX_PAGE_TEXTSIZE];
591 char subtext[MAX_PAGE_TEXTSIZE]; 594 char subtext[MAX_PAGE_TEXTSIZE];
592 uint16_t tabPosition; 595 uint16_t tabPosition;
593 596
594 if((get_globalState() == StMSYS) && (actual_menu_content == MENU_SURFACE)) 597 uint32_t globalState = get_globalState();
595 { 598
596 page = menu.pageMemoryForNavigation; 599 slowUpdate--;
597 tMSystem_refresh(0, text, &tabPosition, subtext); 600 page = menu.pageMemoryForNavigation;
598 update_content_with_new_frame(page, text, tabPosition, subtext); 601 switch(globalState)
599 } 602 {
600 else 603 case StMSYS: if(actual_menu_content == MENU_SURFACE)
601 if(get_globalState() == StMHARD) 604 {
602 { 605 tMSystem_refresh(0, text, &tabPosition, subtext);
603 page = menu.pageMemoryForNavigation; 606 update_content_with_new_frame(page, text, tabPosition, subtext);
604 tMHardware_refresh(0, text, &tabPosition, subtext); 607 }
605 update_content_with_new_frame(page, text, tabPosition, subtext); 608 break;
609 case StMHARD: tMHardware_refresh(0, text, &tabPosition, subtext);
610 update_content_with_new_frame(page, text, tabPosition, subtext);
611 break;
612 case StMOG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0))
613 {
614 tMOG_refresh(0, text, &tabPosition, subtext);
615 update_content_with_new_frame(page, text, tabPosition, subtext);
616 }
617 break;
618 case StMCG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0))
619 {
620 tMCG_refresh(0, text, &tabPosition, subtext);
621 update_content_with_new_frame(page, text, tabPosition, subtext);
622 }
623 break;
624 default:
625 break;
626 }
627 if(slowUpdate == 0)
628 {
629 slowUpdate = SLOW_UPDATE_CNT;
606 } 630 }
607 631
608 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; 632 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
609 tHome_show_lost_connection_count(&tMscreen); 633 tHome_show_lost_connection_count(&tMscreen);
610 /* 634 /*