mirror of
https://github.com/kidoman/embd
synced 2025-07-03 03:47:33 +02:00
matrix4x3: client should ensure rpio is initialised before using
This commit is contained in:
parent
d2ffacd22c
commit
cd54380887
2 changed files with 6 additions and 10 deletions
|
@ -78,7 +78,7 @@ type Matrix4x3 interface {
|
|||
PressedKey() (Key, error)
|
||||
|
||||
// Close.
|
||||
Close() error
|
||||
Close()
|
||||
}
|
||||
|
||||
type matrix4x3 struct {
|
||||
|
@ -127,10 +127,6 @@ func (d *matrix4x3) setup() (err error) {
|
|||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
|
||||
if err = rpio.Open(); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < rows; i++ {
|
||||
d.rpioRowPins[i].Input()
|
||||
d.rpioRowPins[i].PullUp()
|
||||
|
@ -210,12 +206,8 @@ func (d *matrix4x3) Run() {
|
|||
}
|
||||
|
||||
// Close.
|
||||
func (d *matrix4x3) Close() (err error) {
|
||||
func (d *matrix4x3) Close() {
|
||||
if d.quit != nil {
|
||||
d.quit <- true
|
||||
}
|
||||
|
||||
rpio.Close()
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue