comparison code_part1/OSTC_code_asm_part1/definitions.asm @ 163:144822282fa3

Fusion declaration of shared C/ASM variables. + remove unused variables. + sort all in variables in BANK3, and out variables in BANK2.
author JeanDo
date Fri, 21 Jan 2011 01:44:37 +0100
parents 8d6aca08f66b
children 999abb01c78f
comparison
equal deleted inserted replaced
162:fdebc43c8372 163:144822282fa3
15 15
16 ; Defines, I/O Ports and variables 16 ; Defines, I/O Ports and variables
17 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com 17 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
18 ; written: 10/30/05 18 ; written: 10/30/05
19 ; last updated: 01/23/08 19 ; last updated: 01/23/08
20 ; 2011/01/20: [jDG] Create a common file included in ASM and C code.
20 ; known bugs: 21 ; known bugs:
21 ; ToDo: 22 ; ToDo:
22 23
23 ;#DEFINE NO_SENSOR_MODE ; uses Dummy values 24 ;#DEFINE NO_SENSOR_MODE ; uses Dummy values
24 25
74 CONFIG LVP = OFF ;Single-Supply ICSP disabled 75 CONFIG LVP = OFF ;Single-Supply ICSP disabled
75 CONFIG STVREN = OFF ;Stack full/underflow will not cause Reset 76 CONFIG STVREN = OFF ;Stack full/underflow will not cause Reset
76 77
77 ;============================================================================= 78 ;=============================================================================
78 79
79 CBLOCK 0x800 80 #include "../OSTC_code_c_part2/shared_definitions.h"
80 c_code_data_stack:.64 ; Reserve space for C-code data space. Eg.when calling log. 81
81 endc 82 ;=============================================================================
82 83
83 CBLOCK 0x3F0 84 c_code_data_stack EQU 0x800 ; Reserve space for C-code data space. Eg.when calling log.
84 pressureSum:2 ; Stabilize surface presure by a long averaging window [mbar]
85 pressureCount ; Count of pressure values.
86 pressureAvg:2 ; save averaged pressure x16, for altimeter_menu
87 pressureRef:2 ; Pressure at sea level [mbar]
88 altitude:2 ; Last computed altitude [m]
89 ENDC
90 85
91 ;Variable definitions 86 ;Variable definitions
92 ; arrays are in hex size!! 20 = .032 87 ; arrays are in hex size!! 20 = .032
93 88
94 CBLOCK 0x060 ;Bank 0 89 CBLOCK 0x060 ;Bank 0
101 win_width ; box width (1..160) 96 win_width ; box width (1..160)
102 win_font 97 win_font
103 win_invert 98 win_invert
104 win_bargraph ; PLED_box swicth to black after this position (0..159). 99 win_bargraph ; PLED_box swicth to black after this position (0..159).
105 win_flags ; flip_screen flag, transparent fonts, etc... 100 win_flags ; flip_screen flag, transparent fonts, etc...
101
102 pressureSum:2 ; Stabilize surface presure by a long averaging window [mbar]
103 pressureCount ; Count of pressure values.
104 pressureAvg:2 ; save averaged pressure x16, for altimeter_menu
105 pressureRef:2 ; Pressure at sea level [mbar]
106 altitude:2 ; Last computed altitude [m]
107
106 ENDC 108 ENDC
107 109
108 CBLOCK 0x100 ;Bank 1 110 CBLOCK 0x100 ;Bank 1
109 wreg_temp ;variables used for context saving during ISR 111 wreg_temp ;variables used for context saving during ISR
110 status_temp 112 status_temp
314 logbook_temp5 ; Temp used in logbook display&Divemode&Gassetup 316 logbook_temp5 ; Temp used in logbook display&Divemode&Gassetup
315 logbook_temp6 ; Temp used in logbook display&Divemode&Gassetup 317 logbook_temp6 ; Temp used in logbook display&Divemode&Gassetup
316 318
317 convert_value_temp:3 ; used in menu_battery_state_convert_date 319 convert_value_temp:3 ; used in menu_battery_state_convert_date
318 time_correction_value ; Adds to Seconds on midnight 320 time_correction_value ; Adds to Seconds on midnight
319 ENDC
320
321 CBLOCK 0x200 ;Bank 2
322 int_O_tissue_for_debug:.32 ; deco_debug copies pressure of tissue to this variable
323 int_O_GF_spare____:2; // 0x240
324 int_O_GF_step:2; // 0x242
325 int_O_gtissue_limit:2; // 0x244
326 int_O_gtissue_press:2; // 0x246
327 int_O_limit_GF_low:2; // 0x248
328 int_O_gtissue_press_at_GF_low:2; // 0x24A
329 ENDC
330
331 CBLOCK 0x24C
332 char_I_step_is_1min; // 0x24C
333 ENDC
334
335 CBLOCK 0x24E ;Bank 2
336 char_O_GF_low_pointer; // 0x24E
337 char_O_actual_pointer; // 0x24F
338 ENDC
339 CBLOCK 0x250 ;Bank 2
340 char_O_deco_table:.32; // 0x250
341 ENDC
342 CBLOCK 0x270 ;Bank 2
343 char_I_table_deco_done:.32; // 0x270
344 ENDC
345 CBLOCK 0x290 ;Bank 2
346 int_O_calc_tissue_call_counter:2
347 ENDC
348 CBLOCK 0x380 ;Bank 3
349 ; some used in C code!
350 ENDC
351
352 CBLOCK 0x500
353 ; used by deco_main c-code for data transfer with the asm code
354 ; input of c-code
355 int_I_pres_respiration:2; ; 0x500
356 int_I_pres_surface:2; ; 0x502
357 int_I_temp:2; ; 0x504
358 char_I_temp; ; 0x506
359 char_I_actual_ppO2; ; 0x507
360 char_I_deco_N2_ratio2; // 0x508 new in v.102
361 char_I_deco_He_ratio2; // 0x509 new in v.102
362 char_I_deco_N2_ratio3; // 0x50A new in v.102
363 char_I_deco_He_ratio3; // 0x50B new in v.102
364 char_I_deco_N2_ratio4; // 0x50C new in v.102
365 char_I_deco_He_ratio4; // 0x50D new in v.102
366 char_I_deco_N2_ratio5; // 0x50E new in v.102
367 char_I_deco_He_ratio5; // 0x50F new in v.102
368 char_I_N2_ratio; ; 0x510
369 char_I_He_ratio; ; 0x511
370 char_I_saturation_multiplier; ; for conservatism/safety values 1.0 (no conservatism) to 1.5 (50% faster saturation
371 char_I_desaturation_multiplier; ; for conservatism/safety values 0.66 (50% slower desaturation) to 1.0 (no conservatism); consveratism used in calc_tissue(), calc_tissue_step_1_min() and sim_tissue_1min()
372 char_I_GF_Hi_percentage; ; 0x514
373 char_I_GF_Lo_percentage; ; 0x515
374 char_I_GF_Spare; ; 0x516
375 char_I_deco_distance; ; 0x517
376 char_I_const_ppO2; ; 0x518 new in v.101 (C-Code), new in v109 (asm)
377 char_I_deco_ppO2_change; ; 0x519 new in v.101
378 char_I_deco_ppO2; ; 0x51A new in v.101
379 char_I_deco_gas_change; ; 0x51B new in v.101
380 char_I_deco_N2_ratio; ; 0x51C new in v.101
381 char_I_deco_He_ratio; ; 0x51D new in v.101
382 char_I_depth_last_deco; ; 0x51E new in v.101
383 char_I_deco_model; ; 0x51F new in v.102
384 ; output of c-code:
385 int_O_desaturation_time:2; ; 0x520
386 char_O_nullzeit; ; 0x522
387 char_O_deco_status; ; 0x523
388 char_O_array_decotime:7; ; 0x524
389 char_O_array_decodepth:6; ; 0x52B
390 char_O_ascenttime; ; 0x531
391 char_O_gradient_factor; ; 0x532
392 char_O_tissue_saturation:.32; ; 0x533, He starts at 0x543
393 char_O_array_gradient_weighted:.16 ; 0x553
394 char_O_gtissue_no; ; 0x563
395 char_O_diluent; ; 0x564 new in v.101 (C-Code), new in v109 (asm)
396 char_O_CNS_fraction; ; 0x565 new in v.101
397 char_O_relative_gradient_GF; ; 0x566 new in v.102
398 char_I_deco_gas_change2; // 0x567 new in v.102
399 char_I_deco_gas_change3; // 0x568 new in v.102
400 char_I_deco_gas_change4; // 0x569 new in v.102
401 char_I_deco_gas_change5; // 0x56A new in v.102
402 ENDC 321 ENDC
403 322
404 CBLOCK 0x700 ;Bank 7 323 CBLOCK 0x700 ;Bank 7
405 ; variables used exclusively in dd: 324 ; variables used exclusively in dd:
406 dd_temp_BSR ; has to be first in bank7 325 dd_temp_BSR ; has to be first in bank7
442 extern deco_calc_hauptroutine 361 extern deco_calc_hauptroutine
443 extern deco_calc_percentage 362 extern deco_calc_percentage
444 extern deco_calc_wo_deco_step_1_min 363 extern deco_calc_wo_deco_step_1_min
445 extern deco_clear_CNS_fraction 364 extern deco_clear_CNS_fraction
446 extern deco_clear_tissue 365 extern deco_clear_tissue
447 extern deco_gradient_array
448 extern deco_hash 366 extern deco_hash
449 extern deco_pull_tissues_from_vault 367 extern deco_pull_tissues_from_vault
450 extern deco_push_tissues_to_vault 368 extern deco_push_tissues_to_vault
451 369
452 ;I/O Ports (I=Input, O=Output) 370 ;I/O Ports (I=Input, O=Output)