changeset 564:4e9e95d108d2 bug_deco_clearing_missed_stops

Minor cleanups for MacOSX compatibility.
author JeanDo
date Wed, 29 Feb 2012 01:21:31 +0100
parents 7bec4cf28cc7
children 19161c50654a
files code_part1/OSTC_code_c_part2/p2_deco.c
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Sat Feb 25 19:41:43 2012 +0100
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Wed Feb 29 01:21:31 2012 +0100
@@ -155,7 +155,6 @@
 //---- Bank 4 parameters -----------------------------------------------------
 #pragma udata bank4=0x400
 
-static float			temp_limit;
 static float			GF_low;
 static float			GF_high;
 static float			GF_delta;
@@ -345,8 +344,8 @@
 static short read_custom_function(PARAMETER unsigned char cf)
 {
 #ifdef CROSS_COMPILE
-    return (cf & 32) ? eeprom.bank1_CF[cf-32].value
-                     : eeprom.bank0_CF[cf   ].value;
+    return (cf & 32) ? eeprom.bank1_CF[cf-32].value.lo
+                     : eeprom.bank0_CF[cf   ].value.lo;
 #else
     extern unsigned char hi, lo;
     extern void getcustom15();
@@ -390,7 +389,7 @@
     _endasm
 #endif
 
-    assert( 0 <= ci && ci < NUM_COMP );
+    assert( ci < NUM_COMP );
 
     // Use an interleaved array (AoS) to access coefficients with a
     // single addressing.
@@ -421,7 +420,7 @@
     _endasm
 #endif
 
-    assert( 0 <= ci && ci < NUM_COMP );
+    assert( ci < NUM_COMP );
 
     // Integration intervals.
     switch(period)
@@ -472,7 +471,7 @@
     _endasm
 #endif
 
-    assert( 0 <= ci && ci < NUM_COMP );
+    assert( ci < NUM_COMP );
     {
         overlay rom const float* ptr = &buhlmann_ht[2*ci];
         var_N2_ht = *ptr++;
@@ -879,7 +878,7 @@
 //
 static void gas_switch_set(void)
 {
-    assert( 0 <= sim_gas_last_used && sim_gas_last_used <= NUM_GAS );
+    assert( sim_gas_last_used <= NUM_GAS );
 
     if( sim_gas_last_used == 0 )    // Gas6 = manualy set gas.
     {
@@ -2309,7 +2308,7 @@
     RESET_C_STACK
 
     assert( 60 <= char_I_temp && char_I_temp <= 100 );
-    assert(  0 <= int_I_temp  && int_I_temp  < 5760 );      // Less than 4 days = 96h...
+    assert( int_I_temp  < 5760 );      // Less than 4 days = 96h...
 
     int_I_temp = (unsigned short)(((float)int_I_temp * (float)char_I_temp) * 0.01 );