summaryrefslogtreecommitdiffstatshomepage
path: root/examples/unix/ffi_example.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-27 15:36:53 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-28 10:33:03 +1100
commit69661f3343bedf86e514337cff63d96cc42f8859 (patch)
treeaf5dfb380ffdb75dda84828f63cf9d840d992f0f /examples/unix/ffi_example.py
parent3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff)
downloadmicropython-69661f3343bedf86e514337cff63d96cc42f8859.tar.gz
micropython-69661f3343bedf86e514337cff63d96cc42f8859.zip
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'examples/unix/ffi_example.py')
-rw-r--r--examples/unix/ffi_example.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/unix/ffi_example.py b/examples/unix/ffi_example.py
index 3c3c3d2396..a8f02c766e 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)