From 0b653a2d0d74c1ad0ed6e2d0b54cdf6e46ab67a4 Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Thu, 1 May 2014 19:14:52 +0200 Subject: firmware: Added signature to configurationreply --- firmware/main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'firmware') diff --git a/firmware/main.c b/firmware/main.c index 63979ac..4d51c10 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -39,19 +39,23 @@ #endif // Device configuration reply -// Length: 4 bytes +// Length: 6 bytes // Byte 0: User program memory size, high byte // Byte 1: User program memory size, low byte // Byte 2: Flash Pagesize in bytes // Byte 3: Page write timing in ms. // Bit 7 '0': Page erase time equals page write time // Bit 7 '1': Page erase time equals page write time divided by 4 +// Byte 4: SIGNATURE_1 +// Byte 5: SIGNATURE_2 -PROGMEM const uint8_t configurationReply[4] = { +PROGMEM const uint8_t configurationReply[6] = { (((uint16_t)PROGMEM_SIZE) >> 8) & 0xff, ((uint16_t)PROGMEM_SIZE) & 0xff, SPM_PAGESIZE, - MICRONUCLEUS_WRITE_SLEEP + MICRONUCLEUS_WRITE_SLEEP, + SIGNATURE_1, + SIGNATURE_2 }; typedef union { @@ -74,7 +78,7 @@ enum { cmd_erase_application=2, cmd_write_data=3, cmd_exit=4, - cmd_write_page=64, // internal commands start at 64 + cmd_write_page=64 // internal commands start at 64 }; register uint8_t command asm("r3"); // bind command to r3 -- cgit v1.2.3