Skip to content

Commit ca10f7a

Browse files
committed
refactor: removed some local error codes that I added by accident
1 parent c6419e9 commit ca10f7a

File tree

1 file changed

+0
-126
lines changed

1 file changed

+0
-126
lines changed

constants.go

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,6 @@ import (
55
)
66

77
const (
8-
// ErrorCodeChallengeStartNumber is the starting number for challenge-related error codes.
9-
ErrorCodeChallengeStartNumber uint16 = 1
10-
11-
// ErrorCodeCyw43439StartNumber is the starting number for CYW43439-related error codes.
12-
ErrorCodeCyw43439StartNumber uint16 = 10
13-
14-
// ErrorCodeLEDStartNumber is the starting number for LED-related error codes.
15-
ErrorCodeLEDStartNumber uint16 = 20
16-
17-
// ErrorCodeMovementStartNumber is the starting number for movement-related error codes.
18-
ErrorCodeMovementStartNumber uint16 = 30
19-
20-
// ErrorCodeSwitchStartNumber is the starting number for switch-related error codes.
21-
ErrorCodeSwitchStartNumber uint16 = 40
22-
23-
// ErrorCodeUSBCDCStartNumber is the starting number for USB CDC-related error codes.
24-
ErrorCodeUSBCDCStartNumber uint16 = 50
25-
268
// ErrorCodeBuffersStartNumber is the starting number for error code buffers
279
ErrorCodeBuffersStartNumber = 4000
2810

@@ -39,63 +21,6 @@ const (
3921
ErrorCodeServoStartNumber uint16 = 5230
4022
)
4123

42-
const (
43-
ErrorCodeChallengeNilHandler tinygotypes.ErrorCode = tinygotypes.ErrorCode(iota + ErrorCodeChallengeStartNumber)
44-
ErrorCodeChallengeNilObstaclesPullUpHandler
45-
ErrorCodeChallengeNilParkingPullUpHandler
46-
ErrorCodeChallengeInvalidChallengeUint8
47-
)
48-
49-
const (
50-
ErrorCodeCyw43439NilDevice tinygotypes.ErrorCode = tinygotypes.ErrorCode(iota + ErrorCodeCyw43439StartNumber)
51-
ErrorCodeCyw43439FailedToInitialize
52-
)
53-
54-
const (
55-
ErrorCodeLEDNilHandler tinygotypes.ErrorCode = tinygotypes.ErrorCode(iota + ErrorCodeLEDStartNumber)
56-
ErrorCodeLEDNegativeBlinkCount
57-
ErrorCodeLEDNegativeDelayDuration
58-
)
59-
60-
const (
61-
ErrorCodeMovementNilHandler tinygotypes.ErrorCode = tinygotypes.ErrorCode(iota + ErrorCodeMovementStartNumber)
62-
)
63-
64-
const (
65-
ErrorCodeSwitchNilOnEventFunction tinygotypes.ErrorCode = tinygotypes.ErrorCode(iota + ErrorCodeSwitchStartNumber)
66-
)
67-
68-
const (
69-
ErrorCodeUSBCDCNilHandler tinygotypes.ErrorCode = tinygotypes.ErrorCode(iota + ErrorCodeUSBCDCStartNumber)
70-
ErrorCodeUSBCDCNilOutgoingCategory
71-
ErrorCodeUSBCDCUnknownOutgoingCategory
72-
ErrorCodeUSBCDCNilIncomingCategory
73-
ErrorCodeUSBCDCUnknownIncomingCategory
74-
ErrorCodeUSBCDCInvalidMaxMessageDataLength
75-
ErrorCodeUSBCDCFailedToSendStartCharacter
76-
ErrorCodeUSBCDCFailedToSendOutgoingCategory
77-
ErrorCodeUSBCDCFailedToSendControlCharacter
78-
ErrorCodeUSBCDCFailedToSendMessageContent
79-
ErrorCodeUSBCDCFailedToSendEndCharacter
80-
ErrorCodeUSBCDCBufferTooShortForRawFloat64
81-
ErrorCodeUSBCDCUnknownQuaternionIndex
82-
ErrorCodeUSBCDCUnknownEulerDegreesIndex
83-
ErrorCodeUSBCDCUnknownIncomingStatus
84-
ErrorCodeUSBCDCUnknownOutgoingStatus
85-
ErrorCodeUSBCDCUnknownChallenge
86-
ErrorCodeUSBCDCBufferTooShortForRawUint16
87-
ErrorCodeUSBCDCBufferTooShortForRawUint8
88-
ErrorCodeUSBCDCConfirmationMessageTimeout
89-
ErrorCodeUSBCDCReadByteTimeout
90-
ErrorCodeUSBCDCFailedReadingFromSerial
91-
ErrorCodeUSBCDCFailedToConfigureUSBCDC
92-
ErrorCodeUSBCDCFailedToSendInitializationMessage
93-
ErrorCodeUSBCDCInvalidIncomingMessageDataLength
94-
ErrorCodeUSBCDCInvalidOutgoingMessageDataLength
95-
ErrorCodeUSBCDCReadMessageTimeout
96-
ErrorCodeUSBCDCReceivedUnexpectedConfirmationMessage
97-
)
98-
9924
const (
10025
ErrorCodeBuffersInvalidBufferSize tinygotypes.ErrorCode = ErrorCodeBuffersStartNumber + iota
10126
)
@@ -238,57 +163,6 @@ const (
238163
var (
239164
// ErrorCodeMessages maps error codes to their corresponding error messages.
240165
ErrorCodeMessages = map[tinygotypes.ErrorCode]string{
241-
// Challenge errors
242-
ErrorCodeChallengeNilHandler: "challenge handler cannot be nil",
243-
ErrorCodeChallengeNilObstaclesPullUpHandler: "challenge obstacles pull-up handler cannot be nil",
244-
ErrorCodeChallengeNilParkingPullUpHandler: "challenge parking pull-up handler cannot be nil",
245-
ErrorCodeChallengeInvalidChallengeUint8: "invalid challenge uint8",
246-
247-
// Cyw43439 errors
248-
ErrorCodeCyw43439NilDevice: "cyw43439 device cannot be nil",
249-
ErrorCodeCyw43439FailedToInitialize: "cyw43439 failed to initialize",
250-
251-
// LED errors
252-
ErrorCodeLEDNilHandler: "led handler cannot be nil",
253-
ErrorCodeLEDNegativeBlinkCount: "led blink count cannot be negative",
254-
ErrorCodeLEDNegativeDelayDuration: "led delay duration cannot be negative",
255-
256-
// Movement errors
257-
ErrorCodeMovementNilHandler: "movement handler cannot be nil",
258-
259-
// Switch errors
260-
ErrorCodeSwitchNilOnEventFunction: "switch onevent function cannot be nil",
261-
262-
// USB CDC errors
263-
ErrorCodeUSBCDCNilHandler: "usb-cdc handler cannot be nil",
264-
ErrorCodeUSBCDCNilOutgoingCategory: "usb-cdc outgoing category cannot be nil",
265-
ErrorCodeUSBCDCUnknownOutgoingCategory: "usb-cdc unknown outgoing category",
266-
ErrorCodeUSBCDCNilIncomingCategory: "usb-cdc incoming category cannot be nil",
267-
ErrorCodeUSBCDCUnknownIncomingCategory: "usb-cdc unknown incoming category",
268-
ErrorCodeUSBCDCInvalidMaxMessageDataLength: "usb-cdc invalid max message data length",
269-
ErrorCodeUSBCDCFailedToSendStartCharacter: "usb-cdc failed to send start character",
270-
ErrorCodeUSBCDCFailedToSendOutgoingCategory: "usb-cdc failed to send outgoing category",
271-
ErrorCodeUSBCDCFailedToSendControlCharacter: "usb-cdc failed to send control character",
272-
ErrorCodeUSBCDCFailedToSendMessageContent: "usb-cdc failed to send message content",
273-
ErrorCodeUSBCDCFailedToSendEndCharacter: "usb-cdc failed to send end character",
274-
ErrorCodeUSBCDCBufferTooShortForRawFloat64: "usb-cdc buffer too short for raw float64",
275-
ErrorCodeUSBCDCUnknownQuaternionIndex: "usb-cdc unknown quaternion index",
276-
ErrorCodeUSBCDCUnknownEulerDegreesIndex: "usb-cdc unknown euler degrees index",
277-
ErrorCodeUSBCDCUnknownIncomingStatus: "usb-cdc unknown incoming status",
278-
ErrorCodeUSBCDCUnknownOutgoingStatus: "usb-cdc unknown outgoing status",
279-
ErrorCodeUSBCDCUnknownChallenge: "usb-cdc unknown challenge",
280-
ErrorCodeUSBCDCBufferTooShortForRawUint16: "usb-cdc buffer too short for raw uint16",
281-
ErrorCodeUSBCDCBufferTooShortForRawUint8: "usb-cdc buffer too short for raw uint8",
282-
ErrorCodeUSBCDCConfirmationMessageTimeout: "usb-cdc confirmation message timeout",
283-
ErrorCodeUSBCDCReadByteTimeout: "usb-cdc read byte timeout",
284-
ErrorCodeUSBCDCFailedReadingFromSerial: "usb-cdc failed reading from serial",
285-
ErrorCodeUSBCDCFailedToConfigureUSBCDC: "usb-cdc failed to configure",
286-
ErrorCodeUSBCDCFailedToSendInitializationMessage: "usb-cdc failed to send initialization message",
287-
ErrorCodeUSBCDCInvalidIncomingMessageDataLength: "usb-cdc invalid incoming message data length",
288-
ErrorCodeUSBCDCInvalidOutgoingMessageDataLength: "usb-cdc invalid outgoing message data length",
289-
ErrorCodeUSBCDCReadMessageTimeout: "usb-cdc read message timeout",
290-
ErrorCodeUSBCDCReceivedUnexpectedConfirmationMessage: "usb-cdc received unexpected confirmation message",
291-
292166
// Buffers errors
293167
ErrorCodeBuffersInvalidBufferSize: "invalid buffer size",
294168

0 commit comments

Comments
 (0)