comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 33:6e5db85382a2

Speedy simulator! New Deco code test 1
author heinrichsweikamp
date Tue, 25 May 2010 17:37:26 +0200
parents 943dc3336f48
children 5dbdc08e5460
comparison
equal deleted inserted replaced
32:a776039bda63 33:6e5db85382a2
2774 movlw 0xB7 ; Arrow for menu 2774 movlw 0xB7 ; Arrow for menu
2775 movwf POSTINC2 2775 movwf POSTINC2
2776 call word_processor 2776 call word_processor
2777 return 2777 return
2778 2778
2779 PLED_profileview_menu: 2779 ;PLED_profileview_menu:
2780 DISPLAYTEXT .127 ;"Exit" 2780 ; DISPLAYTEXT .127 ;"Exit"
2781 DISPLAYTEXT .128 ;"Delete" 2781 ; DISPLAYTEXT .128 ;"Delete"
2782 ; DISPLAYTEXT .132 ;"Format" 2782 ;; DISPLAYTEXT .132 ;"Format"
2783 return 2783 ; return
2784 2784
2785 custom_warn_surfmode: 2785 custom_warn_surfmode:
2786 movlw .0 2786 movlw .0
2787 movff WREG,box_temp+0 ; Data 2787 movff WREG,box_temp+0 ; Data
2788 movlw .56 2788 movlw .56
3862 ; output_8 3862 ; output_8
3863 ; call word_processor 3863 ; call word_processor
3864 ; return 3864 ; return
3865 ; 3865 ;
3866 3866
3867 PLED_simdata_screen: ;Display Pre-Dive Screen
3868
3869 ; List active gases/Setpoints
3870
3871 btfsc FLAG_const_ppO2_mode ; in ppO2 mode?
3872 bra PLED_simdata_screen3 ; Yes, display SetPoint/Sensor result list
3873
3874 PLED_simdata_screen2:
3875 ostc_debug 'm' ; Sends debug-information to screen if debugmode active
3876
3877 WIN_LEFT .0
3878 WIN_FONT FT_SMALL
3879 bsf leftbind
3880
3881 movlw d'2'
3882 movwf wait_temp ; here: stores eeprom address for gas list
3883 movlw d'0'
3884 movwf waitms_temp ; here: stores row for gas list
3885 clrf hi ; here: Gas counter
3886
3887 PLED_simdata_screen2_loop:
3888 incf hi,F ; Increase Gas
3889 movlw d'4'
3890 addwf wait_temp,F ; Increase eeprom address for gas list
3891
3892 lfsr FSR2,letter
3893 movlw 'G'
3894 movwf POSTINC2
3895 movff hi,lo ; copy gas number
3896 output_8 ; display gas number
3897 movlw ':'
3898 movwf POSTINC2
3899 movlw ' '
3900 movwf POSTINC2
3901 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM
3902 call read_eeprom ; get byte (stored in EEDATA)
3903 movff EEDATA,lo ; copy to lo
3904 output_8 ; outputs into Postinc2!
3905 movlw '/'
3906 movwf POSTINC2
3907 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM
3908 call read_eeprom ; get byte (stored in EEDATA)
3909 movff EEDATA,lo ; copy to lo
3910 output_8 ; outputs into Postinc2!
3911
3912 read_int_eeprom d'27' ; read flag register
3913 movff hi,lo ; copy gas number
3914 PLED_simdata_screen2_loop1:
3915 rrcf EEDATA ; roll flags into carry
3916 decfsz lo,F ; max. 5 times...
3917 bra PLED_simdata_screen2_loop1
3918
3919 btfsc STATUS,C ; test carry
3920 bra PLED_simdata_white
3921
3922 movlw color_grey
3923 call PLED_set_color ; grey out inactive gases!
3924 bra PLED_simdata_color_done
3925
3926 PLED_simdata_white:
3927 call PLED_standard_color
3928
3929 PLED_simdata_color_done:
3930 read_int_eeprom d'33' ; Read start gas (1-5)
3931 movf EEDATA,W
3932 cpfseq hi ; Current Gas the active gas?
3933 bra PLED_simdata_screen2a
3934 bra PLED_simdata_screen2b
3935
3936 PLED_simdata_screen2a:
3937 movlw d'25'
3938 addwf waitms_temp,F ; Increase row
3939 WIN_LEFT .0
3940 movff waitms_temp,win_top ; Set Row
3941 call word_processor ; No, display gas
3942
3943 PLED_simdata_screen2b:
3944 call PLED_standard_color
3945
3946 movlw d'5' ; list all four (remaining) gases
3947 cpfseq hi ; All gases shown?
3948 bra PLED_simdata_screen2_loop ; No
3949
3950 return ; No, return (OC mode)
3951
3952 PLED_simdata_screen3:
3953 WIN_LEFT .0
3954 WIN_FONT FT_SMALL
3955 bsf leftbind
3956
3957 ; list three SP in Gaslist
3958 movlw d'35' ; 36 = current SP position in EEPROM
3959 movwf wait_temp ; here: stores eeprom address for gas list
3960 movlw d'0'
3961 movwf waitms_temp ; here: stores row for gas list
3962 clrf temp5 ; here: SP counter
3963
3964 PLED_simdata_screen3_loop:
3965 incf wait_temp,F ; EEPROM address
3966 incf temp5,F ; Increase SP
3967
3968 movlw d'25'
3969 addwf waitms_temp,F ; Increase row
3970 WIN_LEFT .0
3971 movff waitms_temp,win_top ; Set Row
3972
3973 lfsr FSR2,letter
3974 movlw 'S'
3975 movwf POSTINC2
3976 movlw 'P'
3977 movwf POSTINC2
3978 movff temp5,lo ; copy gas number
3979 output_8 ; display gas number
3980 movlw ':'
3981 movwf POSTINC2
3982 movlw ' '
3983 movwf POSTINC2
3984 movff wait_temp, EEADR; SP #hi position
3985 call read_eeprom ; get byte (stored in EEDATA)
3986 movff EEDATA,lo ; copy to lo
3987 clrf hi
3988 output_16dp d'3' ; outputs into Postinc2!
3989 call word_processor
3990
3991 movlw d'3' ; list all three SP
3992 cpfseq temp5 ; All gases shown?
3993 bra PLED_simdata_screen3_loop ;no
3994
3995 read_int_eeprom d'33' ; Read byte (stored in EEDATA)
3996 movff EEDATA,active_gas ; Read start gas (1-5)
3997 decf active_gas,W ; Gas 0-4
3998 mullw d'4'
3999 movf PRODL,W
4000 addlw d'7' ; = address for He ratio
4001 movwf EEADR
4002 call read_eeprom ; Read He ratio
4003 movff EEDATA,hi ; And copy into hold register
4004 decf active_gas,W ; Gas 0-4
4005 mullw d'4'
4006 movf PRODL,W
4007 addlw d'6' ; = address for O2 ratio
4008 movwf EEADR
4009 call read_eeprom ; Read O2 ratio
4010 movff EEDATA, lo ; O2 ratio
4011
4012 WIN_LEFT .0
4013 WIN_TOP .100
4014 lfsr FSR2,letter
4015 movlw 'D'
4016 movwf POSTINC2
4017 movlw 'i'
4018 movwf POSTINC2
4019 movlw 'l'
4020 movwf POSTINC2
4021 movlw ':'
4022 movwf POSTINC2
4023 output_8 ; O2 Ratio
4024 movlw '/'
4025 movwf POSTINC2
4026 movff hi,lo
4027 output_8 ; He Ratio
4028 call word_processor
4029
4030 bcf leftbind
4031 return ; Return (CC Mode)
4032
3867 4033
3868 4034
3869 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar] 4035 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar]
3870 4036
3871 btfsc simulatormode_active ; Do apply salinity in Simulatormode 4037 btfsc simulatormode_active ; Do apply salinity in Simulatormode