The ATPROGRAM LUFA build system module now defaults to the Atmel ICE debuger tool...
[pub/USBasp.git] / Bootloaders / CDC / BootloaderCDC.c
index 5f1047e..c7eeb92 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2013.
+     Copyright (C) Dean Camera, 2014.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2013  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -91,6 +91,10 @@ void Application_Jump_Check(void)
        if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
          JumpToApplication |= true;
 
+       /* Don't run the user application if the reset vector is blank (no app loaded) */
+       if (pgm_read_word_near(0) == 0xFFFF)
+         JumpToApplication = false;
+
        /* If a request has been made to jump to the user application, honor it */
        if (JumpToApplication)
        {