Compare commits

..

1 Commits

Author SHA1 Message Date
8837368a14 ADS1115: skip negative values. 2019-07-29 10:18:14 +01:00
3 changed files with 2 additions and 9 deletions

View File

@ -51,7 +51,7 @@ UNIT_TEST_TARGET = $(BIN_DIR)/$(UNIT_TEST_SRC_DIR)/$(TARGET_FILE)
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST)) THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
.PHONY: all install uninstall clean distclean .PHONY: all install uninstall clean
all: $(STATIC_LIB) $(DYNAMIC_LIB) all: $(STATIC_LIB) $(DYNAMIC_LIB)
install: all install: all
@ -76,9 +76,6 @@ clean:
rm -f $(OBJ_DIR)/*.gcda $(OBJ_DIR)/*.gcno rm -f $(OBJ_DIR)/*.gcda $(OBJ_DIR)/*.gcno
rm -fr $(COVERAGE_DIR) rm -fr $(COVERAGE_DIR)
distclean:
rm -fr $(BIN_DIR) $(OBJ_DIR) $(LIB_DIR) $(COVERAGE_DIR)
.PHONY: coverage .PHONY: coverage
coverage: _cov_genhtml coverage: _cov_genhtml
$(eval COVERAGE:=$(shell grep 'lines' .coverage.tmp | egrep -o '[0-9]+.[0-9]+%')) $(eval COVERAGE:=$(shell grep 'lines' .coverage.tmp | egrep -o '[0-9]+.[0-9]+%'))

View File

@ -2,7 +2,7 @@
#define __ADS1115__ #define __ADS1115__
#include <stdint.h> #include <stdint.h>
#include <libi2c_bb/i2c.h> #include <libi2c_bb/i2c_bb.h>
struct ads1115_dev { struct ads1115_dev {
struct i2c_bb *i2c_dev; struct i2c_bb *i2c_dev;

View File

@ -11,7 +11,6 @@
#define BUF_SIZE 3 #define BUF_SIZE 3
#define VPS 6.144 / 32768.0 #define VPS 6.144 / 32768.0
// cppcheck-suppress unusedFunction
int ads1115_open(const struct ads1115_dev *ads1115) int ads1115_open(const struct ads1115_dev *ads1115)
{ {
int res; int res;
@ -29,7 +28,6 @@ int ads1115_open(const struct ads1115_dev *ads1115)
return 0; return 0;
} }
// cppcheck-suppress unusedFunction
int ads1115_close(const struct ads1115_dev *ads1115) int ads1115_close(const struct ads1115_dev *ads1115)
{ {
assert(NULL != ads1115); assert(NULL != ads1115);
@ -37,7 +35,6 @@ int ads1115_close(const struct ads1115_dev *ads1115)
return i2c_close(ads1115->i2c_dev); return i2c_close(ads1115->i2c_dev);
} }
// cppcheck-suppress unusedFunction
int ads1115_start_conversation(const struct ads1115_dev *ads1115) int ads1115_start_conversation(const struct ads1115_dev *ads1115)
{ {
int res; int res;
@ -64,7 +61,6 @@ int ads1115_start_conversation(const struct ads1115_dev *ads1115)
return 0; return 0;
} }
// cppcheck-suppress unusedFunction
int ads1115_read_conversation_result(const struct ads1115_dev *ads1115, int ads1115_read_conversation_result(const struct ads1115_dev *ads1115,
struct ads1115_conversation_result *result) struct ads1115_conversation_result *result)
{ {