removed references to json-c
This commit is contained in:
-29
@@ -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, ®_addr, 1);
|
||||
|
||||
Reference in New Issue
Block a user