Skip to content

Commit dfc2400

Browse files
committed
feat: added another tinygo-escmotor ErrorCode
1 parent 375dfc9 commit dfc2400

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

constants.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727
)
2828

2929
const (
30-
ErrorCodeBNO08XPacketBufferIndexOutOfRange tinygoerrors.ErrorCode = tinygoerrors.ErrorCode(iota + ErrorCodeBNO08XStartNumber)
30+
ErrorCodeBNO08XPacketBufferIndexOutOfRange = tinygoerrors.ErrorCode(iota + ErrorCodeBNO08XStartNumber)
3131
ErrorCodeBNO08XInvalidChannelNumber
3232
ErrorCodeBNO08XNilPacketReader
3333
ErrorCodeBNO08XNilPacketWriter
@@ -145,17 +145,18 @@ const (
145145
)
146146

147147
const (
148-
ErrorCodeESCMotorFailedToConfigurePWM tinygoerrors.ErrorCode = tinygoerrors.ErrorCode(iota + ErrorCodeESCMotorStartNumber)
148+
ErrorCodeESCMotorFailedToConfigurePWM = tinygoerrors.ErrorCode(iota + ErrorCodeESCMotorStartNumber)
149149
ErrorCodeESCMotorFailedToInitializeServo
150150
ErrorCodeESCMotorSpeedOutOfRange
151151
ErrorCodeESCMotorSpeedBelowMinPulseWidth
152152
ErrorCodeESCMotorSpeedAboveMaxPulseWidth
153153
ErrorCodeESCMotorNilHandler
154154
ErrorCodeESCMotorInvalidNeutralPulseWidth
155+
ErrorCodeESCMotorUnknownDirection
155156
)
156157

157158
const (
158-
ErrorCodeServoFailedToConfigurePWM tinygoerrors.ErrorCode = tinygoerrors.ErrorCode(iota + ErrorCodeServoStartNumber)
159+
ErrorCodeServoFailedToConfigurePWM = tinygoerrors.ErrorCode(iota + ErrorCodeServoStartNumber)
159160
ErrorCodeServoFailedToInitializeServo
160161
ErrorCodeServoAngleOutOfRange
161162
ErrorCodeServoAngleBelowMinPulseWidth
@@ -168,7 +169,7 @@ var (
168169
// ErrorCodeMessages maps error codes to their corresponding error messages.
169170
ErrorCodeMessages = map[tinygoerrors.ErrorCode]string{
170171
// Buffers errors
171-
ErrorCodeBuffersInvalidBufferSize: "invalid buffer size",
172+
ErrorCodeBuffersInvalidBufferSize: "invalid buffer size",
172173
ErrorCodeBuffersTooMuchPrecisionDigitsForFloat64: "too much precision digits for float64",
173174

174175
// BNO08X errors
@@ -280,21 +281,22 @@ var (
280281
ErrorCodeBNO08XNilWaitForPacketFunction: "bno08x wait for packet function cannot be nil",
281282
ErrorCodeBNO08XInvalidMode: "bno08x invalid mode",
282283
ErrorCodeBNO08XUnknownModeAttemptingSoftwareReset: "bno08x unknown mode attempting software reset",
283-
ErrorCodeBNO08XUARTRVCInvalidYawDegreesValue: "bno08x uart rvc invalid yaw degrees value",
284-
ErrorCodeBNO08XUARTRVCInvalidPitchDegreesValue: "bno08x uart rvc invalid pitch degrees value",
285-
ErrorCodeBNO08XUARTRVCInvalidRollDegreesValue: "bno08x uart rvc invalid roll degrees value",
284+
ErrorCodeBNO08XUARTRVCInvalidYawDegreesValue: "bno08x uart rvc invalid yaw degrees value",
285+
ErrorCodeBNO08XUARTRVCInvalidPitchDegreesValue: "bno08x uart rvc invalid pitch degrees value",
286+
ErrorCodeBNO08XUARTRVCInvalidRollDegreesValue: "bno08x uart rvc invalid roll degrees value",
286287

287288
// Pull-up resistor errors
288289
ErrorCodePullUpResistorNilHandler: "pull-up resistor handler cannot be nil",
289290

290291
// ESC motor errors
291-
ErrorCodeESCMotorFailedToConfigurePWM: "esc motor failed to configure pwm",
292-
ErrorCodeESCMotorFailedToInitializeServo: "esc motor failed to initialize servo",
293-
ErrorCodeESCMotorSpeedOutOfRange: "esc motor speed out of range",
294-
ErrorCodeESCMotorSpeedBelowMinPulseWidth: "esc motor speed below min pulse width",
295-
ErrorCodeESCMotorSpeedAboveMaxPulseWidth: "esc motor speed above max pulse width",
296-
ErrorCodeESCMotorNilHandler: "esc motor handler cannot be nil",
292+
ErrorCodeESCMotorFailedToConfigurePWM: "esc motor failed to configure pwm",
293+
ErrorCodeESCMotorFailedToInitializeServo: "esc motor failed to initialize servo",
294+
ErrorCodeESCMotorSpeedOutOfRange: "esc motor speed out of range",
295+
ErrorCodeESCMotorSpeedBelowMinPulseWidth: "esc motor speed below min pulse width",
296+
ErrorCodeESCMotorSpeedAboveMaxPulseWidth: "esc motor speed above max pulse width",
297+
ErrorCodeESCMotorNilHandler: "esc motor handler cannot be nil",
297298
ErrorCodeESCMotorInvalidNeutralPulseWidth: "esc motor invalid neutral pulse width",
299+
ErrorCodeESCMotorUnknownDirection: "esc motor unknown direction",
298300

299301
// Servo errors
300302
ErrorCodeServoFailedToConfigurePWM: "servo failed to configure pwm",

0 commit comments

Comments
 (0)