Skip to content

Commit

Permalink
docs/develop: Fix typos in C-module example for example_add_ints.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoihu authored and dpgeorge committed Mar 13, 2019
1 parent ea95bdc commit 912e957
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/develop/cmodules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Directory::
#define MODULE_EXAMPLE_ENABLED (1)
// This is the function which will be called from Python as example.add_ints(a, b).
STATIC mp_obj_t example_add_ints(mp_obj_t a_obj, mp_obj_tab_obj) {
STATIC mp_obj_t example_add_ints(mp_obj_t a_obj, mp_obj_t b_obj) {
// Extract the ints from the micropython input objects
int a = mp_obj_get_int(a_obj);
int b = mp_obj_get_int(b_obj);
Expand All @@ -83,7 +83,7 @@ Directory::
return mp_obj_new_int(a + b);
}
// Define a Python reference to the function above
STATIC MP_DEFINE_CONST_FUN_OBJ_1(example_add_ints_obj, example_add_ints);
STATIC MP_DEFINE_CONST_FUN_OBJ_2(example_add_ints_obj, example_add_ints);
// Define all properties of the example module.
// Table entries are key/value pairs of the attribute name (a string)
Expand Down

0 comments on commit 912e957

Please sign in to comment.