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
fca3308c
Commit
fca3308c
authored
Oct 16, 2015
by
danicampora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cc3200: Improvements to terminal duplication.
parent
e19dfe1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
cc3200/hal/cc3200_hal.c
cc3200/hal/cc3200_hal.c
+11
-7
cc3200/mods/modussl.c
cc3200/mods/modussl.c
+1
-1
No files found.
cc3200/hal/cc3200_hal.c
View file @
fca3308c
...
...
@@ -31,13 +31,16 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "py/mpstate.h"
#include MICROPY_HAL_H
#include "py/runtime.h"
#include "py/objstr.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "inc/hw_nvic.h"
#include "hw_memmap.h"
#include "py/mpstate.h"
#include "py/runtime.h"
#include MICROPY_HAL_H
#include "rom_map.h"
#include "interrupt.h"
#include "systick.h"
...
...
@@ -142,7 +145,7 @@ void mp_hal_stdout_tx_strn(const char *str, uint32_t len) {
if
(
MP_OBJ_IS_TYPE
(
MP_STATE_PORT
(
os_term_dup_obj
)
->
stream_o
,
&
pyb_uart_type
))
{
uart_tx_strn
(
MP_STATE_PORT
(
os_term_dup_obj
)
->
stream_o
,
str
,
len
);
}
else
{
MP_STATE_PORT
(
os_term_dup_obj
)
->
write
[
2
]
=
mp_obj_new_
bytes
((
const
byte
*
)
str
,
len
);
MP_STATE_PORT
(
os_term_dup_obj
)
->
write
[
2
]
=
mp_obj_new_
str_of_type
(
&
mp_type_str
,
(
const
byte
*
)
str
,
len
);
mp_call_method_n_kw
(
1
,
0
,
MP_STATE_PORT
(
os_term_dup_obj
)
->
write
);
}
}
...
...
@@ -181,10 +184,11 @@ int mp_hal_stdin_rx_chr(void) {
}
}
else
{
MP_STATE_PORT
(
os_term_dup_obj
)
->
read
[
2
]
=
mp_obj_new_int
(
1
);
mp_obj_t
rbytes
=
mp_call_method_n_kw
(
1
,
0
,
MP_STATE_PORT
(
os_term_dup_obj
)
->
read
);
if
(
rbytes
!=
mp_const_none
)
{
mp_obj_t
data
=
mp_call_method_n_kw
(
1
,
0
,
MP_STATE_PORT
(
os_term_dup_obj
)
->
read
);
// data len is > 0
if
(
mp_obj_is_true
(
data
))
{
mp_buffer_info_t
bufinfo
;
mp_get_buffer_raise
(
rbytes
,
&
bufinfo
,
MP_BUFFER_READ
);
mp_get_buffer_raise
(
data
,
&
bufinfo
,
MP_BUFFER_READ
);
return
((
int
*
)(
bufinfo
.
buf
))[
0
];
}
}
...
...
cc3200/mods/modussl.c
View file @
fca3308c
...
...
@@ -91,7 +91,7 @@ STATIC mp_obj_t mod_ssl_wrap_socket(mp_uint_t n_args, const mp_obj_t *pos_args,
goto
arg_error
;
}
// retrieve the file paths (with an 6 byte offset
because to strip
the '/flash' prefix)
// retrieve the file paths (with an 6 byte offset
in order to strip it from
the '/flash' prefix)
const
char
*
keyfile
=
(
args
[
1
].
u_obj
==
mp_const_none
)
?
NULL
:
&
(
mp_obj_str_get_str
(
args
[
1
].
u_obj
)[
6
]);
const
char
*
certfile
=
(
args
[
2
].
u_obj
==
mp_const_none
)
?
NULL
:
&
(
mp_obj_str_get_str
(
args
[
2
].
u_obj
)[
6
]);
const
char
*
cafile
=
(
args
[
5
].
u_obj
==
mp_const_none
||
args
[
4
].
u_int
!=
SSL_CERT_REQUIRED
)
?
...
...
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