aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--src/main.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0c9b0c1..c913718 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,9 @@ armhf:
x86:
$(CC) $(CFLAGS) src/hmc5883.c src/hih61xx.c src/lm75.c src/main.c -o build/i2sensors
+geode:
+ $(CC) $(CFLAGS) -m32 -mtune=geode -march=geode src/hmc5883.c src/hih61xx.c src/lm75.c src/main.c -o build/i2sensors
+
copy:
scp -r build/i2sensors-armhf root@cb2:/tmp/i2sensors
# rsync -aHv -q -e "ssh" build/i2sensors-arm root@cb2:/tmp/i2sensors
diff --git a/src/main.c b/src/main.c
index 09afe49..2920a2a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -18,7 +18,7 @@
#include "hih61xx.h"
#include "hmc5883.h"
-#define VERSION 1.22
+#define VERSION 1.24
// extern void lm75_print_help(void);
// extern void lm75_read_all(const char *opts);
@@ -66,8 +66,8 @@ void bus_err(int ern){
uchar *xchg_data (uchar *buf, uint16 wrlen, uint16 waitlen, uint16 rdlen){ //# [buf] = 32 byte
- if(write(devicef, buf, wrlen) != wrlen){ //# write one byte to device
- perror("I2C communication(wr) error.");
+ if(write(devicef, buf, 1) != 1){ //# write one byte to device
+ perror("I2C communication(wrr) error.");
printf("errno: %d\n",errno);
}
usleep(waitlen*1000); //# Wait 10ms for reading