mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add native code emitters example.
This commit is contained in:
parent
74876892f6
commit
6693172856
19
scripts/examples/02-Board-Control/native_emitters.py
Normal file
19
scripts/examples/02-Board-Control/native_emitters.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import time
|
||||||
|
|
||||||
|
@micropython.asm_thumb
|
||||||
|
def asm():
|
||||||
|
movw(r0, 42)
|
||||||
|
|
||||||
|
@micropython.viper
|
||||||
|
def viper(a, b):
|
||||||
|
return a + b
|
||||||
|
|
||||||
|
@micropython.native
|
||||||
|
def native(a, b):
|
||||||
|
return a + b
|
||||||
|
|
||||||
|
|
||||||
|
print(asm())
|
||||||
|
print(viper(1, 2))
|
||||||
|
print(native(1, 2))
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user