Skip to content

Commit 2505cd8

Browse files
fixup! Introducing ErrorCode
1 parent b74c4a0 commit 2505cd8

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy