From 3effbff47141c7b54a12399841ba7d1bc9b87c33 Mon Sep 17 00:00:00 2001 From: Karan Misra Date: Thu, 27 Feb 2014 05:05:51 +0530 Subject: [PATCH] prefix host names with "Host" --- describe.go | 2 +- detect.go | 12 +++++++----- samples/gpiodetect.go | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/describe.go b/describe.go index 2ad2c67..f05aa86 100644 --- a/describe.go +++ b/describe.go @@ -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") diff --git a/detect.go b/detect.go index 147f79d..fdd9362 100644 --- a/detect.go +++ b/detect.go @@ -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) } diff --git a/samples/gpiodetect.go b/samples/gpiodetect.go index 1cb3717..17f3252 100644 --- a/samples/gpiodetect.go +++ b/samples/gpiodetect.go @@ -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)")