You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/09/17 02:12:35 UTC
[GitHub] [mynewt-core] vrahane commented on a change in pull request #2376: BMP388 Pressure/temperature sensor i2c communtication optimization
vrahane commented on a change in pull request #2376:
URL: https://github.com/apache/mynewt-core/pull/2376#discussion_r489100645
##########
File path: hw/drivers/sensors/bmp388/src/bmp388.c
##########
@@ -3366,6 +3366,215 @@ bmp388_stream_read(struct sensor *sensor,
return rc;
}
+int
+bmp388_hybrid_read(struct sensor *sensor,
+ sensor_type_t sensor_type,
+ sensor_data_func_t read_func,
+ void *read_arg,
+ uint32_t time_ms)
+{
+ int rc;
+ struct bmp388 *bmp388;
+ struct bmp388_cfg *cfg;
+ os_time_t time_ticks;
+ os_time_t stop_ticks = 0;
+ uint16_t try_count;
+
+#if MYNEWT_VAL(BMP388_FIFO_ENABLE)
+ /* FIFO object to be assigned to device structure */
+ struct bmp3_fifo fifo;
+ /* Pressure and temperature array of structures with maximum frame size */
+ struct bmp3_data sensor_data[74];
Review comment:
Also, there is possibility of a buffer overrun in this case mainly because the FIFO is of 512 bytes. If you keep reading it and the entire FIFO is filled up, there is going to be a buffer overrun. Please try to limit your reads based on the number of data samples in the buffer as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org