Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
buildsupport
Commits
fdbf168e
Commit
fdbf168e
authored
Sep 08, 2017
by
Maxime Perrotin
Browse files
Merge branch 'upython'
parents
4081e287
87468937
Changes
1
Hide whitespace changes
Inline
Side-by-side
c/build_micropython_glue.c
View file @
fdbf168e
...
...
@@ -207,7 +207,7 @@ void micropython_add_PI_to_glue(Interface * i)
fprintf
(
mpy_bind_h
,
");
\n\n
"
);
fprintf
(
mpy_bind_c
,
")
\n
{
\n
"
);
fprintf
(
mpy_bind_c
,
" mp_current_ctx = &mp_ctx;
\n
"
);
fprintf
(
mpy_bind_c
,
" mp_obj_t args[%
u
];
\n
"
,
n_args
);
fprintf
(
mpy_bind_c
,
" mp_obj_t args[%
zd
];
\n
"
,
n_args
);
fprintf
(
mpy_bind_c
,
" mp_stack_ctrl_init();
\n
"
" mp_stack_set_limit(2048);
\n
"
...
...
@@ -221,9 +221,9 @@ void micropython_add_PI_to_glue(Interface * i)
fprintf
(
mpy_bind_c
,
" #ifdef MICROPY_TASTE_NEED_DATA_FOR_%s
\n
"
" mp_obj_asn1Scc%s_t IN_%s_data;
\n
"
" args[%
u
] = mp_obj_encode_asn1Scc%s(IN_%s, &IN_%s_data);
\n
"
" args[%
zd
] = mp_obj_encode_asn1Scc%s(IN_%s, &IN_%s_data);
\n
"
" #else
\n
"
" args[%
u
] = mp_obj_encode_asn1Scc%s(IN_%s, NULL);
\n
"
" args[%
zd
] = mp_obj_encode_asn1Scc%s(IN_%s, NULL);
\n
"
" #endif
\n
"
,
p
->
type
,
p
->
type
,
p
->
name
,
...
...
@@ -236,14 +236,14 @@ void micropython_add_PI_to_glue(Interface * i)
/* Encode the incoming OUT data to MicroPython objects */
FOREACH
(
p
,
Parameter
,
i
->
out
,
{
fprintf
(
mpy_bind_c
,
" mp_obj_tuple_wrap_t wrap%u = {{&mp_type_mutable_attrtuple}, 1, {MP_OBJ_NULL, MP_OBJ_FROM_PTR(wrap_fields)}};
\n
"
" mp_obj_tuple_wrap_t wrap%
z
u = {{&mp_type_mutable_attrtuple}, 1, {MP_OBJ_NULL, MP_OBJ_FROM_PTR(wrap_fields)}};
\n
"
" #ifdef MICROPY_TASTE_NEED_DATA_FOR_%s
\n
"
" mp_obj_asn1Scc%s_t OUT_%s_data;
\n
"
" wrap%u.items[0] = mp_obj_encode_asn1Scc%s(OUT_%s, &OUT_%s_data);
\n
"
" wrap%
z
u.items[0] = mp_obj_encode_asn1Scc%s(OUT_%s, &OUT_%s_data);
\n
"
" #else
\n
"
" wrap%u.items[0] = mp_obj_encode_asn1Scc%s(OUT_%s, NULL);
\n
"
" wrap%
z
u.items[0] = mp_obj_encode_asn1Scc%s(OUT_%s, NULL);
\n
"
" #endif
\n
"
" args[%u] = &wrap%u;
\n
"
,
" args[%
z
u] = &wrap%
z
u;
\n
"
,
n_args
,
p
->
type
,
p
->
type
,
p
->
name
,
...
...
@@ -256,7 +256,7 @@ void micropython_add_PI_to_glue(Interface * i)
/* Call the MicroPython function */
fprintf
(
mpy_bind_c
,
" mp_call_function_n_kw(mp_global_%s_PI_%s, %u, 0, args);
\n
"
,
" mp_call_function_n_kw(mp_global_%s_PI_%s, %
z
u, 0, args);
\n
"
,
i
->
parent_fv
->
name
,
i
->
name
,
n_args
);
...
...
@@ -264,7 +264,7 @@ void micropython_add_PI_to_glue(Interface * i)
n_args
=
n_in_args
;
FOREACH
(
p
,
Parameter
,
i
->
out
,
{
fprintf
(
mpy_bind_c
,
" mp_obj_decode_asn1Scc%s(wrap%u.items[0], OUT_%s);
\n
"
,
" mp_obj_decode_asn1Scc%s(wrap%
z
u.items[0], OUT_%s);
\n
"
,
p
->
type
,
n_args
,
p
->
name
);
n_args
+=
1
;
});
...
...
@@ -328,7 +328,7 @@ void micropython_add_RI_to_glue(Interface * i)
FOREACH
(
p
,
Parameter
,
i
->
in
,
{
fprintf
(
mpy_bind_c
,
" asn1Scc%s asn_IN_%s;
\n
"
" mp_obj_decode_asn1Scc%s(args[%u], &asn_IN_%s);
\n
"
,
" mp_obj_decode_asn1Scc%s(args[%
z
u], &asn_IN_%s);
\n
"
,
p
->
type
,
p
->
name
,
p
->
type
,
n_args
,
p
->
name
);
n_args
+=
1
;
...
...
@@ -361,7 +361,7 @@ void micropython_add_RI_to_glue(Interface * i)
FOREACH
(
p
,
Parameter
,
i
->
out
,
{
/* TODO verify that the argument objects are of the correct type */
fprintf
(
mpy_bind_c
,
" ((mp_obj_tuple_t*)MP_OBJ_TO_PTR(args[%u]))->items[0] = mp_obj_encode_asn1Scc%s(&asn_OUT_%s, MP_OBJ_TO_PTR(((mp_obj_tuple_t*)MP_OBJ_TO_PTR(args[%u]))->items[0]));
\n
"
,
" ((mp_obj_tuple_t*)MP_OBJ_TO_PTR(args[%
z
u]))->items[0] = mp_obj_encode_asn1Scc%s(&asn_OUT_%s, MP_OBJ_TO_PTR(((mp_obj_tuple_t*)MP_OBJ_TO_PTR(args[%
z
u]))->items[0]));
\n
"
,
n_args
,
p
->
type
,
p
->
name
,
n_args
);
n_args
+=
1
;
});
...
...
@@ -369,7 +369,7 @@ void micropython_add_RI_to_glue(Interface * i)
fprintf
(
mpy_bind_c
,
" return mp_const_none;
\n
"
"}
\n
"
"STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(%s_RI_%s_obj, %u, %u, %s_RI_%s_wrap);
\n
"
"STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(%s_RI_%s_obj, %
z
u, %
z
u, %s_RI_%s_wrap);
\n
"
"
\n
"
,
i
->
parent_fv
->
name
,
i
->
name
,
n_args
,
n_args
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment