Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into pio/silence-uart
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Mar 29, 2019
2 parents 8cc389f + 504b45a commit 32615a4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions code/espurna/config/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,14 @@
#define BMX280_SUPPORT 0
#endif

#ifndef BMX280_ADDRESS
#define BMX280_ADDRESS 0x00 // 0x00 means auto
#ifndef BMX280_NUMBER
#define BMX280_NUMBER 2 // Number of sensors present. Either 1 or 2 allowed
#endif
#ifndef BMX280_ADDRESS
#define BMX280_ADDRESS 0x00 // 0x00 means auto (0x76 or 0x77 allowed) for sensor #0
#endif // If (BMX280_NUMBER == 2) and
// (BMX280_ADDRESS == 0x00) then sensor #1 is auto-discovered
// (BMX280_ADDRESS != 0x00) then sensor #1 is the unnamed address

#define BMX280_MODE 1 // 0 for sleep mode, 1 or 2 for forced mode, 3 for normal mode
#define BMX280_STANDBY 0 // 0 for 0.5ms, 1 for 62.5ms, 2 for 125ms
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,5 @@ get_pwm_version(void)
void ICACHE_FLASH_ATTR
set_pwm_debug_en(uint8_t print_en)
{
UNUSED(print_en);
(void) print_en;
}
9 changes: 9 additions & 0 deletions code/espurna/sensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,15 @@ void _sensorLoad() {
BMX280Sensor * sensor = new BMX280Sensor();
sensor->setAddress(BMX280_ADDRESS);
_sensors.push_back(sensor);

#if (BMX280_NUMBER == 2)
// Up to two BME sensors allowed on one I2C bus
BMX280Sensor * sensor2 = new BMX280Sensor();
// For second sensor, if BMX280_ADDRESS is 0x00 then auto-discover
// otherwise choose the other unnamed sensor address
sensor->setAddress( (BMX280_ADDRESS == 0x00) ? 0x00 : (0x76 + 0x77 - BMX280_ADDRESS));
_sensors.push_back(sensor2);
#endif
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion code/espurna/sensors/ECH1560Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ECH1560Sensor : public BaseSensor {

void ICACHE_RAM_ATTR handleInterrupt(unsigned char gpio) {

UNSUSED(gpio);
UNUSED(gpio);

// if we are trying to find the sync-time (CLK goes high for 1-2ms)
if (_dosync == false) {
Expand Down

0 comments on commit 32615a4

Please sign in to comment.