reaper7 / SDM_Energy_Meter

reading SDM72 SDM120 SDM220 SDM230 SDM630 modbus energy meters from arduino (esp8266, esp32, avr)
240 stars 97 forks source link

USE_HARDWARESERIAL per default for ESP32 #73

Closed Adminius closed 1 year ago

Adminius commented 1 year ago

Hi, I'm trying to integrate your lib into OpenDTU. I would like platform.io let collect your library directly from github. That means, that I can't modify SDM_Config_User.h It produces complie error: SoftwareSerial.h is not found. It is because there is no integrated SW Serial for ESP32 like for ESP8266. So, because ESP32 has 3x HW and there is no standard SW Serial lib, it make sense to change some ifdefs to use HW-Serial on ESP32 per default. I think the easiest way is to add before this line https://github.com/reaper7/SDM_Energy_Meter/blob/master/SDM.h#L12

#if defined ( ESP32 )
#define USE_HARDWARESERIAL 
#endif

same here: ESP32 and SW-Serial are not possible: https://github.com/reaper7/SDM_Energy_Meter/blob/master/SDM.cpp#L33

what do you think? Should I create a PR for IT?

reaper7 commented 1 year ago

Hi! yes, of course, please create a PR, I will review it and add it