Skip to content

Commit ccdaa8b

Browse files
author
LittleMouse
committed
update timeout method & function param
1 parent cb2ef41 commit ccdaa8b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/api/api_yolo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int ApiYolo::inferenceAndWaitResult(String& work_id, uint8_t* input, size_t& raw
107107
bool is_time_out = false;
108108
bool is_msg_finish = false;
109109
while (1) {
110-
_module_msg->update();
110+
_module_msg->update(timeout);
111111
_module_msg->takeMsg(request_id, [&time_out_count, &is_msg_finish, &onResult](ResponseMsg_t& msg) {
112112
String response_msg;
113113
{

src/utils/msg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ void ModuleMsg::init(ModuleComm* ModuleMsg)
1212
_module_comm = ModuleMsg;
1313
}
1414

15-
void ModuleMsg::update()
15+
void ModuleMsg::update(uint32_t timeout)
1616
{
17-
auto reponse = _module_comm->getResponse(50);
17+
auto reponse = _module_comm->getResponse(timeout);
1818
if (reponse.time_out) {
1919
return;
2020
}

src/utils/msg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct ResponseMsg_t {
5252
class ModuleMsg {
5353
public:
5454
void init(ModuleComm* moduleComm);
55-
void update();
55+
void update(uint32_t timeout =50);
5656

5757
inline void sendCmd(const char* cmd)
5858
{

0 commit comments

Comments
 (0)