matmunk / DS18B20

Arduino library for the Maxim Integrated DS18B20 1-Wire temperature sensor.
MIT License
90 stars 32 forks source link

The project doesn't compile when both libraries ('DS18B20' and 'Bridge') are used. #1

Closed witold-markowski-sentaca closed 8 years ago

witold-markowski-sentaca commented 8 years ago

The issue is reproduced when developing for an "Arduino Yun" board. Arduino Yun embeds two platforms:

It is possible to "call" some linux mechanisms from inside regular Arduino code. To make that possible there is a native "Bridge" library available in Arduino IDE. The Arduino project doesn't compile when using both libraries: DS18B20 and Bridge. There is a naming conflict as DS18B20 library defines the variable with the same name as some private variable inside Bridge library:

DS18B20.h
...
#define CRC          8
...
Bridge.h

class BridgeClass {

private:
   ...
    uint16_t CRC;
};

I have the feeling that the CRC variable in BridgeClass should/could be written in a lowercase. On the other hand I feel that providing a fix in DS18B20 library will also do the trick and we don;t have to wait until next Arduino IDE release.

matmunk commented 8 years ago

Awesome! Thanks a lot. I've merged your pull request.