Software Serial Research and Questions

GolamMostafa:
It is a valid ISR; it was running well a while ago; now, it is not running because the interrupt logic has been disabled either by the user or by the non-standard instructions appended later.

Insertion of for(; ;){;} within loop() function prevents the MCU from entering into the serialEvent() function (tested). Will the processor be responding to hardware (INT0/INT1) interrupt -- to be tested soon?

So you have admitted adding the infinite loop in the loop() function and the LED does not come on when there is serial data.

If you don't like for ( ; ; ) {} or for (i=0; i<5; i+=0) {} then try
while (1) { delay(1); }
or even swap out 1 for a huge number (the biggest it can accept). Be sure to post your code. The results of the LED will be the same.

This shows that, though you have yet to assimilate the information, serialEvent() is not an ISR. I was this stubborn as well, until I was shown the code for main() which must exist for all C/C++ programs.

int main(void)
{
	init();

	initVariant();

#if defined(USBCON)
	USBDevice.attach();
#endif
	
	setup();
    
	for (;;) {
		loop();  // <- PROGRAM IS STUCK HERE
		if (serialEventRun) serialEventRun(); // <- PROGRAM NEVER ADVANCES TO HERE AND CANNOT CALL serialEventRun() WHICH CALLS serialEvent();
	}
        
	return 0;
}

For homework:
Please explain how an infinite loop() disables an ISR.

Please explain how the compiler can determine a loop is infinite, then based on that knows to go off and disable a certain ISR. (This is a perfect example to call upon Occam's razor)

You have agreed to the proper definition of an ISR, Please show where serialEvent() is defined as an ISR. According to you, somewhere, somehow the is a function call with the keyword ISR that directly call serialEvent().

P.S. I have no doubt that properly defined ISRs will work while there exists an infinite loop in in loop().