summaryrefslogtreecommitdiffstats
path: root/firmware/main.c
diff options
context:
space:
mode:
authorJenna Fox <a@creativepony.com>2012-09-26 01:08:54 +1000
committerJenna Fox <a@creativepony.com>2012-09-26 01:08:54 +1000
commit7b20da73c9a0ed03d32c2f9e654367900cb1e06f (patch)
tree66a87bd1141d43817c90a08b6f4de01095390157 /firmware/main.c
parent9573415534e53c03c66b2c2aa4f6797e09220893 (diff)
downloadmicronucleus-7b20da73c9a0ed03d32c2f9e654367900cb1e06f.tar.gz
micronucleus-7b20da73c9a0ed03d32c2f9e654367900cb1e06f.tar.bz2
micronucleus-7b20da73c9a0ed03d32c2f9e654367900cb1e06f.zip
Added check to make sure BOOTLOADER_ADDRESS aligns with SPM_PAGESIZE
Diffstat (limited to 'firmware/main.c')
-rw-r--r--firmware/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/main.c b/firmware/main.c
index 30077ec..7476254 100644
--- a/firmware/main.c
+++ b/firmware/main.c
@@ -72,6 +72,11 @@ static void leaveBootloader() __attribute__((__noreturn__));
#define POSTSCRIPT_SIZE 6 /* maybe it could be 4 now we do not have checksums? */
#define PROGMEM_SIZE (BOOTLOADER_ADDRESS - POSTSCRIPT_SIZE) /* max size of user program */
+// verify the bootloader address aligns with page size
+#if BOOTLOADER_ADDRESS % SPM_PAGESIZE != 0
+# error "BOOTLOADER_ADDRESS in makefile must be a multiple of chip's pagesize"
+#endif
+
// events system schedules functions to run in the main loop
static uchar events = 0; // bitmap of events to run
#define EVENT_ERASE_APPLICATION 1