Commit ed5c0bd
committed
rgbmatrix: Avoid leaving an incompletely configured display bus
I did not reproduce the exact problem reported; however, I reproduced
that a failure to construct an RGBMatrix object would leave CircuitPython
in an inconsistent state with a display bus registered but not working:
```py
>>> import rgbmatrix, board; rgbmatrix.RGBMatrix(width=64, bit_depth=1, rgb_pins=[], addr_pins=[], clock_pin=board.A0, latch_pin=board.A1, output_enable_pin=board.A2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: The length of rgb_pins must be 6, 12, 18, 24, or 30
>>> import rgbmatrix, board; rgbmatrix.RGBMatrix(width=64, bit_depth=1, rgb_pins=[], addr_pins=[], clock_pin=board.A0, latch_pin=board.A1, output_enable_pin=board.A2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Too many display busses; forgot displayio.release_displays() ?
```
After the fix the second call also results in a ValueError, not a
RuntimeError, which is correct.
Closes #96741 parent 407a31f commit ed5c0bd
File tree
1 file changed
+17
-1
lines changed1 file changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
| |||
217 | 227 | | |
218 | 228 | | |
219 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
220 | 237 | | |
221 | 238 | | |
222 | 239 | | |
| |||
254 | 271 | | |
255 | 272 | | |
256 | 273 | | |
257 | | - | |
258 | 274 | | |
259 | 275 | | |
260 | 276 | | |
| |||
0 commit comments