removed references to json-c

This commit is contained in:
2022-04-05 09:09:50 -06:00
parent 0f080312ab
commit 041ba75d8a
2 changed files with 6 additions and 37 deletions

View File

@ -3,18 +3,16 @@ DEBUG_DIR := build/Debug
BIN_DEBUG_DIR := bin/Debug
RELEASE_DIR := build/Release
BIN_RELEASE_DIR := bin/Release
CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)
debug:
gcc -Wall -fPIC -pg -g -c src/bme280/bme280.c -o $(DEBUG_DIR)/bme280.o -std=${STANDARD} ${LDFLAGS}
gcc -Wall -fPIC -pg -g -c src/main.c -o $(DEBUG_DIR)/main.o -std=${STANDARD} ${LDFLAGS}
gcc -Wall -fPIC -pg -g -o $(BIN_DEBUG_DIR)/tempRecord $(DEBUG_DIR)/main.o $(DEBUG_DIR)/bme280.o -std=${STANDARD} ${LDFLAGS}
gcc -Wall -fPIC -pg -g -c src/bme280/bme280.c -o $(DEBUG_DIR)/bme280.o -std=${STANDARD}
gcc -Wall -fPIC -pg -g -c src/main.c -o $(DEBUG_DIR)/main.o -std=${STANDARD}
gcc -Wall -fPIC -pg -g -o $(BIN_DEBUG_DIR)/tempRecord $(DEBUG_DIR)/main.o $(DEBUG_DIR)/bme280.o -std=${STANDARD}
release:
gcc -Wall -fPIC -O2 -c src/bme280/bme280.c -o $(RELEASE_DIR)/bme280.o -std=${STANDARD} ${LDFLAGS}
gcc -Wall -fPIC -O2 -c src/main.c -o $(RELEASE_DIR)/main.o -std=${STANDARD} ${LDFLAGS}
gcc -Wall -fPIC -O2 -o $(BIN_RELEASE_DIR)/tempRecord $(RELEASE_DIR)/main.o $(RELEASE_DIR)/bme280.o -std=${STANDARD} ${LDFLAGS}
gcc -Wall -fPIC -O2 -c src/bme280/bme280.c -o $(RELEASE_DIR)/bme280.o -std=${STANDARD}
gcc -Wall -fPIC -O2 -c src/main.c -o $(RELEASE_DIR)/main.o -std=${STANDARD}
gcc -Wall -fPIC -O2 -o $(BIN_RELEASE_DIR)/tempRecord $(RELEASE_DIR)/main.o $(RELEASE_DIR)/bme280.o -std=${STANDARD}
.PHONY clean:

View File

@ -13,8 +13,6 @@
#include <sys/types.h>
#include <fcntl.h>
#include <time.h>
#include <json-c/json_object.h>
#include <json-c/json_tokener.h>
#define IIC_Dev "/dev/i2c-1"
@ -48,33 +46,6 @@ double pascals_to_mbar(double pascals)
return pascals / 100;
}
char *parse_json_contents(FILE* filePtr, size_t size)
{
char *str;
int ch;
size_t len = 0;
str = realloc(NULL, sizeof(*str)*size);
if (!str) {
return str;
}
while (EOF != (ch = fgetc(filePtr)) && ch != '\n')
{
str[len++] = ch;
if (len == size)
{
str = realloc(str, sizeof(*str)*(size += 16)); // not sure why 16, was in example
if (!str) {
return str;
}
}
}
str[len++] = '\0'; // ??? append a null character?
return realloc(str, sizeof(*str)*len);
}
int8_t user_i2c_read(uint8_t id, uint8_t reg_addr, uint8_t *data, uint16_t len)
{
write(file_descriptor, &reg_addr, 1);