From a9a097f080ac9c27d4577c8a2fb523c43a809ac9 Mon Sep 17 00:00:00 2001 From: gregjhogan Date: Fri, 9 Feb 2018 20:47:08 -0600 Subject: [PATCH] lowered CPU utilization --- drivers/windows/panda/panda.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/windows/panda/panda.cpp b/drivers/windows/panda/panda.cpp index a1ec6d42c46e27..9c95954f7b2d7e 100644 --- a/drivers/windows/panda/panda.cpp +++ b/drivers/windows/panda/panda.cpp @@ -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; } @@ -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; }