Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 147:a1960295433b
Make loogbook search twice faster.
+ Cleanup inc/dec eeprom_address macros.
+ Cleanup loop menu_logbook2.
+ Make 2 bytes steps
author | JeanDo |
---|---|
date | Sun, 09 Jan 2011 16:04:02 +0100 |
parents | 622da16b768f |
children |
comparison
equal
deleted
inserted
replaced
146:c09b0be2e1e6 | 147:a1960295433b |
---|---|
154 call customview_toggle ; Yes, show next customview (and delete this flag) | 154 call customview_toggle ; Yes, show next customview (and delete this flag) |
155 | 155 |
156 btfsc menubit ; Sleep only with inactive menu... | 156 btfsc menubit ; Sleep only with inactive menu... |
157 bra diveloop_loop4 | 157 bra diveloop_loop4 |
158 | 158 |
159 btfsc simulatormode_active ; Do not sleep in Simualtor mode | 159 ; btfsc simulatormode_active ; Do not sleep in Simualtor mode |
160 bra diveloop_loop4 | 160 ; bra diveloop_loop4 |
161 | 161 |
162 sleep | 162 sleep |
163 nop | 163 nop |
164 diveloop_loop4: | 164 diveloop_loop4: |
165 bra diveloop_loop ; Loop the divemode | 165 bra diveloop_loop ; Loop the divemode |
484 | 484 |
485 store_dive_data: ; CF20 seconds gone | 485 store_dive_data: ; CF20 seconds gone |
486 bcf store_sample ; update only any CF20 seconds | 486 bcf store_sample ; update only any CF20 seconds |
487 bsf update_divetime ; update divemins every CF20 seconds | 487 bsf update_divetime ; update divemins every CF20 seconds |
488 | 488 |
489 btfsc simulatormode_active ; Are we in simulator mode? | 489 ; btfsc simulatormode_active ; Are we in simulator mode? |
490 return ; Yes, discard everything | 490 ; return ; Yes, discard everything |
491 | 491 |
492 btfsc header_stored ; Header already stored? | 492 btfsc header_stored ; Header already stored? |
493 bra store_dive_data2 ; Yes, store only profile data | 493 bra store_dive_data2 ; Yes, store only profile data |
494 bsf header_stored ; Store header | 494 bsf header_stored ; Store header |
495 | 495 |
1021 | 1021 |
1022 end_dive: | 1022 end_dive: |
1023 btfss realdive ; dive longer then one minute | 1023 btfss realdive ; dive longer then one minute |
1024 goto end_dive_common ; No, discard everything | 1024 goto end_dive_common ; No, discard everything |
1025 | 1025 |
1026 btfsc simulatormode_active ; Are we in simulator mode? | 1026 ; btfsc simulatormode_active ; Are we in simulator mode? |
1027 goto end_dive_common ; Yes, discard everything | 1027 ; goto end_dive_common ; Yes, discard everything |
1028 | 1028 |
1029 ; Dive finished (and longer then one minute or Apnoe timeout occured) | 1029 ; Dive finished (and longer then one minute or Apnoe timeout occured) |
1030 | 1030 |
1031 btfsc FLAG_apnoe_mode ; Calc max. depth (again) for very short apnoe dives | 1031 btfsc FLAG_apnoe_mode ; Calc max. depth (again) for very short apnoe dives |
1032 rcall apnoe_calc_maxdepth | 1032 rcall apnoe_calc_maxdepth |
1293 return | 1293 return |
1294 | 1294 |
1295 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 1295 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
1296 bra timeout_divemode2 ; Yes, use CF30 [min] for timeout | 1296 bra timeout_divemode2 ; Yes, use CF30 [min] for timeout |
1297 | 1297 |
1298 btfsc simulatormode_active ; In Simulator mode? | 1298 ; btfsc simulatormode_active ; In Simulator mode? |
1299 bra timeout_divemode3 ; Yes, use fixed 5 seconds timeout | 1299 ; bra timeout_divemode3 ; Yes, use fixed 5 seconds timeout |
1300 | 1300 |
1301 bcf divemode | 1301 bcf divemode |
1302 incf timeout_counter,F | 1302 incf timeout_counter,F |
1303 GETCUSTOM8 d'2' ; diveloop_timeout | 1303 GETCUSTOM8 d'2' ; diveloop_timeout |
1304 addlw d'2' ; adds two seconds in case timout=zero! | 1304 addlw d'2' ; adds two seconds in case timout=zero! |
1356 bsf pres_changed ; Yes | 1356 bsf pres_changed ; Yes |
1357 movf amb_pressure+1,W | 1357 movf amb_pressure+1,W |
1358 cpfseq last_pressure+1 | 1358 cpfseq last_pressure+1 |
1359 bsf pres_changed ; Yes | 1359 bsf pres_changed ; Yes |
1360 | 1360 |
1361 btfsc simulatormode_active ; always update depth when in simulator mode | 1361 ; btfsc simulatormode_active ; always update depth when in simulator mode |
1362 bsf pres_changed | 1362 ; bsf pres_changed |
1363 | 1363 |
1364 btfsc pres_changed | 1364 btfsc pres_changed |
1365 call PLED_depth ; Displays new depth | 1365 call PLED_depth ; Displays new depth |
1366 return | 1366 return |
1367 | 1367 |
1654 bcf low_battery_state ; clear flag for battery warning mode | 1654 bcf low_battery_state ; clear flag for battery warning mode |
1655 bcf header_stored | 1655 bcf header_stored |
1656 bcf premenu | 1656 bcf premenu |
1657 bcf realdive | 1657 bcf realdive |
1658 bsf update_divetime ; set flag | 1658 bsf update_divetime ; set flag |
1659 btfss simulatormode_active ; do not disable in simulator mode! | 1659 ; btfss simulatormode_active ; do not disable in simulator mode! |
1660 call disable_rs232 ; Disable RS232 | 1660 call disable_rs232 ; Disable RS232 |
1661 | 1661 |
1662 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | 1662 read_int_eeprom d'33' ; Read byte (stored in EEDATA) |
1663 movff EEDATA,active_gas ; Read start gas (1-5) | 1663 movff EEDATA,active_gas ; Read start gas (1-5) |
1664 | 1664 |