Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ class BridgeClass {
if (k_mutex_lock(&write_mutex, K_MSEC(10)) == 0){
server->send_response(req);
k_mutex_unlock(&write_mutex);
k_msleep(1);
break;
} else {
k_msleep(1);
k_yield();
}

}
Expand All @@ -142,10 +141,9 @@ class BridgeClass {
if (k_mutex_lock(&write_mutex, K_MSEC(10)) == 0) {
client->send_rpc(method, msg_id_wait, std::forward<Args>(args)...);
k_mutex_unlock(&write_mutex);
k_msleep(1);
break;
} else {
k_msleep(1);
k_yield();
}
}

Expand All @@ -154,13 +152,12 @@ class BridgeClass {
if (k_mutex_lock(&read_mutex, K_MSEC(10)) == 0 ) {
if (client->get_response(msg_id_wait, result)) {
k_mutex_unlock(&read_mutex);
k_msleep(1);
break;
}
k_mutex_unlock(&read_mutex);
k_msleep(1);
} else {
k_msleep(1);
k_yield();
}

}
Expand Down Expand Up @@ -210,10 +207,9 @@ class BridgeClass {
if (k_mutex_lock(&write_mutex, K_MSEC(10)) == 0){
server->send_response(req);
k_mutex_unlock(&write_mutex);
k_msleep(1);
break;
} else {
k_msleep(1);
k_yield();
}

}
Expand Down Expand Up @@ -243,7 +239,7 @@ inline void updateEntryPoint(void *, void *, void *){
if (Bridge) {
Bridge.update();
}
k_msleep(1);
k_yield();
}
}

Expand All @@ -253,7 +249,7 @@ static void safeUpdate(){

// leave as is
void __loopHook(void){
k_msleep(1);
k_yield();
safeUpdate();
}

Expand Down