Mercurial > public > hwos_code
comparison src/p2_deco.c @ 634:4050675965ea
3.10 stable release
author | heinrichsweikamp |
---|---|
date | Tue, 28 Apr 2020 17:34:31 +0200 |
parents | 185ba2f91f59 |
children | 9a64914a8fca |
comparison
equal
deleted
inserted
replaced
633:690c48db7b5b | 634:4050675965ea |
---|---|
1 // *************************************************************************** | 1 // *************************************************************************** |
2 // p2_deco.c combined next generation V3.08.8 | 2 // p2_deco.c combined next generation V3.09.4 |
3 // | 3 // |
4 // Created on: 12.05.2009 | 4 // Created on: 12.05.2009 |
5 // Author: heinrichs weikamp, contributions by Ralph Lembcke and others | 5 // Author: heinrichs weikamp, contributions by Ralph Lembcke and others |
6 // | 6 // |
7 // *************************************************************************** | 7 // *************************************************************************** |
817 // | 817 // |
818 // ********************************************************************************************************************************* | 818 // ********************************************************************************************************************************* |
819 | 819 |
820 | 820 |
821 // p2deco code moved from 0x0D000 to 0x0C000 in v.108 | 821 // p2deco code moved from 0x0D000 to 0x0C000 in v.108 |
822 // moved from 0x0C000 to 0x0B000 in v3.09 | |
822 #ifndef UNIX | 823 #ifndef UNIX |
823 # pragma code p2_deco = 0x0C000 | 824 # pragma code p2_deco = 0x0B000 |
824 #endif | 825 #endif |
825 | 826 |
826 | 827 |
827 ////////////////////////////////////////////////////////////////////////////// | 828 ////////////////////////////////////////////////////////////////////////////// |
828 // Bump to blue-screen when an assert is wrong | 829 // Bump to blue-screen when an assert is wrong |
1924 // calculated respired pressure is < water vapor pressure, thus set ppN2 and ppHe to 0 | 1925 // calculated respired pressure is < water vapor pressure, thus set ppN2 and ppHe to 0 |
1925 ppN2 = 0.0; | 1926 ppN2 = 0.0; |
1926 ppHe = 0.0; | 1927 ppHe = 0.0; |
1927 } | 1928 } |
1928 | 1929 |
1929 #ifdef _helium | 1930 #ifdef _ccr_pscr |
1930 // calculating real tissues? | 1931 // calculating real tissues? |
1931 if( tissue_increment & TISSUE_SELECTOR ) | 1932 if( tissue_increment & TISSUE_SELECTOR ) |
1932 { | 1933 { |
1933 overlay unsigned char temp; | 1934 overlay unsigned char temp; |
1934 | 1935 |
1935 // compute gas density of current mix in multiples of 0.01 grams per liter | 1936 // compute gas density of current mix in multiples of 0.01 grams per liter |
1936 int_O_gas_density = (unsigned int)( 17.9 * ppHe + 125.1 * ppN2 + 142.8 * ppO2 ); | 1937 int_O_gas_density = (unsigned int)( 17.9 * ppHe + 125.1 * ppN2 + 142.8 * ppO2 ); |
1937 | 1938 |
1938 // convert gas density into a 8 bit integer | 1939 // convert gas density into an 8 bit integer, scaling 0.1 grams per liter |
1939 temp = (unsigned char)( (int_O_gas_density + 9) / 10 ); | 1940 temp = (unsigned char)( (int_O_gas_density + 9) / 10 ); |
1940 | 1941 |
1941 // limit to display max and set warning or attention flag | 1942 // limit to display max and set warning or attention flag |
1942 if( temp > 99 ) int_O_gas_density = 999 | INT_FLAG_WARNING; | 1943 if( temp > 99 ) int_O_gas_density = 999 | INT_FLAG_WARNING; |
1943 else if( temp > char_I_gas_density_warn ) int_O_gas_density |= INT_FLAG_WARNING; | 1944 else if( temp >= char_I_gas_density_warn ) int_O_gas_density |= INT_FLAG_WARNING; |
1944 else if( temp > char_I_gas_density_att ) int_O_gas_density |= INT_FLAG_ATTENTION; | 1945 else if( temp >= char_I_gas_density_att ) int_O_gas_density |= INT_FLAG_ATTENTION; |
1945 } | 1946 } |
1946 #endif | 1947 #endif |
1947 } | 1948 } |
1948 | 1949 |
1949 | 1950 |