Add makefile
This adds a Makefile for use with ArduinoMakefile, as well as a simple script to find usb-serial devices.
AR488.ino is updated with forward declarations, which are required for ArduinoMakefile.
Almost forgot - the compiler spits out some warnings that are probably worth investigating. For example,
AR488.ino: In function 'void id_h(char*)':
AR488.ino:2408:11: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (isVerb) dataPort.print(F("VerStr: "));dataPort.println(gpibBus.cfg.vstr);
^~
AR488.ino:2408:53: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
if (isVerb) dataPort.print(F("VerStr: "));dataPort.println(gpibBus.cfg.vstr);
^~~~~~~~
<rant> One of the many things that drives me nuts about C/C++ is how easy it is to write code that doesn't work as expected and causes undefined behavior or goto fail or the like. </rant>
Mark,
That's a good spot. I am going through a refactoring exercise at the moment - the .ino has got rather big for one thing - and found that same problem. Your note has reminded me to fix it in the current code, which I have now done. Not sure how it ended up like that, but it did need fixing. Thanks for pointing it out.
I will also have a look at the PR. Thanks.
Not really come across a code pretty-printer before but will have a look.
The only pretty-printer I've fiddled with much is astyle. A config like this tells it to produce compact formatting. The docs show the results of many (all?) style options, including java, k&r, etc).
It's been a decade since I last used astyle; I believe clang-format wasn't an option back then, and there are probably others as well.