comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 221:448478ceccea

new sorted_gaslist_active flag register
author heinrichsweikamp
date Tue, 01 Mar 2011 11:48:11 +0100
parents 3cf6649e89ac
children 638f8e17bd51
comparison
equal deleted inserted replaced
220:3cf6649e89ac 221:448478ceccea
355 subfwb wait_temp,W ; minus He 355 subfwb wait_temp,W ; minus He
356 subfwb EEDATA,F ; minus O2 356 subfwb EEDATA,F ; minus O2
357 movff EEDATA, char_I_deco_N2_ratio1; = N2! 357 movff EEDATA, char_I_deco_N2_ratio1; = N2!
358 358
359 ; Now, set change depth. Inactive gases have depth=0! 359 ; Now, set change depth. Inactive gases have depth=0!
360 read_int_eeprom d'118' ; read gas_change_depth Gas1 360 read_int_eeprom d'118' ; read gas_change_depth Gas1
361 movff EEDATA,char_I_deco_gas_change5 361 btfss sorted_gaslist_active,0 ; Apply depth?
362 read_int_eeprom d'119' ; read gas_change_depth Gas2 362 clrf EEDATA ; No, clear!
363 movff EEDATA,char_I_deco_gas_change4 363 movff EEDATA,char_I_deco_gas_change5 ; Yes!
364 read_int_eeprom d'120' ; read gas_change_depth Gas3 364
365 movff EEDATA,char_I_deco_gas_change3 365 read_int_eeprom d'119' ; read gas_change_depth Gas2
366 read_int_eeprom d'121' ; read gas_change_depth Gas4 366 btfss sorted_gaslist_active,1 ; Apply depth?
367 movff EEDATA,char_I_deco_gas_change2 367 clrf EEDATA ; No, clear!
368 read_int_eeprom d'122' ; read gas_change_depth Gas5 368 movff EEDATA,char_I_deco_gas_change4 ; Yes!
369 movff EEDATA,char_I_deco_gas_change1 369
370 ; If gas is inactive, overwrite char_I_deco_gas_changex with zero 370 read_int_eeprom d'120' ; read gas_change_depth Gas3
371 read_int_eeprom d'27' ; read flag register 371 btfss sorted_gaslist_active,2 ; Apply depth?
372 clrf WREG ; Clear WREG 372 clrf EEDATA ; No, clear!
373 373 movff EEDATA,char_I_deco_gas_change3 ; Yes!
374 btfss EEDATA,0 374
375 movff WREG,char_I_deco_gas_change1; Gas1 375 read_int_eeprom d'121' ; read gas_change_depth Gas4
376 btfss EEDATA,1 376 btfss sorted_gaslist_active,3 ; Apply depth?
377 movff WREG,char_I_deco_gas_change2; Gas2 377 clrf EEDATA ; No, clear!
378 btfss EEDATA,2 378 movff EEDATA,char_I_deco_gas_change2 ; Yes!
379 movff WREG,char_I_deco_gas_change3; Gas3 379
380 btfss EEDATA,3 380 read_int_eeprom d'122' ; read gas_change_depth Gas5
381 movff WREG,char_I_deco_gas_change4; Gas4 381 btfss sorted_gaslist_active,4 ; Apply depth?
382 btfss EEDATA,4 382 clrf EEDATA ; No, clear!
383 movff WREG,char_I_deco_gas_change5; Gas5 383 movff EEDATA,char_I_deco_gas_change1 ; Yes!
384
385 384
386 ; Debugger 385 ; Debugger
387 ; call enable_rs232 386 ; call enable_rs232
388 ; movff char_I_deco_He_ratio5,TXREG 387 ; movff char_I_deco_He_ratio5,TXREG
389 ; call rs232_wait_tx ; wait for UART 388 ; call rs232_wait_tx ; wait for UART
408 ; movff char_I_deco_gas_change5,TXREG 407 ; movff char_I_deco_gas_change5,TXREG
409 ; call rs232_wait_tx ; wait for UART 408 ; call rs232_wait_tx ; wait for UART
410 ; movff char_I_deco_gas_change4,TXREG 409 ; movff char_I_deco_gas_change4,TXREG
411 ; call rs232_wait_tx ; wait for UART 410 ; call rs232_wait_tx ; wait for UART
412 ; movff char_I_deco_gas_change3,TXREG 411 ; movff char_I_deco_gas_change3,TXREG
413 ; call rs232_wait_tx ; wait for UART 412 ; call rs232_wait_tx ; wait for UART
414 ; movff char_I_deco_gas_change2,TXREG 413 ; movff char_I_deco_gas_change2,TXREG
415 ; call rs232_wait_tx ; wait for UART 414 ; call rs232_wait_tx ; wait for UART
416 ; movff char_I_deco_gas_change,TXREG 415 ; movff char_I_deco_gas_change,TXREG
417 ; call rs232_wait_tx ; wait for UART 416 ; call rs232_wait_tx ; wait for UART
418 417
1662 subfwb wait_temp,W ; minus He 1661 subfwb wait_temp,W ; minus He
1663 bsf STATUS,C ; Borrow bit 1662 bsf STATUS,C ; Borrow bit
1664 subfwb EEDATA,F ; minus O2 1663 subfwb EEDATA,F ; minus O2
1665 movff EEDATA, char_I_N2_ratio ; = N2! 1664 movff EEDATA, char_I_N2_ratio ; = N2!
1666 1665
1667 return 1666 ; Configure sorted_gaslist_active flag register
1667 clrf sorted_gaslist_active ; Clear all flags
1668 read_int_eeprom d'118' ; read gas_change_depth Gas1
1669 tstfsz EEDATA ; =0m?
1670 bsf sorted_gaslist_active,0 ; No, Set Flag for Gas1
1671
1672 read_int_eeprom d'119' ; read gas_change_depth Gas2
1673 tstfsz EEDATA ; =0m?
1674 bsf sorted_gaslist_active,1 ; No, Set Flag for Gas2
1675
1676 read_int_eeprom d'120' ; read gas_change_depth Gas3
1677 tstfsz EEDATA ; =0m?
1678 bsf sorted_gaslist_active,2 ; No, Set Flag for Gas3
1679
1680 read_int_eeprom d'121' ; read gas_change_depth Gas4
1681 tstfsz EEDATA ; =0m?
1682 bsf sorted_gaslist_active,3 ; No, Set Flag for Gas4
1683
1684 read_int_eeprom d'122' ; read gas_change_depth Gas5
1685 tstfsz EEDATA ; =0m?
1686 bsf sorted_gaslist_active,4 ; No, Set Flag for Gas5
1687 return