diff options
Diffstat (limited to 'examples/unix')
-rw-r--r-- | examples/unix/ffi_example.py | 2 | ||||
-rw-r--r-- | examples/unix/machine_bios.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/examples/unix/ffi_example.py b/examples/unix/ffi_example.py index 3c3c3d239..a8f02c766 100644 --- a/examples/unix/ffi_example.py +++ b/examples/unix/ffi_example.py @@ -24,12 +24,14 @@ print("errno value:", errno.get()) perror("perror after error") print() + def cmp(pa, pb): a = uctypes.bytearray_at(pa, 1) b = uctypes.bytearray_at(pb, 1) print("cmp:", a, b) return a[0] - b[0] + cmp_cb = ffi.callback("i", cmp, "PP") print("callback:", cmp_cb) diff --git a/examples/unix/machine_bios.py b/examples/unix/machine_bios.py index f62e4dbdb..878f3fd8f 100644 --- a/examples/unix/machine_bios.py +++ b/examples/unix/machine_bios.py @@ -6,4 +6,4 @@ import umachine as machine -print(hex(machine.mem16[0xc0000])) +print(hex(machine.mem16[0xC0000])) |