comparison src/comm.asm @ 81:8e13866b5496

add some extra safety checks when settings were altered from the PC software
author mh@mh-THINK.localdomain
date Fri, 28 Feb 2014 11:03:18 +0100
parents db920ca01491
children 7ca1105751c7
comparison
equal deleted inserted replaced
80:db920ca01491 81:8e13866b5496
23 #include "adc_lightsensor.inc" 23 #include "adc_lightsensor.inc"
24 24
25 extern testloop,new_battery_menu,restart,option_reset_all 25 extern testloop,new_battery_menu,restart,option_reset_all
26 extern char_I_deco_gas_change, char_I_dil_change, char_I_setpoint_cbar, char_I_setpoint_change 26 extern char_I_deco_gas_change, char_I_dil_change, char_I_setpoint_cbar, char_I_setpoint_change
27 extern char_I_deco_model, char_I_extra_time, char_I_saturation_multiplier, char_I_desaturation_multiplier 27 extern char_I_deco_model, char_I_extra_time, char_I_saturation_multiplier, char_I_desaturation_multiplier
28 extern option_check_all, gaslist_cleanup_list, get_first_gas_to_WREG, get_first_dil_to_WREG
28 29
29 #DEFINE timeout_comm_pre_mode .120 ; Pre-loop 30 #DEFINE timeout_comm_pre_mode .120 ; Pre-loop
30 #DEFINE timeout_comm_mode .120 ; Download mode 31 #DEFINE timeout_comm_mode .120 ; Download mode
31 #DEFINE timeout_service_mode .120 ; Service mode 32 #DEFINE timeout_service_mode .120 ; Service mode
32 33
1259 dcfsnz WREG 1260 dcfsnz WREG
1260 bra comm_write_compass_gain ; RCREG1=0x34 1261 bra comm_write_compass_gain ; RCREG1=0x34
1261 1262
1262 comm_write_unused: 1263 comm_write_unused:
1263 comm_write_abort: 1264 comm_write_abort:
1265 ; Check Options, gases and diluents
1266 call option_check_all ; Check all options (and reset if not within their min/max boundaries)
1267 bsf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
1268 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth
1269 bcf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
1270 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth
1271 call get_first_gas_to_WREG ; Makes sure at least one Gas is "First"
1272 call get_first_dil_to_WREG ; Makes sure at least one Diluent is "First"
1264 bra comm_download_mode0 ; Done. Loop with timeout reset 1273 bra comm_download_mode0 ; Done. Loop with timeout reset
1265 1274
1266 comm_write_gas1: 1275 comm_write_gas1:
1267 call rs232_get_byte 1276 call rs232_get_byte
1268 movff RCREG1,opt_gas_O2_ratio+0 1277 movff RCREG1,opt_gas_O2_ratio+0