]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
now working
authorhadaq <hadaq>
Fri, 18 Sep 2009 23:36:37 +0000 (23:36 +0000)
committerhadaq <hadaq>
Fri, 18 Sep 2009 23:36:37 +0000 (23:36 +0000)
trbrich/trbrichcmd.c

index cac526c970c542a002cd4877d9d980241fb96921..7c4ee2ab9e29b9c36f404110bf764a447b9236f5 100644 (file)
@@ -13,7 +13,7 @@
 
 #define TEMP_RESOLUTION 0.0625
 
-static const char trb_i2c_version[] = "$Revision: 1.2 $"; 
+static const char trb_i2c_version[] = "$Revision: 1.3 $"; 
 
 static const uint16_t adcm_uid_register = 0xc000;
 
@@ -112,7 +112,9 @@ int main(int argc, char** argv)
       for (i = 0, ctr = 0; (i < len) && (tmp < end); i += 4, tmp += 4, ctr++) {
         if ((tmp[2] & 0x8000) > 0 ) {
           printf("%02d  0x%08x%08x\n", ctr, tmp[1], tmp[0]);       
-        }
+        } else {
+          printf("%02d  ------------------\n", ctr);
+       }
       }
     }
             
@@ -162,12 +164,13 @@ int main(int argc, char** argv)
       for (i = 0, ctr = 0; (i < len) && (tmp < end); i += 4, tmp += 4, ctr++) {
         if ((tmp[2] & 0x8000) > 0 ) {
           int16_t temperature = tmp[2] & 0x7fff;
-          temperature = 0x8e37 & 0x7fff;
           temperature = (temperature & 0x0800) == 0 
             ? temperature 
             : temperature | 0xf000;  
           printf("%02d  %.04f\n", ctr, temperature * TEMP_RESOLUTION);
-        }
+        } else {
+          printf("%02d  -------\n", ctr);
+       }
       }
     }