From 0b6bfda8cf4b174a622c3d77c7b6dfa5330bc0bb Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 6 Mar 2021 00:12:17 +0100 Subject: [PATCH] all: do not take the pointer of an I2C object This is in preparation of PR https://github.com/tinygo-org/tinygo/pull/1693, which makes machine.I2C0 and similar objects of pointer type, so they can be freely passed around. --- examples/adt7410/main.go | 2 +- examples/gps/i2c/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/adt7410/main.go b/examples/adt7410/main.go index b633faf..132b77b 100644 --- a/examples/adt7410/main.go +++ b/examples/adt7410/main.go @@ -9,7 +9,7 @@ import ( ) var ( - i2c = &machine.I2C0 + i2c = machine.I2C0 sensor = adt7410.New(i2c) ) diff --git a/examples/gps/i2c/main.go b/examples/gps/i2c/main.go index 2aab5d9..8f7873c 100644 --- a/examples/gps/i2c/main.go +++ b/examples/gps/i2c/main.go @@ -10,7 +10,7 @@ import ( func main() { println("GPS I2C Example") machine.I2C0.Configure(machine.I2CConfig{}) - ublox := gps.NewI2C(&machine.I2C0) + ublox := gps.NewI2C(machine.I2C0) parser := gps.NewParser() var fix gps.Fix for {