From ada3c7808a466918a3f7745e0408339807a954e9 Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Sun, 20 Dec 2015 10:41:43 -0500 Subject: [PATCH 1/2] Remove unused static initializer so that all RAM can be in BSS; dfu_reset() is already initializing these values anyway --- class/dfu/dfu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/class/dfu/dfu.c b/class/dfu/dfu.c index 0db5be7..5cf86b3 100644 --- a/class/dfu/dfu.c +++ b/class/dfu/dfu.c @@ -1,7 +1,7 @@ #include "class/dfu/dfu.h" -DFU_State dfu_state = DFU_STATE_dfuIDLE; -DFU_Status dfu_status = DFU_STATUS_OK; +DFU_State dfu_state; +DFU_Status dfu_status; uint16_t dfu_poll_timeout; uint16_t dfu_block_offset; From 6ac06eb882c1dc03131aabb2e7ba4c44acf5d494 Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Mon, 21 Dec 2015 08:51:12 -0500 Subject: [PATCH 2/2] Remove serial number descriptor code --- samd/usb_samd.c | 13 ------------- samd/usb_samd.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/samd/usb_samd.c b/samd/usb_samd.c index 0f22c7a..2763c98 100644 --- a/samd/usb_samd.c +++ b/samd/usb_samd.c @@ -254,16 +254,3 @@ void USB_Handler() { usb_cb_completion(); } -void* samd_serial_number_string_descriptor() { - char buf[27]; - - const unsigned char* id = (unsigned char*) 0x0080A00C; - for (int i=0; i<26; i++) { - unsigned idx = (i*5)/8; - unsigned pos = (i*5)%8; - unsigned val = ((id[idx] >> pos) | (id[idx+1] << (8-pos))) & ((1<<5)-1); - buf[i] = "0123456789ABCDFGHJKLMNPQRSTVWXYZ"[val]; - } - buf[26] = 0; - return usb_string_to_descriptor(buf); -} diff --git a/samd/usb_samd.h b/samd/usb_samd.h index 73e3b59..61e7dca 100644 --- a/samd/usb_samd.h +++ b/samd/usb_samd.h @@ -12,5 +12,3 @@ extern const uint8_t usb_num_endpoints; #define USB_ENDPOINTS(NUM_EP) \ const uint8_t usb_num_endpoints = (NUM_EP); \ UsbDeviceDescriptor usb_endpoints[(NUM_EP)+1]; - -void* samd_serial_number_string_descriptor();