comparison Discovery/Src/tMenuEditHardware.c @ 92:be35821a4974 kittz

Stable to test. button sensitiveness fix. + global_constants.
author Dmitry Romanov <kitt@bk.ru>
date Mon, 26 Nov 2018 10:50:39 +0300
parents 5f11787b4f42
children 3834b6272ee5
comparison
equal deleted inserted replaced
91:8b0fadd413c6 92:be35821a4974
34 #include "gfx_fonts.h" 34 #include "gfx_fonts.h"
35 #include "ostc.h" 35 #include "ostc.h"
36 #include "tCCR.h" 36 #include "tCCR.h"
37 #include "tMenuEdit.h" 37 #include "tMenuEdit.h"
38 38
39
39 /* Private function prototypes -----------------------------------------------*/ 40 /* Private function prototypes -----------------------------------------------*/
40 void openEdit_Bluetooth(void); 41 void openEdit_Bluetooth(void);
41 void openEdit_Compass(void); 42 void openEdit_Compass(void);
42 void openEdit_O2Sensors(void); 43 void openEdit_O2Sensors(void);
43 void openEdit_Brightness(void); 44 void openEdit_Brightness(void);
756 uint32_t newSensitivityGlobal; 757 uint32_t newSensitivityGlobal;
757 758
758 if(action == ACTION_BUTTON_NEXT) 759 if(action == ACTION_BUTTON_NEXT)
759 { 760 {
760 digitContentNew = digitContent - '0'; 761 digitContentNew = digitContent - '0';
761 if(digitContentNew >= 110) 762 if(digitContentNew >= MAX_BUTTONRESPONSIVENESS_GUI)
762 { 763 {
763 digitContentNew = 70; 764 digitContentNew = MIN_BUTTONRESPONSIVENESS_GUI;
764 } 765 }
765 else 766 else
766 { 767 {
767 remainder = digitContentNew%5; 768 remainder = digitContentNew%5;
768 digitContentNew += 5 - remainder; 769 digitContentNew += 5 - remainder;
769 if(digitContentNew >= 110) 770 if(digitContentNew >= MAX_BUTTONRESPONSIVENESS_GUI)
770 digitContentNew = 110; 771 digitContentNew = MAX_BUTTONRESPONSIVENESS_GUI;
771 } 772 }
772 return '0' + digitContentNew; 773 return '0' + digitContentNew;
773 } 774 }
774 775
775 if(action == ACTION_BUTTON_BACK) 776 if(action == ACTION_BUTTON_BACK)
776 { 777 {
777 digitContentNew = digitContent - '0'; 778 digitContentNew = digitContent - '0';
778 if(digitContentNew <= 70) 779 if(digitContentNew <= MIN_BUTTONRESPONSIVENESS_GUI)
779 digitContentNew = 110; 780 digitContentNew = MAX_BUTTONRESPONSIVENESS_GUI;
780 else 781 else
781 { 782 {
782 remainder = digitContentNew%5; 783 remainder = digitContentNew%5;
783 if(remainder) 784 if(remainder)
784 digitContentNew -= remainder; 785 digitContentNew -= remainder;