Skip to content

Commit a9a097f

Browse files
committed
lowered CPU utilization
1 parent 7c26a70 commit a9a097f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/windows/panda/panda.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ bool Panda::can_rx_q_push(HANDLE kill_event, DWORD timeoutms) {
392392
// Pause if there is not a slot available in the queue
393393
if (n_ptr == this->r_ptr) {
394394
printf("RX queue full!\n");
395+
Sleep(1);
395396
continue;
396397
}
397398

@@ -455,6 +456,7 @@ void Panda::can_rx_q_pop(PANDA_CAN_MSG msg_out[], int &count) {
455456

456457
// No data left in queue
457458
if (this->r_ptr == this->w_ptr) {
459+
Sleep(1);
458460
return;
459461
}
460462

0 commit comments

Comments
 (0)