From 647a90c0f2379bdbd926d35a4e65386b78951a63 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Fri, 11 Aug 2023 22:09:22 +0300 Subject: [PATCH] Enable Wiegand data internal pull-ups Back Door shield needs it as it does not have external pull-ups --- wiegand.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiegand.go b/wiegand.go index 97c9f96..255155e 100644 --- a/wiegand.go +++ b/wiegand.go @@ -113,14 +113,14 @@ func WiegandSetup(a int, b int, bitTimeout time.Duration, solenoid int) *Wiegand } wa, err := gpiod.RequestLine("gpiochip0", a, gpiod.AsInput, - gpiod.WithFallingEdge, gpiod.WithEventHandler(wiegand.wiegandAEvent)) + gpiod.WithFallingEdge, gpiod.LineBiasPullUp, gpiod.WithEventHandler(wiegand.wiegandAEvent)) if err != nil { panic(err) } wiegand.aLine = wa wb, err := gpiod.RequestLine("gpiochip0", b, gpiod.AsInput, - gpiod.WithFallingEdge, gpiod.WithEventHandler(wiegand.wiegandBEvent)) + gpiod.WithFallingEdge, gpiod.LineBiasPullUp, gpiod.WithEventHandler(wiegand.wiegandBEvent)) if err != nil { panic(err) }