From bb4ba5709686e80dceccfd006a0532bc30f13725 Mon Sep 17 00:00:00 2001 From: George Sexton Date: Fri, 28 Mar 2025 14:28:23 -0600 Subject: [PATCH] Fix formatting --- hd44780/af_i2c_backpack.go | 6 +++--- hd44780/example_test.go | 2 +- hd44780/hd44780.go | 6 +++--- hd44780/pcf857x_backpack.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hd44780/af_i2c_backpack.go b/hd44780/af_i2c_backpack.go index 2f572e0..21edad4 100644 --- a/hd44780/af_i2c_backpack.go +++ b/hd44780/af_i2c_backpack.go @@ -43,7 +43,7 @@ func NewAdafruitI2CBackpack(bus i2c.Bus, address uint16, rows, cols int) (*HD447 reset, _ := gr.ByOffset(4).(gpio.PinOut) enable, _ := gr.ByOffset(5).(gpio.PinOut) bl := gr.ByOffset(6).(gpio.PinOut) - return NewHD44780(gr, &reset, &enable, NewBacklight(bl), rows, cols) + return NewHD44780(gr, reset, enable, NewBacklight(bl), rows, cols) } // This function returns a display configured to use the SPI side of the Adafruit @@ -55,8 +55,8 @@ func NewAdafruitSPIBackpack(conn spi.Conn, rows, cols int) (*HD44780, error) { } // The SPI side has the same pins but in reverse order from the I2C side. gr, _ := chip.Group(d7, d6, d5, d4) - rs := &chip.Pins[rsPin] - e := &chip.Pins[enablePin] + rs := chip.Pins[rsPin] + e := chip.Pins[enablePin] bl := chip.Pins[backlightPin] return NewHD44780(gr, rs, e, NewBacklight(bl), rows, cols) } diff --git a/hd44780/example_test.go b/hd44780/example_test.go index 51a6e9b..2690020 100644 --- a/hd44780/example_test.go +++ b/hd44780/example_test.go @@ -46,7 +46,7 @@ func Example() { reset := pins[4].(gpio.PinOut) enable := pins[5].(gpio.PinOut) bl := hd44780.NewBacklight(pins[6].(gpio.PinOut)) - lcd, err := hd44780.NewHD44780(ls, &reset, &enable, bl, 2, 16) + lcd, err := hd44780.NewHD44780(ls, reset, enable, bl, 2, 16) if err != nil { log.Fatal(err) } diff --git a/hd44780/hd44780.go b/hd44780/hd44780.go index 37a7a08..f8d484a 100644 --- a/hd44780/hd44780.go +++ b/hd44780/hd44780.go @@ -83,7 +83,7 @@ func getRowConstant(row, maxcols int) byte { // display.DisplayRGBBacklight. See GPIOMonoBacklight. func NewHD44780( dataPinGroup gpio.Group, - resetPin, enablePin *gpio.PinOut, + resetPin, enablePin gpio.PinOut, backlight any, rows, cols int) (*HD44780, error) { @@ -94,8 +94,8 @@ func NewHD44780( lcd := &HD44780{ dataPins: dataPinGroup, - resetPin: *resetPin, - enablePin: *enablePin, + resetPin: resetPin, + enablePin: enablePin, mode: mode, rows: rows, cols: cols, diff --git a/hd44780/pcf857x_backpack.go b/hd44780/pcf857x_backpack.go index 939c922..6c25499 100644 --- a/hd44780/pcf857x_backpack.go +++ b/hd44780/pcf857x_backpack.go @@ -46,5 +46,5 @@ func NewPCF857xBackpack(bus i2c.Bus, address uint16, rows, cols int) (*HD44780, reset := grPins[4].(gpio.PinOut) enable := grPins[5].(gpio.PinOut) bl := grPins[6].(gpio.PinOut) - return NewHD44780(gr, &reset, &enable, NewBacklight(bl), rows, cols) + return NewHD44780(gr, reset, enable, NewBacklight(bl), rows, cols) }