From 25c4563f26c2270cde01b01dca0e8b801c9c8282 Mon Sep 17 00:00:00 2001 From: stijn Date: Wed, 21 Oct 2020 11:13:47 +0200 Subject: examples: Add example code for user C modules, both C and C++. Add working example code to provide a starting point for users with files that they can just copy, and include the modules in the coverage test to verify the complete user C module build functionality. The cexample module uses the code originally found in cmodules.rst, which has been updated to reflect this and partially rewritten with more complete information. --- examples/usercmodule/cppexample/examplemodule.h | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 examples/usercmodule/cppexample/examplemodule.h (limited to 'examples/usercmodule/cppexample/examplemodule.h') diff --git a/examples/usercmodule/cppexample/examplemodule.h b/examples/usercmodule/cppexample/examplemodule.h new file mode 100644 index 0000000000..d89384a630 --- /dev/null +++ b/examples/usercmodule/cppexample/examplemodule.h @@ -0,0 +1,5 @@ +// Include MicroPython API. +#include "py/runtime.h" + +// Declare the function we'll make available in Python as cppexample.cppfunc(). +extern mp_obj_t cppfunc(mp_obj_t a_obj, mp_obj_t b_obj); -- cgit v1.2.3