From f8f92af0563da0f393d55a7764ad05c1201215d4 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 9 Feb 2017 09:44:32 +0100 Subject: [PATCH] i2c: update function signatures to have correct types Signed-off-by: deadprogram --- drivers/i2c/helpers_test.go | 4 ++-- drivers/i2c/i2c.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/helpers_test.go b/drivers/i2c/helpers_test.go index 67e0dd1e..243258d0 100644 --- a/drivers/i2c/helpers_test.go +++ b/drivers/i2c/helpers_test.go @@ -36,7 +36,7 @@ func (t *i2cTestAdaptor) Close() error { return nil } -func (t *i2cTestAdaptor) ReadByte() (val uint8, err error) { +func (t *i2cTestAdaptor) ReadByte() (val byte, err error) { bytes := []byte{0} bytesRead, err := t.i2cReadImpl(bytes) if err != nil { @@ -82,7 +82,7 @@ func (t *i2cTestAdaptor) ReadBlockData(_ uint8, b []byte) (n int, err error) { return bytesRead, err } -func (t *i2cTestAdaptor) WriteByte(val uint8) (err error) { +func (t *i2cTestAdaptor) WriteByte(val byte) (err error) { t.written = append(t.written, val) bytes := []byte{val} _, err = t.i2cWriteImpl(bytes) diff --git a/drivers/i2c/i2c.go b/drivers/i2c/i2c.go index 48775c44..ea656ffe 100644 --- a/drivers/i2c/i2c.go +++ b/drivers/i2c/i2c.go @@ -60,7 +60,7 @@ func (c *i2cConnection) Close() error { return c.bus.Close() } -func (c *i2cConnection) ReadByte() (val uint8, err error) { +func (c *i2cConnection) ReadByte() (val byte, err error) { if err := c.bus.SetAddress(c.address); err != nil { return 0, err } @@ -88,7 +88,7 @@ func (c *i2cConnection) ReadBlockData(reg uint8, b []byte) (n int, err error) { return c.bus.ReadBlockData(reg, b) } -func (c *i2cConnection) WriteByte(val uint8) (err error) { +func (c *i2cConnection) WriteByte(val byte) (err error) { if err := c.bus.SetAddress(c.address); err != nil { return err }