projects
/
pub
/
USBaspLoader.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
save some more memory in case "BOOTLOADER_CAN_EXIT" is deactivated
[pub/USBaspLoader.git]
/
firmware
/
main.c
diff --git
a/firmware/main.c
b/firmware/main.c
index
c80ab7d
..
fe5d09f
100644
(file)
--- a/
firmware/main.c
+++ b/
firmware/main.c
@@
-41,12
+41,13
@@
#include <string.h>
#include <string.h>
-
-static void leaveBootloader() __attribute__((__noreturn__));
-
#include "bootloaderconfig.h"
#include "usbdrv/usbdrv.c"
#include "bootloaderconfig.h"
#include "usbdrv/usbdrv.c"
+#if BOOTLOADER_CAN_EXIT
+static void leaveBootloader() __attribute__((__noreturn__));
+#endif
+
#ifndef BOOTLOADER_ADDRESS
#error need to know the bootloaders flash address!
#endif
#ifndef BOOTLOADER_ADDRESS
#error need to know the bootloaders flash address!
#endif
@@
-177,6
+178,7
@@
static const uchar signatureBytes[4] = {
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
+#if BOOTLOADER_CAN_EXIT
static void (*nullVector)(void) __attribute__((__noreturn__));
static void leaveBootloader()
static void (*nullVector)(void) __attribute__((__noreturn__));
static void leaveBootloader()
@@
-197,6
+199,7
@@
static void leaveBootloader()
*/
nullVector();
}
*/
nullVector();
}
+#endif
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
@@
-430,7
+433,9
@@
int __attribute__((noreturn)) main(void)
}while (1); /* main event loop */
#endif
}
}while (1); /* main event loop */
#endif
}
+#if BOOTLOADER_CAN_EXIT
leaveBootloader();
leaveBootloader();
+#endif
}
/* ------------------------------------------------------------------------ */
}
/* ------------------------------------------------------------------------ */