I'm working on a little midi hardware project and I'm using attachInterrupt()
to assign a callback function to an interrupt pin.
Nothing gets done in the loop function, so it looks like this:
void loop() { return; }
So far this seems to work out, but I'm wondering if this is a bad practice? I tried adding a short delay() call in there instead but I couldn't really measure if it performed better or worse.
return
... there is nothing to return toloop()
returns tomain()
(from where it was called, inside an infinite loop) after every iteration, whether or not you write areturn;
statement. The only case of such a function not returning one that contains an infinite loop to prevent it.