I discovered that the EnableInterrupt.h 'library' has problems It does not allow interrupt handlers anywhere but in the main sketch code and is also peppered with references to Arduino boards rather than the underlying AVR processor used on those boards. Consequently, if you're using a newer Arduino Board or using a 'non' Arduino board, Moteino to take a random example, you won't even be able to build the code.
I've attached a very simple change I made to their 'Simple' example to prove the failure.
Net: This library is unusable as-is for anything other than a very simple sketch with single interrupt. I've reported the issue on the github.
Tom
UPDATED: removed inappropriate qualitative assessment and clarified usefulness.
Thanks for the removal
. I resembled your earlier remark.
As I mentioned in the Github issue, the references are mostly because, yes, the 'library' is Arduino focused. Given that I have a wife and child to support (== limited time [another word for it is 'myopia', apparently]), I have to direct my energies somewhere. Anyone is free to help- that's why it's released under the Apache license.
To say that it only works on a simple sketch with a single interrupt is incorrect. It will either fail to compile (because I can only test on Arduinos, and another library may define the same ISRs that this one does), or it will work on all interrupts on the chips it recognizes. See
https://github.com/GreyGnome/EnableInterrupt/blob/master/examples/AllPins328/AllPins328.ino . I test every single pin, and I also test to make sure that it enables/disables, that it supports External as well as Pin Change interrupts, and even that you can switch between the two on supported pins (== 2 and 3 on the ATmega328). But I do not test with various other libraries- again, a time/family/sleep/myopia balancing act on my part.
BTW, if you put
#define LIBCALL_ENABLEINTERRUPT ahead of your
#include <EnableInterrupt.h> in your
mOtherFunctions.h file, you should be able to use the library with other libraries. This allows the compiler to recognize the function declarations. You still need to #include EnableInterrupt.h in the main sketch, because the code needs to be defined (not just declared) somewhere. If you know of another technique to allow for this library to work with other Arduino libraries, I'm all ears. I got this idea from Paul Stoffregen some years ago. This is why the code is in the .h file and not in a .cpp file, to enable the library to work with and for other libraries. I do need to document the technique, which I missed.
I don't know why it would barf about an unknown board. The library knows nothing about boards- only CPUs. The fact that there are Arduino #defines is just convenience for me- indeed, the ATmega 1284 is supported based on a request, and it's not an Arduino chip. It's a cool chip, and I like it, so I support it to the best of my ability. But I can only guarantee Arduino compatibility because that's all I have. I can't spend untold dollars purchasing, programming, and supporting the entire ATmega line (not even close), guaranteeing compatibility with all of the different chips.
I spent a couple of months prior to the 0.1 release programming and, yes, testing the hell out of this library (again, see the previous link and other examples- I have probably 4 or 5 test sketches that I run with every release). Did I miss such things as the SoftwareSerial library/EnableInterrupt library conflict? Yes, because I don't use that library *. You can imagine how difficult it would be to design for every circumstance. It works for what I have- an Arduino Duemilanove and Mega2560- for everything else, I pray for help and bug reports over complaints.
* Not that it would have mattered to the release, but I needed to get the new one out the door. Probably what I missed was the fact that I should have documented the issue because I did have that functionality in the PinChangeInt library and would have included it eventually.
Again, if you like the idea and goals of the library, the best thing to do is file bug reports and (especially) help. Complaining about myopia and so on is not useful.