Skip to content

Commit cda1798

Browse files
committed
clean up
1 parent dbeaafa commit cda1798

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

src/usb/uf2/uf2cfg.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
#include "boards.h"
22
#include "dfu_types.h"
33

4-
// Family ID for updating generic Application
5-
#if defined(NRF52833_XXAA)
6-
#define CFG_UF2_FAMILY_APP_ID 0x621E937A
7-
#elif defined(NRF52840_XXAA)
8-
#define CFG_UF2_FAMILY_APP_ID 0xADA52840
9-
#endif
4+
// Virtual disk size: just under 32MB
5+
#define CFG_UF2_NUM_BLOCKS 0x10109
6+
7+
// Family ID for updating Bootloader
8+
#define CFG_UF2_FAMILY_BOOT_ID 0xd663823c
109

1110
// Board-specific ID for board-specific Application
1211
#if defined(USB_DESC_VID) && defined(USB_DESC_UF2_PID) && USB_DESC_VID && USB_DESC_UF2_PID
1312
#define CFG_UF2_BOARD_APP_ID ((USB_DESC_VID << 16) | USB_DESC_UF2_PID)
1413
#endif
1514

16-
17-
// Family ID for updating Bootloader
18-
#define CFG_UF2_FAMILY_BOOT_ID 0xd663823c
19-
20-
#define CFG_UF2_NUM_BLOCKS 0x10109 // just under 32MB
15+
// Family ID and size for updating generic Application
2116
#if defined(NRF52833_XXAA)
22-
#define CFG_UF2_FLASH_SIZE 0x80000 // 512 kB
23-
#else
24-
#define CFG_UF2_FLASH_SIZE (1024*1024) // 1 MB
17+
#define CFG_UF2_FAMILY_APP_ID 0x621E937A
18+
#define CFG_UF2_FLASH_SIZE (512*1024) // 512 kB
19+
#elif defined(NRF52840_XXAA)
20+
#define CFG_UF2_FAMILY_APP_ID 0xADA52840
21+
#define CFG_UF2_FLASH_SIZE (1024*1024) // 1 MB
2522
#endif
2623

2724
// Application Address Space
28-
#define USER_FLASH_START MBR_SIZE // skip MBR included in SD hex
29-
#define USER_FLASH_END (BOOTLOADER_REGION_START - DFU_APP_DATA_RESERVED)
25+
#define USER_FLASH_START MBR_SIZE // skip MBR included in SD hex
26+
#define USER_FLASH_END (BOOTLOADER_REGION_START - DFU_APP_DATA_RESERVED)
3027

3128
// Bootloader start address
3229
#define BOOTLOADER_ADDR_START BOOTLOADER_REGION_START

0 commit comments

Comments
 (0)