-
Notifications
You must be signed in to change notification settings - Fork 110
/
pi_notsupported.go
40 lines (35 loc) · 996 Bytes
/
pi_notsupported.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//go:build !(linux && (arm64 || arm))
package pi
import (
"context"
"github.com/edaniels/golog"
"github.com/pkg/errors"
"go.viam.com/rdk/components/board"
"go.viam.com/rdk/components/board/pi/common"
"go.viam.com/rdk/components/servo"
"go.viam.com/rdk/config"
"go.viam.com/rdk/registry"
)
// init registers a failing pi board since this can only be compiled on non-pi systems.
func init() {
registry.RegisterComponent(
board.Subtype,
picommon.ModelName,
registry.Component{Constructor: func(
ctx context.Context,
deps registry.Dependencies,
config config.Component,
logger golog.Logger,
) (interface{}, error) {
return nil, errors.New("not running on a pi")
}})
registry.RegisterComponent(
servo.Subtype,
picommon.ModelName,
registry.Component{
Constructor: func(ctx context.Context, deps registry.Dependencies, config config.Component, logger golog.Logger) (interface{}, error) {
return nil, errors.New("not running on a pi")
},
},
)
}