Skip to content

Commit

Permalink
lowered CPU utilization
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjhogan committed Feb 18, 2018
1 parent 7c26a70 commit a9a097f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/windows/panda/panda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ bool Panda::can_rx_q_push(HANDLE kill_event, DWORD timeoutms) {
// Pause if there is not a slot available in the queue
if (n_ptr == this->r_ptr) {
printf("RX queue full!\n");
Sleep(1);
continue;
}

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

// No data left in queue
if (this->r_ptr == this->w_ptr) {
Sleep(1);
return;
}

Expand Down

0 comments on commit a9a097f

Please sign in to comment.