-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FL-3890] Infrared button operation fails now shows more informative …
…messages (#3859) * Error codes enum added * Adjusted signal api to return error codes instead of bool * Remote api adjusted to work with error codes * Brute force logic adjusted to work with error codes * Other application functions adjust to work with error codes * All task callbacks now return ErrorCode through int32t, which belongs to thread * All scenes now work with error codes * More api functions now return error code * Now signal names are buffered and restored in case of error. * New error code enumeration added. Now least significant byte is left for the button index * Some macro to simplify error setup and error check * Error code checks replaced by macro * Different message is now shown when move failed * Comments updated * Fixed error check * Fixed navigation issue while openning broken files from Favorites * Now search by index also returns index in addition to error code * Remote loading logic adjusted * New error codes added and numbers adjusted * New error message when loading library file instead of signal one * Some more remote loading logic adjusted * New error message on rename fail * Grammar mistake fix * Function signature changed * Function usage adjusted according to new signature Co-authored-by: あく <[email protected]>
- Loading branch information
1 parent
6a1c27e
commit e0654fe
Showing
18 changed files
with
538 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#pragma once | ||
|
||
typedef enum { | ||
InfraredErrorCodeNone = 0, | ||
InfraredErrorCodeFileOperationFailed = 0x800000, | ||
InfraredErrorCodeWrongFileType = 0x80000100, | ||
InfraredErrorCodeWrongFileVersion = 0x80000200, | ||
|
||
//Common signal errors | ||
InfraredErrorCodeSignalTypeUnknown = 0x80000300, | ||
InfraredErrorCodeSignalNameNotFound = 0x80000400, | ||
InfraredErrorCodeSignalUnableToReadType = 0x80000500, | ||
InfraredErrorCodeSignalUnableToWriteType = 0x80000600, | ||
|
||
//Raw signal errors | ||
InfraredErrorCodeSignalRawUnableToReadFrequency = 0x80000700, | ||
InfraredErrorCodeSignalRawUnableToReadDutyCycle = 0x80000800, | ||
InfraredErrorCodeSignalRawUnableToReadTimingsSize = 0x80000900, | ||
InfraredErrorCodeSignalRawUnableToReadTooLongData = 0x80000A00, | ||
InfraredErrorCodeSignalRawUnableToReadData = 0x80000B00, | ||
|
||
InfraredErrorCodeSignalRawUnableToWriteFrequency = 0x80000C00, | ||
InfraredErrorCodeSignalRawUnableToWriteDutyCycle = 0x80000D00, | ||
InfraredErrorCodeSignalRawUnableToWriteData = 0x80000E00, | ||
|
||
//Message signal errors | ||
InfraredErrorCodeSignalMessageUnableToReadProtocol = 0x80000F00, | ||
InfraredErrorCodeSignalMessageUnableToReadAddress = 0x80001000, | ||
InfraredErrorCodeSignalMessageUnableToReadCommand = 0x80001100, | ||
InfraredErrorCodeSignalMessageIsInvalid = 0x80001200, | ||
|
||
InfraredErrorCodeSignalMessageUnableToWriteProtocol = 0x80001300, | ||
InfraredErrorCodeSignalMessageUnableToWriteAddress = 0x80001400, | ||
InfraredErrorCodeSignalMessageUnableToWriteCommand = 0x80001500, | ||
} InfraredErrorCode; | ||
|
||
#define INFRARED_ERROR_CODE_MASK (0xFFFFFF00) | ||
#define INFRARED_ERROR_INDEX_MASK (0x000000FF) | ||
|
||
#define INFRARED_ERROR_GET_CODE(error) (error & INFRARED_ERROR_CODE_MASK) | ||
#define INFRARED_ERROR_GET_INDEX(error) (error & INFRARED_ERROR_INDEX_MASK) | ||
#define INFRARED_ERROR_SET_INDEX(code, index) (code |= (index & INFRARED_ERROR_INDEX_MASK)) | ||
|
||
#define INFRARED_ERROR_PRESENT(error) (INFRARED_ERROR_GET_CODE(error) != InfraredErrorCodeNone) | ||
#define INFRARED_ERROR_CHECK(error, test_code) (INFRARED_ERROR_GET_CODE(error) == test_code) |
Oops, something went wrong.