Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
775ffdcc
Commit
775ffdcc
authored
Apr 26, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extmod/machine_signal: Fix fault when no args are passed to Signal().
parent
f66c4cbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
extmod/machine_signal.c
extmod/machine_signal.c
+3
-2
No files found.
extmod/machine_signal.c
View file @
775ffdcc
...
...
@@ -43,13 +43,13 @@ typedef struct _machine_signal_t {
}
machine_signal_t
;
STATIC
mp_obj_t
signal_make_new
(
const
mp_obj_type_t
*
type
,
size_t
n_args
,
size_t
n_kw
,
const
mp_obj_t
*
args
)
{
mp_obj_t
pin
=
args
[
0
]
;
mp_obj_t
pin
;
bool
invert
=
false
;
#if defined(MICROPY_PY_MACHINE_PIN_MAKE_NEW)
mp_pin_p_t
*
pin_p
=
NULL
;
if
(
mp_obj_is_obj
(
pin
))
{
if
(
n_args
>
0
&&
mp_obj_is_obj
(
args
[
0
]
))
{
mp_obj_base_t
*
pin_base
=
(
mp_obj_base_t
*
)
MP_OBJ_TO_PTR
(
args
[
0
]);
pin_p
=
(
mp_pin_p_t
*
)
pin_base
->
type
->
protocol
;
}
...
...
@@ -96,6 +96,7 @@ STATIC mp_obj_t signal_make_new(const mp_obj_type_t *type, size_t n_args, size_t
// Otherwise there should be 1 or 2 args
{
if
(
n_args
==
1
)
{
pin
=
args
[
0
];
if
(
n_kw
==
0
)
{
}
else
if
(
n_kw
==
1
&&
args
[
1
]
==
MP_OBJ_NEW_QSTR
(
MP_QSTR_invert
))
{
invert
=
mp_obj_is_true
(
args
[
2
]);
...
...
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