Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
2630d3e5
Commit
2630d3e5
authored
5 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
esp32/machine_uart: Implement UART.deinit() method.
parent
746fcea7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ports/esp32/machine_uart.c
+8
-1
8 additions, 1 deletion
ports/esp32/machine_uart.c
with
8 additions
and
1 deletion
ports/esp32/machine_uart.c
+
8
−
1
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
)
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment