stm32/mboot: Add DFU logic to respond to DFU_GETSTATE request.

This is required for some DFU programmers, eg ST's DfuSe demo PC app.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2020-06-30 14:23:50 +10:00
parent 40006813c3
commit 65a7e00078
1 changed files with 3 additions and 0 deletions

View File

@ -933,6 +933,9 @@ static int dfu_handle_tx(int cmd, int arg, int len, uint8_t *buf, int max_len) {
dfu_context.status = DFU_STATUS_OK; dfu_context.status = DFU_STATUS_OK;
dfu_context.error = 0; dfu_context.error = 0;
return 6; return 6;
} else if (cmd == DFU_GETSTATE && len == 1) {
buf[0] = dfu_context.state; // bState
return 1;
} }
return -1; return -1;
} }