Skip to content

Commit

Permalink
Merge pull request hybridgroup#386 from erkkah/drv2605-bugfix
Browse files Browse the repository at this point in the history
Small bugfix for the DRV2605 driver
  • Loading branch information
deadprogram authored Mar 15, 2017
2 parents b7791a9 + 7328471 commit 248fea6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/i2c/drv2605l_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (d *DRV2605LDriver) SetMode(newMode DRV2605Mode) (err error) {
}

// clear mode bits (lower three bits)
mode &= 0xf1
mode &= 0xf8
// set new mode bits
mode |= uint8(newMode)

Expand Down Expand Up @@ -264,7 +264,7 @@ func (d *DRV2605LDriver) Halt() (err error) {
}

// enter standby
return d.connection.WriteByteData(drv2605RegMode, 1)
return d.SetStandbyMode(true)
}
return
}
2 changes: 1 addition & 1 deletion drivers/i2c/drv2605l_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestDRV2605LDriverHalt(t *testing.T) {
gobottest.Assert(t, d.Start(), nil)
adaptor.written = []byte{}
gobottest.Assert(t, d.Halt(), nil)
gobottest.Assert(t, adaptor.written, []byte{drv2605RegGo, 0, drv2605RegMode, 1})
gobottest.Assert(t, adaptor.written, []byte{drv2605RegGo, 0, drv2605RegMode, 42 | drv2605Standby})
}

func TestDRV2605LDriverGetPause(t *testing.T) {
Expand Down

0 comments on commit 248fea6

Please sign in to comment.