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
2630d3e5
Commit
2630d3e5
authored
May 15, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esp32/machine_uart: Implement UART.deinit() method.
parent
746fcea7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
ports/esp32/machine_uart.c
ports/esp32/machine_uart.c
+8
-1
No files found.
ports/esp32/machine_uart.c
View file @
2630d3e5
...
...
@@ -286,6 +286,13 @@ STATIC mp_obj_t machine_uart_init(size_t n_args, const mp_obj_t *args, mp_map_t
}
MP_DEFINE_CONST_FUN_OBJ_KW
(
machine_uart_init_obj
,
1
,
machine_uart_init
);
STATIC
mp_obj_t
machine_uart_deinit
(
mp_obj_t
self_in
)
{
machine_uart_obj_t
*
self
=
MP_OBJ_TO_PTR
(
self_in
);
uart_driver_delete
(
self
->
uart_num
);
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
machine_uart_deinit_obj
,
machine_uart_deinit
);
STATIC
mp_obj_t
machine_uart_any
(
mp_obj_t
self_in
)
{
machine_uart_obj_t
*
self
=
MP_OBJ_TO_PTR
(
self_in
);
size_t
rxbufsize
;
...
...
@@ -327,7 +334,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_uart_sendbreak_obj, machine_uart_sendbr
STATIC
const
mp_rom_map_elem_t
machine_uart_locals_dict_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR_init
),
MP_ROM_PTR
(
&
machine_uart_init_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_deinit
),
MP_ROM_PTR
(
&
machine_uart_deinit_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_any
),
MP_ROM_PTR
(
&
machine_uart_any_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_read
),
MP_ROM_PTR
(
&
mp_stream_read_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_readline
),
MP_ROM_PTR
(
&
mp_stream_unbuffered_readline_obj
)
},
...
...
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