Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ COPT += -O3 -DNDEBUG
endif

JSFLAGS += -s ASYNCIFY
# We can hit lower values due to user stack use. See stack_size.py example.
JSFLAGS += -s ASYNCIFY_STACK_SIZE=262144
JSFLAGS += -s EXIT_RUNTIME
JSFLAGS += -s MODULARIZE=1
JSFLAGS += -s EXPORT_NAME=createModule
Expand Down
1 change: 1 addition & 0 deletions src/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
</option>
<option value="sound_effects_user">Sound effects (user)</option>
<option value="speech">Speech</option>
<option value="stack_size">Stack size</option>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds the example to the list in the demo

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, very nice!

<option value="volume">Volume</option>
</select>
<textarea
Expand Down
10 changes: 10 additions & 0 deletions src/examples/stack_size.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def g():
global depth
depth += 1
g()
depth = 0
try:
g()
except RuntimeError:
pass
print('maximum recursion depth g():', depth)