Mercurial > public > hwos_code
comparison src/start.asm @ 629:237931377539
3.07 stable release
author | heinrichsweikamp |
---|---|
date | Fri, 29 Nov 2019 18:48:11 +0100 |
parents | cd58f7fc86db |
children | 185ba2f91f59 |
comparison
equal
deleted
inserted
replaced
628:cd58f7fc86db | 629:237931377539 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File start.asm combined next generation V3.04.3 | 3 ; File start.asm combined next generation V3.06.1 |
4 ; | 4 ; |
5 ; Startup subroutines | 5 ; Startup subroutines |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
158 ; load surface pressure into ISR | 158 ; load surface pressure into ISR |
159 ; initially needs to be done twice in order to shift the current absolute pressure through the | 159 ; initially needs to be done twice in order to shift the current absolute pressure through the |
160 ; 15 minutes sampling buffer into the reference buffer from where it is loaded by the ISR | 160 ; 15 minutes sampling buffer into the reference buffer from where it is loaded by the ISR |
161 rcall sample_surface_pressure ; 1st pass | 161 rcall sample_surface_pressure ; 1st pass |
162 rcall sample_surface_pressure ; 2nd pass | 162 rcall sample_surface_pressure ; 2nd pass |
163 | |
164 ; wait until initial surface pressure value has been loaded into the ISR | |
163 btfsc update_surface_pressure ; has the ISR confirmed loading of the surface pressure? | 165 btfsc update_surface_pressure ; has the ISR confirmed loading of the surface pressure? |
164 bra $-2 ; NO - not yet, loop until ISR has confirmed loading | 166 bra $-2 ; NO - not yet, loop until ISR has confirmed loading |
165 | 167 |
166 ; reset all tissue pressures to surface pressure equilibrium state by default | 168 ; reset all tissue pressures to surface pressure equilibrium state by default |
167 call deco_clear_tissue ; (C-code) | 169 call deco_clear_tissue ; (C-code) |
168 banksel common | 170 banksel common |
169 | 171 |
170 ; restore tissue pressures from EEPROM (if available) | 172 ; restore tissue pressures from EEPROM (if available) |
171 movlw HIGH .512 ; =2 | 173 movlw HIGH .512 ; =2 |
172 movwf EEADRH ; set EEPROM address, high byte | 174 movwf EEADRH ; set EEPROM address, high byte |
173 read_int_eeprom .0 | 175 read_int_eeprom .0 ; read tissue storage information flag |
174 clrf EEADRH | 176 clrf EEADRH ; revert EEPROM high address pointer to default |
175 movlw 0xAA ; coding for tissue pressures available | 177 movlw 0xAA ; load coding for tissue pressures available |
176 cpfseq EEDATA ; tissue pressures available? | 178 cpfseq EEDATA ; tissue pressures available? |
177 bra start_1 ; NO - no tissue pressures available | 179 bra start_1 ; NO - no tissue pressures available |
178 call restore_decodata_from_eeprom ; YES - reload tissue pressures from EEPROM | 180 call restore_decodata_from_eeprom ; YES - reload tissue pressures from EEPROM |
179 | 181 |
180 start_1: | 182 start_1: |
502 ; called from divemode.asm, menu_tree.asm and surfmode.asm | 504 ; called from divemode.asm, menu_tree.asm and surfmode.asm |
503 ; | 505 ; |
504 global restart_set_modes_and_flags | 506 global restart_set_modes_and_flags |
505 restart_set_modes_and_flags: | 507 restart_set_modes_and_flags: |
506 call option_restore_all ; restore all options settings from EEPROM | 508 call option_restore_all ; restore all options settings from EEPROM |
509 call disable_ir_s8 ; switch off IR/S8 digital interface by default (for all compile versions!) | |
507 | 510 |
508 IFDEF _external_sensor | 511 IFDEF _external_sensor |
509 call disable_ir_s8 ; switch off IR/S8 digital interface by default | 512 WAITMS d'100' ; some delay to power down S8-HUD properly |
510 WAITMS d'100' ; Some delay to power down S8-HUD properly | 513 ENDIF |
511 ENDIF | 514 |
512 ; setup sampling rate | 515 ; setup sampling rate |
513 movlw .2 ; default to 2 seconds | 516 movlw .2 ; default to 2 seconds |
514 movwf sampling_rate ; write setting | 517 movwf sampling_rate ; write setting |
515 TSTOSS opt_sampling_rate ; check option: 1= 10s, 0= 2s | 518 TSTOSS opt_sampling_rate ; check option: 1= 10s, 0= 2s |
516 bra restart_set_modes_and_flags1 ; 0 - 2 seconds selected, done | 519 bra restart_set_modes_and_flags1 ; 0 - 2 seconds selected, done |