diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-07-06 00:08:33 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-07-08 11:37:23 +0300 |
commit | 354d17523f599746a84e5b22fa670c9910137947 (patch) | |
tree | bfea06b4d85306803cd9a9bb0a3ec6bcdfd25d6c /tests/extmod/machine1.py | |
parent | a0a3de60becb0147be209ab5a32139ea9cec3d2e (diff) | |
download | micropython-354d17523f599746a84e5b22fa670c9910137947.tar.gz micropython-354d17523f599746a84e5b22fa670c9910137947.zip |
modmachine: Implement physical memory access using /dev/mem (Linux, etc).
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.
Diffstat (limited to 'tests/extmod/machine1.py')
-rw-r--r-- | tests/extmod/machine1.py | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/tests/extmod/machine1.py b/tests/extmod/machine1.py index e7fd40d4db..af4dacd03a 100644 --- a/tests/extmod/machine1.py +++ b/tests/extmod/machine1.py @@ -7,22 +7,8 @@ except ImportError: import sys sys.exit() -import uctypes - print(machine.mem8) -buf = bytearray(8) -addr = uctypes.addressof(buf) - -machine.mem8[addr] = 123 -print(machine.mem8[addr]) - -machine.mem16[addr] = 12345 -print(machine.mem16[addr]) - -machine.mem32[addr] = 123456789 -print(machine.mem32[addr]) - try: machine.mem16[1] except ValueError: |