How to jump straight to sketch in Arduino Leonardo bootloader

Hi, All:

I am currently studying the Arduino Leonardo bootloader, and want to make a Arduino compatible
bootloader on my x86 hardware. When i trace the following bootloader code(Caterina.c):

if (mcusr_state & (1<<EXTRF)) {
	// External reset -  we should continue to self-programming mode.
} else if ((mcusr_state & (1<<PORF)) && (pgm_read_word(0) != 0xFFFF)) {		
	// After a power-on reset skip the bootloader and jump straight to sketch 
	// if one exists.	
} else if ((mcusr_state & (1<<WDRF)) && (bootKeyPtrVal != bootKey) && (pgm_read_word(0) != 0xFFFF)) {	
	// If it looks like an "accidental" watchdog reset then start the sketch.

I would like to try whether jump straight to StartSketch(), for example: poweron-reset occur;
For testing, i provide a continue 0 ~ 5V voltage to the Arduino Leonardo by using a power supply.
In theory, it would set Atmega32u4 MCUSR’s PORF to 1 when the voltage between 1.4V and 2.3V,
and i don’t press external RESET button during the process. For trying 10 times, Arduino Leonardo
always executed the bootloader(wait for 8s) first then the sketch. Is my method wrong?

I need to know what operations let Arduino Leonardo to jump straight to sketch(skip bootloader),
or it never occur on Arduino Leonardo?

Are you testing with a Leonardo or your own circuit?

If with the Leonardo, did you burn the latest bootloader? Most shipping Leonardos have the older bootloader with the 8 second delay. I believe you need IDE v1.0.3 or later that has the correct fixes for skipping the bootloader on power-on.

Thank you. I use IDE 1.0.3 to re-burn Arduino Leonardo bootloader , then it works correctly now :) I will add this feature to a new Arduino compatible bootloader that running on my x86 hardware. Thank you again.