Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 724:03f8a8eec9ae
correct diluent store address
author | heinrichsweikamp |
---|---|
date | Wed, 29 May 2013 14:41:34 +0200 |
parents | 91ae251d379f |
children |
comparison
equal
deleted
inserted
replaced
723:6fd9a9feca91 | 724:03f8a8eec9ae |
---|---|
45 ;Byte114-115: | 45 ;Byte114-115: |
46 ;Diluent 5 Current (%O2,%He) | 46 ;Diluent 5 Current (%O2,%He) |
47 ;Byte116: | 47 ;Byte116: |
48 ;First Diluent (1-5) | 48 ;First Diluent (1-5) |
49 | 49 |
50 ; EEPROM BANK0 Byte96-97: | |
51 ; Diluent 1 (%O2,%He) | |
52 ; EEPROM BANK0 Byte98-99: | |
53 ; Diluent 2 (%O2,%He) | |
54 ; EEPROM BANK0 Byte100-101: | |
55 ; Diluent 3 (%O2,%He) | |
56 ; EEPROM BANK0 Byte102-103: | |
57 ; Diluent 4 (%O2,%He) | |
58 ; EEPROM BANK0 Byte104-105: | |
59 ; Diluent 5 (%O2,%He) | |
60 ; EEPROM BANK0 Byte106: | |
61 ; First Diluent (1-5) | |
62 | |
63 | |
64 menu_const_ppO2: | 50 menu_const_ppO2: |
65 movlw d'1' | 51 movlw d'1' |
66 movwf menupos | 52 movwf menupos |
67 menu_const_ppO2_return: | 53 menu_const_ppO2_return: |
68 call DISP_ClearScreen | 54 call DISP_ClearScreen |
119 call DISP_standard_color | 105 call DISP_standard_color |
120 clrf decodata+0 ; Here: # of gas 0-4 | 106 clrf decodata+0 ; Here: # of gas 0-4 |
121 clrf divemins+0 ; Here: # of Gas * 4 | 107 clrf divemins+0 ; Here: # of Gas * 4 |
122 movlw d'5' | 108 movlw d'5' |
123 movwf waitms_temp ; here: stores row for gas list | 109 movwf waitms_temp ; here: stores row for gas list |
124 movlw d'93' | 110 movlw d'94' |
125 movwf wait_temp ; here: stores eeprom address for gas list | 111 movwf wait_temp ; here: stores eeprom address for gas list |
126 | 112 |
127 menu_diluentsetup_list: | 113 menu_diluentsetup_list: |
128 WIN_LEFT .20 | 114 WIN_LEFT .20 |
129 movlw d'4' | 115 movlw d'4' |
159 WIN_LEFT .48 | 145 WIN_LEFT .48 |
160 movf waitms_temp,W ; Load row into WREG | 146 movf waitms_temp,W ; Load row into WREG |
161 movff WREG,win_top | 147 movff WREG,win_top |
162 lfsr FSR2,letter | 148 lfsr FSR2,letter |
163 | 149 |
164 movff wait_temp, EEADR ; Gas %He - Set address in internal EEPROM | 150 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM |
165 incf EEADR,F ; Gas %He - Set address in internal EEPROM | 151 incf EEADR,F ; Gas %He - Set address in internal EEPROM |
166 call read_eeprom ; Read He value from EEPROM | 152 call read_eeprom ; Read He value from EEPROM |
167 movff EEDATA,lo ; Move EEDATA -> lo | 153 movff EEDATA,lo ; Move EEDATA -> lo |
168 movf lo,f ; Move lo -> f | 154 movf lo,f ; Move lo -> f |
169 movlw d'0' ; Move 0 -> WREG | 155 movlw d'0' ; Move 0 -> WREG |
281 bra menu_const_ppO2 ; Exit List | 267 bra menu_const_ppO2 ; Exit List |
282 | 268 |
283 diluent_list_edit_gas1: | 269 diluent_list_edit_gas1: |
284 movlw d'0' ; Diluent Number 0-4 | 270 movlw d'0' ; Diluent Number 0-4 |
285 movwf decodata+0 | 271 movwf decodata+0 |
286 movlw d'91' ; EEPROM address of %O2 | 272 movlw d'92' ; EEPROM address of Dil 1 %O2 default - 4 |
287 movwf divemins+0 | 273 movwf divemins+0 |
288 bra menu_diluentgas | 274 bra menu_diluentgas |
289 diluent_list_edit_gas2: | 275 diluent_list_edit_gas2: |
290 movlw d'1' ; Diluent Number 0-4 | 276 movlw d'1' ; Diluent Number 0-4 |
291 movwf decodata+0 | 277 movwf decodata+0 |
292 movlw d'95' ; EEPROM address of %O2 | 278 movlw d'96' ; EEPROM address of Dil 2 %O2 default - 4 |
293 movwf divemins+0 | 279 movwf divemins+0 |
294 bra menu_diluentgas | 280 bra menu_diluentgas |
295 diluent_list_edit_gas3: | 281 diluent_list_edit_gas3: |
296 movlw d'2' ; Diluent Number 0-4 | 282 movlw d'2' ; Diluent Number 0-4 |
297 movwf decodata+0 | 283 movwf decodata+0 |
298 movlw d'99' ; EEPROM address of %O2 | 284 movlw d'100' ; EEPROM address of Dil 3 %O2 default - 4 |
299 movwf divemins+0 | 285 movwf divemins+0 |
300 bra menu_diluentgas | 286 bra menu_diluentgas |
301 diluent_list_edit_gas4: | 287 diluent_list_edit_gas4: |
302 movlw d'3' ; Diluent Number 0-4 | 288 movlw d'3' ; Diluent Number 0-4 |
303 movwf decodata+0 | 289 movwf decodata+0 |
304 movlw d'103' ; EEPROM address of %O2 | 290 movlw d'104' ; EEPROM address of Dil 4 %O2 default - 4 |
305 movwf divemins+0 | 291 movwf divemins+0 |
306 bra menu_diluentgas | 292 bra menu_diluentgas |
307 diluent_list_edit_gas5: | 293 diluent_list_edit_gas5: |
308 movlw d'4' ; Diluent Number 0-4 | 294 movlw d'4' ; Diluent Number 0-4 |
309 movwf decodata+0 | 295 movwf decodata+0 |
310 movlw d'107' ; EEPROM address of %O2 | 296 movlw d'108' ; EEPROM address of Dil 5 %O2 default - 4 |
311 movwf divemins+0 | 297 movwf divemins+0 |
312 ; bra menu_diluentgas | 298 ; bra menu_diluentgas |
313 menu_diluentgas: | 299 menu_diluentgas: |
314 movlw d'1' | 300 movlw d'1' |
315 movwf menupos | 301 movwf menupos |
672 addlw 0x05 | 658 addlw 0x05 |
673 movwf EEADR | 659 movwf EEADR |
674 call read_eeprom ; High-value | 660 call read_eeprom ; High-value |
675 movff EEDATA,hi | 661 movff EEDATA,hi |
676 | 662 |
677 movf divemins+0,W ; save Default value | 663 movf divemins+0,W ; save current value |
678 addlw 0x06 | 664 addlw 0x06 |
679 movwf EEADR | 665 movwf EEADR |
680 movff lo,EEDATA | 666 movff lo,EEDATA |
681 call write_eeprom ; Low-value | 667 call write_eeprom ; Low-value |
682 movf divemins+0,W | 668 movf divemins+0,W |
991 | 977 |
992 get_first_diluent: ; Read first diluent into lo(O2) and hi(He) | 978 get_first_diluent: ; Read first diluent into lo(O2) and hi(He) |
993 read_int_eeprom d'116' ; Read First Diluent (1-5) | 979 read_int_eeprom d'116' ; Read First Diluent (1-5) |
994 movf EEDATA,W ; WREG: 0-4 | 980 movf EEDATA,W ; WREG: 0-4 |
995 mullw .4 ; PRODL: 0-16 | 981 mullw .4 ; PRODL: 0-16 |
996 movlw .93 ; Base address for O2 | 982 movlw .94 ; Base address for O2 |
997 addwf PRODL,W | 983 addwf PRODL,W |
998 movwf EEADR | 984 movwf EEADR |
999 call read_eeprom ; Read O2 | 985 call read_eeprom ; Read O2 |
1000 movff EEDATA,lo | 986 movff EEDATA,lo |
1001 incf EEADR,F | 987 incf EEADR,F |