EnviroDIY / ModularSensors

An Arduino library to give environmental sensors a common interface of functions for use with Arduino-framework dataloggers, such as the EnviroDIY Mayfly.
https://envirodiy.github.io/ModularSensors/
Other
81 stars 48 forks source link

AOSongDHT has cc error #387

Closed neilh10 closed 2 years ago

neilh10 commented 3 years ago

AOSongDHT has compile errors. I believe this problem is already been seen, but just adding this to track the solution.

There must be a new version of the compiler, and there is a conflict with items in the DHType enum with the same named parts in DHT.h / Define types of sensors. / static const uint8_t DHT11{11}; /< DHT TYPE 11 / static const uint8_t DHT12{12}; /< DHY TYPE 12 / static const uint8_t DHT21{21}; /< DHT TYPE 21 / static const uint8_t DHT22{22}; /< DHT TYPE 22 / static const uint8_t AM2301{21}; /*< AM2301 /

AOSongDHT.h: typedef enum DHTtype { DHT11 = 11, DHT21 = 21, AM2301 = 21, DHT22 = 22, AM2302 = 22 } DHTtype;

The parts in the enum are not referenced, it looks like it is specified to improve documentation. I solved the cc problem with a rename, this maynot be an ideal long term fix,

typedef enum DHTtype { // should match values in DHT.h, but can have same names eDHT11 = 11, eDHT12 = 12, eDHT21 = 21, eAM2301 = 21, eDHT22 = 22, eAM2302 = 22 } DHTtype;