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
db14a664
Commit
db14a664
authored
Sep 14, 2017
by
Damien George
Browse files
MicroPython: add some helpful comments about OUT parameters and Ref.
parent
4549edd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
c/build_micropython_skeletons.c
View file @
db14a664
...
...
@@ -112,6 +112,8 @@ void micropython_skel_preamble(FV * fv)
fprintf
(
user_code_py
,
" # Write your initialization code here,
\n
"
" # but do not make any call to a required interface.
\n
"
" # You can construct ASN.1 instances using the type name as a function call.
\n
"
" # You can construct an object reference using Ref(...).
\n
"
" # It's recommended to lock the heap once initialisation is done, but
\n
"
" # note that without the heap some Python operations are not possible.
\n
"
" micropython.heap_lock()
\n
"
...
...
@@ -195,7 +197,29 @@ void add_PI_to_MicroPython_skel(Interface * i)
});
#endif
fprintf
(
user_code_py
,
"):
\n
# Write your code here!
\n
pass
\n\n
"
);
fprintf
(
user_code_py
,
"):
\n
"
" # Write your code here!
\n
"
);
/* Add helpful comment for IN parameters */
if
(
i
->
in
!=
NULL
)
{
fprintf
(
user_code_py
,
" # For IN parameters you can reference the value's members using . and [] notation
\n
"
);
}
/* Add helpful comment for OUT parameters */
if
(
i
->
out
!=
NULL
)
{
fprintf
(
user_code_py
,
" # For OUT parameters you must use the .val member to access the value, ie: "
);
comma
=
false
;
FOREACH
(
p
,
Parameter
,
i
->
out
,
{
fprintf
(
user_code_py
,
"%sOUT_%s.val"
,
comma
?
", "
:
""
,
p
->
name
);
comma
=
true
;
});
fprintf
(
user_code_py
,
"
\n
"
);
}
fprintf
(
user_code_py
,
" pass
\n\n
"
);
free
(
signature_py
);
}
...
...
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