Skip to content

Commit

Permalink
get tests to pass again
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinland committed Apr 26, 2023
1 parent d5a9c65 commit 0a48adb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/servo/gpio/servo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func setupDependencies(t *testing.T) resource.Dependencies {
innerTick1 = utils.ScaleByPct(scale1, dutyCyclePct)
return nil
}
pin0.SetPWMFreqFunc = func(ctx context.Context, freqHz uint, extra map[string]interface{}) error {
return nil
}

pin1 := &inject.GPIOPin{}
pin1.PWMFunc = func(ctx context.Context, extra map[string]interface{}) (float64, error) {
pct := float64(innerTick2) / float64(scale2)
Expand All @@ -134,6 +138,10 @@ func setupDependencies(t *testing.T) resource.Dependencies {
innerTick2 = utils.ScaleByPct(scale2, dutyCyclePct)
return nil
}
pin1.SetPWMFreqFunc = func(ctx context.Context, freqHz uint, extra map[string]interface{}) error {
return nil
}

board1.GPIOPinByNameFunc = func(name string) (board.GPIOPin, error) {
switch name {
case "0":
Expand Down

0 comments on commit 0a48adb

Please sign in to comment.