Rev 30 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 30 | Rev 31 | ||
---|---|---|---|
Line 235... | Line 235... | ||
235 | { |
235 | { |
236 | lastTick = HAL_GetTick (); |
236 | lastTick = HAL_GetTick (); |
237 | /* Reading the raw data from sensor */ |
237 | /* Reading the raw data from sensor */ |
238 | rslt = bmp280_get_uncomp_data (&ucomp_data, bmp); |
238 | rslt = bmp280_get_uncomp_data (&ucomp_data, bmp); |
239 | 239 | ||
240 | /* reading the raw data from the second sensor */ |
240 | /* Check to see if the second BMP is online */ |
241 | rslt2 = bmp280_get_uncomp_data (&ucomp_data2, bmp2); |
- | |
242 | - | ||
243 | if (rslt2 == BMP280_OK) |
241 | if (pollBmp2State ()) |
244 | { |
- | |
245 | rslt2 = bmp280_get_comp_temp_32bit (&temp32_out, |
- | |
246 | ucomp_data2.uncomp_temp, |
- | |
247 | bmp2); |
- | |
248 | } |
- | |
249 | // if it returns 128,0,0 for both temperature and pressure at the same time, then this ends up as the value 524288 which is broken .. |
- | |
250 | if (rslt2 != BMP280_OK |
- | |
251 | || (ucomp_data2.uncomp_temp == 524288 |
- | |
252 | && ucomp_data2.uncomp_press == 524288)) |
- | |
253 | { |
242 | { |
254 | /// try to reset the device, its playing up |
243 | /* reading the raw data from the second sensor */ |
255 | resetBmp2 (); |
244 | rslt2 = bmp280_get_uncomp_data (&ucomp_data2, bmp2); |
256 | 245 | ||
- | 246 | if (rslt2 == BMP280_OK) |
|
- | 247 | { |
|
- | 248 | rslt2 = bmp280_get_comp_temp_32bit (&temp32_out, |
|
- | 249 | ucomp_data2.uncomp_temp, |
|
- | 250 | bmp2); |
|
257 | } |
251 | } |
- | 252 | // if it returns 128,0,0 for both temperature and pressure at the same time, then this ends up as the value 524288 which is broken .. |
|
- | 253 | if (rslt2 != BMP280_OK |
|
- | 254 | || (ucomp_data2.uncomp_temp == 524288 |
|
- | 255 | && ucomp_data2.uncomp_press == 524288)) |
|
- | 256 | { |
|
- | 257 | /// try to reset the device, its playing up |
|
- | 258 | resetBmp2 (); |
|
258 | 259 | ||
- | 260 | } |
|
- | 261 | } |
|
259 | if (rslt == BMP280_OK) |
262 | if (rslt == BMP280_OK) |
260 | { |
263 | { |
261 | /* Getting the 32 bit compensated temperature */ |
264 | /* Getting the 32 bit compensated temperature */ |
262 | rslt = bmp280_get_comp_temp_32bit (&temp32, |
265 | rslt = bmp280_get_comp_temp_32bit (&temp32, |
263 | ucomp_data.uncomp_temp, bmp); |
266 | ucomp_data.uncomp_temp, bmp); |