comparison code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 816:df8cd5ffd993

BUGFIX: Load first diluent if <> 1 correctly Auto-SP change work...
author heinrichsweikamp
date Sat, 16 May 2015 14:48:26 +0200
parents 2a0e5d884fc3
children e49a35ab7394
comparison
equal deleted inserted replaced
815:2a0e5d884fc3 816:df8cd5ffd993
64 menu_const_ppO2: 64 menu_const_ppO2:
65 movlw d'1' 65 movlw d'1'
66 movwf menupos 66 movwf menupos
67 menu_const_ppO2_return: 67 menu_const_ppO2_return:
68 call DISP_ClearScreen 68 call DISP_ClearScreen
69 menu_const_ppO2_return2:
69 call DISP_ccr_setup_menu_mask 70 call DISP_ccr_setup_menu_mask
70 call refresh_cursor 71 call refresh_cursor
71 call menu_pre_loop_common 72 call menu_pre_loop_common
73 call show_sp_mode
72 74
73 menu_const_ppO2_preloop: 75 menu_const_ppO2_preloop:
74 call check_switches_menu 76 call check_switches_menu
75 movlw d'3' 77 movlw d'4'
76 cpfseq menupos 78 cpfseq menupos
77 bra menu_const_ppO2_preloop2 ; Returns 79 bra menu_const_ppO2_preloop2 ; Returns
78 movlw d'6' 80 movlw d'6'
79 movwf menupos 81 movwf menupos
80 call DISP_menu_cursor 82 call DISP_menu_cursor
83
81 84
82 menu_const_ppO2_preloop2: 85 menu_const_ppO2_preloop2:
83 btfsc menubit2 86 btfsc menubit2
84 bra do_ccr_pre_menu ; call submenu 87 bra do_ccr_pre_menu ; call submenu
85 btfss menubit 88 btfss menubit
95 dcfsnz menupos,F 98 dcfsnz menupos,F
96 goto menu_diluentsetup 99 goto menu_diluentsetup
97 dcfsnz menupos,F 100 dcfsnz menupos,F
98 goto menu_const_ppO2_setpoints 101 goto menu_const_ppO2_setpoints
99 dcfsnz menupos,F 102 dcfsnz menupos,F
100 goto exit_menu_const_ppO2 ; exit... 103 goto menu_const_ppO2_toggle_mode
101 dcfsnz menupos,F 104 dcfsnz menupos,F
102 goto exit_menu_const_ppO2 ; exit... 105 goto exit_menu_const_ppO2 ; exit...
103 dcfsnz menupos,F 106 dcfsnz menupos,F
104 goto exit_menu_const_ppO2 ; exit... 107 goto exit_menu_const_ppO2 ; exit...
105 exit_menu_const_ppO2: ; exit... 108 exit_menu_const_ppO2: ; exit...
106 movlw d'2' 109 movlw d'2'
107 movwf menupos 110 movwf menupos
108 goto more_menu2 111 goto more_menu2
112
113 menu_const_ppO2_toggle_mode:
114 read_int_eeprom .116 ; SP Mode
115 movlw .1 ; Preload 1
116 tstfsz EEDATA ; =0?
117 movlw .0 ; No.
118 movwf EEDATA ; Set new value
119 write_int_eeprom .116 ; write back result
120 movlw d'3'
121 movwf menupos
122 goto menu_const_ppO2_return2 ; Done.
123
124 show_sp_mode:
125 read_int_eeprom .116 ; SP Mode
126 tstfsz EEDATA ; =0?
127 bra show_sp_mode2 ; No
128 DISPLAYTEXTH .312 ; =0: Manual
129 return
130 show_sp_mode2:
131 DISPLAYTEXTH .313 ; =1: Auto
132 return
133
109 134
110 menu_diluentsetup: 135 menu_diluentsetup:
111 movlw d'1' 136 movlw d'1'
112 movwf menupos 137 movwf menupos
113 138
931 movwf EEADR 956 movwf EEADR
932 call read_eeprom ; Low-value 957 call read_eeprom ; Low-value
933 movff EEDATA,lo 958 movff EEDATA,lo
934 959
935 incf lo,F ; increase depth 960 incf lo,F ; increase depth
936 movlw d'251' 961 movlw d'201'
937 cpfseq lo 962 cpfseq lo
938 bra change_ppo2_plus2 963 bra change_ppo2_plus2
939 movlw d'250' 964 movlw d'200'
940 movwf lo 965 movwf lo
941 change_ppo2_plus2: 966 change_ppo2_plus2:
942 movff lo,EEDATA ; write result 967 movff lo,EEDATA ; write result
943 call write_eeprom ; save result in EEPROM 968 call write_eeprom ; save result in EEPROM
944 movlw d'3' 969 movlw d'3'
951 movwf EEADR 976 movwf EEADR
952 call read_eeprom ; Low-value 977 call read_eeprom ; Low-value
953 movff EEDATA,lo 978 movff EEDATA,lo
954 979
955 decf lo,F ; decrease depth 980 decf lo,F ; decrease depth
956 movlw d'255' 981 movlw d'29'
957 cpfseq lo 982 cpfseq lo
958 bra change_ppo2_minus2 983 bra change_ppo2_minus2
959 movlw d'0' 984 movlw d'30'
960 movwf lo 985 movwf lo
961 986
962 change_ppo2_minus2: 987 change_ppo2_minus2:
963 movff lo,EEDATA ; write result 988 movff lo,EEDATA ; write result
964 call write_eeprom ; save result in EEPROM 989 call write_eeprom ; save result in EEPROM