bob
This commit is contained in:
1 parent
836b8c92d4
commit
7f0eca5aa2
1 file changed
+12
-1
@@ -71,11 +71,20 @@ var (
|
|||||||
FUN1_13 pin.Pin = allwinner.PL11 // IR-RX
|
FUN1_13 pin.Pin = allwinner.PL11 // IR-RX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func isOrangePiZeroModel(model string) bool {
|
||||||
|
lowerModel := strings.ToLower(model)
|
||||||
|
|
||||||
|
return strings.Contains(lowerModel, "orange") &&
|
||||||
|
strings.Contains(lowerModel, "pi") &&
|
||||||
|
strings.Contains(lowerModel, "zero")
|
||||||
|
}
|
||||||
|
|
||||||
// registerHeaders registers the headers for various Orange Pi boards. Currently
|
// registerHeaders registers the headers for various Orange Pi boards. Currently
|
||||||
// only Orange Pi Zero is supported.
|
// only Orange Pi Zero is supported.
|
||||||
func registerHeaders(model string) error {
|
func registerHeaders(model string) error {
|
||||||
// http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero.html
|
// http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero.html
|
||||||
if strings.Contains(model, boardZero) {
|
if isOrangePiZeroModel(model) {
|
||||||
|
fmt.Println("It is an orange pi zero!")
|
||||||
// 26pin expansion port
|
// 26pin expansion port
|
||||||
if err := pinreg.Register("PA", [][]pin.Pin{
|
if err := pinreg.Register("PA", [][]pin.Pin{
|
||||||
{PA1_1, PA1_2},
|
{PA1_1, PA1_2},
|
||||||
@@ -113,6 +122,8 @@ func registerHeaders(model string) error {
|
|||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
fmt.Println("Sad panda")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in new issue
Block a user