|
MaxMatrix
Drive chained 8x8 LED dot matrix modules with MAX7219.
|
What a function that can fail returns when it has no value to return. More...
#include <MaxMatrixError.h>
Public Member Functions | |
| Status (Error error=Error::kOk) | |
| Makes a status of error, ok when none is given. | |
| MAXMATRIX_NODISCARD Error | GetError () const |
| Returns why the call failed, or Error::kOk. | |
| MAXMATRIX_NODISCARD __FlashStringHelper const * | GetErrorText () const |
| Returns the error in a few words, in flash, for Serial.print(). | |
| MAXMATRIX_NODISCARD bool | IsOk () const |
| Returns whether the call did what it was asked. | |
Friends | |
| bool | operator== (Status status, Error error) |
| Returns whether the call failed for this reason. | |
| bool | operator!= (Status status, Error error) |
| Returns whether the call did not fail for this reason. | |
What a function that can fail returns when it has no value to return.
A sketch asks IsOk(), or compares with an error:
|
inline |
Makes a status of error, ok when none is given.
Implicit, so that a function returns an error as it is.
| [in] | error | The error, or Error::kOk. |
| MAXMATRIX_NODISCARD __FlashStringHelper const * max_matrix::Status::GetErrorText | ( | ) | const |
Returns the error in a few words, in flash, for Serial.print().
"out of range" for Error::kOutOfRange. Serial.print() reads a __FlashStringHelper from flash, so the text needs no RAM. A sketch that never calls it pays nothing, as the linker drops it with its texts.
Returns whether the call did not fail for this reason.
| [in] | status | The status of the call. |
| [in] | error | The error to compare with. |
Returns whether the call failed for this reason.
| [in] | status | The status of the call. |
| [in] | error | The error to compare with. |