Skip to content

Commit 27b25be

Browse files
committed
itsybitsy-m4: remove extra variables for i2c test
Signed-off-by: deadprogram <[email protected]>
1 parent cf1a644 commit 27b25be

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

itsybitsy-m4/main.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ var (
4242
analogG = machine.ADC{machine.A2}
4343

4444
// used by i2c tests
45-
accel *mpu6050.Device
4645
powerpin = machine.D7
4746

4847
serial = machine.UART0
@@ -251,8 +250,7 @@ func i2cConnection() {
251250
powerpin.Configure(machine.PinConfig{Mode: machine.PinOutput})
252251
time.Sleep(100 * time.Millisecond)
253252

254-
a := mpu6050.New(machine.I2C0)
255-
accel = &a
253+
accel := mpu6050.New(machine.I2C0)
256254

257255
printtest("i2cConnectionNoPower")
258256

@@ -268,10 +266,10 @@ func i2cConnection() {
268266
printtest("i2cConnectionPower")
269267
// turn on power and should be connected now
270268
powerpin.High()
271-
time.Sleep(500 * time.Millisecond)
269+
time.Sleep(100 * time.Millisecond)
272270

273271
accel.Configure()
274-
time.Sleep(500 * time.Millisecond)
272+
time.Sleep(100 * time.Millisecond)
275273

276274
if !accel.Connected() {
277275
printtestresult("fail")

0 commit comments

Comments
 (0)