354d17523f
This requires root access. And on recent Linux kernels, with CONFIG_STRICT_DEVMEM option enabled, only address ranges listed in /proc/iomem can be accessed. The above compiled-time option can be however overriden with boot-time option "iomem=relaxed". This also removed separate read/write paths - there unlikely would be a case when they're different.
26 lines
351 B
Python
26 lines
351 B
Python
# test machine module
|
|
|
|
try:
|
|
import machine
|
|
except ImportError:
|
|
print("SKIP")
|
|
import sys
|
|
sys.exit()
|
|
|
|
print(machine.mem8)
|
|
|
|
try:
|
|
machine.mem16[1]
|
|
except ValueError:
|
|
print("ValueError")
|
|
|
|
try:
|
|
machine.mem16[1] = 1
|
|
except ValueError:
|
|
print("ValueError")
|
|
|
|
try:
|
|
del machine.mem8[0]
|
|
except TypeError:
|
|
print("TypeError")
|