skorokithakis / A6lib

An ESP8266/Arduino library for communicating with the A6 GSM module. ⛺
MIT License
127 stars 49 forks source link

Enable to compile for arduino boards #38

Closed 1technophile closed 5 years ago

1technophile commented 5 years ago

Currently build is working with esp8266 but not with arduino. By adding macro depending on the board we can build now the library on Arduino or ESP8266.

skorokithakis commented 5 years ago

Would it not be easier to just #define _min min?

1technophile commented 5 years ago

with a condition about which board is compiled I suppose?

skorokithakis commented 5 years ago

Yep, exactly.

1technophile commented 5 years ago

yes we can do it like that, it will factorize the modification

skorokithakis commented 5 years ago

Looks great now, thanks! There are some whitespace changes that need to be fixed, could you fix those so I can merge?

Also, I don't know why the functions are _min instead of min, another person made that change and I don't know the rationale. The ESP8266 does support min as well, though...

1technophile commented 5 years ago

With previous version of ESP8266 arduino board not, but it is now maybe the case, did you try to build with min?

skorokithakis commented 5 years ago

Not recently, but I can. It used to be with min originally, and it worked fine, but someone changed it and I don't know why. I thought it was an improvement, but apparently not.

1technophile commented 5 years ago

I changed it due to build error with ESP8266

skorokithakis commented 5 years ago

Oh hmm, well we can merge yours and I'll try mine when I get home and see.