writer.py: fix issue with rp2 fast mode.

pull/45/head
Peter Hinch 2021-02-14 17:07:24 +00:00
rodzic b338e73154
commit 0803aeab57
1 zmienionych plików z 13 dodań i 10 usunięć

Wyświetl plik

@ -23,20 +23,23 @@
import framebuf import framebuf
from uctypes import bytearray_at, addressof from uctypes import bytearray_at, addressof
from sys import platform
__version__ = (0, 4, 0) __version__ = (0, 4, 1)
fast_mode = True fast_mode = platform != 'rp2' # framebuf_utils crashes RP2
try: if fast_mode:
try: try:
from framebuf_utils import render
except ImportError: # May be running in GUI. Try relative import.
try: try:
from .framebuf_utils import render from framebuf_utils import render
except ImportError: except ImportError: # May be running in GUI. Try relative import.
fast_mode = False try:
except ValueError: from .framebuf_utils import render
fast_mode = False except ImportError:
fast_mode = False
except ValueError:
fast_mode = False
if not fast_mode:
print('Ignoring framebuf_utils.mpy: compiled for incorrect architecture.') print('Ignoring framebuf_utils.mpy: compiled for incorrect architecture.')