Unverified Commit 1020023e authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Avoid infinite loop in BLE HID send (#1834)

If the BLE connection is severed, don't wait for the needToSend
flag to clear in the HID::send routine since it may never actually
clear unless the BLE connection is restored.

Partial #1817
parent a475c444
......@@ -252,8 +252,10 @@ public:
}
bool send(void *rpt, int len) {
//wait for another report to be sent
while (_needToSend);
// Wait for another report to be sent
while (connected() && _needToSend) {
/* noop busy wait */
}
_needToSend = true;
_sendReport = rpt;
_sendReportLen = len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment