File tree 3 files changed +16
-0
lines changed
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>
88
88
< option value ="compass "> Compass</ option >
89
89
< option value ="data_logging "> Data logging</ option >
90
90
< option value ="display "> Display</ option >
91
+ < option value ="inline_assembler "> Inline assembler</ option >
91
92
< option value ="microphone "> Microphone</ option >
92
93
< option value ="music "> Music</ option >
93
94
< 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);
162
162
#define MICROPY_MACHINE_MEM_GET_READ_ADDR machine_mem_get_read_addr
163
163
#define MICROPY_MACHINE_MEM_GET_WRITE_ADDR machine_mem_get_write_addr
164
164
165
+ #define MICROPY_MAKE_POINTER_CALLABLE (p ) \
166
+ ((mp_raise_NotImplementedError(MP_ERROR_TEXT("simulator limitation: asm_thumb code"))), p)
167
+
165
168
#endif
You can’t perform that action at this time.
0 commit comments