X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Bootloader%2Fdfu.h;h=d4da289eb93b4caf60ba3ccde706dcb7636e8a97;hb=7c10ab1d60b667f6756cbf095bd8ebea8149c4a4;hp=83d5d2b549bab1dc4a4213ca3b6119b47dd49007;hpb=1acbc97e98d8388332c51260017ab23227a91339;p=kiibohd-controller.git diff --git a/Bootloader/dfu.h b/Bootloader/dfu.h index 83d5d2b..d4da289 100644 --- a/Bootloader/dfu.h +++ b/Bootloader/dfu.h @@ -15,8 +15,7 @@ * along with this program. If not, see . */ -#ifndef _USB_DFU_H -#define _USB_DFU_H +#pragma once // ----- Compiler Includes ----- @@ -30,7 +29,15 @@ #ifndef USB_DFU_TRANSFER_SIZE -#define USB_DFU_TRANSFER_SIZE FLASH_SECTOR_SIZE +// Sector size is the same as the program flash size +#if defined(_mk20dx128vlf5_) +#define USB_DFU_TRANSFER_SIZE FLASH_SECTOR_SIZE + +// Sector size is double the program flash size +#elif defined(_mk20dx256vlh7_ ) +#define USB_DFU_TRANSFER_SIZE FLASH_SECTOR_SIZE / 2 + +#endif #endif #define USB_FUNCTION_DESC_DFU_DECL \ @@ -163,4 +170,3 @@ void dfu_write_done( enum dfu_status, struct dfu_ctx *ctx ); void dfu_init( dfu_setup_read_t setup_read, dfu_setup_write_t setup_write, dfu_finish_write_t finish_write, struct dfu_ctx *ctx ); void dfu_app_init( dfu_detach_t detachcb ); -#endif