hosted/firmware: Waits for read response as long as cortexm_wait_timeout.
This commit is contained in:
parent
26a23dd1cb
commit
62d9f60f03
|
@ -24,7 +24,7 @@
|
||||||
#if !defined(__CL_UTILS_H)
|
#if !defined(__CL_UTILS_H)
|
||||||
#define __CL_UTILS_H
|
#define __CL_UTILS_H
|
||||||
|
|
||||||
#define RESP_TIMEOUT (100)
|
#include "cortexm.h"
|
||||||
|
|
||||||
enum bmp_cl_mode {
|
enum bmp_cl_mode {
|
||||||
BMP_MODE_DEBUG,
|
BMP_MODE_DEBUG,
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
#include "remote.h"
|
#include "remote.h"
|
||||||
#include "cl_utils.h"
|
#include "cl_utils.h"
|
||||||
|
#include "cortexm.h"
|
||||||
|
|
||||||
static int fd; /* File descriptor for connection to GDB remote */
|
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;
|
c = data;
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
|
|
||||||
tv.tv_usec = 1000 * RESP_TIMEOUT;
|
tv.tv_usec = 1000 * cortexm_wait_timeout;
|
||||||
|
|
||||||
/* Look for start of response */
|
/* Look for start of response */
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -145,7 +145,7 @@ int platform_buffer_read(uint8_t *data, int maxsize)
|
||||||
DWORD s;
|
DWORD s;
|
||||||
uint8_t response = 0;
|
uint8_t response = 0;
|
||||||
uint32_t startTime = platform_time_ms();
|
uint32_t startTime = platform_time_ms();
|
||||||
uint32_t endTime = platform_time_ms() + RESP_TIMEOUT;
|
uint32_t endTime = platform_time_ms() + cortexm_wait_timeout;
|
||||||
do {
|
do {
|
||||||
if (!ReadFile(hComm, &response, 1, &s, NULL)) {
|
if (!ReadFile(hComm, &response, 1, &s, NULL)) {
|
||||||
DEBUG_WARN("ERROR on read RESP\n");
|
DEBUG_WARN("ERROR on read RESP\n");
|
||||||
|
|
Loading…
Reference in New Issue