Skip to content
This repository was archived by the owner on Feb 18, 2020. It is now read-only.

Conversation

@mlgd
Copy link

@mlgd mlgd commented Aug 6, 2016

No description provided.

valueFile: value,
initial: true,
}
if exposed {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exposed is never false unless expose() fails

Copy link
Author

@mlgd mlgd Aug 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exposed is set to true if GPIO port is already opened :

func expose(pin int) (string, bool, error) {
exposed := false
pinBase := filepath.Join(gpiobase, fmt.Sprintf("gpio%d", pin))
var err error
if _, statErr := os.Stat(pinBase); os.IsNotExist(statErr) {
err = writeFile(exportPath, "%d", pin)
} else {
exposed = true
}
return pinBase, exposed, err
}

@davecheney
Copy link
Owner

Thanks for your change. As you've probably discovered, this repo is long dead. I'm happy to merge this change once you've addressed my comments, but you may find it easier to fork and run. I won't take it personally :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants