bme280 delay fixes plus Makefile for avr-rss2

This commit is contained in:
Robert Olsson 2016-11-30 11:51:10 +01:00 committed by Antonio Lignan
parent f9b32f8139
commit 4ef4bdd0a5
3 changed files with 8 additions and 2 deletions

View file

@ -159,6 +159,7 @@ bme280_h_overscale1024(int32_t uh)
uint8_t
bme280_init(uint8_t mode)
{
uint16_t i;
uint8_t buf[26];
bme280_arch_i2c_init();
@ -170,7 +171,10 @@ bme280_init(uint8_t mode)
}
bme280_arch_i2c_write_mem(BME280_ADDR, BME280_CNTL_RESET, 0xB6);
clock_delay_usec(BME280_MAX_WAIT);
for(i = 0; i < BME280_MAX_WAIT; i++) {
clock_delay_usec(1000);
}
memset(buf, 0, sizeof(buf));

View file

@ -94,7 +94,8 @@ void bme280_read(uint8_t mode);
#define BME280_MODE_INDOOR_NAVIGATION 3
#define BME280_MODE_GAMING 4
#define BME280_MAX_WAIT 300000 /* ms. Forced mode max wait */
#define BME280_MAX_WAIT 300 /* ms. Forced mode max wait */
struct {
int32_t t_overscale100;

View file

@ -10,6 +10,7 @@ CONTIKI_TARGET_SOURCEFILES += temp-sensor.c
CONTIKI_TARGET_SOURCEFILES += enc28j60_avr.c
CONTIKI_TARGET_SOURCEFILES += co2_sa_kxx-sensor.c
CONTIKI_TARGET_SOURCEFILES += bme280-arch.c
CONTIKIAVR=$(CONTIKI)/cpu/avr
CONTIKIBOARD=.