File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,20 @@ msgid ""
35
35
"https://github.com/adafruit/circuitpython/issues\n"
36
36
msgstr ""
37
37
38
+ #: main.c
39
+ msgid ""
40
+ "\n"
41
+ "WARNING: Allocating pystack failed, defaulting back to build value. \n"
42
+ "\n"
43
+ msgstr ""
44
+
45
+ #: main.c
46
+ msgid ""
47
+ "\n"
48
+ "WARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n"
49
+ "\n"
50
+ msgstr ""
51
+
38
52
#: py/obj.c
39
53
msgid " File \" %q\" "
40
54
msgstr ""
Original file line number Diff line number Diff line change @@ -141,12 +141,15 @@ STATIC supervisor_allocation __attribute__ ((noinline)) * alloc_pystack(void) {
141
141
(void )common_hal_os_getenv_int ("CIRCUITPY_PYSTACK_SIZE" , & pystack_size );
142
142
// Check if value is valid
143
143
if ((CIRCUITPY_PYSTACK_SIZE != pystack_size ) && ((pystack_size < 384 ) || (pystack_size % sizeof (size_t ) != 0 ))) {
144
+ serial_write_compressed (translate ("\nWARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n\n" ));
144
145
pystack_size = CIRCUITPY_PYSTACK_SIZE ; // Reset
145
- // TODO: Find a way to inform the user about it.
146
- // Perhaps safemode? Or is it too much?
147
146
}
148
147
#endif
149
148
supervisor_allocation * pystack = allocate_memory (pystack_size , false, false);
149
+ if (pystack == NULL ) {
150
+ serial_write_compressed (translate ("\nWARNING: Allocating pystack failed, defaulting back to build value. \n\n" ));
151
+ pystack = allocate_memory (CIRCUITPY_PYSTACK_SIZE , false, false);
152
+ }
150
153
return pystack ;
151
154
}
152
155
#endif
You can’t perform that action at this time.
0 commit comments