There are many non-Arduino programs made for ATmega architecture (no setup, no loop, just a main) that I would like to use in the Arduino IDE. Being able to replace the built-in
main() is a good thing, but as noted, there are some minor issues.
As I recall, the built-in
main() is just this:
void main() {
init();
setup();
while (1)
loop();
}
So if you wanted to support Arduino library features like
delay(), but don't have the setup/loop structure in your ATmega project, you have two options:
(1) call the built-in
init() in your
main() before you use Arduino library features, or
(2) change your
main() to be called
setup() and provide a dead, empty
loop() function.