Closed jamesbowman closed 3 years ago
sys.platform
usually just indicates the chip that's used, not the individual board. That documentation could be phrased better. Take a look at os.uname()
, which provides board info:
>>> sys.platform
'Atmel SAMD21'
>>> os.uname()
(sysname='samd21', nodename='samd21', release='6.2.0', version='6.2.0-beta.1-9-g70a5f464d on 2021-01-29', machine='Adafruit Trinket M0 with samd21e18')
os.uname()
on a Pico:
>>> os.uname()
(sysname='rp2040', nodename='rp2040', release='6.2.0', version='6.2.0-beta.1 on 2021-01-27', machine='Raspberry Pi Pico with rp2040')
Excellent, thanks.
So should I send a PR with:
for the raspberrypi ports?
Yes, that would be good, in mpconfigport.h
Use RP2040
, capitalized, because that's the chip designation.
Fixed by #4092
sys.platform
is missing from the raspberrypi ports.I started to make a PR, with
#define MICROPY_PY_SYS_PLATFORM
inmpconfigport.h
. However, it seems to require some thought. According to the docs forsys.platform
:(This is exactly what I want it for... to distinguish between boards in the Gameduino driver and assign the appropriate default IO pins.)
So it should be different for the raspberry_pi_pico and adafruit_feather_rp2040 boards. Maybe it should be
But unsure. Happy to continue the PR with any given scheme.