File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
8888 < option value ="compass "> Compass</ option >
8989 < option value ="data_logging "> Data logging</ option >
9090 < option value ="display "> Display</ option >
91+ < option value ="inline_assembler "> Inline assembler</ option >
9192 < option value ="microphone "> Microphone</ option >
9293 < option value ="music "> Music</ option >
9394 < option value ="pin_logo "> Pin logo</ option >
Original file line number Diff line number Diff line change 1+ from microbit import *
2+
3+ # Unsupported in the simulator
4+ @micropython .asm_thumb
5+ def asm_add (r0 , r1 ):
6+ add (r0 , r0 , r1 )
7+
8+ while True :
9+ if button_a .was_pressed ():
10+ print (1 + 2 )
11+ elif button_b .was_pressed ():
12+ print (asm_add (1 , 2 ))
Original file line number Diff line number Diff line change @@ -162,4 +162,7 @@ extern uint32_t rng_generate_random_word(void);
162162#define MICROPY_MACHINE_MEM_GET_READ_ADDR machine_mem_get_read_addr
163163#define MICROPY_MACHINE_MEM_GET_WRITE_ADDR machine_mem_get_write_addr
164164
165+ #define MICROPY_MAKE_POINTER_CALLABLE (p ) \
166+ ((mp_raise_NotImplementedError(MP_ERROR_TEXT("simulator limitation: asm_thumb code"))), p)
167+
165168#endif
You can’t perform that action at this time.
0 commit comments