view code_part1/OSTC_code_c_part2/p2_definitions.h @ 233:2cbaa01dac26

Hunting for NoFly (bug BB13)... not found yet... + In DEBUG compile, keep simulated dives in logbook, desat and nofly time, etc.
author JeanDo
date Tue, 15 Mar 2011 19:16:34 +0100
parents 638f8e17bd51
children ade0848c8b8b
line wrap: on
line source

// *********************************************************
// ** Common definitions for the OSTC decompression code  **
// *********************************************************

//////////////////////////////////////////////////////////////////////////////
// OSTC - diving computer code
// Copyright (C) 2008 HeinrichsWeikamp GbR
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
//////////////////////////////////////////////////////////////////////////////
// history:
// 12/25/10 v110: [jDG] split in three files (deco.c, main.c, definitions.h)

#define	DBG_c_gas	0x0001
#define	DBG_c_ppO2	0x0002
#define	DBG_RUN 	0x0004
#define	DBG_RESTART 0x0008

#define	DBG_CdeSAT 	0x0010
#define	DBG_C_MODE	0x0020
#define	DBG_C_SURF	0x0040
#define	DBG_HEwoHE 	0x0080

#define	DBG_C_DPPO2	0x0100
#define	DBG_C_DGAS 	0x0200
#define	DBG_C_DIST	0x0400
#define	DBG_C_LAST	0x0800

#define	DBG_C_GF	0x1000
#define	DBG_ZH16ERR	0x2000
#define	DBG_PHIGH	0x4000
#define	DBG_PLOW	0x8000

#define	DBS_mode	0x0001
#define	DBS_ppO2	0x0002
#define	DBS_HE_sat	0x0004
#define	DBS_ppO2chg 0x0008
                    
#define	DBS_SAT2l	0x0010
#define	DBS_SAT2h	0x0020
#define	DBS_GFLOW2l	0x0040
#define	DBS_GFLOW2h	0x0080
                    
#define	DBS_GFHGH2l	0x0100
#define	DBS_GFHGH2h	0x0200
#define	DBS_GASO22l	0x0400
#define	DBS_GASO22h	0x0800
                    
#define	DBS_DIST2h 	0x1000
#define	DBS_LAST2h 	0x2000
#define	DBS_DECOO2l	0x4000
#define	DBS_DECOO2h	0x8000

#define	DBS2_PRES2h 0x0001
#define	DBS2_PRES2l 0x0002
#define	DBS2_SURF2l	0x0004
#define	DBS2_SURF2h	0x0008
                    
#define DBS2_DESAT2l 0x0010
#define DBS2_DESAT2h 0x0020
#define	DBS2_GFDneg  0x0040

#define	MBAR_REACH_GASCHANGE_AUTO_CHANGE_OFF	150

// *************************
// ** P R O T O T Y P E S **
// *************************

extern void calc_percentage(void);
extern void deco_calc_hauptroutine(void);
extern void deco_clear_tissue(void);
extern void deco_calc_percentage(void);
extern void deco_calc_wo_deco_step_1_min(void);
extern void deco_debug(void);
extern void deco_gradient_array(void);
extern void deco_hash(void);
extern void deco_calc_desaturation_time(void);
extern void deco_calc_CNS_fraction(void);
extern void deco_clear_CNS_fraction(void);
extern void deco_push_tissues_to_vault(void);
extern void deco_pull_tissues_from_vault(void);
extern void deco_gas_volumes(void);

// ***********************************************
// **         Allow compile on VisualC          **
// ***********************************************

#ifdef WIN32
    // Some keywords just dont exists on Visual C++:
#   define CROSS_COMPILE
#   define __18CXX
#   define ram
#   define rom
#   define overlay
#   define PARAMETER

#include <assert.h>

    // Avoid warnings about float/double mismatches:
#   pragma warning(disable: 4244 4068 4305)
#else
#   define PARAMETER static
#   define assert(predicate)
#endif

//////////////////////////////////////////////////////////////////////////////