0
0
Fork 0

fix(DAP) reset not working when FREERTOS FREQ < 500

This commit is contained in:
kerms 2024-04-15 14:54:39 +08:00
parent e547a83938
commit 86a8804cca
2 changed files with 6 additions and 2 deletions

View File

@ -969,6 +969,7 @@ __STATIC_INLINE void DAP_SETUP(void)
PORT_OFF();
}
/* minimum 1 tick delay */
extern void dap_os_delay(int ms);
/** Reset Target Device with custom specific I/O pin or command sequence.
This function allows the optional implementation of a device specific reset sequence.

View File

@ -1846,8 +1846,11 @@ void DAP_Setup(void) {
DAP_SETUP(); // Device specific setup
}
void dap_os_delay(int ms)
{
vTaskDelay(pdMS_TO_TICKS(ms));
if (CONFIG_FREERTOS_HZ >= 1000) {
vTaskDelay(pdMS_TO_TICKS(ms));
} else {
vTaskDelay(pdMS_TO_TICKS(ms) + 1);
}
}