From 68ba342e1bf6b5c345516ab3b3a6fb1e2e22d39e Mon Sep 17 00:00:00 2001 From: Kunal Powar Date: Thu, 10 Apr 2014 07:38:14 +0530 Subject: [PATCH] i2c: added debug logs --- host/generic/i2cbus.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index bb5a348..dc8e74c 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -11,6 +11,7 @@ import ( "time" "unsafe" + "github.com/golang/glog" "github.com/kidoman/embd" ) @@ -58,6 +59,8 @@ func (b *i2cBus) init() error { return err } + glog.V(2).Infof("i2c: bus %v initialized", b.l) + b.initialized = true return nil @@ -65,6 +68,7 @@ func (b *i2cBus) init() error { func (b *i2cBus) setAddress(addr byte) error { if addr != b.addr { + glog.V(2).Infof("i2c: setting bus %v address to %#02x", b.l, addr) if _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, b.file.Fd(), slaveCmd, uintptr(addr)); errno != 0 { return syscall.Errno(errno) }