adafruit / Adafruit_BME280_Library

Arduino Library for BME280 sensors
Other
333 stars 304 forks source link

Commented out code: Purpose of Adafruit_BME280_Unified? #12

Closed mozzbozz closed 7 years ago

mozzbozz commented 8 years ago

The header file contains some commented out code which is there since the initial commit - there's no comment or whatsoever explaining the purpose of it. Is is just a TODO?

This is the code:

/*
class Adafruit_BME280_Unified : public Adafruit_Sensor
{
  public:
    Adafruit_BME280_Unified(int32_t sensorID = -1);
    bool  begin(uint8_t addr = BME280_ADDRESS);
    void  getTemperature(float *temp);
    void  getPressure(float *pressure);
    float pressureToAltitude(float seaLevel, float atmospheric, float temp);
    float seaLevelForAltitude(float altitude, float atmospheric, float temp);
    void  getEvent(sensors_event_t*);
    void  getSensor(sensor_t*);
  private:
    uint8_t   _i2c_addr;
    int32_t   _sensorID;
};
*/

As the "unified" stuff seems to be just some mocking, there doesn't seem to be any need for the #include <Adafruit_Sensor.h> either? At least removing it from both the Adafruit_BME280.h-file and the bme280test.ino example sketch gets rid of the following warning at compile time:

warning: unused parameter 'enabled' in virtual void enableAutoRange(bool enabled) {};

and at least for me it doesn't seem to break anything. But I think the code author will know better than me about the reasons for this code segment...

ladyada commented 7 years ago

its a 'todo' for us to get around to Unifying all our sensors to be standardized. no need for it at this time, just ignore it :)