summaryrefslogtreecommitdiff
path: root/peripheral/libupm/src/si114x/si114x.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'peripheral/libupm/src/si114x/si114x.cxx')
-rw-r--r--peripheral/libupm/src/si114x/si114x.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/peripheral/libupm/src/si114x/si114x.cxx b/peripheral/libupm/src/si114x/si114x.cxx
index 7d75445..6887690 100644
--- a/peripheral/libupm/src/si114x/si114x.cxx
+++ b/peripheral/libupm/src/si114x/si114x.cxx
@@ -30,7 +30,7 @@
#include <stdexcept>
#include <string>
-#include "si114x.hpp"
+#include "si114x.h"
using namespace upm;
using namespace std;
@@ -91,20 +91,12 @@ bool SI114X::writeByte(uint8_t reg, uint8_t byte)
uint8_t SI114X::readByte(uint8_t reg)
{
- int x = mraa_i2c_read_byte_data(m_i2c, reg);
- if (x != -1) {
- return (uint8_t) x;
- }
- return 0;
+ return mraa_i2c_read_byte_data(m_i2c, reg);
}
uint16_t SI114X::readWord(uint8_t reg)
{
- int x = mraa_i2c_read_word_data(m_i2c, reg);
- if (x != -1) {
- return (uint16_t) x;
- }
- return 0;
+ return mraa_i2c_read_word_data(m_i2c, reg);
}
void SI114X::setUVCalibration(uint8_t uvcoeff0, uint8_t uvcoeff1,