From 42a2d1842d56c7332c024b58c1094d98a995db50 Mon Sep 17 00:00:00 2001 From: hadaq Date: Fri, 18 Sep 2009 23:36:37 +0000 Subject: [PATCH] now working --- trbrich/trbrichcmd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/trbrich/trbrichcmd.c b/trbrich/trbrichcmd.c index cac526c..7c4ee2a 100644 --- a/trbrich/trbrichcmd.c +++ b/trbrich/trbrichcmd.c @@ -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); + } } } -- 2.43.0