Mercurial > public > hwos_code
comparison src/tft_outputs.asm @ 192:efe70488a04b
voting logic for external monitoring
| author | heinrichsweikamp |
|---|---|
| date | Mon, 03 Nov 2014 17:25:19 +0100 |
| parents | d049511b25c6 |
| children | dcd513840c6c |
comparison
equal
deleted
inserted
replaced
| 191:d049511b25c6 | 192:efe70488a04b |
|---|---|
| 950 | 950 |
| 951 global TFT_hud_voltages | 951 global TFT_hud_voltages |
| 952 TFT_hud_voltages: ; Show HUD details | 952 TFT_hud_voltages: ; Show HUD details |
| 953 WIN_SMALL .5,dive_hud_data_row | 953 WIN_SMALL .5,dive_hud_data_row |
| 954 call TFT_standard_color | 954 call TFT_standard_color |
| 955 btfss use_02_sensor1 | 955 btfss use_O2_sensor1 |
| 956 call TFT_warnings_color | 956 call TFT_warnings_color |
| 957 movff o2_mv_sensor1+0,lo | 957 movff o2_mv_sensor1+0,lo |
| 958 movff o2_mv_sensor1+1,hi | 958 movff o2_mv_sensor1+1,hi |
| 959 bsf leftbind | 959 bsf leftbind |
| 960 output_16dp .4 ; x.xx | 960 output_16dp .4 ; x.xx |
| 961 bcf leftbind | 961 bcf leftbind |
| 962 STRCAT_PRINT "mV " | 962 STRCAT_PRINT "mV " |
| 963 WIN_SMALL .55,dive_hud_data_row | 963 WIN_SMALL .55,dive_hud_data_row |
| 964 call TFT_standard_color | 964 call TFT_standard_color |
| 965 btfss use_02_sensor2 | 965 btfss use_O2_sensor2 |
| 966 call TFT_warnings_color | 966 call TFT_warnings_color |
| 967 movff o2_mv_sensor2+0,lo | 967 movff o2_mv_sensor2+0,lo |
| 968 movff o2_mv_sensor2+1,hi | 968 movff o2_mv_sensor2+1,hi |
| 969 bsf leftbind | 969 bsf leftbind |
| 970 output_16dp .4 ; x.xx | 970 output_16dp .4 ; x.xx |
| 971 bcf leftbind | 971 bcf leftbind |
| 972 STRCAT_PRINT "mV " | 972 STRCAT_PRINT "mV " |
| 973 WIN_SMALL .105,dive_hud_data_row | 973 WIN_SMALL .105,dive_hud_data_row |
| 974 call TFT_standard_color | 974 call TFT_standard_color |
| 975 btfss use_02_sensor3 | 975 btfss use_O2_sensor3 |
| 976 call TFT_warnings_color | 976 call TFT_warnings_color |
| 977 movff o2_mv_sensor3+0,lo | 977 movff o2_mv_sensor3+0,lo |
| 978 movff o2_mv_sensor3+1,hi | 978 movff o2_mv_sensor3+1,hi |
| 979 bsf leftbind | 979 bsf leftbind |
| 980 output_16dp .4 ; x.xx | 980 output_16dp .4 ; x.xx |
| 981 bcf leftbind | 981 bcf leftbind |
| 982 STRCAT_PRINT "mV " | 982 STRCAT_PRINT "mV " |
| 983 call TFT_standard_color | 983 call TFT_standard_color |
| 984 return | 984 return |
| 985 | 985 |
| 986 global TFT_update_hud ; Update HUD data | 986 global TFT_update_ppo2_sensors ; Update Sensor data |
| 987 TFT_update_hud: | 987 TFT_update_ppo2_sensors: |
| 988 ; show three sensors | 988 ; show three sensors |
| 989 bsf leftbind | 989 bsf leftbind |
| 990 movff o2_ppo2_sensor1,lo | 990 btfsc use_O2_sensor1 ; Use Sensor 1? |
| 991 tstfsz lo ; ppO2=0 (No data/failure)? | 991 bra TFT_update_hud1 ; Yes |
| 992 bra TFT_update_hud1 ; No | |
| 993 btfss dive_hud1_displayed ; Was the sensor shown? | 992 btfss dive_hud1_displayed ; Was the sensor shown? |
| 994 bra TFT_update_hud2 ; Yes, skip clear | 993 bra TFT_update_hud2 ; Yes, skip clear |
| 995 bcf dive_hud1_displayed ; No, clear display flag | 994 bcf dive_hud1_displayed ; No, clear display flag |
| 996 WIN_BOX_BLACK dive_hud_data_row, dive_hud_data_row+.30, dive_hud_sensor1_column, dive_hud_sensor2_column ; top, bottom, left, right | 995 WIN_BOX_BLACK dive_hud_data_row, dive_hud_data_row+.31, dive_hud_sensor1_column, dive_hud_sensor2_column ; top, bottom, left, right |
| 997 WIN_STD dive_hud_sensor1_column+.7,dive_hud_data_row+.5 | 996 WIN_STD dive_hud_sensor1_column+.7,dive_hud_data_row+.5 |
| 998 call TFT_standard_color | 997 call TFT_standard_color |
| 999 STRCPY_PRINT "---" | 998 STRCPY_PRINT "---" |
| 1000 bra TFT_update_hud2 ; Skip Sensor 1 | 999 bra TFT_update_hud2 ; Skip Sensor 1 |
| 1001 TFT_update_hud1: | 1000 TFT_update_hud1: |
| 1002 WIN_MEDIUM dive_hud_sensor1_column,dive_hud_data_row | 1001 WIN_MEDIUM dive_hud_sensor1_column,dive_hud_data_row |
| 1002 movff o2_ppo2_sensor1,lo | |
| 1003 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo | 1003 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo |
| 1004 btfss voting_logic_sensor1 ; Sensor within voting logic? | |
| 1005 bsf win_invert ; No, invert output... | |
| 1006 btfss voting_logic_sensor1 | |
| 1007 call TFT_warnings_color ; ... and draw in red | |
| 1004 clrf hi | 1008 clrf hi |
| 1005 output_16dp .3 ; x.xx bar | 1009 output_16dp .3 ; x.xx bar |
| 1006 STRCAT_PRINT "" | 1010 STRCAT_PRINT "" |
| 1011 bcf win_invert | |
| 1007 bsf dive_hud1_displayed ; Set display flag | 1012 bsf dive_hud1_displayed ; Set display flag |
| 1008 TFT_update_hud2: | 1013 TFT_update_hud2: |
| 1009 movff o2_ppo2_sensor2,lo | 1014 btfsc use_O2_sensor2 ; Use Sensor 2? |
| 1010 tstfsz lo ; ppO2=0 (No data/failure)? | 1015 bra TFT_update_hud3 ; Yes |
| 1011 bra TFT_update_hud3 ; No | |
| 1012 btfss dive_hud2_displayed ; Was the sensor shown? | 1016 btfss dive_hud2_displayed ; Was the sensor shown? |
| 1013 bra TFT_update_hud4 ; Yes, skip clear | 1017 bra TFT_update_hud4 ; Yes, skip clear |
| 1014 bcf dive_hud2_displayed ; No, clear display flag | 1018 bcf dive_hud2_displayed ; No, clear display flag |
| 1015 WIN_BOX_BLACK dive_hud_data_row, dive_hud_data_row+.30, dive_hud_sensor2_column, dive_hud_sensor3_column ; top, bottom, left, right | 1019 WIN_BOX_BLACK dive_hud_data_row, dive_hud_data_row+.31, dive_hud_sensor2_column, dive_hud_sensor3_column ; top, bottom, left, right |
| 1016 WIN_STD dive_hud_sensor2_column+.7,dive_hud_data_row+.5 | 1020 WIN_STD dive_hud_sensor2_column+.7,dive_hud_data_row+.5 |
| 1017 call TFT_standard_color | 1021 call TFT_standard_color |
| 1018 STRCPY_PRINT "---" | 1022 STRCPY_PRINT "---" |
| 1019 bra TFT_update_hud4 ; Skip Sensor 2 | 1023 bra TFT_update_hud4 ; Skip Sensor 2 |
| 1020 TFT_update_hud3: | 1024 TFT_update_hud3: |
| 1021 WIN_MEDIUM dive_hud_sensor2_column,dive_hud_data_row | 1025 WIN_MEDIUM dive_hud_sensor2_column,dive_hud_data_row |
| 1026 movff o2_ppo2_sensor2,lo | |
| 1022 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo | 1027 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo |
| 1028 btfss voting_logic_sensor2 ; Sensor within voting logic? | |
| 1029 bsf win_invert ; No, invert output... | |
| 1030 btfss voting_logic_sensor2 | |
| 1031 call TFT_warnings_color ; ... and draw in red | |
| 1023 clrf hi | 1032 clrf hi |
| 1024 output_16dp .3 ; x.xx bar | 1033 output_16dp .3 ; x.xx bar |
| 1025 STRCAT_PRINT "" | 1034 STRCAT_PRINT "" |
| 1035 bcf win_invert | |
| 1026 bsf dive_hud2_displayed ; Set display flag | 1036 bsf dive_hud2_displayed ; Set display flag |
| 1027 TFT_update_hud4: | 1037 TFT_update_hud4: |
| 1028 movff o2_ppo2_sensor3,lo | 1038 btfsc use_O2_sensor3 ; Use Sensor 3? |
| 1029 tstfsz lo ; ppO2=0 (No data/failure)? | 1039 bra TFT_update_hud5 ; Yes |
| 1030 bra TFT_update_hud5 ; No | |
| 1031 btfss dive_hud3_displayed ; Was the sensor shown? | 1040 btfss dive_hud3_displayed ; Was the sensor shown? |
| 1032 bra TFT_update_hud6 ; Yes, skip clear | 1041 bra TFT_update_hud6 ; Yes, skip clear |
| 1033 bcf dive_hud3_displayed ; No, clear display flag | 1042 bcf dive_hud3_displayed ; No, clear display flag |
| 1034 WIN_BOX_BLACK dive_hud_data_row, dive_hud_data_row+.30, dive_hud_sensor3_column, .159 ; top, bottom, left, right | 1043 WIN_BOX_BLACK dive_hud_data_row, dive_hud_data_row+.31, dive_hud_sensor3_column, .159 ; top, bottom, left, right |
| 1035 WIN_STD dive_hud_sensor3_column+.7,dive_hud_data_row+.5 | 1044 WIN_STD dive_hud_sensor3_column+.7,dive_hud_data_row+.5 |
| 1036 call TFT_standard_color | 1045 call TFT_standard_color |
| 1037 STRCPY_PRINT "---" | 1046 STRCPY_PRINT "---" |
| 1038 bra TFT_update_hud6 ; Skip Sensor 3 | 1047 bra TFT_update_hud6 ; Skip Sensor 3 |
| 1039 TFT_update_hud5: | 1048 TFT_update_hud5: |
| 1040 WIN_MEDIUM dive_hud_sensor3_column,dive_hud_data_row | 1049 WIN_MEDIUM dive_hud_sensor3_column,dive_hud_data_row |
| 1050 movff o2_ppo2_sensor3,lo | |
| 1041 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo | 1051 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo |
| 1052 btfss voting_logic_sensor3 ; Sensor within voting logic? | |
| 1053 bsf win_invert ; No, invert output... | |
| 1054 btfss voting_logic_sensor3 | |
| 1055 call TFT_warnings_color ; ... and draw in red | |
| 1042 clrf hi | 1056 clrf hi |
| 1043 output_16dp .3 ; x.xx bar | 1057 output_16dp .3 ; x.xx bar |
| 1044 STRCAT_PRINT "" | 1058 STRCAT_PRINT "" |
| 1059 bcf win_invert | |
| 1045 bsf dive_hud3_displayed ; Set display flag | 1060 bsf dive_hud3_displayed ; Set display flag |
| 1046 TFT_update_hud6: | 1061 TFT_update_hud6: |
| 1047 bcf leftbind | 1062 bcf leftbind |
| 1048 call TFT_standard_color | 1063 call TFT_standard_color |
| 1049 return | 1064 return |
| 1051 global TFT_surface_sensor ; Update Sensor data in surface mode | 1066 global TFT_surface_sensor ; Update Sensor data in surface mode |
| 1052 TFT_surface_sensor: | 1067 TFT_surface_sensor: |
| 1053 ; show three sensors | 1068 ; show three sensors |
| 1054 bsf leftbind | 1069 bsf leftbind |
| 1055 WIN_SMALL surf_hud_sensor1_column,surf_hud_sensor1_row | 1070 WIN_SMALL surf_hud_sensor1_column,surf_hud_sensor1_row |
| 1056 movff o2_ppo2_sensor1,lo | 1071 btfsc use_O2_sensor1 ; Use Sensor 1? |
| 1057 tstfsz lo ; ppO2=0 (No data/failure)? | 1072 bra TFT_surface_sensor1 ; Yes |
| 1058 bra TFT_surface_sensor1 ; No | |
| 1059 call TFT_standard_color | 1073 call TFT_standard_color |
| 1060 STRCPY_PRINT "--- " | 1074 STRCPY_PRINT "--- " |
| 1061 bra TFT_surface_sensor2 ; Skip Sensor 1 | 1075 bra TFT_surface_sensor2 ; Skip Sensor 1 |
| 1062 TFT_surface_sensor1: | 1076 TFT_surface_sensor1: |
| 1077 movff o2_ppo2_sensor1,lo | |
| 1063 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo | 1078 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo |
| 1064 clrf hi | 1079 clrf hi |
| 1065 output_16dp .3 ; x.xx bar | 1080 output_16dp .3 ; x.xx bar |
| 1066 STRCAT_PRINT "" | 1081 STRCAT_PRINT "" |
| 1067 TFT_surface_sensor2: | 1082 TFT_surface_sensor2: |
| 1068 WIN_SMALL surf_hud_sensor2_column,surf_hud_sensor2_row | 1083 WIN_SMALL surf_hud_sensor2_column,surf_hud_sensor2_row |
| 1069 movff o2_ppo2_sensor2,lo | 1084 btfsc use_O2_sensor2 ; Use Sensor 2? |
| 1070 tstfsz lo ; ppO2=0 (No data/failure)? | 1085 bra TFT_surface_sensor3 ; Yes |
| 1071 bra TFT_surface_sensor3 ; No | |
| 1072 call TFT_standard_color | 1086 call TFT_standard_color |
| 1073 STRCPY_PRINT "--- " | 1087 STRCPY_PRINT "--- " |
| 1074 bra TFT_surface_sensor4 ; Skip Sensor 2 | 1088 bra TFT_surface_sensor4 ; Skip Sensor 2 |
| 1075 TFT_surface_sensor3: | 1089 TFT_surface_sensor3: |
| 1090 movff o2_ppo2_sensor2,lo | |
| 1076 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo | 1091 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo |
| 1077 clrf hi | 1092 clrf hi |
| 1078 output_16dp .3 ; x.xx bar | 1093 output_16dp .3 ; x.xx bar |
| 1079 STRCAT_PRINT "" | 1094 STRCAT_PRINT "" |
| 1080 TFT_surface_sensor4: | 1095 TFT_surface_sensor4: |
| 1081 WIN_SMALL surf_hud_sensor3_column,surf_hud_sensor3_row | 1096 WIN_SMALL surf_hud_sensor3_column,surf_hud_sensor3_row |
| 1082 movff o2_ppo2_sensor3,lo | 1097 btfsc use_O2_sensor3 ; Use Sensor 3? |
| 1083 tstfsz lo ; ppO2=0 (No data/failure)? | 1098 bra TFT_surface_sensor5 ; Yes |
| 1084 bra TFT_surface_sensor5 ; No | |
| 1085 call TFT_standard_color | 1099 call TFT_standard_color |
| 1086 STRCPY_PRINT "--- " | 1100 STRCPY_PRINT "--- " |
| 1087 bra TFT_surface_sensor6 ; Skip Sensor 3 | 1101 bra TFT_surface_sensor6 ; Skip Sensor 3 |
| 1088 TFT_surface_sensor5: | 1102 TFT_surface_sensor5: |
| 1103 movff o2_ppo2_sensor3,lo | |
| 1089 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo | 1104 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo |
| 1090 clrf hi | 1105 clrf hi |
| 1091 output_16dp .3 ; x.xx bar | 1106 output_16dp .3 ; x.xx bar |
| 1092 STRCAT_PRINT "" | 1107 STRCAT_PRINT "" |
| 1093 TFT_surface_sensor6: | 1108 TFT_surface_sensor6: |
