Browse Source

Merge remote-tracking branch 'origin/dev' into pio/silence-uart

rules-rpn
Max Prokhorov 5 years ago
parent
commit
32615a43ac
4 changed files with 18 additions and 4 deletions
  1. +7
    -2
      code/espurna/config/sensors.h
  2. +1
    -1
      code/espurna/pwm.c
  3. +9
    -0
      code/espurna/sensor.ino
  4. +1
    -1
      code/espurna/sensors/ECH1560Sensor.h

+ 7
- 2
code/espurna/config/sensors.h View File

@ -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


+ 1
- 1
code/espurna/pwm.c View File

@ -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
- 0
code/espurna/sensor.ino View File

@ -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


+ 1
- 1
code/espurna/sensors/ECH1560Sensor.h View File

@ -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) {


Loading…
Cancel
Save