TinyCircuits / TinyCircuits-Tiny-Game-Engine

MicroPython game engine for TinyCircuits Thumby Color
GNU General Public License v3.0
9 stars 1 forks source link

Use sys.implementation to verify if the device is Thumby or not. #49

Closed TPReal closed 3 months ago

TPReal commented 3 months ago

I'm not actually sure about this change. Looking for the "/" root seems weird, but on the other hand "Raspberry Pi" could appear if someone run the unix version on a Pi. Maybe look for RP2040 instead, or whatever is the right name.

TinyCircuits commented 3 months ago

On my device I get:

>>> import sys
>>> sys.implementation
(name='micropython', version=(1, 23, 0, ''), _machine='TinyCircuits Thumby Color with RP2040', _mpy=7942)

The RP2040 part is obviously incorrect. This _machine entry comes from me creating a custom MicroPython board in the rp2 port and changing this line: https://github.com/micropython/micropython/blob/557d31ed2c75e90b2f2c534c7019cb51aab5a7c8/ports/rp2/boards/RPI_PICO/mpconfigboard.h#L2 to TinyCircuits Thumby Color (the 'with RP2040' is added/defined somewhere else).

TPReal commented 3 months ago

Ah, if you're going to change that value to your custom value then it's even better. How about now?

TinyCircuits commented 3 months ago

LGTM