comparison Discovery/Src/t7.c @ 740:5078da3845c0

Added button lock after wakeup in surface mode: During setup of diveequipment the OSTC4 is sometimes operated unintended (e.g. while equipping the jaket). To avoid this it is now possible to activate a button lock in the button lock sensitivity menu. The OSTC4 will then wakeup as usuall but if the diver wants to oerate the menus he has to press the buttons in a certain order. The button to be pressed is indicated by a blue bar. The button lock is deactivated in dive mode.
author Ideenmodellierer
date Thu, 02 Feb 2023 17:35:38 +0100
parents 5071d554aaa5
children 6871d4b586ff
comparison
equal deleted inserted replaced
739:4a6bffaa38b3 740:5078da3845c0
42 #include "simulation.h" 42 #include "simulation.h"
43 #include "timer.h" 43 #include "timer.h"
44 #include "unit.h" 44 #include "unit.h"
45 #include "motion.h" 45 #include "motion.h"
46 #include "configuration.h" 46 #include "configuration.h"
47 #include "base.h"
47 48
48 /* Private function prototypes -----------------------------------------------*/ 49 /* Private function prototypes -----------------------------------------------*/
49 50
50 void t7_refresh_surface(void); 51 void t7_refresh_surface(void);
51 void t7_refresh_surface_debugmode(void); 52 void t7_refresh_surface_debugmode(void);
695 uint8_t hours; 696 uint8_t hours;
696 uint8_t loop, textIdx; 697 uint8_t loop, textIdx;
697 uint8_t date[3], year,month,day; 698 uint8_t date[3], year,month,day;
698 uint32_t color; 699 uint32_t color;
699 uint8_t customview_warnings = 0; 700 uint8_t customview_warnings = 0;
701 SButtonLock ButtonLockState;
700 702
701 RTC_DateTypeDef Sdate; 703 RTC_DateTypeDef Sdate;
702 RTC_TimeTypeDef Stime; 704 RTC_TimeTypeDef Stime;
703 RTC_DateTypeDef SdateFirmware; 705 RTC_DateTypeDef SdateFirmware;
704 706
719 updateNecessary = 1; 721 updateNecessary = 1;
720 else 722 else
721 updateNecessary = 0; 723 updateNecessary = 0;
722 724
723 /* buttons */ 725 /* buttons */
724 text[0] = TXT_2BYTE; 726 ButtonLockState = get_ButtonLock();
725 text[1] = TXT2BYTE_ButtonLogbook; 727 if(ButtonLockState == LOCK_OFF)
726 text[2] = 0; 728 {
727 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); 729 text[0] = TXT_2BYTE;
728 730 text[1] = TXT2BYTE_ButtonLogbook;
729 text[0] = '\001'; 731 text[2] = 0;
730 text[1] = TXT_2BYTE; 732 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen);
731 text[2] = TXT2BYTE_ButtonView; 733
732 text[3] = 0; 734 text[0] = '\001';
733 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); 735 text[1] = TXT_2BYTE;
734 736 text[2] = TXT2BYTE_ButtonView;
735 text[0] = '\002'; 737 text[3] = 0;
736 text[1] = TXT_2BYTE; 738 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen);
737 text[2] = TXT2BYTE_ButtonMenu; 739
738 text[3] = 0; 740 text[0] = '\002';
739 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); 741 text[1] = TXT_2BYTE;
740 742 text[2] = TXT2BYTE_ButtonMenu;
743 text[3] = 0;
744 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen);
745 }
746 else
747 {
748 switch(ButtonLockState)
749 {
750 default:
751 case LOCK_1: snprintf(text,255,"\a\001 ");
752 break;
753 case LOCK_2: snprintf(text,255,"\a\002 ");
754 break;
755 case LOCK_3: snprintf(text,255,"\a ");
756 break;
757 }
758 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen);
759 // GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow);
760 }
741 /* was power on reset */ 761 /* was power on reset */
742 //..... 762 //.....
743 /* removed hw 160802 in V1.1.1 763 /* removed hw 160802 in V1.1.1
744 if(errorsInSettings) 764 if(errorsInSettings)
745 { 765 {