summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpldcpu <cpldcpu@gmail.com>2014-05-01 19:14:52 +0200
committercpldcpu <cpldcpu@gmail.com>2014-05-01 19:14:52 +0200
commit0b653a2d0d74c1ad0ed6e2d0b54cdf6e46ab67a4 (patch)
treeb18c02bd18c3165143881178b72d5e0d9c29562f
parentadebe9cd1f00275eabb5eff1dea3902803c9fb38 (diff)
downloadmicronucleus-0b653a2d0d74c1ad0ed6e2d0b54cdf6e46ab67a4.tar.gz
micronucleus-0b653a2d0d74c1ad0ed6e2d0b54cdf6e46ab67a4.tar.bz2
micronucleus-0b653a2d0d74c1ad0ed6e2d0b54cdf6e46ab67a4.zip
firmware: Added signature to configurationreply
-rw-r--r--firmware/main.c12
1 files changed, 8 insertions, 4 deletions
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