Commit 39675ae
Fix measurement lockup: clear AVALID between reads
readAllChannels() would lock up under rapidly changing light because
AVALID persisted from the previous measurement. Now stops SP_EN, clears
STATUS/ASTATUS, waits for AVALID to deassert, then starts fresh. Also
stops measurement after reading so AVALID is clean for next call.
Co-authored-by: ladyada <limor@ladyada.net>1 parent 1e91ea2 commit 39675ae
1 file changed
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
320 | 341 | | |
321 | 342 | | |
322 | 343 | | |
323 | 344 | | |
324 | 345 | | |
325 | 346 | | |
326 | | - | |
| 347 | + | |
327 | 348 | | |
328 | 349 | | |
| 350 | + | |
329 | 351 | | |
330 | 352 | | |
331 | 353 | | |
332 | 354 | | |
333 | 355 | | |
334 | | - | |
335 | | - | |
336 | | - | |
| 356 | + | |
337 | 357 | | |
338 | 358 | | |
339 | 359 | | |
| |||
344 | 364 | | |
345 | 365 | | |
346 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
347 | 370 | | |
348 | 371 | | |
349 | 372 | | |
| |||
0 commit comments