Skip to content

Commit

Permalink
stm32f1: use the "Command" to identify a high density device
Browse files Browse the repository at this point in the history
  • Loading branch information
Arksine committed May 4, 2020
1 parent 73b8bef commit 215010f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bootloader/F1/Src/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ volatile bool UploadStarted;
volatile bool UploadFinished;

/* Sent command (Received command is the same minus last byte) */
#if PAGE_SIZE == 1024
static const uint8_t Command[] = {'B', 'T', 'L', 'D', 'C', 'M', 'D', 2};
#else
static const uint8_t Command[] = {'B', 'T', 'L', 'D', 'C', 'M', 'D', 3};
#endif

/* Flash page buffer */
static uint8_t PageData[PAGE_SIZE];
Expand Down Expand Up @@ -286,7 +290,7 @@ static void HIDUSB_HandleData(uint8_t *data)
CurrentPageOffset = 0;
LED1_OFF;
}

if((CurrentPageOffset == 0)||(CurrentPageOffset == 1024)){
USB_SendData(ENDP1, (uint16_t *) Command,
sizeof (Command));
Expand Down
2 changes: 2 additions & 0 deletions bootloader/F1/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ void Reset_Handler(void)
delay(400L);
};

delay(200000L);

/* Reset the USB */
USB_Shutdown();

Expand Down

0 comments on commit 215010f

Please sign in to comment.