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
GitLab 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
7807da20
Commit
7807da20
authored
Feb 19, 2015
by
danicampora
Browse files
Options
Downloads
Patches
Plain Diff
cc3200: Increase UART default read buffer size to 128 bytes.
parent
868fa82e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cc3200/mods/pybuart.c
+4
-6
4 additions, 6 deletions
cc3200/mods/pybuart.c
with
4 additions
and
6 deletions
cc3200/mods/pybuart.c
+
4
−
6
View file @
7807da20
...
@@ -336,7 +336,7 @@ STATIC void pyb_uart_print(void (*print)(void *env, const char *fmt, ...), void
...
@@ -336,7 +336,7 @@ STATIC void pyb_uart_print(void (*print)(void *env, const char *fmt, ...), void
}
}
}
}
/// \method init(baudrate, bits=8, parity=None, stop=1, *, timeout=1000, timeout_char=0, read_buf_len=
64
)
/// \method init(baudrate, bits=8, parity=None, stop=1, *, timeout=1000, timeout_char=0, read_buf_len=
128
)
///
///
/// Initialise the UART bus with the given parameters:
/// Initialise the UART bus with the given parameters:
///
///
...
@@ -357,7 +357,7 @@ STATIC const mp_arg_t pyb_uart_init_args[] = {
...
@@ -357,7 +357,7 @@ STATIC const mp_arg_t pyb_uart_init_args[] = {
{
MP_QSTR_flow
,
MP_ARG_KW_ONLY
|
MP_ARG_OBJ
,
{.
u_int
=
UART_FLOWCONTROL_NONE
}
},
{
MP_QSTR_flow
,
MP_ARG_KW_ONLY
|
MP_ARG_OBJ
,
{.
u_int
=
UART_FLOWCONTROL_NONE
}
},
{
MP_QSTR_timeout
,
MP_ARG_KW_ONLY
|
MP_ARG_INT
,
{.
u_int
=
1000
}
},
{
MP_QSTR_timeout
,
MP_ARG_KW_ONLY
|
MP_ARG_INT
,
{.
u_int
=
1000
}
},
{
MP_QSTR_timeout_char
,
MP_ARG_KW_ONLY
|
MP_ARG_INT
,
{.
u_int
=
1
}
},
{
MP_QSTR_timeout_char
,
MP_ARG_KW_ONLY
|
MP_ARG_INT
,
{.
u_int
=
1
}
},
{
MP_QSTR_read_buf_len
,
MP_ARG_KW_ONLY
|
MP_ARG_INT
,
{.
u_int
=
64
}
},
{
MP_QSTR_read_buf_len
,
MP_ARG_KW_ONLY
|
MP_ARG_INT
,
{.
u_int
=
128
}
},
};
};
STATIC
mp_obj_t
pyb_uart_init_helper
(
pyb_uart_obj_t
*
self
,
mp_uint_t
n_args
,
const
mp_obj_t
*
pos_args
,
mp_map_t
*
kw_args
)
{
STATIC
mp_obj_t
pyb_uart_init_helper
(
pyb_uart_obj_t
*
self
,
mp_uint_t
n_args
,
const
mp_obj_t
*
pos_args
,
mp_map_t
*
kw_args
)
{
...
@@ -458,7 +458,7 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
...
@@ -458,7 +458,7 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
// create object
// create object
pyb_uart_obj_t
*
self
;
pyb_uart_obj_t
*
self
;
if
(
MP_STATE_PORT
(
pyb_uart_obj_all
)[
uart_id
-
1
]
==
NULL
)
{
if
(
MP_STATE_PORT
(
pyb_uart_obj_all
)[
uart_id
-
1
]
==
NULL
)
{
// create new UART object
// create
a
new UART object
self
=
m_new_obj
(
pyb_uart_obj_t
);
self
=
m_new_obj
(
pyb_uart_obj_t
);
self
->
base
.
type
=
&
pyb_uart_type
;
self
->
base
.
type
=
&
pyb_uart_type
;
self
->
uart_id
=
uart_id
;
self
->
uart_id
=
uart_id
;
...
@@ -466,7 +466,7 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
...
@@ -466,7 +466,7 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
self
->
enabled
=
false
;
self
->
enabled
=
false
;
MP_STATE_PORT
(
pyb_uart_obj_all
)[
uart_id
-
1
]
=
self
;
MP_STATE_PORT
(
pyb_uart_obj_all
)[
uart_id
-
1
]
=
self
;
}
else
{
}
else
{
// reference existing UART object
// reference
an
existing UART object
self
=
MP_STATE_PORT
(
pyb_uart_obj_all
)[
uart_id
-
1
];
self
=
MP_STATE_PORT
(
pyb_uart_obj_all
)[
uart_id
-
1
];
}
}
...
@@ -475,8 +475,6 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
...
@@ -475,8 +475,6 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
mp_map_t
kw_args
;
mp_map_t
kw_args
;
mp_map_init_fixed_table
(
&
kw_args
,
n_kw
,
args
+
n_args
);
mp_map_init_fixed_table
(
&
kw_args
,
n_kw
,
args
+
n_args
);
pyb_uart_init_helper
(
self
,
n_args
-
1
,
args
+
1
,
&
kw_args
);
pyb_uart_init_helper
(
self
,
n_args
-
1
,
args
+
1
,
&
kw_args
);
}
else
if
(
!
self
->
enabled
)
{
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_TypeError
,
mpexception_num_type_invalid_arguments
));
}
}
return
self
;
return
self
;
...
...
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