Skip to content

Commit 58ebdd6

Browse files
committed
Enabled a bunch of modules
1 parent 5c462a3 commit 58ebdd6

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

ports/duo/mpconfigport.h

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77

88
#define MICROPY_STACK_CHECK (1)
99
#define MICROPY_ENABLE_PYSTACK (0)
10+
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
11+
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (256)
1012

1113
#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C)
1214
#define MICROPY_KBD_EXCEPTION (1)
1315
#define MICROPY_REPL_AUTO_INDENT (1)
16+
//#define MICROPY_ASYNC_KBD_INTR (1)
1417

1518
#define MICROPY_NLR_SETJMP (1)
1619
#define MICROPY_QSTR_BYTES_IN_HASH (1)
@@ -31,7 +34,7 @@
3134
#define MICROPY_HELPER_LEXER_UNIX (0)
3235
#define MICROPY_ENABLE_SOURCE_LINE (1)
3336
#define MICROPY_ENABLE_DOC_STRING (1)
34-
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
37+
//#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
3538
#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
3639
#define MICROPY_PY_ASYNC_AWAIT (1)
3740

@@ -41,11 +44,32 @@
4144
//#define MICROPY_MODULE_FROZEN_STR (0)
4245
//#define MICROPY_MODULE_FROZEN_MPY (0)
4346

47+
#define MICROPY_PY_OS_STATVFS (1)
4448
#define MICROPY_PY_UJSON (1)
49+
#define MICROPY_PY_UTIME (1)
50+
#define MICROPY_PY_UTIME_MP_HAL (1)
51+
#define MICROPY_PY_UERRNO (1)
52+
#define MICROPY_PY_UCTYPES (1)
53+
#define MICROPY_PY_UZLIB (1)
54+
#define MICROPY_PY_UJSON (1)
55+
#define MICROPY_PY_URE (1)
56+
#define MICROPY_PY_UHEAPQ (1)
57+
#define MICROPY_PY_UTIMEQ (1)
58+
#define MICROPY_PY_UHASHLIB (1)
59+
#define MICROPY_PY_UHASHLIB_MD5 (1)
60+
#define MICROPY_PY_USSL (0)
61+
#define MICROPY_SSL_AXTLS (0)
62+
#if MICROPY_PY_USSL
63+
#define MICROPY_PY_UHASHLIB_SHA1 (1)
64+
#define MICROPY_PY_UCRYPTOLIB (1)
65+
#endif
66+
#define MICROPY_PY_UBINASCII (1)
67+
#define MICROPY_PY_UBINASCII_CRC32 (1)
68+
#define MICROPY_PY_URANDOM (1)
4569

4670
#define MICROPY_MODULE_FROZEN (1)
4771
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
48-
#define MICROPY_PY_BUILTINS_MEMORYVIEW (0)
72+
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
4973
#define MICROPY_PY_BUILTINS_ENUMERATE (1)
5074
#define MICROPY_PY_BUILTINS_FILTER (1)
5175
#define MICROPY_PY_BUILTINS_FROZENSET (1)
@@ -54,7 +78,22 @@
5478
#define MICROPY_PY_BUILTINS_SLICE (1)
5579
#define MICROPY_PY_BUILTINS_PROPERTY (1)
5680
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
81+
#define MICROPY_PY_BUILTINS_COMPILE (1)
82+
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
83+
#define MICROPY_PY_BUILTINS_INPUT (1)
84+
#define MICROPY_PY_BUILTINS_POW3 (1)
85+
#define MICROPY_PY_BUILTINS_ROUND_INT (1)
86+
#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
87+
#define MICROPY_PY_BUILTINS_STR_CENTER (1)
88+
#define MICROPY_PY_BUILTINS_STR_PARTITION (1)
89+
#define MICROPY_PY_BUILTINS_STR_SPLITLINES (1)
90+
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
5791
#define MICROPY_PY___FILE__ (1)
92+
#define MICROPY_PY_FUNCTION_ATTRS (1)
93+
#define MICROPY_PY_DESCRIPTORS (1)
94+
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
95+
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
96+
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
5897
#define MICROPY_PY_GC (1)
5998
#define MICROPY_PY_ARRAY (1)
6099
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
@@ -70,10 +109,12 @@
70109
#define MICROPY_PY_SYS_MAXSIZE (1)
71110
#define MICROPY_PY_SYS_EXIT (1)
72111
#define MICROPY_PY_SYS_STDFILES (1)
112+
#define MICROPY_PY_OS_STATVFS (1)
73113
#define MICROPY_CPYTHON_COMPAT (0)
74114
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
75115
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
76116

117+
77118
#define MICROPY_VFS (1)
78119
#define MICROPY_FATFS_ENABLE_LFN (1)
79120
#define MICROPY_FATFS_RPATH (2)
@@ -84,7 +125,14 @@
84125
#define MICROPY_FATFS_MULTI_PARTITION (0)
85126
#define MICROPY_READER_VFS (MICROPY_VFS)
86127

87-
#define MICROPY_PY_UBINASCII (0)
128+
129+
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
130+
#define MICROPY_WARNINGS (1)
131+
#define MICROPY_ERROR_PRINTER (&mp_stderr_print)
132+
#define MICROPY_PY_STR_BYTES_CMP_WARN (1)
133+
134+
extern const struct _mp_print_t mp_stderr_print;
135+
88136

89137
// extra builtin modules to add to the list of known ones
90138
extern const struct _mp_obj_module_t pyb_module;
@@ -99,7 +147,6 @@ extern const struct _mp_obj_module_t uos_module;
99147
// extra constants
100148
#define MICROPY_PORT_CONSTANTS \
101149
{ MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \
102-
{ MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&uos_module }, \
103150

104151

105152
#define BYTES_PER_WORD (4)

ports/duo/wiring.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
148148

149149
#endif
150150

151+
STATIC void stderr_print_strn(void *env, const char *str, size_t len) {
152+
(void)env;
153+
//ssize_t dummy = write(STDERR_FILENO, str, len);
154+
//mp_uos_dupterm_tx_strn(str, len);
155+
mp_hal_stdout_tx_strn(str, len);
156+
//(void)dummy;
157+
}
158+
159+
const mp_print_t mp_stderr_print = {NULL, stderr_print_strn};
160+
151161
void NORETURN __fatal_error(const char *msg) {
152162
printf("!!! %s\n", msg);
153163
longjmp(buf, 1);

0 commit comments

Comments
 (0)