File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ STATIC bool repl_display_debugging_info = 0;
53
53
#define EXEC_FLAG_PRINT_EOF (1)
54
54
#define EXEC_FLAG_ALLOW_DEBUGGING (2)
55
55
#define EXEC_FLAG_IS_REPL (4)
56
- #define EXEC_FLAG_SOURCE_IS_RAW_CODE (8)
57
- #define EXEC_FLAG_SOURCE_IS_VSTR (16)
58
- #define EXEC_FLAG_SOURCE_IS_FILENAME (32)
56
+ #define EXEC_FLAG_RERAISE (8)
57
+ #define EXEC_FLAG_SOURCE_IS_RAW_CODE (16)
58
+ #define EXEC_FLAG_SOURCE_IS_VSTR (32)
59
+ #define EXEC_FLAG_SOURCE_IS_FILENAME (64)
59
60
60
61
// parses, compiles and executes the code in the lexer
61
62
// frees the lexer before returning
@@ -550,6 +551,9 @@ int pyexec_friendly_repl(void) {
550
551
int pyexec_file (const char * filename ) {
551
552
return parse_compile_execute (filename , MP_PARSE_FILE_INPUT , EXEC_FLAG_SOURCE_IS_FILENAME );
552
553
}
554
+ int pyexec_str (vstr_t * str ) {
555
+ return parse_compile_execute (str , MP_PARSE_FILE_INPUT , EXEC_FLAG_RERAISE | EXEC_FLAG_SOURCE_IS_VSTR );
556
+ }
553
557
554
558
int pyexec_file_if_exists (const char * filename ) {
555
559
#if MICROPY_MODULE_FROZEN
Original file line number Diff line number Diff line change @@ -63,10 +63,18 @@ int mp_hal_stdin_rx_chr(void) {
63
63
// Send string of given length
64
64
void mp_hal_stdout_tx_strn (const char * str , mp_uint_t len ) {
65
65
mp_putsn (str , len );
66
+ #ifdef PKG_USING_OPENMV_CP
67
+ extern void serial_dbg_send_strn (const char * str , int len );
68
+ serial_dbg_send_strn (str , len );
69
+ #endif
66
70
}
67
71
68
72
void mp_hal_stdout_tx_strn_stream (const char * str , size_t len ) {
69
73
mp_putsn_stream (str , len );
74
+ #ifdef PKG_USING_OPENMV_CP
75
+ extern void serial_dbg_send_strn_cooked (const char * str , int len );
76
+ serial_dbg_send_strn_cooked (str , len );
77
+ #endif
70
78
}
71
79
72
80
mp_uint_t mp_hal_ticks_us (void ) {
You can’t perform that action at this time.
0 commit comments