Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
c13d0b33
Commit
c13d0b33
authored
Apr 15, 2014
by
Damien George
Browse files
stmhal: Wrap skin-named-usarts in PYBV10 #if.
parent
35443610
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/usart.c
View file @
c13d0b33
...
...
@@ -182,7 +182,9 @@ STATIC mp_obj_t usart_obj_make_new(mp_obj_t type_in, uint n_args, uint n_kw, con
o
->
usart_id
=
0
;
if
(
MP_OBJ_IS_STR
(
args
[
0
]))
{
const
char
*
port
=
mp_obj_str_get_str
(
args
[
0
]);
if
(
strcmp
(
port
,
"XA"
)
==
0
)
{
if
(
0
)
{
#if defined(PYBV10)
}
else
if
(
strcmp
(
port
,
"XA"
)
==
0
)
{
o
->
usart_id
=
PYB_USART_XA
;
}
else
if
(
strcmp
(
port
,
"XB"
)
==
0
)
{
o
->
usart_id
=
PYB_USART_XB
;
...
...
@@ -190,10 +192,11 @@ STATIC mp_obj_t usart_obj_make_new(mp_obj_t type_in, uint n_args, uint n_kw, con
o
->
usart_id
=
PYB_USART_YA
;
}
else
if
(
strcmp
(
port
,
"YB"
)
==
0
)
{
o
->
usart_id
=
PYB_USART_YB
;
#endif
}
else
{
nlr_raise
(
mp_obj_new_exception_msg_varg
(
&
mp_type_ValueError
,
"Usart port %s does not exist"
,
port
));
}
}
else
if
(
MP_OBJ_IS_INT
(
args
[
0
]))
{
}
else
{
o
->
usart_id
=
mp_obj_get_int
(
args
[
0
]);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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