hosted/firmware: Waits for read response as long as cortexm_wait_timeout.

This commit is contained in:
Uwe Bonnes 2020-11-08 16:18:11 +01:00 committed by UweBonnes
parent 26a23dd1cb
commit 62d9f60f03
3 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,7 @@
#if !defined(__CL_UTILS_H)
#define __CL_UTILS_H
#define RESP_TIMEOUT (100)
#include "cortexm.h"
enum bmp_cl_mode {
BMP_MODE_DEBUG,

View File

@ -29,6 +29,7 @@
#include "general.h"
#include "remote.h"
#include "cl_utils.h"
#include "cortexm.h"
static int fd; /* File descriptor for connection to GDB remote */
@ -189,7 +190,7 @@ int platform_buffer_read(uint8_t *data, int maxsize)
c = data;
tv.tv_sec = 0;
tv.tv_usec = 1000 * RESP_TIMEOUT;
tv.tv_usec = 1000 * cortexm_wait_timeout;
/* Look for start of response */
do {

View File

@ -145,7 +145,7 @@ int platform_buffer_read(uint8_t *data, int maxsize)
DWORD s;
uint8_t response = 0;
uint32_t startTime = platform_time_ms();
uint32_t endTime = platform_time_ms() + RESP_TIMEOUT;
uint32_t endTime = platform_time_ms() + cortexm_wait_timeout;
do {
if (!ReadFile(hComm, &response, 1, &s, NULL)) {
DEBUG_WARN("ERROR on read RESP\n");