rename tud_dfu_set_timeout_cb() to tud_dfu_get_status_cb()

also add state as argument
This commit is contained in:
hathach
2021-07-12 21:08:13 +07:00
parent 8c48a4a288
commit 86d511f244
3 changed files with 17 additions and 15 deletions

View File

@@ -125,10 +125,13 @@ bool tud_dfu_firmware_valid_check_cb(uint8_t alt)
return true;
}
uint16_t tud_dfu_set_timeout_cb(uint8_t alt)
uint32_t tud_dfu_get_status_cb(uint8_t alt, uint8_t state)
{
// For example Alt1 (EEPROM) is slow, add 2000ms timeout
if (alt == 1) return 2000;
if ( state == DFU_DNBUSY )
{
if (alt == 1) return 2000;
}
return 0;
}