Fix lint errors

pull/92/head
George Sexton 1 year ago
parent e5400cd321
commit f4e4334cc1

@ -3,7 +3,7 @@
// that can be found in the LICENSE file. // that can be found in the LICENSE file.
// Package mcp23xxx provides drivers for the MCP23XXX family of GPIO expanders. // Package mcp23xxx provides drivers for the MCP23XXX family of GPIO expanders.
// It's availble with either I2C or SPI interfaces in 8 and 16 bit variants. // It's available with either I2C or SPI interfaces in 8 and 16 bit variants.
// Additionally, variants are available that have Open-Drain outputs. // Additionally, variants are available that have Open-Drain outputs.
// //
// # Datasheet // # Datasheet

@ -115,6 +115,9 @@ func (pg *pinGroup) Out(value, mask gpio.GPIOValue) error {
// Read the current value // Read the current value
currentValue, err := port.olat.readValue(true) currentValue, err := port.olat.readValue(true)
if err != nil {
return err
}
// Apply the mask to clear bits we're writing. // Apply the mask to clear bits we're writing.
currentValue &= (0xff ^ wrMask) currentValue &= (0xff ^ wrMask)
// Or the value with the bits to modify // Or the value with the bits to modify

@ -98,9 +98,7 @@ func TestReadWrite(t *testing.T) {
// For this test, write to the pins individually, and then // For this test, write to the pins individually, and then
// confirm read on the other set works as expected. // confirm read on the other set works as expected.
x := gRead
gRead = gOut gRead = gOut
gOut = x
t.Log(gRead) t.Log(gRead)
pinset := extender.Pins[0][:4] pinset := extender.Pins[0][:4]
for i := range gpio.GPIOValue(16) { for i := range gpio.GPIOValue(16) {

Loading…
Cancel
Save