Skip to content

Commit

Permalink
added hasError and isOK convenience functions
Browse files Browse the repository at this point in the history
  • Loading branch information
udoklein committed Jan 20, 2018
1 parent c86a7dc commit cbe23bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions MLX90393.cpp
Expand Up @@ -100,6 +100,21 @@ checkStatus(uint8_t status)
return (status & ERROR_BIT) ? STATUS_ERROR : STATUS_OK;
}

bool
MLX90393::
isOK(uint8_t status)
{
return (status & ERROR_BIT) == 0;
}

bool
MLX90393::
hasError(uint8_t status)
{
return (status & ERROR_BIT) != 0;
}


uint8_t
MLX90393::
sendCommand(uint8_t cmd)
Expand Down
2 changes: 2 additions & 0 deletions MLX90393.h
Expand Up @@ -78,6 +78,8 @@ class MLX90393
uint8_t nop();
uint8_t sendCommand(uint8_t cmd);
uint8_t checkStatus(uint8_t status);
bool isOK(uint8_t status);
bool hasError(uint8_t status);
txyz convertRaw(txyzRaw raw);
uint16_t convDelayMillis();

Expand Down

0 comments on commit cbe23bd

Please sign in to comment.