Skip to content

Commit e034fa5

Browse files
fixup! Introducing ErrorCode
1 parent 57050bf commit e034fa5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api/ErrorCodes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ enum : error_t {
9090
};
9191

9292
/* Error Codes:
93-
* In Arduino if a function returns 1 is considered to have run successfully,
94-
* any value different from 1 is considered an error.
93+
* In Arduino if a function returns 0 is considered to have failed,
94+
* while any value different from 0 is considered success.
9595
* Errors are generally represented with an int type that may vary in size depending on the platform.
9696
* For this reason in this representation error_t type is defined with an integer type with a defined size.
9797
*/
9898
class ErrorCode {
9999
public:
100-
constexpr ErrorCode(int value): error(value == 1? ArduinoSuccess : ArduinoError) {}
100+
constexpr ErrorCode(int value): error(value != 0? ArduinoSuccess : ArduinoError) {}
101101
constexpr ErrorCode(error_t value): error(value) {}
102102
const error_t error;
103103

0 commit comments

Comments
 (0)