diff options
-rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -67,12 +67,14 @@ 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 - bus_err(errno); + printf("I2C communication(wr) error. errno: %d\n",errno); + perror(errno); } usleep(waitlen*1000); //# Wait 10ms for reading if(read(devicef, buf, rdlen) != rdlen) { //# read the result - bus_err(errno); + printf("I2C communication(rd) error. errno: %d\n",errno); + perror(errno); } return buf; } |