prefix host names with "Host"

This commit is contained in:
Karan Misra 2014-02-27 05:05:51 +05:30
parent 6f8576873f
commit 3effbff471
3 changed files with 10 additions and 8 deletions

View File

@ -20,7 +20,7 @@ func describeHost() (descriptor, error) {
}
switch host {
case RPi:
case HostRPi:
return rpi.Descriptor(rev), nil
default:
return nil, errors.New("host: invalid host")

View File

@ -10,9 +10,11 @@ import (
type Host int
const (
Null Host = iota
RPi
BBB
HostNull Host = iota
HostRPi
HostBBB
HostCubieTruck
HostGalileo
)
func execOutput(name string, arg ...string) (output string, err error) {
@ -67,9 +69,9 @@ func DetectHost() (host Host, rev int, err error) {
switch node {
case "raspberrypi":
host = RPi
host = HostRPi
case "beaglebone":
host = BBB
host = HostBBB
default:
err = fmt.Errorf("embd: your host %q is not supported at this moment. please request support at https://github.com/kidoman/embd/issues", node)
}

View File

@ -15,9 +15,9 @@ func main() {
var pinNo interface{}
switch h {
case embd.BBB:
case embd.HostBBB:
pinNo = "P9_31"
case embd.RPi:
case embd.HostRPi:
pinNo = 10
default:
panic("host not supported (yet :P)")