gpioreg: Switch aliases to be to names instead of numbers.

This makes it much more generic and extensible. This will enable addressing
issue #125.

Refuse registering an high and low priority pins with different numbers but same
name and reverse.
pull/1/head
Marc-Antoine Ruel 9 years ago
parent bdefda99fb
commit 2853fb49f6

@ -220,12 +220,12 @@ func (d *driver) Init() (bool, error) {
return false, nil return false, nil
} }
if in != -1 { if in != -1 {
if err := gpioreg.RegisterAlias("IR_IN", in); err != nil { if err := gpioreg.RegisterAlias("IR_IN", strconv.Itoa(in)); err != nil {
return true, err return true, err
} }
} }
if out != -1 { if out != -1 {
if err := gpioreg.RegisterAlias("IR_OUT", out); err != nil { if err := gpioreg.RegisterAlias("IR_OUT", strconv.Itoa(out)); err != nil {
return true, err return true, err
} }
} }

Loading…
Cancel
Save