Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/start.asm @ 341:2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
author | JeanDo |
---|---|
date | Fri, 20 May 2011 00:48:30 +0200 |
parents | 6544f79e298c |
children | 797e2ac42d24 |
comparison
equal
deleted
inserted
replaced
340:ecbbbd423e86 | 341:2144f19fa1eb |
---|---|
65 | 65 |
66 bsf sleepmode ; Routine only works in sleepmode... | 66 bsf sleepmode ; Routine only works in sleepmode... |
67 call pressuretest_sleep_fast ; Gets pressure without averaging (faster!) | 67 call pressuretest_sleep_fast ; Gets pressure without averaging (faster!) |
68 bcf sleepmode ; Normal mode again | 68 bcf sleepmode ; Normal mode again |
69 | 69 |
70 movff amb_pressure+0,last_surfpressure+0 | 70 SAFE_2BYTE_COPY amb_pressure, last_surfpressure |
71 movff amb_pressure+1,last_surfpressure+1 | 71 movff last_surfpressure+0,last_surfpressure_15min+0 |
72 movff amb_pressure+0,last_surfpressure_15min+0 | 72 movff last_surfpressure+1,last_surfpressure_15min+1 |
73 movff amb_pressure+1,last_surfpressure_15min+1 | 73 movff last_surfpressure+0,last_surfpressure_30min+0 |
74 movff amb_pressure+0,last_surfpressure_30min+0 | 74 movff last_surfpressure+1,last_surfpressure_30min+1 ; Rests all airpressure registers |
75 movff amb_pressure+1,last_surfpressure_30min+1 ; Rests all airpressure registers | |
76 | 75 |
77 ; Extra power-up reset (JeanDo) | 76 ; Extra power-up reset (JeanDo) |
78 ifdef TESTING | 77 ifdef TESTING |
79 call do_menu_reset_all2 | 78 call do_menu_reset_all2 |
80 endif | 79 endif |
89 movff WREG,char_I_step_is_1min ; 2 second deco mode | 88 movff WREG,char_I_step_is_1min ; 2 second deco mode |
90 GETCUSTOM8 d'11' ; Saturation multiplier % | 89 GETCUSTOM8 d'11' ; Saturation multiplier % |
91 movff WREG,char_I_saturation_multiplier | 90 movff WREG,char_I_saturation_multiplier |
92 GETCUSTOM8 d'12' ; Desaturation multiplier % | 91 GETCUSTOM8 d'12' ; Desaturation multiplier % |
93 movff WREG,char_I_desaturation_multiplier | 92 movff WREG,char_I_desaturation_multiplier |
94 movff amb_pressure+0,int_I_pres_respiration+0 ; copy for deco routine | 93 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy for deco routine |
95 movff amb_pressure+1,int_I_pres_respiration+1 | 94 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine |
96 movff amb_pressure+0,int_I_pres_surface+0 ; copy for desat routine | 95 movff int_I_pres_respiration+1,int_I_pres_surface+1 |
97 movff amb_pressure+1,int_I_pres_surface+1 | |
98 | 96 |
99 call deco_clear_tissue ; | 97 call deco_clear_tissue ; |
100 call deco_calc_desaturation_time ; calculate desaturation time | 98 call deco_calc_desaturation_time ; calculate desaturation time |
101 call deco_clear_CNS_fraction ; clear CNS | 99 call deco_clear_CNS_fraction ; clear CNS |
102 call calc_deko_surfmode ; calculate desaturation every minute | 100 call calc_deko_surfmode ; calculate desaturation every minute |