mirror of
https://github.com/kidoman/embd
synced 2025-04-18 07:58:29 +02:00
prefix host names with "Host"
This commit is contained in:
parent
6f8576873f
commit
3effbff471
@ -20,7 +20,7 @@ func describeHost() (descriptor, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch host {
|
switch host {
|
||||||
case RPi:
|
case HostRPi:
|
||||||
return rpi.Descriptor(rev), nil
|
return rpi.Descriptor(rev), nil
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("host: invalid host")
|
return nil, errors.New("host: invalid host")
|
||||||
|
12
detect.go
12
detect.go
@ -10,9 +10,11 @@ import (
|
|||||||
type Host int
|
type Host int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Null Host = iota
|
HostNull Host = iota
|
||||||
RPi
|
HostRPi
|
||||||
BBB
|
HostBBB
|
||||||
|
HostCubieTruck
|
||||||
|
HostGalileo
|
||||||
)
|
)
|
||||||
|
|
||||||
func execOutput(name string, arg ...string) (output string, err error) {
|
func execOutput(name string, arg ...string) (output string, err error) {
|
||||||
@ -67,9 +69,9 @@ func DetectHost() (host Host, rev int, err error) {
|
|||||||
|
|
||||||
switch node {
|
switch node {
|
||||||
case "raspberrypi":
|
case "raspberrypi":
|
||||||
host = RPi
|
host = HostRPi
|
||||||
case "beaglebone":
|
case "beaglebone":
|
||||||
host = BBB
|
host = HostBBB
|
||||||
default:
|
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)
|
err = fmt.Errorf("embd: your host %q is not supported at this moment. please request support at https://github.com/kidoman/embd/issues", node)
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@ func main() {
|
|||||||
var pinNo interface{}
|
var pinNo interface{}
|
||||||
|
|
||||||
switch h {
|
switch h {
|
||||||
case embd.BBB:
|
case embd.HostBBB:
|
||||||
pinNo = "P9_31"
|
pinNo = "P9_31"
|
||||||
case embd.RPi:
|
case embd.HostRPi:
|
||||||
pinNo = 10
|
pinNo = 10
|
||||||
default:
|
default:
|
||||||
panic("host not supported (yet :P)")
|
panic("host not supported (yet :P)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user