annotate code_part1/OSTC_code_c_part2/p2_main.c @ 131:03df42de03e1

Merge 129 with 130
author Heinrichsweikamp
date Wed, 05 Jan 2011 07:46:20 +0100
parents 14a074e1a375
children cb055a7d75f3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
1 // **************************************************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
2 // ** main code for simulation / tests without assembler code **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
3 // ** This is NOT a part of the OSTC **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
4 // **************************************************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
5
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
6 //////////////////////////////////////////////////////////////////////////////
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
7 // OSTC - diving computer code
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
8 // Copyright (C) 2008 HeinrichsWeikamp GbR
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
9 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
10 // This program is free software: you can redistribute it and/or modify
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
11 // it under the terms of the GNU General Public License as published by
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
13 // (at your option) any later version.
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
14 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
15 // This program is distributed in the hope that it will be useful,
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
18 // GNU General Public License for more details.
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
19 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
20 // You should have received a copy of the GNU General Public License
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
22 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
23 //////////////////////////////////////////////////////////////////////////////
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
24 // history:
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
25 // 12/25/10 v110: [jDG] split in three files (deco.c, main.c, definitions.h)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
26
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
27 #include <p18f4685.h>
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
28 #include <stdlib.h>
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
29
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
30 #include "p2_definitions.h"
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
31
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
32 // **************************************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
33 // ** Make sure to freeze ram banks used elsewhere **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
34 // **************************************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
35
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
36 #pragma udata bank0=0x060
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
37 static const unsigned char keep_free_bank0[0xA0]; // used by the assembler code
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
38
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
39 #pragma udata bank1=0x100
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
40 static const unsigned char keep_free_bank1[256]; // used by the assembler code
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
41
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
42 #pragma udata bank7=0x700
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
43 const unsigned char keep_free_bank7[256]; // used by the assembler code (DD font2display)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
44
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
45 // ********************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
46 // ** C O N F I G U R A T I O N **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
47 // ** for simulation without asm **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
48 // ********************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
49 #pragma config OSC = IRCIO67
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
50 #pragma config FCMEN = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
51 #pragma config IESO = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
52 #pragma config PWRT = ON
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
53 #pragma config BOREN = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
54 #pragma config WDT = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
55 #pragma config WDTPS = 128
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
56 #pragma config MCLRE = ON
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
57 #pragma config LPT1OSC = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
58 #pragma config PBADEN = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
59 #pragma config DEBUG = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
60 #pragma config XINST = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
61 #pragma config LVP = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
62 #pragma config STVREN = OFF
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
63
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
64 // *************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
65 // ** P R O T O T Y P E S **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
66 // *************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
67
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
68 void main(void);
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
69
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
70 // *******************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
71 // ** start **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
72 // ** necessary for compilation **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
73 // *******************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
74 #pragma romdata der_code = 0x0000
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
75 #pragma code der_start = 0x0000
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
76 void der_start(void)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
77 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
78 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
79 goto main
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
80 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
81 }
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
82
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
83 #pragma code main = 0x9000
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
84 #pragma udata
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
85 void main(void)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
86 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
87 static unsigned int i;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
88 static unsigned int debug_temp;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
89
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
90 #if 1
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
91 // new main to test DR-5
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
92
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
93 char_I_deco_model = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
94
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
95 char_I_GF_Low_percentage = 100;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
96 char_I_GF_High_percentage = 100;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
97
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
98 deco_clear_CNS_fraction();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
99 //char_I_const_ppO2 = 100;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
100 //for (i=0;i<255;i++)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
101 //{
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
102 //calc_CNS_fraction();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
103 //} //for
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
104
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
105 int_I_pres_respiration = 1000;//980;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
106 int_I_pres_surface = 1000;//980;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
107 char_I_N2_ratio = 79; //38;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
108 char_I_He_ratio = 0; //50;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
109 char_I_deco_distance = 10; // 10 = 1 meter
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
110 char_I_depth_last_deco = 3; // values below 3 (meter) are ignored
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
111
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
112 char_I_const_ppO2 = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
113 char_I_deco_ppO2_change = 0; // [dm] 10 = 1 meter
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
114 char_I_deco_ppO2 = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
115
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
116 char_I_deco_gas_change = 20; // [m] 1 = 1 meter
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
117 char_I_deco_N2_ratio = 50;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
118 char_I_deco_He_ratio = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
119
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
120 char_I_deco_gas_change2 = 6; // [m] 1 = 1 meter
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
121 char_I_deco_N2_ratio2 = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
122 char_I_deco_He_ratio2 = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
123
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
124 char_I_deco_gas_change3 = 0; // [m] 1 = 1 meter
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
125 char_I_deco_gas_change4 = 0; // [m] 1 = 1 meter
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
126 char_I_deco_gas_change5 = 0; // [m] 1 = 1 meter
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
127
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
128 //char_I_actual_ppO2; // 0x507
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
129 char_I_GF_High_percentage = 100; // 0x514 new in v.102
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
130 char_I_GF_Low_percentage = 100; // 0x515 new in v.102
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
131
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
132 char_I_saturation_multiplier = 110;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
133 char_I_desaturation_multiplier = 90;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
134 calc_hauptroutine_data_input();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
135
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
136 deco_clear_tissue();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
137
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
138 char_I_step_is_1min = 1;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
139 int_I_pres_respiration = 4500 + int_I_pres_surface;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
140
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
141 for (i=0;i<29;i++)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
142 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
143 deco_calc_hauptroutine();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
144 }
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
145
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
146 char_I_step_is_1min = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
147 char_O_deco_status = 255;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
148 while (char_O_deco_status)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
149 deco_calc_hauptroutine();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
150 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
151 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
152 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
153
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
154 char_O_deco_status = 255;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
155 while (char_O_deco_status)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
156 deco_calc_hauptroutine();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
157 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
158 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
159 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
160
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
161 int_I_pres_respiration = 10000;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
162 for (i=0;i<1500;i++)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
163 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
164 deco_calc_hauptroutine();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
165 }
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
166
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
167 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
168 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
169 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
170
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
171
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
172 int_I_pres_respiration = 3000;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
173 for (i=0;i<150;i++)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
174 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
175 calc_hauptroutine_data_input();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
176 calc_hauptroutine_update_tissues();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
177 } //for
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
178
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
179 update_startvalues();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
180 clear_decoarray();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
181 clear_internal_deco_table_GF();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
182 calc_hauptroutine_calc_ascend_to_deco();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
183 if (char_O_deco_status > 15) // can't go up to first deco, too deep to calculate in the given time slot
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
184 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
185 char_O_deco_status = 2;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
186 // char_O_lock_depth_list = 255;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
187 }
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
188 else
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
189 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
190 // char_O_lock_depth_list = lock_GF_depth_list;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
191 calc_hauptroutine_calc_deco();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
192 }
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
193 // build_debug_output();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
194
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
195 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
196 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
197 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
198 while (char_O_deco_status == 1)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
199 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
200 char_O_deco_status = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
201 // char_O_lock_depth_list = 255;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
202 calc_hauptroutine_calc_deco();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
203 // build_debug_output();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
204 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
205 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
206 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
207 };
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
208 debug_temp = 60; // [mtr Aufstieg in 10 mtr/min (30steps'2sec/min]
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
209 int_I_pres_respiration = 9980;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
210 for (i=0;i<debug_temp;i++)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
211 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
212 int_I_pres_respiration = int_I_pres_respiration - 33;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
213 calc_hauptroutine_data_input();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
214 calc_hauptroutine_update_tissues();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
215 int_I_pres_respiration = int_I_pres_respiration - 33;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
216 calc_hauptroutine_data_input();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
217 calc_hauptroutine_update_tissues();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
218 int_I_pres_respiration = int_I_pres_respiration - 34;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
219 calc_hauptroutine_data_input();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
220 calc_hauptroutine_update_tissues();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
221 } //for
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
222 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
223 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
224 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
225
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
226 update_startvalues();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
227 clear_decoarray();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
228 clear_internal_deco_table_GF();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
229 calc_hauptroutine_calc_ascend_to_deco();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
230 if (char_O_deco_status > 15) // can't go up to first deco, too deep to calculate in the given time slot
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
231 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
232 char_O_deco_status = 2;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
233 // char_O_lock_depth_list = 255;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
234 }
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
235 else
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
236 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
237 // char_O_lock_depth_list = lock_GF_depth_list;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
238 calc_hauptroutine_calc_deco();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
239 }
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
240 // build_debug_output();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
241
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
242 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
243 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
244 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
245 while (char_O_deco_status == 1)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
246 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
247 char_O_deco_status = 0;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
248 // char_O_lock_depth_list = 255;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
249 calc_hauptroutine_calc_deco();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
250 // build_debug_output();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
251 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
252 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
253 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
254 };
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
255 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
256 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
257 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
258 debug_temp = 60; // [mtr Aufstieg in 10 mtr/min (30steps'2sec/min]
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
259 int_I_pres_respiration = 9980;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
260 debug_temp = debug_temp * 3;
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
261 for (i=0;i<debug_temp;i++)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
262 {
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
263 calc_hauptroutine_data_input();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
264 calc_hauptroutine_update_tissues();
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
265 } //for
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
266 _asm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
267 nop
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
268 _endasm
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
269 #endif
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
270 // -----------------------
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
271
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
272 } // main