flash_mode(1);\r
} else if(BUTTON_PRESS()) {\r
flash_mode(0);\r
+ } else if(*(uint32_t*)&_osimage_entry == 0xffffffffU) {\r
+ flash_mode(1);\r
} else {\r
// jump to Flash address of the osimage entry point (LSBit set for thumb mode)\r
asm("bx %0\n" : : "r" ( ((int)&_osimage_entry) | 0x1 ) );\r