Effect of Returning from loop()

If I return from the required loop() function , Does the System automatically re run the function, or will the system stall.

I have a piece of code in a new loop1() using Scheduler. The code calls a return; on any config failures. I would hope the loop1() will just repeat.

Is this a correct assumption?

I believe I got my answer for main.cpp
i
nt main(void)
{
init();

#if defined(USBCON)
USBDevice.attach();
#endif

setup();

for (;:wink: {
loop();
if (serialEventRun) serialEventRun();
}

return 0;
}

Right. loop() will get called over and over. Your new function loop1() will only be called if you call it. Returning from it will return to wherever you called it from.

Ahh. But with the Due, There is a Scheduler library. This loop1 is a secondary loop. ( Multitasking)

Will this loop be called again like the Main loop?

Oh, you didn't say Due. I don't know about Due.

But if it uses that same main.cpp then I would assume no since that main() doesn't ever call anything called loop1().

Sorry for not being clear about the Due.

I would hope that the Scheduler library would handle the loop.

I will dig into this.
Thanks for your reply.

Sorry for not being clear about the Due.

The Due has its own forum section.
Would you like me to move this thread there?

Yes Please. and Thank you

Ran some tests at it appears that the secondary loops do in fact repeat after a return.