Commit 2822375
committed
pbio/drv/bluetooth_stm32_cc2640: Only restart observe when needed.
Everytime we restart observing, there is a small chance of locking up the Bluetooth chip. The restart was added as a workaround for the scan queue getting full so new scan events were not coming in. This usually doesn't happen for a long time, so we can avoid restarting observing until then.
Since there isn't a good way to know if the queue is full, we can request a restart if we are not receiving data when the user is expecting some data. In the worst case, this will still restart it every 10 seconds as it used to do. If all of the subscribed channels get incoming data, restarting is delayed, thus reducing the likelihood of a freeze.1 parent 4a4714a commit 2822375
File tree
3 files changed
+28
-14
lines changed- lib/pbio/drv/bluetooth
- pybricks/common
3 files changed
+28
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
503 | | - | |
504 | 503 | | |
505 | 504 | | |
506 | 505 | | |
| |||
747 | 746 | | |
748 | 747 | | |
749 | 748 | | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
| 749 | + | |
| 750 | + | |
754 | 751 | | |
755 | 752 | | |
756 | 753 | | |
| |||
1162 | 1159 | | |
1163 | 1160 | | |
1164 | 1161 | | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
| 1162 | + | |
| 1163 | + | |
1169 | 1164 | | |
1170 | 1165 | | |
1171 | 1166 | | |
| |||
1201 | 1196 | | |
1202 | 1197 | | |
1203 | 1198 | | |
1204 | | - | |
| 1199 | + | |
1205 | 1200 | | |
1206 | 1201 | | |
1207 | 1202 | | |
1208 | 1203 | | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1209 | 1209 | | |
1210 | 1210 | | |
1211 | 1211 | | |
| |||
2250 | 2250 | | |
2251 | 2251 | | |
2252 | 2252 | | |
2253 | | - | |
| 2253 | + | |
2254 | 2254 | | |
2255 | 2255 | | |
2256 | 2256 | | |
| |||
2309 | 2309 | | |
2310 | 2310 | | |
2311 | 2311 | | |
2312 | | - | |
| 2312 | + | |
2313 | 2313 | | |
2314 | 2314 | | |
2315 | 2315 | | |
2316 | 2316 | | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
2317 | 2320 | | |
2318 | 2321 | | |
2319 | 2322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
443 | 449 | | |
444 | 450 | | |
445 | 451 | | |
| |||
0 commit comments