lewapek / sds-dust-sensors-arduino-library

Library for Nova Fitness SDS dust sensors family (SDS011, SDS021)
MIT License
64 stars 19 forks source link

Support SAMD based boards #13

Closed noerw closed 5 years ago

noerw commented 5 years ago

I put SoftwareSerial.h behind a #ifdef to support compilation for SAMD based boards which lack this header. According to https://github.com/thomasklingbeil/sds-dust-sensors-arduino-library/commit/eaa03da56f0585d57525ebe43086cf68de695c5b, ESP32 is affected as well.

If only AVR based boards have the SoftwareSerial.h header, one could think about replacing the SAMD check for a #ifdef (__AVR__) || (__avr__) instead. But I'm not knowledgeable about SoftwareSerial.h to tell if this is a good idea.

lewapek commented 5 years ago

Thank you for your work. SoftwareSerial is problematic and I think it is good idea to put it behind #ifndef directive. I'm not sure if only AVR based boards have this header so I leave the directive as you proposed.

lewapek commented 5 years ago

There is also new release associated with your PR: https://github.com/lewapek/sds-dust-sensors-arduino-library/releases/tag/1.4.0