Skip to content

Commit a44bb5d

Browse files
committed
refactor: reformatted code
1 parent 70cf308 commit a44bb5d

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# tinygo-servo
2+
23
Servo wrapper for TinyGo projects

constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ const (
66

77
// RightLimitAngle is the angle that represents the right limit position of the servo motors.
88
RightLimitAngle uint16 = 180
9-
)
9+
)

types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
"machine"
77

88
tinygoerrors "github.com/ralvarezdev/tinygo-errors"
9-
tinygodriversservo "tinygo.org/x/drivers/servo"
109
tinygologger "github.com/ralvarezdev/tinygo-logger"
10+
tinygodriversservo "tinygo.org/x/drivers/servo"
1111
)
1212

1313
type (
1414
// DefaultHandler is the default implementation of the Servo interface
1515
DefaultHandler struct {
16-
afterSetAngleFunc func(angle uint16)
17-
isMovementEnabled func() bool
16+
afterSetAngleFunc func(angle uint16)
17+
isMovementEnabled func() bool
1818
isDirectionInverted bool
1919
frequency uint16
2020
minPulseWidth uint16
@@ -25,7 +25,7 @@ type (
2525
maxAngle uint16
2626
servo tinygodriversservo.Servo
2727
angle uint16
28-
logger tinygologger.Logger
28+
logger tinygologger.Logger
2929
}
3030
)
3131

@@ -87,8 +87,8 @@ func NewDefaultHandler(
8787

8888
// Initialize the servo with the provided parameters
8989
handler := &DefaultHandler{
90-
afterSetAngleFunc: afterSetAngleFunc,
91-
isMovementEnabled: isMovementEnabled,
90+
afterSetAngleFunc: afterSetAngleFunc,
91+
isMovementEnabled: isMovementEnabled,
9292
isDirectionInverted: isDirectionInverted,
9393
frequency: frequency,
9494
minPulseWidth: minPulseWidth,
@@ -98,7 +98,7 @@ func NewDefaultHandler(
9898
servo: servo,
9999
angle: centerAngle,
100100
centerAngle: centerAngle,
101-
logger: logger,
101+
logger: logger,
102102
maxAngle: maxAngle,
103103
}
104104

@@ -264,4 +264,4 @@ func (h *DefaultHandler) SafeSetAngleToLeft(angle uint16) tinygoerrors.ErrorCode
264264
angle = h.maxAngle
265265
}
266266
return h.SetAngleToLeft(angle)
267-
}
267+
}

0 commit comments

Comments
 (0)