X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbarometer.c;h=66ab20c02427b814788adca24d55784c475b8284;hb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;hp=6945442c45e27b91aaa40d2338f0ec301bf69de8;hpb=029b489b237a8785c539f85d4840a49ba6743603;p=collectd.git diff --git a/src/barometer.c b/src/barometer.c index 6945442c..66ab20c0 100644 --- a/src/barometer.c +++ b/src/barometer.c @@ -177,14 +177,14 @@ static const char *config_keys[] = { static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static char *config_device = NULL; /**< I2C bus device */ -static int config_oversample = 1; /**< averaging window */ +static char *config_device; /**< I2C bus device */ +static int config_oversample = 1; /**< averaging window */ -static double config_press_offset = 0.0; /**< pressure offset */ -static double config_temp_offset = 0.0; /**< temperature offset */ +static double config_press_offset; /**< pressure offset */ +static double config_temp_offset; /**< temperature offset */ static double config_altitude = NAN; /**< altitude */ -static int config_normalize = 0; /**< normalization method */ +static int config_normalize; /**< normalization method */ static bool configured; /**< the whole plugin config status */ @@ -193,7 +193,7 @@ static int i2c_bus_fd = -1; /**< I2C bus device FD */ static enum Sensor_type sensor_type = Sensor_none; /**< detected/used sensor type */ -static __s32 mpl3115_oversample = 0; /**< MPL3115 CTRL1 oversample setting */ +static __s32 mpl3115_oversample; /**< MPL3115 CTRL1 oversample setting */ // BMP085 configuration static unsigned bmp085_oversampling; /**< BMP085 oversampling (0-3) */ @@ -235,8 +235,8 @@ typedef struct averaging_s { int ring_buffer_head; } averaging_t; -static averaging_t pressure_averaging = {NULL, 0, 0L, 0}; -static averaging_t temperature_averaging = {NULL, 0, 0L, 0}; +static averaging_t pressure_averaging; +static averaging_t temperature_averaging; /** * Create / allocate averaging buffer @@ -317,7 +317,7 @@ typedef struct temperature_list_s { struct temperature_list_s *next; /**< next in the list */ } temperature_list_t; -static temperature_list_t *temp_list = NULL; +static temperature_list_t *temp_list; /* * Add new sensor to the temperature reference list @@ -1392,7 +1392,7 @@ static int MPL115_collectd_barometer_read(void) { config_oversample - 1); usleep(20000); } - avg_initialized = 1; + avg_initialized = true; } result = MPL115_read_averaged(&pressure, &temperature); @@ -1635,7 +1635,7 @@ static int collectd_barometer_init(void) { return -1; } - configured = 1; + configured = true; return 0; }