├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── brun.sh ├── brun_auto.sh ├── cmake ├── CMakeLists.txt ├── README.md ├── common.cmake ├── compile-flags.cmake ├── dump-config.cmake ├── executable.cmake ├── fix-9985.cmake ├── macros.cmake ├── macros.internal.cmake └── toolchain.cmake ├── contributors ├── Canaan.png ├── DeepVISION.jpg └── Sipeed.png ├── gdb.sh ├── lds └── kendryte.ld ├── lib ├── CMakeLists.txt ├── bsp │ ├── crt.S │ ├── entry.c │ ├── entry_user.c │ ├── include │ │ ├── atomic.h │ │ ├── bsp.h │ │ ├── dump.h │ │ ├── encoding.h │ │ ├── entry.h │ │ ├── interrupt.h │ │ ├── platform.h │ │ ├── printf.h │ │ ├── sleep.h │ │ ├── syscalls.h │ │ └── util.h │ ├── interrupt.c │ ├── printf.c │ ├── sleep.c │ └── syscalls.c ├── drivers │ ├── aes.c │ ├── clint.c │ ├── dmac.c │ ├── dvp.c │ ├── fft.c │ ├── fpioa.c │ ├── gpio.c │ ├── gpiohs.c │ ├── i2c.c │ ├── i2s.c │ ├── include │ │ ├── aes.h │ │ ├── clint.h │ │ ├── dmac.h │ │ ├── dvp.h │ │ ├── fft.h │ │ ├── fpioa.h │ │ ├── gpio.h │ │ ├── gpio_common.h │ │ ├── gpiohs.h │ │ ├── i2c.h │ │ ├── i2s.h │ │ ├── io.h │ │ ├── kpu.h │ │ ├── plic.h │ │ ├── pwm.h │ │ ├── rtc.h │ │ ├── sha256.h │ │ ├── spi.h │ │ ├── sysctl.h │ │ ├── timer.h │ │ ├── uart.h │ │ ├── uarths.h │ │ ├── utils.h │ │ └── wdt.h │ ├── kpu.c │ ├── plic.c │ ├── pwm.c │ ├── rtc.c │ ├── sha256.c │ ├── spi.c │ ├── sysclock.c │ ├── sysctl.c │ ├── timer.c │ ├── uart.c │ ├── uarths.c │ ├── utils.c │ └── wdt.c ├── math │ ├── fastexp.c │ └── fastexp.h └── utils │ └── include │ └── syslog.h ├── make.sh ├── openmv.bin └── src └── openmv ├── main └── main.c └── src ├── micropython ├── ACKNOWLEDGEMENTS ├── CODECONVENTIONS.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── README_CN.md ├── docs │ ├── Makefile │ ├── README.md │ ├── conf.py │ ├── differences │ │ └── index_template.txt │ ├── esp8266 │ │ ├── general.rst │ │ ├── img │ │ │ └── adafruit_products_pinoutstop.jpg │ │ ├── quickref.rst │ │ └── tutorial │ │ │ ├── adc.rst │ │ │ ├── dht.rst │ │ │ ├── filesystem.rst │ │ │ ├── index.rst │ │ │ ├── intro.rst │ │ │ ├── neopixel.rst │ │ │ ├── network_basics.rst │ │ │ ├── network_tcp.rst │ │ │ ├── nextsteps.rst │ │ │ ├── onewire.rst │ │ │ ├── pins.rst │ │ │ ├── powerctrl.rst │ │ │ ├── pwm.rst │ │ │ └── repl.rst │ ├── index.rst │ ├── library │ │ ├── _thread.rst │ │ ├── array.rst │ │ ├── btree.rst │ │ ├── builtins.rst │ │ ├── cmath.rst │ │ ├── esp.rst │ │ ├── framebuf.rst │ │ ├── gc.rst │ │ ├── index.rst │ │ ├── lcd160cr.rst │ │ ├── machine.ADC.rst │ │ ├── machine.I2C.rst │ │ ├── machine.Pin.rst │ │ ├── machine.RTC.rst │ │ ├── machine.SD.rst │ │ ├── machine.SPI.rst │ │ ├── machine.Signal.rst │ │ ├── machine.Timer.rst │ │ ├── machine.TimerWiPy.rst │ │ ├── machine.UART.rst │ │ ├── machine.WDT.rst │ │ ├── machine.rst │ │ ├── math.rst │ │ ├── micropython.rst │ │ ├── network.CC3K.rst │ │ ├── network.WIZNET5K.rst │ │ ├── network.WLAN.rst │ │ ├── network.WLANWiPy.rst │ │ ├── network.rst │ │ ├── pyb.ADC.rst │ │ ├── pyb.Accel.rst │ │ ├── pyb.CAN.rst │ │ ├── pyb.DAC.rst │ │ ├── pyb.ExtInt.rst │ │ ├── pyb.I2C.rst │ │ ├── pyb.LCD.rst │ │ ├── pyb.LED.rst │ │ ├── pyb.Pin.rst │ │ ├── pyb.RTC.rst │ │ ├── pyb.SPI.rst │ │ ├── pyb.Servo.rst │ │ ├── pyb.Switch.rst │ │ ├── pyb.Timer.rst │ │ ├── pyb.UART.rst │ │ ├── pyb.USB_HID.rst │ │ ├── pyb.USB_VCP.rst │ │ ├── pyb.rst │ │ ├── sys.rst │ │ ├── ubinascii.rst │ │ ├── ucollections.rst │ │ ├── ucryptolib.rst │ │ ├── uctypes.rst │ │ ├── uerrno.rst │ │ ├── uhashlib.rst │ │ ├── uheapq.rst │ │ ├── uio.rst │ │ ├── ujson.rst │ │ ├── uos.rst │ │ ├── ure.rst │ │ ├── uselect.rst │ │ ├── usocket.rst │ │ ├── ussl.rst │ │ ├── ustruct.rst │ │ ├── utime.rst │ │ ├── uzlib.rst │ │ └── wipy.rst │ ├── license.rst │ ├── make.bat │ ├── pyboard │ │ ├── general.rst │ │ ├── hardware │ │ │ └── index.rst │ │ ├── quickref.rst │ │ └── tutorial │ │ │ ├── accel.rst │ │ │ ├── amp_skin.rst │ │ │ ├── assembler.rst │ │ │ ├── debounce.rst │ │ │ ├── fading_led.rst │ │ │ ├── img │ │ │ ├── fading_leds_breadboard_fritzing.png │ │ │ ├── pyboard_servo.jpg │ │ │ ├── pyboard_usb_micro.jpg │ │ │ ├── skin_amp_1.jpg │ │ │ ├── skin_amp_2.jpg │ │ │ ├── skin_lcd_1.jpg │ │ │ └── skin_lcd_2.jpg │ │ │ ├── index.rst │ │ │ ├── intro.rst │ │ │ ├── lcd160cr_skin.rst │ │ │ ├── lcd_skin.rst │ │ │ ├── leds.rst │ │ │ ├── pass_through.rst │ │ │ ├── power_ctrl.rst │ │ │ ├── repl.rst │ │ │ ├── reset.rst │ │ │ ├── script.rst │ │ │ ├── servo.rst │ │ │ ├── switch.rst │ │ │ ├── timer.rst │ │ │ └── usb_mouse.rst │ ├── readthedocs │ │ └── settings │ │ │ └── local_settings.py │ ├── reference │ │ ├── asm_thumb2_arith.rst │ │ ├── asm_thumb2_compare.rst │ │ ├── asm_thumb2_directives.rst │ │ ├── asm_thumb2_float.rst │ │ ├── asm_thumb2_hints_tips.rst │ │ ├── asm_thumb2_index.rst │ │ ├── asm_thumb2_label_branch.rst │ │ ├── asm_thumb2_ldr.rst │ │ ├── asm_thumb2_logical_bit.rst │ │ ├── asm_thumb2_misc.rst │ │ ├── asm_thumb2_mov.rst │ │ ├── asm_thumb2_stack.rst │ │ ├── asm_thumb2_str.rst │ │ ├── constrained.rst │ │ ├── glossary.rst │ │ ├── index.rst │ │ ├── isr_rules.rst │ │ ├── packages.rst │ │ ├── repl.rst │ │ └── speed_python.rst │ ├── static │ │ ├── customstyle.css │ │ └── favicon.ico │ ├── templates │ │ ├── layout.html │ │ ├── replace.inc │ │ ├── topindex.html │ │ └── versions.html │ └── wipy │ │ ├── general.rst │ │ ├── quickref.rst │ │ └── tutorial │ │ ├── blynk.rst │ │ ├── index.rst │ │ ├── intro.rst │ │ ├── repl.rst │ │ ├── reset.rst │ │ ├── timer.rst │ │ └── wlan.rst ├── drivers │ ├── README.md │ ├── bus │ │ ├── qspi.h │ │ ├── softqspi.c │ │ ├── softspi.c │ │ └── spi.h │ ├── cc3000 │ │ ├── inc │ │ │ ├── cc3000_common.h │ │ │ ├── ccspi.h │ │ │ ├── data_types.h │ │ │ ├── evnt_handler.h │ │ │ ├── hci.h │ │ │ ├── host_driver_version.h │ │ │ ├── inet_ntop.h │ │ │ ├── inet_pton.h │ │ │ ├── netapp.h │ │ │ ├── nvmem.h │ │ │ ├── patch_prog.h │ │ │ ├── security.h │ │ │ ├── socket.h │ │ │ └── wlan.h │ │ └── src │ │ │ ├── cc3000_common.c │ │ │ ├── ccspi.c │ │ │ ├── evnt_handler.c │ │ │ ├── hci.c │ │ │ ├── inet_ntop.c │ │ │ ├── inet_pton.c │ │ │ ├── netapp.c │ │ │ ├── nvmem.c │ │ │ ├── patch.c │ │ │ ├── patch_prog.c │ │ │ ├── security.c │ │ │ ├── socket.c │ │ │ └── wlan.c │ ├── cc3100 │ │ ├── inc │ │ │ ├── device.h │ │ │ ├── driver.h │ │ │ ├── flowcont.h │ │ │ ├── fs.h │ │ │ ├── netapp.h │ │ │ ├── netcfg.h │ │ │ ├── nonos.h │ │ │ ├── objInclusion.h │ │ │ ├── protocol.h │ │ │ ├── simplelink.h │ │ │ ├── socket.h │ │ │ ├── spawn.h │ │ │ ├── trace.h │ │ │ ├── wlan.h │ │ │ └── wlan_rx_filters.h │ │ └── src │ │ │ ├── device.c │ │ │ ├── driver.c │ │ │ ├── flowcont.c │ │ │ ├── fs.c │ │ │ ├── netapp.c │ │ │ ├── netcfg.c │ │ │ ├── nonos.c │ │ │ ├── socket.c │ │ │ ├── spawn.c │ │ │ └── wlan.c │ ├── dht │ │ ├── dht.c │ │ ├── dht.h │ │ └── dht.py │ ├── display │ │ ├── lcd160cr.py │ │ ├── lcd160cr_test.py │ │ └── ssd1306.py │ ├── memory │ │ ├── spiflash.c │ │ └── spiflash.h │ ├── nrf24l01 │ │ ├── nrf24l01.py │ │ └── nrf24l01test.py │ ├── onewire │ │ ├── ds18x20.py │ │ └── onewire.py │ ├── sdcard │ │ ├── sdcard.py │ │ └── sdtest.py │ └── wiznet5k │ │ ├── README.md │ │ ├── ethernet │ │ ├── socket.c │ │ ├── socket.h │ │ ├── w5200 │ │ │ ├── w5200.c │ │ │ └── w5200.h │ │ ├── w5500 │ │ │ ├── w5500.c │ │ │ └── w5500.h │ │ ├── wizchip_conf.c │ │ └── wizchip_conf.h │ │ └── internet │ │ ├── dhcp │ │ ├── dhcp.c │ │ └── dhcp.h │ │ └── dns │ │ ├── dns.c │ │ └── dns.h ├── examples │ ├── SDdatalogger │ │ ├── README.md │ │ ├── boot.py │ │ ├── cardreader.py │ │ └── datalogger.py │ ├── accel_i2c.py │ ├── accellog.py │ ├── asmled.py │ ├── asmsum.py │ ├── conwaylife.py │ ├── embedding │ │ ├── Makefile │ │ ├── Makefile.upylib │ │ ├── README.md │ │ ├── hello-embed.c │ │ ├── mpconfigport.h │ │ └── mpconfigport_minimal.h │ ├── hwapi │ │ ├── README.md │ │ ├── button_led.py │ │ ├── button_reaction.py │ │ ├── hwconfig_console.py │ │ ├── hwconfig_dragonboard410c.py │ │ ├── hwconfig_esp8266_esp12.py │ │ ├── hwconfig_pyboard.py │ │ ├── hwconfig_z_96b_carbon.py │ │ ├── hwconfig_z_frdm_k64f.py │ │ ├── soft_pwm.py │ │ ├── soft_pwm2_uasyncio.py │ │ └── soft_pwm_uasyncio.py │ ├── ledangle.py │ ├── mandel.py │ ├── micropython.py │ ├── network │ │ ├── http_client.py │ │ ├── http_client_ssl.py │ │ ├── http_server.py │ │ ├── http_server_simplistic.py │ │ ├── http_server_simplistic_commented.py │ │ └── http_server_ssl.py │ ├── pins.py │ ├── pyb.py │ ├── switch.py │ └── unix │ │ ├── ffi_example.py │ │ └── machine_bios.py ├── extmod │ ├── axtls-include │ │ ├── config.h │ │ └── version.h │ ├── crypto-algorithms │ │ ├── sha256.c │ │ └── sha256.h │ ├── lwip-include │ │ ├── arch │ │ │ ├── cc.h │ │ │ └── perf.h │ │ └── lwipopts.h │ ├── machine_i2c.c │ ├── machine_i2c.h │ ├── machine_mem.c │ ├── machine_mem.h │ ├── machine_pinbase.c │ ├── machine_pinbase.h │ ├── machine_pulse.c │ ├── machine_pulse.h │ ├── machine_signal.c │ ├── machine_signal.h │ ├── machine_spi.c │ ├── machine_spi.h │ ├── misc.h │ ├── modbtree.c │ ├── modframebuf.c │ ├── modlwip.c │ ├── modonewire.c │ ├── modubinascii.c │ ├── modubinascii.h │ ├── moducryptolib.c │ ├── moductypes.c │ ├── moduhashlib.c │ ├── moduheapq.c │ ├── modujson.c │ ├── modurandom.c │ ├── modure.c │ ├── moduselect.c │ ├── modussl_axtls.c │ ├── modussl_mbedtls.c │ ├── modutimeq.c │ ├── moduzlib.c │ ├── modwebrepl.c │ ├── modwebsocket.c │ ├── modwebsocket.h │ ├── re1.5 │ │ ├── charclass.c │ │ ├── compilecode.c │ │ ├── dumpcode.c │ │ ├── re1.5.h │ │ └── recursiveloop.c │ ├── uos_dupterm.c │ ├── utime_mphal.c │ ├── utime_mphal.h │ ├── uzlib │ │ ├── adler32.c │ │ ├── crc32.c │ │ ├── tinf.h │ │ ├── tinfgzip.c │ │ ├── tinflate.c │ │ └── tinfzlib.c │ ├── vfs.c │ ├── vfs.h │ ├── vfs_fat.c │ ├── vfs_fat.h │ ├── vfs_fat_diskio.c │ ├── vfs_fat_file.c │ ├── vfs_posix.c │ ├── vfs_posix.h │ ├── vfs_posix_file.c │ ├── vfs_reader.c │ ├── virtpin.c │ └── virtpin.h ├── lib │ ├── README.md │ ├── cmsis │ │ └── inc │ │ │ ├── cmsis_armcc.h │ │ │ ├── cmsis_armcc_V6.h │ │ │ ├── cmsis_gcc.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_cmSimd.h │ │ │ ├── core_sc000.h │ │ │ └── core_sc300.h │ ├── embed │ │ └── abort_.c │ ├── libc │ │ └── string0.c │ ├── libm │ │ ├── acoshf.c │ │ ├── asinfacosf.c │ │ ├── asinhf.c │ │ ├── atan2f.c │ │ ├── atanf.c │ │ ├── atanhf.c │ │ ├── ef_rem_pio2.c │ │ ├── ef_sqrt.c │ │ ├── erf_lgamma.c │ │ ├── fdlibm.h │ │ ├── fmodf.c │ │ ├── kf_cos.c │ │ ├── kf_rem_pio2.c │ │ ├── kf_sin.c │ │ ├── kf_tan.c │ │ ├── libm.h │ │ ├── log1pf.c │ │ ├── math.c │ │ ├── nearbyintf.c │ │ ├── roundf.c │ │ ├── sf_cos.c │ │ ├── sf_erf.c │ │ ├── sf_frexp.c │ │ ├── sf_ldexp.c │ │ ├── sf_modf.c │ │ ├── sf_sin.c │ │ ├── sf_tan.c │ │ ├── thumb_vfp_sqrtf.c │ │ ├── wf_lgamma.c │ │ └── wf_tgamma.c │ ├── libm_dbl │ │ ├── README │ │ ├── __cos.c │ │ ├── __expo2.c │ │ ├── __fpclassify.c │ │ ├── __rem_pio2.c │ │ ├── __rem_pio2_large.c │ │ ├── __signbit.c │ │ ├── __sin.c │ │ ├── __tan.c │ │ ├── acos.c │ │ ├── acosh.c │ │ ├── asin.c │ │ ├── asinh.c │ │ ├── atan.c │ │ ├── atan2.c │ │ ├── atanh.c │ │ ├── ceil.c │ │ ├── copysign.c │ │ ├── cos.c │ │ ├── cosh.c │ │ ├── erf.c │ │ ├── exp.c │ │ ├── expm1.c │ │ ├── floor.c │ │ ├── fmod.c │ │ ├── frexp.c │ │ ├── ldexp.c │ │ ├── lgamma.c │ │ ├── libm.h │ │ ├── log.c │ │ ├── log10.c │ │ ├── log1p.c │ │ ├── modf.c │ │ ├── nearbyint.c │ │ ├── pow.c │ │ ├── rint.c │ │ ├── scalbn.c │ │ ├── sin.c │ │ ├── sinh.c │ │ ├── sqrt.c │ │ ├── tan.c │ │ ├── tanh.c │ │ ├── tgamma.c │ │ └── trunc.c │ ├── memzip │ │ ├── README.md │ │ ├── import.c │ │ ├── lexermemzip.c │ │ ├── make-memzip.py │ │ ├── memzip.c │ │ └── memzip.h │ ├── mp-readline │ │ ├── readline.c │ │ └── readline.h │ ├── netutils │ │ ├── netutils.c │ │ └── netutils.h │ ├── oofatfs │ │ ├── diskio.h │ │ ├── ff.c │ │ ├── ff.h │ │ ├── ffconf.h │ │ └── option │ │ │ ├── ccsbcs.c │ │ │ └── unicode.c │ ├── timeutils │ │ ├── timeutils.c │ │ └── timeutils.h │ ├── tinytest │ │ ├── README │ │ ├── tinytest.c │ │ ├── tinytest.h │ │ └── tinytest_macros.h │ ├── upytesthelper │ │ ├── upytesthelper.c │ │ └── upytesthelper.h │ └── utils │ │ ├── interrupt_char.c │ │ ├── interrupt_char.h │ │ ├── printf.c │ │ ├── pyexec.c │ │ ├── pyexec.h │ │ ├── stdout_helpers.c │ │ └── sys_stdio_mphal.c ├── logo │ ├── 1bit-logo.png │ ├── FONT-LICENSE.txt │ ├── logo.jpg │ ├── micropythonpowered-art.png │ ├── trans-logo.png │ ├── upython-with-micro.jpg │ ├── upython-with-micro.png │ ├── vector-logo-2-BW.svg │ ├── vector-logo-2.png │ ├── vector-logo-3.png │ ├── vector-logo-R2000.dxf │ ├── vector-logo-inkscape_master.svg │ ├── vector-logo.svg │ ├── vector-text-R2000.dxf │ └── vector-text.svg ├── mpy-cross │ ├── Makefile │ ├── README.md │ ├── gccollect.c │ ├── main.c │ ├── mpconfigport.h │ ├── mphalport.h │ └── qstrdefsport.h ├── ports │ ├── k210-standalone │ │ ├── Makefile │ │ ├── Makefile_back │ │ ├── board-drivers │ │ │ ├── face_detect.c │ │ │ ├── include │ │ │ │ ├── face_detect.h │ │ │ │ ├── font.h │ │ │ │ ├── lcd.h │ │ │ │ ├── led.h │ │ │ │ ├── nt35310.h │ │ │ │ ├── ov2640.h │ │ │ │ ├── ov5640.h │ │ │ │ ├── ov5640cfg.h │ │ │ │ ├── region_layer.h │ │ │ │ ├── systick.h │ │ │ │ ├── w25qxx.h │ │ │ │ └── ws2812b.h │ │ │ ├── lcd.c │ │ │ ├── led.c │ │ │ ├── nt35310.c │ │ │ ├── ov2640.c │ │ │ ├── ov5640.c │ │ │ ├── region_layer.c │ │ │ ├── systick.c │ │ │ ├── uart_core.c │ │ │ ├── w25qxx.c │ │ │ └── ws2812b.c │ │ ├── buildin-py │ │ │ ├── board_demo.py │ │ │ ├── boot.py │ │ │ ├── common.py │ │ │ ├── face_detect.py │ │ │ ├── img_watermark.py │ │ │ ├── platform.py │ │ │ └── qrcode.py │ │ ├── file_io.c │ │ ├── frozentest.mpy │ │ ├── frozentest.py │ │ ├── help.c │ │ ├── main.c │ │ ├── mpconfigport.h │ │ ├── mphalport.h │ │ ├── mpy-mod │ │ │ ├── machine │ │ │ │ ├── include │ │ │ │ │ ├── modmachine.h │ │ │ │ │ └── rzsz.h │ │ │ │ ├── machine_burner.c │ │ │ │ ├── machine_face_detect.c │ │ │ │ ├── machine_fpioa.c │ │ │ │ ├── machine_led.c │ │ │ │ ├── machine_nt35310.c │ │ │ │ ├── machine_ov2640.c │ │ │ │ ├── machine_ov5640.c │ │ │ │ ├── machine_pin.c │ │ │ │ ├── machine_pwm.c │ │ │ │ ├── machine_spiflash.c │ │ │ │ ├── machine_timer.c │ │ │ │ ├── machine_uart.c │ │ │ │ ├── machine_uarths.c │ │ │ │ ├── machine_ws2812.c │ │ │ │ ├── machine_zmodem.c │ │ │ │ └── modmachine.c │ │ │ └── uos │ │ │ │ └── moduos.c │ │ ├── qstrdefsport.h │ │ ├── sdk.patch │ │ ├── spiffs-port │ │ │ ├── include │ │ │ │ ├── params_test.h │ │ │ │ ├── spiffs-port.h │ │ │ │ ├── spiffs_config.h │ │ │ │ └── spiffs_configport.h │ │ │ └── spiffs-port.c │ │ ├── spiffs │ │ │ ├── .git.bak │ │ │ │ ├── HEAD │ │ │ │ ├── config │ │ │ │ ├── description │ │ │ │ ├── hooks │ │ │ │ │ ├── applypatch-msg.sample │ │ │ │ │ ├── commit-msg.sample │ │ │ │ │ ├── fsmonitor-watchman.sample │ │ │ │ │ ├── post-update.sample │ │ │ │ │ ├── pre-applypatch.sample │ │ │ │ │ ├── pre-commit.sample │ │ │ │ │ ├── pre-push.sample │ │ │ │ │ ├── pre-rebase.sample │ │ │ │ │ ├── pre-receive.sample │ │ │ │ │ ├── prepare-commit-msg.sample │ │ │ │ │ └── update.sample │ │ │ │ ├── index │ │ │ │ ├── info │ │ │ │ │ └── exclude │ │ │ │ ├── logs │ │ │ │ │ ├── HEAD │ │ │ │ │ └── refs │ │ │ │ │ │ ├── heads │ │ │ │ │ │ └── master │ │ │ │ │ │ └── remotes │ │ │ │ │ │ └── origin │ │ │ │ │ │ └── HEAD │ │ │ │ ├── objects │ │ │ │ │ └── pack │ │ │ │ │ │ ├── pack-ebcbfa4b0419424c9d48198a6baeaaae9b71f034.idx │ │ │ │ │ │ └── pack-ebcbfa4b0419424c9d48198a6baeaaae9b71f034.pack │ │ │ │ ├── packed-refs │ │ │ │ └── refs │ │ │ │ │ ├── heads │ │ │ │ │ └── master │ │ │ │ │ └── remotes │ │ │ │ │ └── origin │ │ │ │ │ └── HEAD │ │ │ ├── .travis.yml │ │ │ ├── FUZZING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── afltests │ │ │ │ ├── 100 │ │ │ │ ├── 200 │ │ │ │ ├── a │ │ │ │ └── b │ │ │ ├── docs │ │ │ │ ├── TECH_SPEC │ │ │ │ └── TODO │ │ │ ├── files.mk │ │ │ ├── makefile │ │ │ ├── py │ │ │ │ ├── Makefile │ │ │ │ ├── params_test.h │ │ │ │ ├── python_ops.c │ │ │ │ ├── sp_test.py │ │ │ │ └── spiffs.py │ │ │ └── src │ │ │ │ ├── default │ │ │ │ └── spiffs_config.h │ │ │ │ ├── spiffs.h │ │ │ │ ├── spiffs_cache.c │ │ │ │ ├── spiffs_check.c │ │ │ │ ├── spiffs_gc.c │ │ │ │ ├── spiffs_hydrogen.c │ │ │ │ ├── spiffs_nucleus.c │ │ │ │ ├── spiffs_nucleus.h │ │ │ │ └── test │ │ │ │ ├── main.c │ │ │ │ ├── params_test.h │ │ │ │ ├── test_bugreports.c │ │ │ │ ├── test_check.c │ │ │ │ ├── test_dev.c │ │ │ │ ├── test_hydrogen.c │ │ │ │ ├── test_spiffs.c │ │ │ │ ├── test_spiffs.h │ │ │ │ ├── testrunner.c │ │ │ │ ├── testrunner.h │ │ │ │ └── testsuites.c │ │ └── todo.md │ └── windows │ │ ├── .appveyor.yml │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── fmode.c │ │ ├── fmode.h │ │ ├── init.c │ │ ├── init.h │ │ ├── micropython.vcxproj │ │ ├── mpconfigport.h │ │ ├── mpconfigport.mk │ │ ├── msvc │ │ ├── common.props │ │ ├── debug.props │ │ ├── dirent.c │ │ ├── dirent.h │ │ ├── genhdr.targets │ │ ├── gettimeofday.c │ │ ├── paths.props │ │ ├── release.props │ │ ├── sources.props │ │ ├── sys │ │ │ └── time.h │ │ └── unistd.h │ │ ├── realpath.c │ │ ├── realpath.h │ │ ├── sleep.c │ │ ├── sleep.h │ │ ├── windows_mphal.c │ │ └── windows_mphal.h ├── py │ ├── argcheck.c │ ├── asmarm.c │ ├── asmarm.h │ ├── asmbase.c │ ├── asmbase.h │ ├── asmthumb.c │ ├── asmthumb.h │ ├── asmx64.c │ ├── asmx64.h │ ├── asmx86.c │ ├── asmx86.h │ ├── asmxtensa.c │ ├── asmxtensa.h │ ├── bc.c │ ├── bc.h │ ├── bc0.h │ ├── binary.c │ ├── binary.h │ ├── builtin.h │ ├── builtinevex.c │ ├── builtinhelp.c │ ├── builtinimport.c │ ├── compile.c │ ├── compile.h │ ├── emit.h │ ├── emitbc.c │ ├── emitcommon.c │ ├── emitglue.c │ ├── emitglue.h │ ├── emitinlinethumb.c │ ├── emitinlinextensa.c │ ├── emitnarm.c │ ├── emitnative.c │ ├── emitnthumb.c │ ├── emitnx64.c │ ├── emitnx86.c │ ├── emitnxtensa.c │ ├── formatfloat.c │ ├── formatfloat.h │ ├── frozenmod.c │ ├── frozenmod.h │ ├── gc.c │ ├── gc.h │ ├── grammar.h │ ├── lexer.c │ ├── lexer.h │ ├── makeqstrdata.py │ ├── makeqstrdata.pyc │ ├── makeqstrdefs.py │ ├── makeversionhdr.py │ ├── malloc.c │ ├── map.c │ ├── misc.h │ ├── mkenv.mk │ ├── mkrules.mk │ ├── modarray.c │ ├── modbuiltins.c │ ├── modcmath.c │ ├── modcollections.c │ ├── modgc.c │ ├── modio.c │ ├── modmath.c │ ├── modmicropython.c │ ├── modstruct.c │ ├── modsys.c │ ├── modthread.c │ ├── moduerrno.c │ ├── mpconfig.h │ ├── mperrno.h │ ├── mphal.h │ ├── mpprint.c │ ├── mpprint.h │ ├── mpstate.c │ ├── mpstate.h │ ├── mpthread.h │ ├── mpz.c │ ├── mpz.h │ ├── nativeglue.c │ ├── nlr.c │ ├── nlr.h │ ├── nlrsetjmp.c │ ├── nlrthumb.c │ ├── nlrx64.c │ ├── nlrx86.c │ ├── nlrxtensa.c │ ├── obj.c │ ├── obj.h │ ├── objarray.c │ ├── objarray.h │ ├── objattrtuple.c │ ├── objbool.c │ ├── objboundmeth.c │ ├── objcell.c │ ├── objclosure.c │ ├── objcomplex.c │ ├── objdeque.c │ ├── objdict.c │ ├── objenumerate.c │ ├── objexcept.c │ ├── objexcept.h │ ├── objfilter.c │ ├── objfloat.c │ ├── objfun.c │ ├── objfun.h │ ├── objgenerator.c │ ├── objgenerator.h │ ├── objgetitemiter.c │ ├── objint.c │ ├── objint.h │ ├── objint_longlong.c │ ├── objint_mpz.c │ ├── objlist.c │ ├── objlist.h │ ├── objmap.c │ ├── objmodule.c │ ├── objmodule.h │ ├── objnamedtuple.c │ ├── objnamedtuple.h │ ├── objnone.c │ ├── objobject.c │ ├── objpolyiter.c │ ├── objproperty.c │ ├── objrange.c │ ├── objreversed.c │ ├── objset.c │ ├── objsingleton.c │ ├── objslice.c │ ├── objstr.c │ ├── objstr.h │ ├── objstringio.c │ ├── objstringio.h │ ├── objstrunicode.c │ ├── objtuple.c │ ├── objtuple.h │ ├── objtype.c │ ├── objtype.h │ ├── objzip.c │ ├── opmethods.c │ ├── parse.c │ ├── parse.h │ ├── parsenum.c │ ├── parsenum.h │ ├── parsenumbase.c │ ├── parsenumbase.h │ ├── persistentcode.c │ ├── persistentcode.h │ ├── py.mk │ ├── pystack.c │ ├── pystack.h │ ├── qstr.c │ ├── qstr.h │ ├── qstrdefs.h │ ├── reader.c │ ├── reader.h │ ├── repl.c │ ├── repl.h │ ├── ringbuf.h │ ├── runtime.c │ ├── runtime.h │ ├── runtime0.h │ ├── runtime_utils.c │ ├── scheduler.c │ ├── scope.c │ ├── scope.h │ ├── sequence.c │ ├── showbc.c │ ├── smallint.c │ ├── smallint.h │ ├── stackctrl.c │ ├── stackctrl.h │ ├── stream.c │ ├── stream.h │ ├── unicode.c │ ├── unicode.h │ ├── vm.c │ ├── vmentrytable.h │ ├── vstr.c │ └── warning.c ├── tests │ ├── README │ ├── basics │ │ ├── 0prelim.py │ │ ├── andor.py │ │ ├── array1.py │ │ ├── array_add.py │ │ ├── array_construct.py │ │ ├── array_construct2.py │ │ ├── array_construct_endian.py │ │ ├── array_intbig.py │ │ ├── array_micropython.py │ │ ├── array_micropython.py.exp │ │ ├── assign1.py │ │ ├── async_await.py │ │ ├── async_await.py.exp │ │ ├── async_await2.py │ │ ├── async_await2.py.exp │ │ ├── async_def.py │ │ ├── async_def.py.exp │ │ ├── async_for.py │ │ ├── async_for.py.exp │ │ ├── async_for2.py │ │ ├── async_for2.py.exp │ │ ├── async_with.py │ │ ├── async_with.py.exp │ │ ├── async_with2.py │ │ ├── async_with2.py.exp │ │ ├── async_with_break.py │ │ ├── async_with_break.py.exp │ │ ├── async_with_return.py │ │ ├── async_with_return.py.exp │ │ ├── attrtuple1.py │ │ ├── bool1.py │ │ ├── boundmeth1.py │ │ ├── break.py │ │ ├── builtin_abs.py │ │ ├── builtin_abs_intbig.py │ │ ├── builtin_allany.py │ │ ├── builtin_bin.py │ │ ├── builtin_bin_intbig.py │ │ ├── builtin_callable.py │ │ ├── builtin_chr.py │ │ ├── builtin_compile.py │ │ ├── builtin_delattr.py │ │ ├── builtin_dir.py │ │ ├── builtin_divmod.py │ │ ├── builtin_divmod_intbig.py │ │ ├── builtin_ellipsis.py │ │ ├── builtin_enumerate.py │ │ ├── builtin_eval.py │ │ ├── builtin_eval_error.py │ │ ├── builtin_exec.py │ │ ├── builtin_filter.py │ │ ├── builtin_getattr.py │ │ ├── builtin_hasattr.py │ │ ├── builtin_hash.py │ │ ├── builtin_hash_gen.py │ │ ├── builtin_hash_intbig.py │ │ ├── builtin_help.py │ │ ├── builtin_help.py.exp │ │ ├── builtin_hex.py │ │ ├── builtin_hex_intbig.py │ │ ├── builtin_id.py │ │ ├── builtin_issubclass.py │ │ ├── builtin_len1.py │ │ ├── builtin_locals.py │ │ ├── builtin_map.py │ │ ├── builtin_minmax.py │ │ ├── builtin_oct.py │ │ ├── builtin_oct_intbig.py │ │ ├── builtin_ord.py │ │ ├── builtin_override.py │ │ ├── builtin_pow.py │ │ ├── builtin_pow3.py │ │ ├── builtin_pow3_intbig.py │ │ ├── builtin_print.py │ │ ├── builtin_property.py │ │ ├── builtin_property_inherit.py │ │ ├── builtin_range.py │ │ ├── builtin_range_attrs.py │ │ ├── builtin_range_binop.py │ │ ├── builtin_reversed.py │ │ ├── builtin_round.py │ │ ├── builtin_round_int.py │ │ ├── builtin_round_intbig.py │ │ ├── builtin_setattr.py │ │ ├── builtin_slice.py │ │ ├── builtin_sorted.py │ │ ├── builtin_sum.py │ │ ├── builtin_type.py │ │ ├── builtin_zip.py │ │ ├── bytearray1.py │ │ ├── bytearray_add.py │ │ ├── bytearray_append.py │ │ ├── bytearray_construct.py │ │ ├── bytearray_construct_array.py │ │ ├── bytearray_construct_endian.py │ │ ├── bytearray_intbig.py │ │ ├── bytearray_slice_assign.py │ │ ├── bytes.py │ │ ├── bytes_add.py │ │ ├── bytes_add_array.py │ │ ├── bytes_add_endian.py │ │ ├── bytes_compare.py │ │ ├── bytes_compare2.py │ │ ├── bytes_compare3.py │ │ ├── bytes_compare3.py.exp │ │ ├── bytes_compare_array.py │ │ ├── bytes_construct.py │ │ ├── bytes_construct_array.py │ │ ├── bytes_construct_endian.py │ │ ├── bytes_construct_intbig.py │ │ ├── bytes_count.py │ │ ├── bytes_find.py │ │ ├── bytes_format_modulo.py │ │ ├── bytes_format_modulo.py.exp │ │ ├── bytes_gen.py │ │ ├── bytes_large.py │ │ ├── bytes_mult.py │ │ ├── bytes_partition.py │ │ ├── bytes_replace.py │ │ ├── bytes_split.py │ │ ├── bytes_strip.py │ │ ├── bytes_subscr.py │ │ ├── class1.py │ │ ├── class2.py │ │ ├── class3.py │ │ ├── class_bind_self.py │ │ ├── class_binop.py │ │ ├── class_call.py │ │ ├── class_contains.py │ │ ├── class_delattr_setattr.py │ │ ├── class_descriptor.py │ │ ├── class_emptybases.py │ │ ├── class_getattr.py │ │ ├── class_inherit1.py │ │ ├── class_inherit_mul.py │ │ ├── class_inplace_op.py │ │ ├── class_instance_override.py │ │ ├── class_item.py │ │ ├── class_misc.py │ │ ├── class_new.py │ │ ├── class_notimpl.py │ │ ├── class_number.py │ │ ├── class_reverse_op.py │ │ ├── class_staticclassmethod.py │ │ ├── class_store.py │ │ ├── class_store_class.py │ │ ├── class_str.py │ │ ├── class_super.py │ │ ├── class_super_aslocal.py │ │ ├── class_super_closure.py │ │ ├── class_super_multinherit.py │ │ ├── class_super_object.py │ │ ├── class_use_other.py │ │ ├── closure1.py │ │ ├── closure2.py │ │ ├── closure_defargs.py │ │ ├── closure_manyvars.py │ │ ├── closure_namedarg.py │ │ ├── compare_multi.py │ │ ├── comprehension1.py │ │ ├── containment.py │ │ ├── continue.py │ │ ├── decorator.py │ │ ├── del_attr.py │ │ ├── del_deref.py │ │ ├── del_global.py │ │ ├── del_local.py │ │ ├── del_name.py │ │ ├── del_subscr.py │ │ ├── deque1.py │ │ ├── deque2.py │ │ ├── deque2.py.exp │ │ ├── dict1.py │ │ ├── dict2.py │ │ ├── dict_clear.py │ │ ├── dict_construct.py │ │ ├── dict_copy.py │ │ ├── dict_del.py │ │ ├── dict_fixed.py │ │ ├── dict_fixed.py.exp │ │ ├── dict_from_iter.py │ │ ├── dict_fromkeys.py │ │ ├── dict_fromkeys2.py │ │ ├── dict_get.py │ │ ├── dict_intern.py │ │ ├── dict_iterator.py │ │ ├── dict_pop.py │ │ ├── dict_popitem.py │ │ ├── dict_setdefault.py │ │ ├── dict_specialmeth.py │ │ ├── dict_update.py │ │ ├── dict_views.py │ │ ├── equal.py │ │ ├── equal_class.py │ │ ├── errno1.py │ │ ├── errno1.py.exp │ │ ├── except_match_tuple.py │ │ ├── exception1.py │ │ ├── exception_chain.py │ │ ├── exception_chain.py.exp │ │ ├── exceptpoly.py │ │ ├── exceptpoly2.py │ │ ├── floordivide.py │ │ ├── floordivide_intbig.py │ │ ├── for1.py │ │ ├── for2.py │ │ ├── for3.py │ │ ├── for_break.py │ │ ├── for_else.py │ │ ├── for_range.py │ │ ├── for_return.py │ │ ├── frozenset1.py │ │ ├── frozenset_add.py │ │ ├── frozenset_binop.py │ │ ├── frozenset_copy.py │ │ ├── frozenset_difference.py │ │ ├── frozenset_set.py │ │ ├── fun1.py │ │ ├── fun2.py │ │ ├── fun3.py │ │ ├── fun_annotations.py │ │ ├── fun_calldblstar.py │ │ ├── fun_calldblstar2.py │ │ ├── fun_calldblstar3.py │ │ ├── fun_callstar.py │ │ ├── fun_callstardblstar.py │ │ ├── fun_defargs.py │ │ ├── fun_defargs2.py │ │ ├── fun_error.py │ │ ├── fun_error2.py │ │ ├── fun_kwargs.py │ │ ├── fun_kwonly.py │ │ ├── fun_kwonlydef.py │ │ ├── fun_kwvarargs.py │ │ ├── fun_largestate.py │ │ ├── fun_name.py │ │ ├── fun_str.py │ │ ├── fun_varargs.py │ │ ├── gc1.py │ │ ├── gen_yield_from.py │ │ ├── gen_yield_from_close.py │ │ ├── gen_yield_from_ducktype.py │ │ ├── gen_yield_from_exc.py │ │ ├── gen_yield_from_executing.py │ │ ├── gen_yield_from_iter.py │ │ ├── gen_yield_from_send.py │ │ ├── gen_yield_from_stopped.py │ │ ├── gen_yield_from_throw.py │ │ ├── gen_yield_from_throw2.py │ │ ├── gen_yield_from_throw3.py │ │ ├── generator1.py │ │ ├── generator2.py │ │ ├── generator_args.py │ │ ├── generator_close.py │ │ ├── generator_closure.py │ │ ├── generator_exc.py │ │ ├── generator_name.py │ │ ├── generator_pend_throw.py │ │ ├── generator_pend_throw.py.exp │ │ ├── generator_pep479.py │ │ ├── generator_pep479.py.exp │ │ ├── generator_return.py │ │ ├── generator_send.py │ │ ├── generator_throw.py │ │ ├── getattr.py │ │ ├── getitem.py │ │ ├── globals_del.py │ │ ├── ifcond.py │ │ ├── ifexpr.py │ │ ├── int1.py │ │ ├── int2.py │ │ ├── int_big1.py │ │ ├── int_big_add.py │ │ ├── int_big_and.py │ │ ├── int_big_and2.py │ │ ├── int_big_and3.py │ │ ├── int_big_cmp.py │ │ ├── int_big_div.py │ │ ├── int_big_error.py │ │ ├── int_big_lshift.py │ │ ├── int_big_mod.py │ │ ├── int_big_mul.py │ │ ├── int_big_or.py │ │ ├── int_big_or2.py │ │ ├── int_big_or3.py │ │ ├── int_big_pow.py │ │ ├── int_big_rshift.py │ │ ├── int_big_unary.py │ │ ├── int_big_xor.py │ │ ├── int_big_xor2.py │ │ ├── int_big_xor3.py │ │ ├── int_big_zeroone.py │ │ ├── int_bytes.py │ │ ├── int_bytes_intbig.py │ │ ├── int_constfolding.py │ │ ├── int_constfolding_intbig.py │ │ ├── int_divmod.py │ │ ├── int_divmod_intbig.py │ │ ├── int_divzero.py │ │ ├── int_intbig.py │ │ ├── int_small.py │ │ ├── io_buffered_writer.py │ │ ├── io_buffered_writer.py.exp │ │ ├── io_bytesio_cow.py │ │ ├── io_bytesio_ext.py │ │ ├── io_bytesio_ext2.py │ │ ├── io_bytesio_ext2.py.exp │ │ ├── io_iobase.py │ │ ├── io_stringio1.py │ │ ├── io_stringio_with.py │ │ ├── io_write_ext.py │ │ ├── io_write_ext.py.exp │ │ ├── is_isnot.py │ │ ├── iter0.py │ │ ├── iter1.py │ │ ├── iter2.py │ │ ├── iter_of_iter.py │ │ ├── lambda1.py │ │ ├── lambda_defargs.py │ │ ├── lexer.py │ │ ├── list1.py │ │ ├── list_clear.py │ │ ├── list_compare.py │ │ ├── list_copy.py │ │ ├── list_count.py │ │ ├── list_extend.py │ │ ├── list_index.py │ │ ├── list_insert.py │ │ ├── list_mult.py │ │ ├── list_pop.py │ │ ├── list_remove.py │ │ ├── list_reverse.py │ │ ├── list_slice.py │ │ ├── list_slice_3arg.py │ │ ├── list_slice_assign.py │ │ ├── list_slice_assign_grow.py │ │ ├── list_sort.py │ │ ├── list_sum.py │ │ ├── logic_constfolding.py │ │ ├── memoryerror.py │ │ ├── memoryerror.py.exp │ │ ├── memoryview1.py │ │ ├── memoryview2.py │ │ ├── memoryview_gc.py │ │ ├── memoryview_intbig.py │ │ ├── module1.py │ │ ├── module2.py │ │ ├── module2.py.exp │ │ ├── namedtuple1.py │ │ ├── namedtuple_asdict.py │ │ ├── object1.py │ │ ├── object_dict.py │ │ ├── object_new.py │ │ ├── op_error.py │ │ ├── op_error_intbig.py │ │ ├── op_error_memoryview.py │ │ ├── op_precedence.py │ │ ├── ordereddict1.py │ │ ├── ordereddict_eq.py │ │ ├── ordereddict_eq.py.exp │ │ ├── parser.py │ │ ├── python34.py │ │ ├── python34.py.exp │ │ ├── python36.py │ │ ├── python36.py.exp │ │ ├── return1.py │ │ ├── scope.py │ │ ├── self_type_check.py │ │ ├── seq_unpack.py │ │ ├── set_add.py │ │ ├── set_basic.py │ │ ├── set_binop.py │ │ ├── set_clear.py │ │ ├── set_comprehension.py │ │ ├── set_containment.py │ │ ├── set_copy.py │ │ ├── set_difference.py │ │ ├── set_discard.py │ │ ├── set_intersection.py │ │ ├── set_isdisjoint.py │ │ ├── set_isfooset.py │ │ ├── set_iter.py │ │ ├── set_iter_of_iter.py │ │ ├── set_pop.py │ │ ├── set_remove.py │ │ ├── set_specialmeth.py │ │ ├── set_symmetric_difference.py │ │ ├── set_type.py │ │ ├── set_union.py │ │ ├── set_unop.py │ │ ├── set_update.py │ │ ├── slice_attrs.py │ │ ├── slice_intbig.py │ │ ├── slots_bool_len.py │ │ ├── special_methods.py │ │ ├── special_methods2.py │ │ ├── string1.py │ │ ├── string_center.py │ │ ├── string_compare.py │ │ ├── string_count.py │ │ ├── string_cr_conversion.py │ │ ├── string_crlf_conversion.py │ │ ├── string_endswith.py │ │ ├── string_endswith_upy.py │ │ ├── string_endswith_upy.py.exp │ │ ├── string_escape.py │ │ ├── string_find.py │ │ ├── string_format.py │ │ ├── string_format2.py │ │ ├── string_format_error.py │ │ ├── string_format_modulo.py │ │ ├── string_format_modulo_int.py │ │ ├── string_index.py │ │ ├── string_istest.py │ │ ├── string_join.py │ │ ├── string_large.py │ │ ├── string_mult.py │ │ ├── string_partition.py │ │ ├── string_replace.py │ │ ├── string_repr.py │ │ ├── string_rfind.py │ │ ├── string_rindex.py │ │ ├── string_rpartition.py │ │ ├── string_rsplit.py │ │ ├── string_slice.py │ │ ├── string_split.py │ │ ├── string_splitlines.py │ │ ├── string_startswith.py │ │ ├── string_startswith_upy.py │ │ ├── string_startswith_upy.py.exp │ │ ├── string_strip.py │ │ ├── string_upperlow.py │ │ ├── struct1.py │ │ ├── struct1_intbig.py │ │ ├── struct2.py │ │ ├── struct_micropython.py │ │ ├── struct_micropython.py.exp │ │ ├── subclass_classmethod.py │ │ ├── subclass_native1.py │ │ ├── subclass_native2_list.py │ │ ├── subclass_native2_tuple.py │ │ ├── subclass_native3.py │ │ ├── subclass_native4.py │ │ ├── subclass_native5.py │ │ ├── subclass_native_buffer.py │ │ ├── subclass_native_call.py │ │ ├── subclass_native_call.py.exp │ │ ├── subclass_native_cmp.py │ │ ├── subclass_native_containment.py │ │ ├── subclass_native_init.py │ │ ├── subclass_native_iter.py │ │ ├── subclass_native_specmeth.py │ │ ├── syntaxerror.py │ │ ├── sys1.py │ │ ├── sys_getsizeof.py │ │ ├── true_value.py │ │ ├── try1.py │ │ ├── try2.py │ │ ├── try3.py │ │ ├── try4.py │ │ ├── try_as_var.py │ │ ├── try_continue.py │ │ ├── try_error.py │ │ ├── try_finally1.py │ │ ├── try_finally2.py │ │ ├── try_finally_loops.py │ │ ├── try_finally_return.py │ │ ├── try_finally_return2.py │ │ ├── try_finally_return3.py │ │ ├── try_finally_return4.py │ │ ├── try_reraise.py │ │ ├── try_reraise2.py │ │ ├── try_return.py │ │ ├── tuple1.py │ │ ├── tuple_compare.py │ │ ├── tuple_count.py │ │ ├── tuple_index.py │ │ ├── tuple_mult.py │ │ ├── types1.py │ │ ├── types2.py │ │ ├── unary_op.py │ │ ├── unboundlocal.py │ │ ├── unpack1.py │ │ ├── while1.py │ │ ├── while_cond.py │ │ ├── while_nest_exc.py │ │ ├── with1.py │ │ ├── with_break.py │ │ ├── with_continue.py │ │ ├── with_raise.py │ │ └── with_return.py │ ├── bench │ │ ├── arrayop-1-list_inplace.py │ │ ├── arrayop-2-list_map.py │ │ ├── arrayop-3-bytearray_inplace.py │ │ ├── arrayop-4-bytearray_map.py │ │ ├── bench.py │ │ ├── bytealloc-1-bytes_n.py │ │ ├── bytealloc-2-repeat.py │ │ ├── bytebuf-1-inplace.py │ │ ├── bytebuf-2-join_map_bytes.py │ │ ├── bytebuf-3-bytarray_map.py │ │ ├── from_iter-1-list_bound.py │ │ ├── from_iter-2-list_unbound.py │ │ ├── from_iter-3-tuple_bound.py │ │ ├── from_iter-4-tuple_unbound.py │ │ ├── from_iter-5-bytes_bound.py │ │ ├── from_iter-6-bytes_unbound.py │ │ ├── from_iter-7-bytearray_bound.py │ │ ├── from_iter-8-bytearray_unbound.py │ │ ├── func_args-1.1-pos_1.py │ │ ├── func_args-1.2-pos_3.py │ │ ├── func_args-2-pos_default_2_of_3.py │ │ ├── func_args-3.1-kw_1.py │ │ ├── func_args-3.2-kw_3.py │ │ ├── func_builtin-1-enum_pos.py │ │ ├── func_builtin-2-enum_kw.py │ │ ├── funcall-1-inline.py │ │ ├── funcall-2-funcall.py │ │ ├── funcall-3-funcall-local.py │ │ ├── loop_count-1-range.py │ │ ├── loop_count-2-range_iter.py │ │ ├── loop_count-3-while_up.py │ │ ├── loop_count-4-while_down_gt.py │ │ ├── loop_count-5-while_down_ne.py │ │ ├── loop_count-5.1-while_down_ne_localvar.py │ │ ├── var-1-constant.py │ │ ├── var-2-global.py │ │ ├── var-3-local.py │ │ ├── var-4-arg.py │ │ ├── var-5-class-attr.py │ │ ├── var-6-instance-attr.py │ │ ├── var-6.1-instance-attr-5.py │ │ ├── var-7-instance-meth.py │ │ ├── var-8-namedtuple-1st.py │ │ └── var-8.1-namedtuple-5th.py │ ├── cmdline │ │ ├── cmd_optimise.py │ │ ├── cmd_optimise.py.exp │ │ ├── cmd_parsetree.py │ │ ├── cmd_parsetree.py.exp │ │ ├── cmd_showbc.py │ │ ├── cmd_showbc.py.exp │ │ ├── cmd_verbose.py │ │ ├── cmd_verbose.py.exp │ │ ├── repl_autocomplete.py │ │ ├── repl_autocomplete.py.exp │ │ ├── repl_basic.py │ │ ├── repl_basic.py.exp │ │ ├── repl_cont.py │ │ ├── repl_cont.py.exp │ │ ├── repl_emacs_keys.py │ │ └── repl_emacs_keys.py.exp │ ├── cpydiff │ │ ├── builtin_next_arg2.py │ │ ├── core_class_delnotimpl.py │ │ ├── core_class_mro.py │ │ ├── core_class_supermultiple.py │ │ ├── core_class_superproperty.py │ │ ├── core_function_argcount.py │ │ ├── core_function_userattr.py │ │ ├── core_generator_noexit.py │ │ ├── core_import_path.py │ │ ├── core_import_prereg.py │ │ ├── core_import_split_ns_pkgs.py │ │ ├── core_locals.py │ │ ├── core_locals_eval.py │ │ ├── modules │ │ │ ├── __init__.py │ │ │ ├── foo.py │ │ │ └── subpkg │ │ │ │ └── foo.py │ │ ├── modules2 │ │ │ └── subpkg │ │ │ │ └── bar.py │ │ ├── modules_array_containment.py │ │ ├── modules_array_deletion.py │ │ ├── modules_array_subscrstep.py │ │ ├── modules_deque.py │ │ ├── modules_json_nonserializable.py │ │ ├── modules_struct_fewargs.py │ │ ├── modules_struct_manyargs.py │ │ ├── modules_sys_stdassign.py │ │ ├── syntax_spaces.py │ │ ├── syntax_unicode_nameesc.py │ │ ├── types_bytearray_sliceassign.py │ │ ├── types_bytes_format.py │ │ ├── types_bytes_keywords.py │ │ ├── types_bytes_subscrstep.py │ │ ├── types_exception_chaining.py │ │ ├── types_exception_instancevar.py │ │ ├── types_exception_loops.py │ │ ├── types_exception_subclassinit.py │ │ ├── types_float_rounding.py │ │ ├── types_int_subclassconv.py │ │ ├── types_list_delete_subscrstep.py │ │ ├── types_list_store_noniter.py │ │ ├── types_list_store_subscrstep.py │ │ ├── types_str_endswith.py │ │ ├── types_str_formatsubscr.py │ │ ├── types_str_keywords.py │ │ ├── types_str_ljust_rjust.py │ │ ├── types_str_rsplitnone.py │ │ ├── types_str_subclassequality.py │ │ ├── types_str_subscrstep.py │ │ └── types_tuple_subscrstep.py │ ├── extmod │ │ ├── btree1.py │ │ ├── btree1.py.exp │ │ ├── framebuf1.py │ │ ├── framebuf1.py.exp │ │ ├── framebuf16.py │ │ ├── framebuf16.py.exp │ │ ├── framebuf2.py │ │ ├── framebuf2.py.exp │ │ ├── framebuf4.py │ │ ├── framebuf4.py.exp │ │ ├── framebuf8.py │ │ ├── framebuf8.py.exp │ │ ├── framebuf_subclass.py │ │ ├── framebuf_subclass.py.exp │ │ ├── machine1.py │ │ ├── machine1.py.exp │ │ ├── machine_pinbase.py │ │ ├── machine_pinbase.py.exp │ │ ├── machine_pulse.py │ │ ├── machine_pulse.py.exp │ │ ├── machine_signal.py │ │ ├── machine_signal.py.exp │ │ ├── ticks_diff.py │ │ ├── ticks_diff.py.exp │ │ ├── time_ms_us.py │ │ ├── time_ms_us.py.exp │ │ ├── ubinascii_a2b_base64.py │ │ ├── ubinascii_b2a_base64.py │ │ ├── ubinascii_crc32.py │ │ ├── ubinascii_hexlify.py │ │ ├── ubinascii_micropython.py │ │ ├── ubinascii_micropython.py.exp │ │ ├── ubinascii_unhexlify.py │ │ ├── ucryptolib_aes128_cbc.py │ │ ├── ucryptolib_aes128_cbc.py.exp │ │ ├── ucryptolib_aes128_ecb.py │ │ ├── ucryptolib_aes128_ecb.py.exp │ │ ├── ucryptolib_aes128_ecb_enc.py │ │ ├── ucryptolib_aes128_ecb_enc.py.exp │ │ ├── ucryptolib_aes128_ecb_inpl.py │ │ ├── ucryptolib_aes128_ecb_inpl.py.exp │ │ ├── ucryptolib_aes128_ecb_into.py │ │ ├── ucryptolib_aes128_ecb_into.py.exp │ │ ├── ucryptolib_aes256_cbc.py │ │ ├── ucryptolib_aes256_cbc.py.exp │ │ ├── ucryptolib_aes256_ecb.py │ │ ├── ucryptolib_aes256_ecb.py.exp │ │ ├── uctypes_32bit_intbig.py │ │ ├── uctypes_32bit_intbig.py.exp │ │ ├── uctypes_array_assign_le.py │ │ ├── uctypes_array_assign_le.py.exp │ │ ├── uctypes_array_assign_native_le.py │ │ ├── uctypes_array_assign_native_le.py.exp │ │ ├── uctypes_array_assign_native_le_intbig.py │ │ ├── uctypes_array_assign_native_le_intbig.py.exp │ │ ├── uctypes_bytearray.py │ │ ├── uctypes_bytearray.py.exp │ │ ├── uctypes_byteat.py │ │ ├── uctypes_byteat.py.exp │ │ ├── uctypes_error.py │ │ ├── uctypes_error.py.exp │ │ ├── uctypes_le.py │ │ ├── uctypes_le.py.exp │ │ ├── uctypes_le_float.py │ │ ├── uctypes_le_float.py.exp │ │ ├── uctypes_native_float.py │ │ ├── uctypes_native_float.py.exp │ │ ├── uctypes_native_le.py │ │ ├── uctypes_native_le.py.exp │ │ ├── uctypes_print.py │ │ ├── uctypes_print.py.exp │ │ ├── uctypes_ptr_le.py │ │ ├── uctypes_ptr_le.py.exp │ │ ├── uctypes_ptr_native_le.py │ │ ├── uctypes_ptr_native_le.py.exp │ │ ├── uctypes_sizeof.py │ │ ├── uctypes_sizeof.py.exp │ │ ├── uctypes_sizeof_float.py │ │ ├── uctypes_sizeof_float.py.exp │ │ ├── uctypes_sizeof_layout.py │ │ ├── uctypes_sizeof_layout.py.exp │ │ ├── uctypes_sizeof_native.py │ │ ├── uctypes_sizeof_native.py.exp │ │ ├── uctypes_sizeof_od.py │ │ ├── uctypes_sizeof_od.py.exp │ │ ├── uhashlib_md5.py │ │ ├── uhashlib_sha1.py │ │ ├── uhashlib_sha256.py │ │ ├── uheapq1.py │ │ ├── ujson_dump.py │ │ ├── ujson_dump_iobase.py │ │ ├── ujson_dumps.py │ │ ├── ujson_dumps_extra.py │ │ ├── ujson_dumps_extra.py.exp │ │ ├── ujson_dumps_float.py │ │ ├── ujson_load.py │ │ ├── ujson_loads.py │ │ ├── ujson_loads_float.py │ │ ├── urandom_basic.py │ │ ├── urandom_extra.py │ │ ├── urandom_extra_float.py │ │ ├── ure1.py │ │ ├── ure_debug.py │ │ ├── ure_debug.py.exp │ │ ├── ure_error.py │ │ ├── ure_group.py │ │ ├── ure_groups.py │ │ ├── ure_namedclass.py │ │ ├── ure_span.py │ │ ├── ure_split.py │ │ ├── ure_split_empty.py │ │ ├── ure_split_empty.py.exp │ │ ├── ure_split_notimpl.py │ │ ├── ure_split_notimpl.py.exp │ │ ├── ure_stack_overflow.py │ │ ├── ure_stack_overflow.py.exp │ │ ├── ure_sub.py │ │ ├── ure_sub_unmatched.py │ │ ├── ure_sub_unmatched.py.exp │ │ ├── uselect_poll_basic.py │ │ ├── ussl_basic.py │ │ ├── ussl_basic.py.exp │ │ ├── utimeq1.py │ │ ├── utimeq1.py.exp │ │ ├── utimeq_stable.py │ │ ├── utimeq_stable.py.exp │ │ ├── uzlib_decompio.py │ │ ├── uzlib_decompio.py.exp │ │ ├── uzlib_decompio_gz.py │ │ ├── uzlib_decompio_gz.py.exp │ │ ├── uzlib_decompress.py │ │ ├── vfs_basic.py │ │ ├── vfs_basic.py.exp │ │ ├── vfs_fat_fileio1.py │ │ ├── vfs_fat_fileio1.py.exp │ │ ├── vfs_fat_fileio2.py │ │ ├── vfs_fat_fileio2.py.exp │ │ ├── vfs_fat_more.py │ │ ├── vfs_fat_more.py.exp │ │ ├── vfs_fat_oldproto.py │ │ ├── vfs_fat_oldproto.py.exp │ │ ├── vfs_fat_ramdisk.py │ │ ├── vfs_fat_ramdisk.py.exp │ │ ├── vfs_userfs.py │ │ ├── vfs_userfs.py.exp │ │ ├── websocket_basic.py │ │ └── websocket_basic.py.exp │ ├── feature_check │ │ ├── README │ │ ├── async_check.py │ │ ├── async_check.py.exp │ │ ├── byteorder.py │ │ ├── byteorder.py.exp │ │ ├── complex.py │ │ ├── complex.py.exp │ │ ├── const.py │ │ ├── const.py.exp │ │ ├── coverage.py │ │ ├── coverage.py.exp │ │ ├── float.py │ │ ├── float.py.exp │ │ ├── int_big.py │ │ ├── int_big.py.exp │ │ ├── native_check.py │ │ ├── native_check.py.exp │ │ ├── repl_emacs_check.py │ │ ├── repl_emacs_check.py.exp │ │ ├── reverse_ops.py │ │ ├── reverse_ops.py.exp │ │ ├── set_check.py │ │ └── set_check.py.exp │ ├── float │ │ ├── array_construct.py │ │ ├── builtin_float_abs.py │ │ ├── builtin_float_hash.py │ │ ├── builtin_float_minmax.py │ │ ├── builtin_float_pow.py │ │ ├── builtin_float_round.py │ │ ├── builtin_float_round_intbig.py │ │ ├── bytearray_construct.py │ │ ├── bytes_construct.py │ │ ├── cmath_fun.py │ │ ├── cmath_fun_special.py │ │ ├── complex1.py │ │ ├── complex1_intbig.py │ │ ├── float1.py │ │ ├── float2int_doubleprec_intbig.py │ │ ├── float2int_fp30_intbig.py │ │ ├── float2int_intbig.py │ │ ├── float_array.py │ │ ├── float_compare.py │ │ ├── float_divmod.py │ │ ├── float_divmod_relaxed.py │ │ ├── float_format.py │ │ ├── float_parse.py │ │ ├── float_parse_doubleprec.py │ │ ├── float_struct.py │ │ ├── int_big_float.py │ │ ├── int_divzero.py │ │ ├── int_power.py │ │ ├── list_index.py │ │ ├── math_domain.py │ │ ├── math_domain_special.py │ │ ├── math_factorial_intbig.py │ │ ├── math_fun.py │ │ ├── math_fun_bool.py │ │ ├── math_fun_int.py │ │ ├── math_fun_intbig.py │ │ ├── math_fun_special.py │ │ ├── python36.py │ │ ├── python36.py.exp │ │ ├── string_format.py │ │ ├── string_format2.py │ │ ├── string_format_fp30.py │ │ ├── string_format_modulo.py │ │ ├── string_format_modulo2.py │ │ ├── string_format_modulo2_intbig.py │ │ ├── string_format_modulo3.py │ │ ├── string_format_modulo3.py.exp │ │ ├── true_value.py │ │ └── types.py │ ├── import │ │ ├── builtin_import.py │ │ ├── gen_context.py │ │ ├── gen_context2.py │ │ ├── import1a.py │ │ ├── import1b.py │ │ ├── import2a.py │ │ ├── import3a.py │ │ ├── import_file.py │ │ ├── import_pkg1.py │ │ ├── import_pkg2.py │ │ ├── import_pkg3.py │ │ ├── import_pkg4.py │ │ ├── import_pkg5.py │ │ ├── import_pkg6.py │ │ ├── import_pkg7.py │ │ ├── import_pkg8.py │ │ ├── module_getattr.py │ │ ├── module_getattr.py.exp │ │ ├── mpy_invalid.py │ │ ├── mpy_invalid.py.exp │ │ ├── pkg │ │ │ ├── __init__.py │ │ │ └── mod.py │ │ ├── pkg2 │ │ │ ├── __init__.py │ │ │ ├── mod1.py │ │ │ └── mod2.py │ │ ├── pkg3 │ │ │ ├── __init__.py │ │ │ ├── mod1.py │ │ │ ├── mod2.py │ │ │ └── subpkg1 │ │ │ │ ├── __init__.py │ │ │ │ └── mod1.py │ │ ├── pkg6 │ │ │ ├── __init__.py │ │ │ └── x │ │ │ │ ├── __init__.py │ │ │ │ └── y.py │ │ ├── pkg7 │ │ │ ├── __init__.py │ │ │ ├── mod1.py │ │ │ ├── mod2.py │ │ │ └── subpkg1 │ │ │ │ ├── __init__.py │ │ │ │ └── subpkg2 │ │ │ │ ├── __init__.py │ │ │ │ └── mod3.py │ │ ├── pkg8 │ │ │ └── mod.py │ │ ├── rel_import_inv.py │ │ └── try_module.py │ ├── inlineasm │ │ ├── asmargs.py │ │ ├── asmargs.py.exp │ │ ├── asmbcc.py │ │ ├── asmbcc.py.exp │ │ ├── asmbitops.py │ │ ├── asmbitops.py.exp │ │ ├── asmblbx.py │ │ ├── asmblbx.py.exp │ │ ├── asmconst.py │ │ ├── asmconst.py.exp │ │ ├── asmdiv.py │ │ ├── asmdiv.py.exp │ │ ├── asmfpaddsub.py │ │ ├── asmfpaddsub.py.exp │ │ ├── asmfpcmp.py │ │ ├── asmfpcmp.py.exp │ │ ├── asmfpldrstr.py │ │ ├── asmfpldrstr.py.exp │ │ ├── asmfpmuldiv.py │ │ ├── asmfpmuldiv.py.exp │ │ ├── asmfpsqrt.py │ │ ├── asmfpsqrt.py.exp │ │ ├── asmit.py │ │ ├── asmit.py.exp │ │ ├── asmpushpop.py │ │ ├── asmpushpop.py.exp │ │ ├── asmrettype.py │ │ ├── asmrettype.py.exp │ │ ├── asmshift.py │ │ ├── asmshift.py.exp │ │ ├── asmspecialregs.py │ │ ├── asmspecialregs.py.exp │ │ ├── asmsum.py │ │ └── asmsum.py.exp │ ├── io │ │ ├── argv.py │ │ ├── builtin_print_file.py │ │ ├── data │ │ │ ├── bigfile1 │ │ │ ├── file1 │ │ │ └── file2 │ │ ├── file1.py │ │ ├── file_iter.py │ │ ├── file_long_read.py │ │ ├── file_long_read2.py │ │ ├── file_long_read3.py │ │ ├── file_readinto.py │ │ ├── file_readinto_len.py │ │ ├── file_readinto_len.py.exp │ │ ├── file_readline.py │ │ ├── file_seek.py │ │ ├── file_stdio.py │ │ ├── file_with.py │ │ ├── open_append.py │ │ ├── open_plus.py │ │ ├── resource_stream.py │ │ └── resource_stream.py.exp │ ├── jni │ │ ├── README │ │ ├── list.py │ │ ├── list.py.exp │ │ ├── object.py │ │ ├── object.py.exp │ │ ├── system_out.py │ │ └── system_out.py.exp │ ├── micropython │ │ ├── const.py │ │ ├── const.py.exp │ │ ├── const2.py │ │ ├── const2.py.exp │ │ ├── const_error.py │ │ ├── const_error.py.exp │ │ ├── const_intbig.py │ │ ├── const_intbig.py.exp │ │ ├── decorator.py │ │ ├── decorator.py.exp │ │ ├── decorator_error.py │ │ ├── decorator_error.py.exp │ │ ├── emg_exc.py │ │ ├── emg_exc.py.exp │ │ ├── extreme_exc.py │ │ ├── extreme_exc.py.exp │ │ ├── heap_lock.py │ │ ├── heap_lock.py.exp │ │ ├── heapalloc.py │ │ ├── heapalloc.py.exp │ │ ├── heapalloc_bytesio.py │ │ ├── heapalloc_bytesio.py.exp │ │ ├── heapalloc_bytesio2.py │ │ ├── heapalloc_bytesio2.py.exp │ │ ├── heapalloc_exc_raise.py │ │ ├── heapalloc_exc_raise.py.exp │ │ ├── heapalloc_inst_call.py │ │ ├── heapalloc_inst_call.py.exp │ │ ├── heapalloc_int_from_bytes.py │ │ ├── heapalloc_int_from_bytes.py.exp │ │ ├── heapalloc_iter.py │ │ ├── heapalloc_str.py │ │ ├── heapalloc_str.py.exp │ │ ├── heapalloc_super.py │ │ ├── heapalloc_super.py.exp │ │ ├── heapalloc_traceback.py │ │ ├── heapalloc_traceback.py.exp │ │ ├── kbd_intr.py │ │ ├── kbd_intr.py.exp │ │ ├── meminfo.py │ │ ├── meminfo.py.exp │ │ ├── memstats.py │ │ ├── memstats.py.exp │ │ ├── native_closure.py │ │ ├── native_closure.py.exp │ │ ├── native_const.py │ │ ├── native_const.py.exp │ │ ├── native_const_intbig.py │ │ ├── native_const_intbig.py.exp │ │ ├── native_misc.py │ │ ├── native_misc.py.exp │ │ ├── native_try.py │ │ ├── native_try.py.exp │ │ ├── native_try_deep.py │ │ ├── native_try_deep.py.exp │ │ ├── native_with.py │ │ ├── native_with.py.exp │ │ ├── opt_level.py │ │ ├── opt_level.py.exp │ │ ├── schedule.py │ │ ├── schedule.py.exp │ │ ├── stack_use.py │ │ ├── stack_use.py.exp │ │ ├── viper_addr.py │ │ ├── viper_addr.py.exp │ │ ├── viper_args.py │ │ ├── viper_args.py.exp │ │ ├── viper_binop_arith.py │ │ ├── viper_binop_arith.py.exp │ │ ├── viper_binop_comp.py │ │ ├── viper_binop_comp.py.exp │ │ ├── viper_binop_comp_imm.py │ │ ├── viper_binop_comp_imm.py.exp │ │ ├── viper_binop_divmod.py │ │ ├── viper_binop_divmod.py.exp │ │ ├── viper_binop_multi_comp.py │ │ ├── viper_binop_multi_comp.py.exp │ │ ├── viper_cond.py │ │ ├── viper_cond.py.exp │ │ ├── viper_const.py │ │ ├── viper_const.py.exp │ │ ├── viper_const_intbig.py │ │ ├── viper_const_intbig.py.exp │ │ ├── viper_error.py │ │ ├── viper_error.py.exp │ │ ├── viper_globals.py │ │ ├── viper_globals.py.exp │ │ ├── viper_import.py │ │ ├── viper_import.py.exp │ │ ├── viper_misc.py │ │ ├── viper_misc.py.exp │ │ ├── viper_misc_intbig.py │ │ ├── viper_misc_intbig.py.exp │ │ ├── viper_ptr16_load.py │ │ ├── viper_ptr16_load.py.exp │ │ ├── viper_ptr16_store.py │ │ ├── viper_ptr16_store.py.exp │ │ ├── viper_ptr32_load.py │ │ ├── viper_ptr32_load.py.exp │ │ ├── viper_ptr32_store.py │ │ ├── viper_ptr32_store.py.exp │ │ ├── viper_ptr8_load.py │ │ ├── viper_ptr8_load.py.exp │ │ ├── viper_ptr8_store.py │ │ ├── viper_ptr8_store.py.exp │ │ ├── viper_subscr.py │ │ ├── viper_subscr.py.exp │ │ ├── viper_try.py │ │ ├── viper_try.py.exp │ │ ├── viper_with.py │ │ └── viper_with.py.exp │ ├── misc │ │ ├── features.py │ │ ├── non_compliant.py │ │ ├── non_compliant.py.exp │ │ ├── non_compliant_lexer.py │ │ ├── non_compliant_lexer.py.exp │ │ ├── print_exception.py │ │ ├── rge_sm.py │ │ └── sys_exc_info.py │ ├── net_hosted │ │ ├── README │ │ ├── accept_nonblock.py │ │ ├── accept_nonblock.py.exp │ │ ├── accept_timeout.py │ │ ├── accept_timeout.py.exp │ │ ├── connect_nonblock.py │ │ ├── connect_nonblock.py.exp │ │ ├── connect_poll.py │ │ ├── connect_poll.py.exp │ │ ├── ssl_getpeercert.py │ │ └── ssl_getpeercert.py.exp │ ├── net_inet │ │ ├── README │ │ ├── test_tls_sites.py │ │ └── test_tls_sites.py.exp │ ├── pyb │ │ ├── accel.py │ │ ├── accel.py.exp │ │ ├── adc.py │ │ ├── adc.py.exp │ │ ├── adcall.py │ │ ├── adcall.py.exp │ │ ├── can.py │ │ ├── can.py.exp │ │ ├── dac.py │ │ ├── dac.py.exp │ │ ├── extint.py │ │ ├── extint.py.exp │ │ ├── halerror.py │ │ ├── halerror.py.exp │ │ ├── i2c.py │ │ ├── i2c.py.exp │ │ ├── i2c_error.py │ │ ├── i2c_error.py.exp │ │ ├── irq.py │ │ ├── irq.py.exp │ │ ├── led.py │ │ ├── led.py.exp │ │ ├── modstm.py │ │ ├── modstm.py.exp │ │ ├── modtime.py │ │ ├── modtime.py.exp │ │ ├── pin.py │ │ ├── pin.py.exp │ │ ├── pyb1.py │ │ ├── pyb1.py.exp │ │ ├── pyb_f405.py │ │ ├── pyb_f405.py.exp │ │ ├── pyb_f411.py │ │ ├── pyb_f411.py.exp │ │ ├── rtc.py │ │ ├── rtc.py.exp │ │ ├── servo.py │ │ ├── servo.py.exp │ │ ├── spi.py │ │ ├── spi.py.exp │ │ ├── switch.py │ │ ├── switch.py.exp │ │ ├── timer.py │ │ ├── timer.py.exp │ │ ├── timer_callback.py │ │ ├── timer_callback.py.exp │ │ ├── uart.py │ │ └── uart.py.exp │ ├── pybnative │ │ ├── for.py │ │ ├── for.py.exp │ │ ├── while.py │ │ └── while.py.exp │ ├── run-bench-tests │ ├── run-tests │ ├── run-tests-exp.py │ ├── run-tests-exp.sh │ ├── stress │ │ ├── dict_copy.py │ │ ├── dict_create.py │ │ ├── dict_create_max.py │ │ ├── gc_trace.py │ │ ├── list_sort.py │ │ ├── recursion.py │ │ ├── recursive_data.py │ │ ├── recursive_data.py.exp │ │ ├── recursive_gen.py │ │ ├── recursive_iternext.py │ │ └── recursive_iternext.py.exp │ ├── thread │ │ ├── mutate_bytearray.py │ │ ├── mutate_dict.py │ │ ├── mutate_instance.py │ │ ├── mutate_list.py │ │ ├── mutate_set.py │ │ ├── stress_aes.py │ │ ├── stress_create.py │ │ ├── stress_heap.py │ │ ├── stress_recurse.py │ │ ├── thread_exc1.py │ │ ├── thread_exc2.py │ │ ├── thread_exc2.py.exp │ │ ├── thread_exit1.py │ │ ├── thread_exit2.py │ │ ├── thread_gc1.py │ │ ├── thread_ident1.py │ │ ├── thread_lock1.py │ │ ├── thread_lock2.py │ │ ├── thread_lock3.py │ │ ├── thread_lock4.py │ │ ├── thread_qstr1.py │ │ ├── thread_shared1.py │ │ ├── thread_shared2.py │ │ ├── thread_sleep1.py │ │ ├── thread_stacksize1.py │ │ ├── thread_start1.py │ │ └── thread_start2.py │ ├── unicode │ │ ├── data │ │ │ ├── utf-8_1.txt │ │ │ └── utf-8_2.txt │ │ ├── file1.py │ │ ├── file2.py │ │ ├── unicode.py │ │ ├── unicode_chr.py │ │ ├── unicode_id.py │ │ ├── unicode_index.py │ │ ├── unicode_iter.py │ │ ├── unicode_ord.py │ │ ├── unicode_pos.py │ │ ├── unicode_str_format.py │ │ ├── unicode_str_modulo.py │ │ └── unicode_subscr.py │ ├── unix │ │ ├── extra_coverage.py │ │ ├── extra_coverage.py.exp │ │ ├── ffi_callback.py │ │ ├── ffi_callback.py.exp │ │ ├── ffi_float.py │ │ ├── ffi_float.py.exp │ │ ├── ffi_float2.py │ │ └── ffi_float2.py.exp │ └── wipy │ │ ├── adc.py │ │ ├── adc.py.exp │ │ ├── i2c.py │ │ ├── i2c.py.exp │ │ ├── modwipy.py │ │ ├── modwipy.py.exp │ │ ├── os.py │ │ ├── os.py.exp │ │ ├── pin.py │ │ ├── pin.py.exp │ │ ├── pin_irq.py │ │ ├── pin_irq.py.exp │ │ ├── reset │ │ ├── reset.py │ │ └── reset.py.exp │ │ ├── rtc.py │ │ ├── rtc.py.exp │ │ ├── sd.py │ │ ├── sd.py.exp │ │ ├── skipped │ │ ├── rtc_irq.py │ │ └── rtc_irq.py.exp │ │ ├── spi.py │ │ ├── spi.py.exp │ │ ├── time.py │ │ ├── time.py.exp │ │ ├── timer.py │ │ ├── timer.py.exp │ │ ├── uart.py │ │ ├── uart.py.exp │ │ ├── uart_irq.py │ │ ├── uart_irq.py.exp │ │ ├── wdt.py │ │ ├── wdt.py.exp │ │ └── wlan │ │ ├── machine.py │ │ ├── machine.py.exp │ │ ├── server.py │ │ ├── server.py.exp │ │ ├── wlan.py │ │ └── wlan.py.exp └── tools │ ├── .gitattributes │ ├── .gitignore │ ├── bootstrap_upip.sh │ ├── build-stm-latest.sh │ ├── cc1 │ ├── check_code_size.sh │ ├── codestats.sh │ ├── dfu.py │ ├── file2h.py │ ├── gen-changelog.sh │ ├── gen-cpydiff.py │ ├── gendoc.py │ ├── insert-usb-ids.py │ ├── make-frozen.py │ ├── mpy-tool.py │ ├── mpy_bin2res.py │ ├── mpy_cross_all.py │ ├── pyboard.py │ ├── pydfu.py │ ├── tinytest-codegen.py │ ├── upip.py │ └── upip_utarfile.py └── omv ├── array.c ├── array.h ├── boards └── OPENMV3 │ ├── imlib_config.h │ └── omv_boardconfig.h ├── cambus.c ├── cambus.h ├── common.h ├── fb_alloc.c ├── fb_alloc.h ├── ff_wrapper.c ├── ff_wrapper.h ├── framebuffer.c ├── framebuffer.h ├── img ├── agast.c ├── apriltag.c ├── binary.c ├── blob.c ├── bmp.c ├── cascade.h ├── clahe.c ├── collections.c ├── collections.h ├── dmtx.c ├── draw.c ├── edge.c ├── eye.c ├── fast.c ├── fft.c ├── fft.h ├── filter.c ├── fmath.c ├── fmath.h ├── font.c ├── font.h ├── fsort.c ├── fsort.h ├── gif.c ├── haar.c ├── hog.c ├── hough.c ├── imlib.c ├── imlib.h ├── integral.c ├── integral_mw.c ├── invariant_tab.c ├── jpeg.c ├── kmeans.c ├── lab_tab.c ├── lbp.c ├── line.c ├── lsd.c ├── mathop.c ├── mjpeg.c ├── orb.c ├── phasecorrelation.c ├── point.c ├── pool.c ├── ppm.c ├── qrcode.c ├── qsort.c ├── rainbow_tab.c ├── rectangle.c ├── rgb2rgb_tab.c ├── selective_search.c ├── shadow_removal.c ├── sincos_tab.c ├── stats.c ├── template.c ├── xyz_tab.c ├── yuv_tab.c └── zbar.c ├── ini.c ├── ini.h ├── lepton.c ├── lepton.h ├── main.c ├── mk ├── mt9v034.c ├── mt9v034.h ├── mutex.c ├── mutex.h ├── nn ├── nn.c └── nn.h ├── ov2640.c ├── ov2640.h ├── ov2640_regs.h ├── ov7725.c ├── ov7725.h ├── ov7725_regs.h ├── ov9650.c ├── ov9650.h ├── ov9650_regs.h ├── py ├── mp.h ├── py_assert.h ├── py_cpufreq.c ├── py_cpufreq.h ├── py_fir.h ├── py_gif.c ├── py_helper.c ├── py_helper.h ├── py_image.c ├── py_image.h ├── py_lcd.c ├── py_lcd.h ├── py_mjpeg.c ├── py_nn.c ├── py_omv.c ├── py_sensor.c ├── py_sensor.h ├── py_time.c ├── py_time.h ├── py_tof.h └── qstrdefsomv.h ├── ringbuf.c ├── ringbuf.h ├── sdcard_sdio.c ├── sdcard_spi.c ├── sdram.c ├── sdram.h ├── sensor.c ├── sensor.h ├── soft_i2c.c ├── soft_i2c.h ├── trace.c ├── trace.h ├── umm_malloc.c ├── umm_malloc.h ├── usbdbg.c ├── usbdbg.h ├── wifidbg.h ├── xalloc.c └── xalloc.h /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | src/openmv/src/micropython/mpy-cross/mpy-cross 3 | src/openmv/src/micropython/mpy-cross/mpy-cross.map 4 | src/openmv/src/micropython/omv/ 5 | src/openmv/src/micropython/ports/k210-standalone/micropython.a 6 | -------------------------------------------------------------------------------- /cmake/README.md: -------------------------------------------------------------------------------- 1 | prepend `common.cmake` before 2 | 3 | append `executable.cmake` after 4 | -------------------------------------------------------------------------------- /cmake/fix-9985.cmake: -------------------------------------------------------------------------------- 1 | ### http://www.cmake.org/Bug/view.php?id=9985 2 | string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}") 3 | string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}") 4 | -------------------------------------------------------------------------------- /contributors/Canaan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/contributors/Canaan.png -------------------------------------------------------------------------------- /contributors/DeepVISION.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/contributors/DeepVISION.jpg -------------------------------------------------------------------------------- /contributors/Sipeed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/contributors/Sipeed.png -------------------------------------------------------------------------------- /gdb.sh: -------------------------------------------------------------------------------- 1 | /home/xel/kendryte-toolchain-8.2/bin/riscv64-unknown-elf-gdb -ex "set remotetimeout 240" -ex "target extended-remote localhost:3333" -ex "monitor reset halt" -ex "load" $1 2 | 3 | -------------------------------------------------------------------------------- /lib/bsp/include/bsp.h: -------------------------------------------------------------------------------- 1 | #ifndef _KENDRYTE_BSP_H 2 | #define _KENDRYTE_BSP_H 3 | #include "atomic.h" 4 | #include "entry.h" 5 | #include "sleep.h" 6 | #include "encoding.h" 7 | #endif -------------------------------------------------------------------------------- /make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd ./build 4 | cmake .. -DPROJ=$1 -DTOOLCHAIN=/home/xel/kendryte-toolchain-8.2/bin && make 5 | -------------------------------------------------------------------------------- /openmv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/openmv.bin -------------------------------------------------------------------------------- /src/openmv/src/micropython/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | When reporting an issue and especially submitting a pull request, please 2 | make sure that you are acquainted with Contributor Guidelines: 3 | 4 | https://github.com/micropython/micropython/wiki/ContributorGuidelines 5 | 6 | and Code Conventions: 7 | 8 | https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/differences/index_template.txt: -------------------------------------------------------------------------------- 1 | .. _cpython_diffs: 2 | 3 | MicroPython differences from CPython 4 | ==================================== 5 | 6 | The operations listed in this section produce conflicting results in MicroPython when compared to standard Python. 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/esp8266/img/adafruit_products_pinoutstop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/esp8266/img/adafruit_products_pinoutstop.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/index.rst: -------------------------------------------------------------------------------- 1 | MicroPython documentation and references 2 | ======================================== 3 | 4 | .. toctree:: 5 | 6 | library/index.rst 7 | reference/index.rst 8 | genrst/index.rst 9 | license.rst 10 | pyboard/quickref.rst 11 | esp8266/quickref.rst 12 | wipy/quickref.rst 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/pyboard/tutorial/img/pyboard_servo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/pyboard/tutorial/img/pyboard_servo.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/pyboard/tutorial/img/pyboard_usb_micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/pyboard/tutorial/img/pyboard_usb_micro.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_amp_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_amp_1.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_amp_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_amp_2.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_lcd_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_lcd_1.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_lcd_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/pyboard/tutorial/img/skin_lcd_2.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/static/customstyle.css: -------------------------------------------------------------------------------- 1 | /* custom CSS for MicroPython docs 2 | */ 3 | 4 | .admonition-difference-to-cpython { 5 | border: 1px solid black; 6 | } 7 | 8 | .admonition-difference-to-cpython .admonition-title { 9 | margin: 4px; 10 | } 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/docs/static/favicon.ico -------------------------------------------------------------------------------- /src/openmv/src/micropython/docs/templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | {% set css_files = css_files + ["_static/customstyle.css"] %} 3 | 4 | {# we change the master_doc variable so that links to the index 5 | page are to index.html instead of _index.html #} 6 | {% set master_doc = "index" %} 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/drivers/README.md: -------------------------------------------------------------------------------- 1 | This directory contains drivers for specific hardware. The drivers are 2 | intended to work across multiple ports. 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/drivers/cc3000/inc/inet_ntop.h: -------------------------------------------------------------------------------- 1 | #ifndef __INET_NTOP_H 2 | #define __INET_NTOP_H 3 | char *inet_ntop(int af, const void *addr, char *buf, size_t size); 4 | #endif /* __INET_NTOP_H */ 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/drivers/cc3000/inc/inet_pton.h: -------------------------------------------------------------------------------- 1 | #ifndef __INET_PTON_H 2 | #define __INET_PTON_H 3 | int inet_pton(int, const char *, void *); 4 | #endif /* __INET_PTON_H */ 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/drivers/cc3100/inc/netapp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/drivers/cc3100/inc/netapp.h -------------------------------------------------------------------------------- /src/openmv/src/micropython/drivers/dht/dht.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROPY_INCLUDED_DRIVERS_DHT_DHT_H 2 | #define MICROPY_INCLUDED_DRIVERS_DHT_DHT_H 3 | 4 | #include "py/obj.h" 5 | 6 | MP_DECLARE_CONST_FUN_OBJ_2(dht_readinto_obj); 7 | 8 | #endif // MICROPY_INCLUDED_DRIVERS_DHT_DHT_H 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/drivers/wiznet5k/README.md: -------------------------------------------------------------------------------- 1 | This is the driver for the WIZnet5x00 series of Ethernet controllers. 2 | 3 | Adapted for MicroPython. 4 | 5 | Original source: https://github.com/Wiznet/W5500_EVB/tree/master/ioLibrary 6 | Taken on: 30 August 2014 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/examples/SDdatalogger/cardreader.py: -------------------------------------------------------------------------------- 1 | # cardread.py 2 | # This is called when the user enters cardreader mode. It does nothing. 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/examples/embedding/Makefile: -------------------------------------------------------------------------------- 1 | MPTOP = ../.. 2 | CFLAGS = -std=c99 -I. -I$(MPTOP) -DNO_QSTR 3 | LDFLAGS = -L. 4 | 5 | hello-embed: hello-embed.o -lmicropython 6 | 7 | -lmicropython: 8 | $(MAKE) -f $(MPTOP)/examples/embedding/Makefile.upylib MPTOP=$(MPTOP) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/examples/embedding/mpconfigport.h: -------------------------------------------------------------------------------- 1 | mpconfigport_minimal.h -------------------------------------------------------------------------------- /src/openmv/src/micropython/examples/hwapi/button_led.py: -------------------------------------------------------------------------------- 1 | import utime 2 | from hwconfig import LED, BUTTON 3 | 4 | # Light LED when (and while) a BUTTON is pressed 5 | 6 | while 1: 7 | LED.value(BUTTON.value()) 8 | # Don't burn CPU 9 | utime.sleep_ms(10) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/examples/hwapi/hwconfig_esp8266_esp12.py: -------------------------------------------------------------------------------- 1 | from machine import Pin, Signal 2 | 3 | # ESP12 module as used by many boards 4 | # Blue LED on pin 2, active low (inverted) 5 | LED = Signal(2, Pin.OUT, invert=True) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/examples/hwapi/hwconfig_z_frdm_k64f.py: -------------------------------------------------------------------------------- 1 | from machine import Pin, Signal 2 | 3 | # Freescale/NXP FRDM-K64F board 4 | # Blue LED on port B, pin 21 5 | LED = Signal(("GPIO_1", 21), Pin.OUT) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/examples/micropython.py: -------------------------------------------------------------------------------- 1 | # micropython module placeholder for CPython 2 | 3 | # Dummy function decorators 4 | 5 | def nodecor(x): 6 | return x 7 | 8 | bytecode = native = viper = nodecor 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/extmod/axtls-include/version.h: -------------------------------------------------------------------------------- 1 | #define AXTLS_VERSION "(no version)" 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/extmod/lwip-include/arch/perf.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H 2 | #define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H 3 | 4 | #define PERF_START /* null definition */ 5 | #define PERF_STOP(x) /* null definition */ 6 | 7 | #endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/extmod/modwebsocket.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H 2 | #define MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H 3 | 4 | #define FRAME_OPCODE_MASK 0x0f 5 | enum { 6 | FRAME_CONT, FRAME_TXT, FRAME_BIN, 7 | FRAME_CLOSE = 0x8, FRAME_PING, FRAME_PONG 8 | }; 9 | 10 | #endif // MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/README.md: -------------------------------------------------------------------------------- 1 | This directory contains standard, low-level C libraries with emphasis on 2 | being independent and efficient. They can be used by any port. 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/embed/abort_.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | NORETURN void abort_(void); 4 | 5 | NORETURN void abort_(void) { 6 | mp_raise_msg(&mp_type_RuntimeError, "abort() called"); 7 | } 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/libm/thumb_vfp_sqrtf.c: -------------------------------------------------------------------------------- 1 | // an implementation of sqrtf for Thumb using hardware VFP instructions 2 | 3 | #include 4 | 5 | float sqrtf(float x) { 6 | asm volatile ( 7 | "vsqrt.f32 %[r], %[x]\n" 8 | : [r] "=t" (x) 9 | : [x] "t" (x)); 10 | return x; 11 | } 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/libm_dbl/__fpclassify.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __fpclassifyd(double x) 5 | { 6 | union {double f; uint64_t i;} u = {x}; 7 | int e = u.i>>52 & 0x7ff; 8 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 9 | if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE; 10 | return FP_NORMAL; 11 | } 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/libm_dbl/__signbit.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | int __signbitd(double x) 4 | { 5 | union { 6 | double d; 7 | uint64_t i; 8 | } y = { x }; 9 | return y.i>>63; 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/libm_dbl/ldexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ldexp(double x, int n) 4 | { 5 | return scalbn(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/libm_dbl/lgamma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double __lgamma_r(double, int*); 4 | 5 | double lgamma(double x) { 6 | int sign; 7 | return __lgamma_r(x, &sign); 8 | } 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/libm_dbl/log10.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static const double _M_LN10 = 2.302585092994046; 4 | 5 | double log10(double x) { 6 | return log(x) / (double)_M_LN10; 7 | } 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/lib/libm_dbl/tanh.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double tanh(double x) { 4 | int sign = 0; 5 | if (x < 0) { 6 | sign = 1; 7 | x = -x; 8 | } 9 | x = expm1(-2 * x); 10 | x = x / (x + 2); 11 | return sign ? x : -x; 12 | } 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/1bit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/1bit-logo.png -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/logo.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/micropythonpowered-art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/micropythonpowered-art.png -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/trans-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/trans-logo.png -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/upython-with-micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/upython-with-micro.jpg -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/upython-with-micro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/upython-with-micro.png -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/vector-logo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/vector-logo-2.png -------------------------------------------------------------------------------- /src/openmv/src/micropython/logo/vector-logo-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/logo/vector-logo-3.png -------------------------------------------------------------------------------- /src/openmv/src/micropython/mpy-cross/mphalport.h: -------------------------------------------------------------------------------- 1 | // prevent including extmod/virtpin.h 2 | #define mp_hal_pin_obj_t 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/mpy-cross/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/board-drivers/include/led.h: -------------------------------------------------------------------------------- 1 | #ifndef LED_H 2 | #define LED_H 3 | void led_init(); 4 | void led_OnOff(int lednum,int OnOff); 5 | #endif 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/buildin-py/board_demo.py: -------------------------------------------------------------------------------- 1 | import machine 2 | 3 | st7789=machine.st7789() 4 | st7789.init() 5 | ov2640=machine.ov2640() 6 | ov2640.init() 7 | buf=bytearray(320*240*2) 8 | demo=machine.demo_face_detect() 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/buildin-py/img_watermark.py: -------------------------------------------------------------------------------- 1 | import image 2 | import sensor 3 | 4 | while(True): 5 | img = sensor.snapshot() 6 | img = img.draw_string( 7 | 20, 20, "OpenMV Base on MaixPy @kendryte K210", scale=2) 8 | nop = img.show() 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/frozentest.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/ports/k210-standalone/frozentest.mpy -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/frozentest.py: -------------------------------------------------------------------------------- 1 | print('uPy') 2 | print('a long string that is not interned') 3 | print('a string that has unicode αβγ chars') 4 | print(b'bytes 1234\x01') 5 | print(123456789) 6 | for i in range(4): 7 | print(i) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/mphalport.h: -------------------------------------------------------------------------------- 1 | static inline mp_uint_t mp_hal_ticks_ms(void) { return 0; } 2 | static inline void mp_hal_set_interrupt_char(char c) {} 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs-port/include/spiffs-port.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSPIFFS_H 2 | #define MYSPIFFS_H 3 | 4 | #include 5 | void my_spiffs_mount(); 6 | void my_spiffs_init(); 7 | int format_fs(void); 8 | extern spiffs fs; 9 | #endif// MYSPIFFS_H 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/index -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 1350deb54c097fd06133f3c6d39dd3532a229829 xiahui <2535418266@qq.com> 1539275694 +0800 clone: from https://github.com/pellepl/spiffs.git 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 1350deb54c097fd06133f3c6d39dd3532a229829 xiahui <2535418266@qq.com> 1539275694 +0800 clone: from https://github.com/pellepl/spiffs.git 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/logs/refs/remotes/origin/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 1350deb54c097fd06133f3c6d39dd3532a229829 xiahui <2535418266@qq.com> 1539275694 +0800 clone: from https://github.com/pellepl/spiffs.git 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/objects/pack/pack-ebcbfa4b0419424c9d48198a6baeaaae9b71f034.idx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/objects/pack/pack-ebcbfa4b0419424c9d48198a6baeaaae9b71f034.idx -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/objects/pack/pack-ebcbfa4b0419424c9d48198a6baeaaae9b71f034.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/objects/pack/pack-ebcbfa4b0419424c9d48198a6baeaaae9b71f034.pack -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/refs/heads/master: -------------------------------------------------------------------------------- 1 | 1350deb54c097fd06133f3c6d39dd3532a229829 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.git.bak/refs/remotes/origin/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/remotes/origin/master 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | compiler: 4 | - gcc 5 | 6 | before_script: 7 | 8 | script: make all && make clean && make test && make build-all && make clean test FLAGS=-DSPIFFS_OBJ_META_LEN=8 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/afltests/100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/ports/k210-standalone/spiffs/afltests/100 -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/afltests/200: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/ports/k210-standalone/spiffs/afltests/200 -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/afltests/a: -------------------------------------------------------------------------------- 1 | b55 2 | O4W4R4C4D4 3 | b45 4 | d5rh 5 | O4W4R4f4C4 6 | baaU 7 | d5rh 8 | OaWaRafaCa 9 | cd5rh 10 | OaWaRafaCa 11 | O4S4W4R4C4 12 | d5rh 13 | O4W4S4R4C4 14 | d5rh 15 | O4W4R4S4C4 16 | d5rh 17 | O4W4R4C4 18 | d5rh 19 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/afltests/b: -------------------------------------------------------------------------------- 1 | b55 2 | O4 3 | W?W?W?W?W?f4 4 | WW:W;f4 5 | C4 6 | b45 7 | d5rh 8 | O4W?R4f4C4 9 | baa 10 | d5rh 11 | OaWaRafaCa 12 | d5rh 13 | OaWaRafaCa 14 | O4W?R4C4 15 | d5rh 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/py/params_test.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef int32_t s32_t; 4 | typedef uint32_t u32_t; 5 | typedef int16_t s16_t; 6 | typedef uint16_t u16_t; 7 | typedef int8_t s8_t; 8 | typedef uint8_t u8_t; 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/k210-standalone/spiffs/src/test/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef NO_TEST 4 | #include "testrunner.h" 5 | #endif 6 | 7 | int main(int argc, char **args) { 8 | #ifndef NO_TEST 9 | run_tests(argc, args); 10 | #endif 11 | exit(EXIT_SUCCESS); 12 | } 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/ports/windows/.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.*sdf 3 | *.suo 4 | *.sln 5 | *.exe 6 | *.pdb 7 | *.ilk 8 | *.filters 9 | /build/* 10 | .vs/* 11 | *.VC.*db 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/py/makeqstrdata.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/py/makeqstrdata.pyc -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/0prelim.py: -------------------------------------------------------------------------------- 1 | # all tests need print to work! make sure it does work 2 | 3 | print(1) 4 | print('abc') 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/andor.py: -------------------------------------------------------------------------------- 1 | # test short circuit expressions outside if conditionals 2 | print(() or 1) 3 | print((1,) or 1) 4 | print(() and 1) 5 | print((1,) and 1) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/array_construct2.py: -------------------------------------------------------------------------------- 1 | try: 2 | from array import array 3 | except ImportError: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | # construct from something with unknown length (requires generators) 8 | print(array('i', (i for i in range(10)))) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/array_construct_endian.py: -------------------------------------------------------------------------------- 1 | # test construction of array.array from different objects 2 | 3 | try: 4 | from array import array 5 | except ImportError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | # raw copy from bytes, bytearray 10 | print(array('h', b'12')) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/array_micropython.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/assign1.py: -------------------------------------------------------------------------------- 1 | # test assignments 2 | 3 | a = 1 4 | print(a) 5 | 6 | a = b = 2 7 | print(a, b) 8 | 9 | a = b = c = 3 10 | print(a, b, c) 11 | 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_await.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | 3 3 | 2 4 | 1 5 | 0 6 | 0 7 | 1 8 | 0 9 | 0 10 | 2 11 | 1 12 | 0 13 | 0 14 | 1 15 | 0 16 | 0 17 | 3 18 | 2 19 | 1 20 | 0 21 | 0 22 | 1 23 | 0 24 | 0 25 | 2 26 | 1 27 | 0 28 | 0 29 | 1 30 | 0 31 | 0 32 | finished 33 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_await2.py.exp: -------------------------------------------------------------------------------- 1 | wait value: 1 2 | return from send: message from wait(1) 3 | wait got back: message from main 4 | x = 100 5 | got StopIteration 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_def.py: -------------------------------------------------------------------------------- 1 | # test async def 2 | 3 | def dec(f): 4 | print('decorator') 5 | return f 6 | 7 | # test definition with a decorator 8 | @dec 9 | async def foo(): 10 | print('foo') 11 | 12 | coro = foo() 13 | try: 14 | coro.send(None) 15 | except StopIteration: 16 | print('StopIteration') 17 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_def.py.exp: -------------------------------------------------------------------------------- 1 | decorator 2 | foo 3 | StopIteration 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_for.py.exp: -------------------------------------------------------------------------------- 1 | init 2 | aiter 3 | anext 4 | a 5 | anext 6 | b 7 | anext 8 | c 9 | anext 10 | finished 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_with.py.exp: -------------------------------------------------------------------------------- 1 | enter 2 | body 3 | exit None None 4 | finished 5 | enter 6 | 1 7 | exit error 8 | ValueError 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_with2.py.exp: -------------------------------------------------------------------------------- 1 | enter 2 | f start: 10 3 | coro yielded: 11 4 | coro yielded: 12 5 | f returned: 13 6 | body start 7 | f start: 30 8 | coro yielded: 31 9 | coro yielded: 32 10 | body f returned: 33 11 | body end 12 | exit None None 13 | f start: 20 14 | coro yielded: 21 15 | coro yielded: 22 16 | f returned: 23 17 | finished 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_with_break.py.exp: -------------------------------------------------------------------------------- 1 | enter 2 | body 3 | exit None None 4 | finished 5 | enter 6 | body 7 | exit None None 8 | finally 9 | finished 10 | enter 11 | body 12 | exit None None 13 | finally inner 14 | finally outer 15 | finished 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/async_with_return.py.exp: -------------------------------------------------------------------------------- 1 | enter 2 | body 3 | exit None None 4 | finished 5 | enter 6 | body 7 | exit None None 8 | finally 9 | finished 10 | enter 11 | body 12 | exit None None 13 | finally inner 14 | finally outer 15 | finished 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bool1.py: -------------------------------------------------------------------------------- 1 | # tests for bool objects 2 | 3 | # basic logic 4 | print(not False) 5 | print(not True) 6 | print(False and True) 7 | print(False or True) 8 | 9 | # unary operators 10 | print(+True) 11 | print(-True) 12 | 13 | # unsupported unary op 14 | try: 15 | len(False) 16 | except TypeError: 17 | print('TypeError') 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/break.py: -------------------------------------------------------------------------------- 1 | while True: 2 | break 3 | 4 | for i in range(4): 5 | print('one', i) 6 | if i > 2: 7 | break 8 | print('two', i) 9 | 10 | for i in [1, 2, 3, 4]: 11 | if i == 3: 12 | break 13 | print(i) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_abs.py: -------------------------------------------------------------------------------- 1 | # test builtin abs 2 | 3 | print(abs(False)) 4 | print(abs(True)) 5 | print(abs(1)) 6 | print(abs(-1)) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_bin.py: -------------------------------------------------------------------------------- 1 | # test builtin bin function 2 | 3 | print(bin(1)) 4 | print(bin(-1)) 5 | print(bin(15)) 6 | print(bin(-15)) 7 | 8 | print(bin(12345)) 9 | print(bin(0b10101)) 10 | 11 | print(bin(0b10101010101010101010)) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_bin_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin bin function 2 | 3 | print(bin(12345678901234567890)) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_chr.py: -------------------------------------------------------------------------------- 1 | # test builtin chr (whether or not we support unicode) 2 | 3 | print(chr(65)) 4 | 5 | try: 6 | chr(0x110000) 7 | except ValueError: 8 | print("ValueError") 9 | 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_divmod.py: -------------------------------------------------------------------------------- 1 | # test builtin divmod 2 | 3 | print(divmod(0, 2)) 4 | print(divmod(3, 4)) 5 | print(divmod(20, 3)) 6 | 7 | try: 8 | divmod(1, 0) 9 | except ZeroDivisionError: 10 | print("ZeroDivisionError") 11 | 12 | try: 13 | divmod('a', 'b') 14 | except TypeError: 15 | print("TypeError") 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_divmod_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin divmod 2 | 3 | try: 4 | divmod(1 << 65, 0) 5 | except ZeroDivisionError: 6 | print("ZeroDivisionError") 7 | 8 | # bignum 9 | l = (1 << 65) + 123 10 | print(divmod(3, l)) 11 | print(divmod(l, 5)) 12 | print(divmod(l + 3, l)) 13 | print(divmod(l * 20, l + 2)) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_ellipsis.py: -------------------------------------------------------------------------------- 1 | # tests that .../Ellipsis exists 2 | 3 | print(...) 4 | print(Ellipsis) 5 | 6 | print(... == Ellipsis) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_eval.py: -------------------------------------------------------------------------------- 1 | # builtin eval 2 | 3 | try: 4 | eval 5 | except NameError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | eval('1 + 2') 10 | eval('1 + 2\n') 11 | eval('1 + 2\n\n#comment\n') 12 | 13 | x = 4 14 | eval('x') 15 | 16 | eval('lambda x: x + 10')(-5) 17 | 18 | y = 6 19 | eval('lambda: y * 2')() 20 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_eval_error.py: -------------------------------------------------------------------------------- 1 | # test if eval raises SyntaxError 2 | 3 | try: 4 | eval 5 | except NameError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | try: 10 | print(eval("[1,,]")) 11 | except SyntaxError: 12 | print("SyntaxError") 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_filter.py: -------------------------------------------------------------------------------- 1 | try: 2 | filter 3 | except: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | print(list(filter(lambda x: x & 1, range(-3, 4)))) 8 | print(list(filter(None, range(-3, 4)))) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_hash_gen.py: -------------------------------------------------------------------------------- 1 | # test builtin hash function, on generators 2 | 3 | def gen(): 4 | yield 5 | 6 | print(type(hash(gen))) 7 | print(type(hash(gen()))) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_hex.py: -------------------------------------------------------------------------------- 1 | # test builtin hex function 2 | 3 | print(hex(1)) 4 | print(hex(-1)) 5 | print(hex(15)) 6 | print(hex(-15)) 7 | 8 | print(hex(12345)) 9 | print(hex(0x12345)) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_hex_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin hex function 2 | 3 | print(hex(12345678901234567890)) 4 | print(hex(0x12345678901234567890)) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_id.py: -------------------------------------------------------------------------------- 1 | print(id(1) == id(2)) 2 | print(id(None) == id(None)) 3 | # This can't be true per Python semantics, just CPython implementation detail 4 | #print(id([]) == id([])) 5 | 6 | l = [1, 2] 7 | print(id(l) == id(l)) 8 | 9 | f = lambda:None 10 | print(id(f) == id(f)) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_issubclass.py: -------------------------------------------------------------------------------- 1 | # test builtin issubclass 2 | 3 | class A: 4 | pass 5 | 6 | print(issubclass(A, A)) 7 | print(issubclass(A, (A,))) 8 | 9 | try: 10 | issubclass(A, 1) 11 | except TypeError: 12 | print('TypeError') 13 | 14 | try: 15 | issubclass('a', 1) 16 | except TypeError: 17 | print('TypeError') 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_len1.py: -------------------------------------------------------------------------------- 1 | # builtin len 2 | 3 | print(len(())) 4 | print(len((1,))) 5 | print(len((1, 2))) 6 | 7 | print(len([])) 8 | x = [1, 2, 3] 9 | print(len(x)) 10 | 11 | f = len 12 | print(f({})) 13 | print(f({1:2, 3:4})) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_locals.py: -------------------------------------------------------------------------------- 1 | # test builtin locals() 2 | 3 | x = 123 4 | print(locals()['x']) 5 | 6 | class A: 7 | y = 1 8 | def f(self): 9 | pass 10 | 11 | print('x' in locals()) 12 | print(locals()['y']) 13 | print('f' in locals()) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_map.py: -------------------------------------------------------------------------------- 1 | print(list(map(lambda x: x & 1, range(-3, 4)))) 2 | print(list(map(abs, range(-3, 4)))) 3 | print(list(map(tuple, [[i] for i in range(-3, 4)]))) 4 | print(list(map(pow, range(4), range(4)))) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_oct.py: -------------------------------------------------------------------------------- 1 | # test builtin oct function 2 | 3 | print(oct(1)) 4 | print(oct(-1)) 5 | print(oct(15)) 6 | print(oct(-15)) 7 | 8 | print(oct(12345)) 9 | print(oct(0o12345)) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_oct_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin oct function 2 | 3 | print(oct(12345678901234567890)) 4 | print(oct(0o12345670123456701234)) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_pow.py: -------------------------------------------------------------------------------- 1 | # test builtin pow() with integral values 2 | # 2 arg version 3 | 4 | print(pow(0, 1)) 5 | print(pow(1, 0)) 6 | print(pow(-2, 3)) 7 | print(pow(3, 8)) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_round.py: -------------------------------------------------------------------------------- 1 | # test round() with integral values 2 | 3 | tests = [ 4 | False, True, 5 | 0, 1, -1, 10 6 | ] 7 | for t in tests: 8 | print(round(t)) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_slice.py: -------------------------------------------------------------------------------- 1 | # test builtin slice 2 | 3 | # print slice 4 | class A: 5 | def __getitem__(self, idx): 6 | print(idx) 7 | return idx 8 | s = A()[1:2:3] 9 | 10 | # check type 11 | print(type(s) is slice) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_sum.py: -------------------------------------------------------------------------------- 1 | # test builtin "sum" 2 | 3 | tests = ( 4 | (), 5 | [], 6 | [0], 7 | [1], 8 | [0, 1, 2], 9 | range(10), 10 | ) 11 | 12 | for test in tests: 13 | print(sum(test)) 14 | print(sum(test, -2)) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/builtin_zip.py: -------------------------------------------------------------------------------- 1 | try: 2 | zip 3 | set 4 | except NameError: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | print(list(zip())) 9 | print(list(zip([1], set([2, 3])))) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytearray_append.py: -------------------------------------------------------------------------------- 1 | # test bytearray.append method 2 | 3 | a = bytearray(4) 4 | print(a) 5 | 6 | # append should append a single byte 7 | a.append(2) 8 | print(a) 9 | 10 | # a should not be modified if append fails 11 | try: 12 | a.append(None) 13 | except TypeError: 14 | print('TypeError') 15 | print(a) 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytearray_construct.py: -------------------------------------------------------------------------------- 1 | # test construction of bytearray from different objects 2 | 3 | print(bytearray(b'123')) 4 | print(bytearray('1234', 'utf-8')) 5 | print(bytearray('12345', 'utf-8', 'strict')) 6 | print(bytearray((1, 2))) 7 | print(bytearray([1, 2])) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytearray_construct_array.py: -------------------------------------------------------------------------------- 1 | # test construction of bytearray from different objects 2 | try: 3 | from array import array 4 | except ImportError: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | # arrays 9 | print(bytearray(array('b', [1, 2]))) 10 | print(bytearray(array('h', [0x101, 0x202]))) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytearray_construct_endian.py: -------------------------------------------------------------------------------- 1 | # test construction of bytearray from different objects 2 | try: 3 | from array import array 4 | except ImportError: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | # arrays 9 | print(bytearray(array('h', [1, 2]))) 10 | print(bytearray(array('I', [1, 2]))) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytearray_intbig.py: -------------------------------------------------------------------------------- 1 | print(bytearray(2**65 - (2**65 - 1))) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_add.py: -------------------------------------------------------------------------------- 1 | # test bytes + other 2 | 3 | print(b"123" + b"456") 4 | print(b"123" + bytearray(2)) 5 | 6 | print(b"123" + b"") # RHS is empty, can be optimised 7 | print(b"" + b"123") # LHS is empty, can be optimised 8 | print(b"" + bytearray(1)) # LHS is empty but can't be optimised 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_add_array.py: -------------------------------------------------------------------------------- 1 | # test bytes + other 2 | try: 3 | import array 4 | except ImportError: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | # should be byteorder-neutral 9 | print(b"123" + array.array('h', [0x1515])) 10 | 11 | print(b"\x01\x02" + array.array('b', [1, 2])) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_add_endian.py: -------------------------------------------------------------------------------- 1 | # test bytes + other 2 | try: 3 | import array 4 | except ImportError: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | print(b"123" + array.array('i', [1])) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_compare2.py: -------------------------------------------------------------------------------- 1 | print(b"1" == 1) 2 | print(b"123" == bytearray(b"123")) 3 | print(b'123' < bytearray(b"124")) 4 | print(b'123' > bytearray(b"122")) 5 | print(bytearray(b"23") in b"1234") 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_compare3.py.exp: -------------------------------------------------------------------------------- 1 | ######## 2 | False 3 | ######## 4 | False 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_compare_array.py: -------------------------------------------------------------------------------- 1 | try: 2 | import array 3 | except ImportError: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | print(array.array('b', [1, 2]) in b'\x01\x02\x03') 8 | # CPython gives False here 9 | #print(b"\x01\x02\x03" == array.array("B", [1, 2, 3])) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_construct_array.py: -------------------------------------------------------------------------------- 1 | # test construction of bytes from different objects 2 | try: 3 | from array import array 4 | except ImportError: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | # arrays 9 | print(bytes(array('b', [1, 2]))) 10 | print(bytes(array('h', [0x101, 0x202]))) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_construct_endian.py: -------------------------------------------------------------------------------- 1 | # test construction of bytes from different objects 2 | 3 | try: 4 | from array import array 5 | except ImportError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | # arrays 10 | print(bytes(array('h', [1, 2]))) 11 | print(bytes(array('I', [1, 2]))) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_construct_intbig.py: -------------------------------------------------------------------------------- 1 | # test construction of bytes from different objects 2 | 3 | # long ints 4 | print(ord(bytes([14953042807679334000 & 0xff]))) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_format_modulo.py: -------------------------------------------------------------------------------- 1 | # This test requires CPython3.5 2 | print(b"%%" % ()) 3 | print(b"=%d=" % 1) 4 | print(b"=%d=%d=" % (1, 2)) 5 | 6 | print(b"=%s=" % b"str") 7 | print(b"=%r=" % b"str") 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_format_modulo.py.exp: -------------------------------------------------------------------------------- 1 | b'%' 2 | b'=1=' 3 | b'=1=2=' 4 | b'=str=' 5 | b"=b'str'=" 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_gen.py: -------------------------------------------------------------------------------- 1 | # construct a bytes object from a generator 2 | def gen(): 3 | for i in range(4): 4 | yield i 5 | print(bytes(gen())) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_mult.py: -------------------------------------------------------------------------------- 1 | # basic multiplication 2 | print(b'0' * 5) 3 | 4 | # check negative, 0, positive; lhs and rhs multiplication 5 | for i in (-4, -2, 0, 2, 4): 6 | print(i * b'12') 7 | print(b'12' * i) 8 | 9 | # check that we don't modify existing object 10 | a = b'123' 11 | c = a * 3 12 | print(a, c) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/bytes_subscr.py: -------------------------------------------------------------------------------- 1 | # test [...] of bytes 2 | 3 | print(b'123'[0]) 4 | print(b'123'[1]) 5 | print(b'123'[-1]) 6 | 7 | try: 8 | b'123'[1] = 4 9 | except TypeError: 10 | print('TypeError') 11 | 12 | try: 13 | del b'123'[1] 14 | except TypeError: 15 | print('TypeError') 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/class_emptybases.py: -------------------------------------------------------------------------------- 1 | class A(): 2 | pass 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/class_instance_override.py: -------------------------------------------------------------------------------- 1 | # test that we can override a class method with an instance method 2 | 3 | class A: 4 | def foo(self): 5 | return 1 6 | 7 | a = A() 8 | print(a.foo()) 9 | a.foo = lambda:2 10 | print(a.foo()) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/class_misc.py: -------------------------------------------------------------------------------- 1 | # converting user instance to buffer 2 | class C: 3 | pass 4 | 5 | c = C() 6 | try: 7 | d = bytearray(c) 8 | except TypeError: 9 | print('TypeError') 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/class_store.py: -------------------------------------------------------------------------------- 1 | # store to class vs instance 2 | 3 | class C: 4 | pass 5 | 6 | c = C() 7 | c.x = 1 8 | print(c.x) 9 | C.x = 2 10 | C.y = 3 11 | print(c.x, c.y) 12 | print(C.x, C.y) 13 | print(C().x, C().y) 14 | c = C() 15 | print(c.x) 16 | c.x = 4 17 | print(c.x) 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/class_super_aslocal.py: -------------------------------------------------------------------------------- 1 | # test using the name "super" as a local variable 2 | 3 | class A: 4 | def foo(self): 5 | super = [1, 2] 6 | super.pop() 7 | print(super) 8 | 9 | A().foo() 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/class_super_multinherit.py: -------------------------------------------------------------------------------- 1 | # test super with multiple inheritance 2 | 3 | class A: 4 | def foo(self): 5 | print('A.foo') 6 | 7 | class B: 8 | def foo(self): 9 | print('B.foo') 10 | 11 | class C(A, B): 12 | def foo(self): 13 | print('C.foo') 14 | super().foo() 15 | 16 | C().foo() 17 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/class_use_other.py: -------------------------------------------------------------------------------- 1 | # check that we can use an instance of B in a method of A 2 | 3 | class A: 4 | def store(a, b): 5 | a.value = b 6 | 7 | class B: 8 | pass 9 | 10 | b = B() 11 | A.store(b, 1) 12 | print(b.value) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/closure1.py: -------------------------------------------------------------------------------- 1 | # closures 2 | 3 | def f(x): 4 | y = 2 * x 5 | def g(z): 6 | return y + z 7 | return g 8 | 9 | print(f(1)(1)) 10 | 11 | x = f(2) 12 | y = f(3) 13 | print(x(1), x(2), x(3)) 14 | print(y(1), y(2), y(3)) 15 | print(x(1), x(2), x(3)) 16 | print(y(1), y(2), y(3)) 17 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/closure2.py: -------------------------------------------------------------------------------- 1 | # closures; closing over an argument 2 | 3 | def f(x): 4 | y = 2 * x 5 | def g(z): 6 | return x + y + z 7 | return g 8 | 9 | print(f(1)(1)) 10 | 11 | x = f(2) 12 | y = f(3) 13 | print(x(1), x(2), x(3)) 14 | print(y(1), y(2), y(3)) 15 | print(x(1), x(2), x(3)) 16 | print(y(1), y(2), y(3)) 17 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/closure_defargs.py: -------------------------------------------------------------------------------- 1 | # test closure with default args 2 | 3 | def f(): 4 | a = 1 5 | def bar(b = 10, c = 20): 6 | print(a + b + c) 7 | bar() 8 | bar(2) 9 | bar(2, 3) 10 | 11 | print(f()) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/closure_manyvars.py: -------------------------------------------------------------------------------- 1 | # test closure with lots of closed over variables 2 | 3 | def f(): 4 | a, b, c, d, e, f, g, h = [i for i in range(8)] 5 | def x(): 6 | print(a, b, c, d, e, f, g, h) 7 | x() 8 | 9 | f() 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/closure_namedarg.py: -------------------------------------------------------------------------------- 1 | # test passing named arg to closed-over function 2 | 3 | def f(): 4 | x = 1 5 | def g(z): 6 | print(x, z) 7 | return g 8 | 9 | f()(z=42) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/compare_multi.py: -------------------------------------------------------------------------------- 1 | print(1 < 2 < 3) 2 | print(1 < 2 < 3 < 4) 3 | print(1 > 2 < 3) 4 | print(1 < 2 > 3) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/continue.py: -------------------------------------------------------------------------------- 1 | for i in range(4): 2 | print('one', i) 3 | if i > 2: 4 | continue 5 | print('two', i) 6 | 7 | for i in range(4): 8 | print('one', i) 9 | if i < 2: 10 | continue 11 | print('two', i) 12 | 13 | for i in [1, 2, 3, 4]: 14 | if i == 3: 15 | continue 16 | print(i) 17 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/del_name.py: -------------------------------------------------------------------------------- 1 | # del name 2 | 3 | x = 1 4 | print(x) 5 | del x 6 | try: 7 | print(x) 8 | except NameError: 9 | print("NameError") 10 | try: 11 | del x 12 | except: # NameError: 13 | # FIXME uPy returns KeyError for this 14 | print("NameError") 15 | 16 | class C: 17 | def f(): 18 | pass 19 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/del_subscr.py: -------------------------------------------------------------------------------- 1 | l = [1, 2, 3] 2 | print(l) 3 | del l[0] 4 | print(l) 5 | del l[-1] 6 | print(l) 7 | 8 | d = {1:2, 3:4, 5:6} 9 | del d[1] 10 | del d[3] 11 | print(d) 12 | del d[5] 13 | print(d) 14 | 15 | # delete nested subscr 16 | d = {0:{0:0}} 17 | del d[0][0] 18 | print(d) 19 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/deque2.py.exp: -------------------------------------------------------------------------------- 1 | ValueError 2 | ValueError 3 | TypeError 4 | IndexError 5 | None 6 | 1 7 | 2 8 | 3 4 9 | IndexError('empty',) 10 | 2 11 | IndexError('full',) 12 | 2 13 | 5 6 14 | 0 15 | IndexError('empty',) 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict2.py: -------------------------------------------------------------------------------- 1 | # using strings as keys in dict 2 | 3 | d = {'1': 1, '2': 2} 4 | print(d['1'], d['2']) 5 | 6 | d['3'] = 3 7 | print(d['1'], d['2'], d['3']) 8 | 9 | d['2'] = 222 10 | print(d['1'], d['2'], d['3']) 11 | 12 | d2 = dict(d) 13 | print('2' in d2) 14 | print(id(d) != id(d2), d == d2) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_clear.py: -------------------------------------------------------------------------------- 1 | d = {1: 2, 3: 4} 2 | print(len(d)) 3 | d.clear() 4 | print(d) 5 | d[2] = 42 6 | print(d) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_construct.py: -------------------------------------------------------------------------------- 1 | # dict constructor 2 | 3 | d = dict() 4 | print(d) 5 | 6 | d = dict({1:2}) 7 | print(d) 8 | 9 | d = dict(a=1) 10 | print(d) 11 | 12 | d = dict({1:2}, a=3) 13 | print(d[1], d['a']) 14 | 15 | d = dict([(1, 2)], a=3, b=4) 16 | print(d[1], d['a'], d['b']) 17 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_copy.py: -------------------------------------------------------------------------------- 1 | a = {i: 2*i for i in range(100)} 2 | b = a.copy() 3 | for i in range(100): 4 | print(i, b[i]) 5 | print(len(b)) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_fixed.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | TypeError 3 | TypeError 4 | TypeError 5 | TypeError 6 | TypeError 7 | TypeError 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_fromkeys.py: -------------------------------------------------------------------------------- 1 | d = dict.fromkeys([1, 2, 3, 4]) 2 | l = list(d.keys()) 3 | l.sort() 4 | print(l) 5 | 6 | d = dict.fromkeys([1, 2, 3, 4], 42) 7 | l = list(d.values()) 8 | l.sort() 9 | print(l) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_fromkeys2.py: -------------------------------------------------------------------------------- 1 | try: 2 | reversed 3 | except: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | # argument to fromkeys has no __len__ 8 | d = dict.fromkeys(reversed(range(1))) 9 | #d = dict.fromkeys((x for x in range(1))) 10 | print(d) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_get.py: -------------------------------------------------------------------------------- 1 | for d in {}, {42:2}: 2 | print(d.get(42)) 3 | print(d.get(42,2)) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_iterator.py: -------------------------------------------------------------------------------- 1 | d = {1: 2, 3: 4} 2 | els = [] 3 | for i in d: 4 | els.append((i, d[i])) 5 | print(sorted(els)) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_pop.py: -------------------------------------------------------------------------------- 1 | d = {1: 2, 3: 4} 2 | print(d.pop(3), d) 3 | print(d) 4 | print(d.pop(1, 42), d) 5 | print(d.pop(1, 42), d) 6 | print(d.pop(1, None), d) 7 | try: 8 | print(d.pop(1), "!!!",) 9 | except KeyError: 10 | print("Raised KeyError") 11 | else: 12 | print("Did not rise KeyError!") 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_setdefault.py: -------------------------------------------------------------------------------- 1 | d = {} 2 | print(d.setdefault(1)) 3 | print(d.setdefault(1)) 4 | print(d.setdefault(5, 42)) 5 | print(d.setdefault(5, 1)) 6 | print(d[1]) 7 | print(d[5]) 8 | d.pop(5) 9 | print(d.setdefault(5, 1)) 10 | print(d[1]) 11 | print(d[5]) 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_specialmeth.py: -------------------------------------------------------------------------------- 1 | # dict object with special methods 2 | 3 | d = {} 4 | d.__setitem__('2', 'two') 5 | print(d.__getitem__('2')) 6 | d.__delitem__('2') 7 | print(d) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/dict_update.py: -------------------------------------------------------------------------------- 1 | d = {1:2, 3:4} 2 | print(len(d)) 3 | d.update(["ab"]) 4 | print(d[1]) 5 | print(d[3]) 6 | print(d["a"]) 7 | print(len(d)) 8 | d.update([(1,4)]) 9 | print(d[1]) 10 | print(len(d)) 11 | 12 | # using keywords 13 | d.update(a=5) 14 | print(d['a']) 15 | d.update([(1,5)], b=6) 16 | print(d[1], d['b']) 17 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/errno1.py.exp: -------------------------------------------------------------------------------- 1 | 2 | [Errno ] EIO 3 | 9999 4 | uerrno 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/exception1.py: -------------------------------------------------------------------------------- 1 | print(repr(IndexError())) 2 | print(str(IndexError())) 3 | 4 | print(str(IndexError("foo"))) 5 | 6 | a = IndexError(1, "test", [100, 200]) 7 | print(repr(a)) 8 | print(str(a)) 9 | print(a.args) 10 | 11 | s = StopIteration() 12 | print(s.value) 13 | s = StopIteration(1, 2, 3) 14 | print(s.value) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/exception_chain.py: -------------------------------------------------------------------------------- 1 | # Exception chaining is not supported, but check that basic 2 | # exception works as expected. 3 | try: 4 | raise Exception from None 5 | except Exception: 6 | print("Caught Exception") 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/exception_chain.py.exp: -------------------------------------------------------------------------------- 1 | Warning: exception chaining not supported 2 | Caught Exception 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/floordivide.py: -------------------------------------------------------------------------------- 1 | # check modulo matches python definition 2 | 3 | # This tests compiler version 4 | print(123 // 7) 5 | print(-123 // 7) 6 | print(123 // -7) 7 | print(-123 // -7) 8 | 9 | a = 10000001 10 | b = 10000000 11 | print(a // b) 12 | print(a // -b) 13 | print(-a // b) 14 | print(-a // -b) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/for2.py: -------------------------------------------------------------------------------- 1 | i = 'init' 2 | for i in range(0): 3 | pass 4 | print(i) # should not have been modified 5 | 6 | for i in range(10): 7 | pass 8 | print(i) # should be last successful value of loop 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/for3.py: -------------------------------------------------------------------------------- 1 | # test assigning to iterator within the loop 2 | for i in range(2): 3 | print(i) 4 | i = 2 5 | 6 | # test assigning to range parameter within the loop 7 | # (since we optimise for loops, this needs checking, currently it fails) 8 | n = 2 9 | for i in range(n): 10 | print(i) 11 | n = 0 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/for_return.py: -------------------------------------------------------------------------------- 1 | # test returning from within a for loop 2 | 3 | def f(): 4 | for i in [1, 2, 3]: 5 | return i 6 | 7 | print(f()) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/frozenset_copy.py: -------------------------------------------------------------------------------- 1 | try: 2 | frozenset 3 | except NameError: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | s = frozenset({1, 2, 3, 4}) 8 | t = s.copy() 9 | print(type(t)) 10 | for i in s, t: 11 | print(sorted(i)) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/fun1.py: -------------------------------------------------------------------------------- 1 | # calling a function 2 | 3 | def f(): 4 | print(1) 5 | f() 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/fun2.py: -------------------------------------------------------------------------------- 1 | # calling a function from a function 2 | 3 | def f(x): 4 | print(x + 1) 5 | 6 | def g(x): 7 | f(2 * x) 8 | f(4 * x) 9 | 10 | g(3) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/fun3.py: -------------------------------------------------------------------------------- 1 | # function with large number of arguments 2 | 3 | def fun(a, b, c, d, e, f, g): 4 | return a + b + c * d + e * f * g 5 | 6 | print(fun(1, 2, 3, 4, 5, 6, 7)) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/fun_annotations.py: -------------------------------------------------------------------------------- 1 | def foo(x: int, y: list) -> dict: 2 | return {x: y} 3 | 4 | print(foo(1, [2, 3])) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/fun_error2.py: -------------------------------------------------------------------------------- 1 | # test errors from bad function calls 2 | try: 3 | enumerate 4 | except: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | # function with keyword args not given a specific keyword arg 9 | try: 10 | enumerate() 11 | except TypeError: 12 | print('TypeError') 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/fun_str.py: -------------------------------------------------------------------------------- 1 | # test str of function 2 | 3 | def f(): 4 | pass 5 | print(str(f)[:8]) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/gen_yield_from_exc.py: -------------------------------------------------------------------------------- 1 | def gen(): 2 | yield 1 3 | yield 2 4 | raise ValueError 5 | 6 | def gen2(): 7 | try: 8 | print((yield from gen())) 9 | except ValueError: 10 | print("caught ValueError from downstream") 11 | 12 | g = gen2() 13 | print(list(g)) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/gen_yield_from_iter.py: -------------------------------------------------------------------------------- 1 | def gen(): 2 | yield from (1, 2, 3) 3 | 4 | def gen2(): 5 | yield from gen() 6 | 7 | def gen3(): 8 | yield from (4, 5) 9 | yield 6 10 | 11 | print(list(gen())) 12 | print(list(gen2())) 13 | print(list(gen3())) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/gen_yield_from_send.py: -------------------------------------------------------------------------------- 1 | def gen(): 2 | print("sent:", (yield 1)) 3 | yield 2 4 | 5 | def gen2(): 6 | print((yield from gen())) 7 | 8 | g = gen2() 9 | next(g) 10 | print("yielded:", g.send("val")) 11 | try: 12 | next(g) 13 | except StopIteration: 14 | print("StopIteration") 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/generator2.py: -------------------------------------------------------------------------------- 1 | gen = (i for i in range(10)) 2 | for i in gen: 3 | print(i) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/generator_pend_throw.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | raised ValueError() 4 | ret was: None 5 | TypeError 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/generator_pep479.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | RuntimeError 3 | StopIteration 4 | 1 5 | RuntimeError 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/ifexpr.py: -------------------------------------------------------------------------------- 1 | # test if-expressions 2 | 3 | print(1 if 0 else 2) 4 | print(3 if 1 else 4) 5 | 6 | def f(x): 7 | print('a' if x else 'b') 8 | f([]) 9 | f([1]) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int2.py: -------------------------------------------------------------------------------- 1 | # test basic int operations 2 | 3 | # test conversion of bool on RHS of binary op 4 | a = False 5 | print(1 + a) 6 | a = True 7 | print(1 + a) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int_big_cmp.py: -------------------------------------------------------------------------------- 1 | # test bignum comparisons 2 | 3 | i = 1 << 65 4 | 5 | print(i == 0) 6 | print(i != 0) 7 | print(i < 0) 8 | print(i > 0) 9 | print(i <= 0) 10 | print(i >= 0) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int_big_pow.py: -------------------------------------------------------------------------------- 1 | # test bignum power 2 | 3 | i = 1 << 65 4 | 5 | print(0 ** i) 6 | print(i ** 0) 7 | print(i ** 1) 8 | print(i ** 2) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int_big_rshift.py: -------------------------------------------------------------------------------- 1 | i = 123456789012345678901234567890 2 | print(i >> 1) 3 | print(i >> 1000) 4 | 5 | # result needs rounding up 6 | i = -(1 << 70) 7 | print(i >> 80) 8 | i = -0xffffffffffffffff 9 | print(i >> 32) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int_big_unary.py: -------------------------------------------------------------------------------- 1 | # test bignum unary operations 2 | 3 | i = 1 << 65 4 | 5 | print(bool(i)) 6 | print(+i) 7 | print(-i) 8 | print(~i) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int_divmod.py: -------------------------------------------------------------------------------- 1 | # test integer floor division and modulo 2 | 3 | # test all combination of +/-/0 cases 4 | for i in range(-2, 3): 5 | for j in range(-4, 5): 6 | if j != 0: 7 | print(i, j, i // j, i % j, divmod(i, j)) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int_divmod_intbig.py: -------------------------------------------------------------------------------- 1 | # test integer floor division and modulo 2 | 3 | # this tests bignum modulo 4 | a = 987654321987987987987987987987 5 | b = 19 6 | print(a % b) 7 | print(a % -b) 8 | print(-a % b) 9 | print(-a % -b) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/int_divzero.py: -------------------------------------------------------------------------------- 1 | try: 2 | 1 // 0 3 | except ZeroDivisionError: 4 | print("ZeroDivisionError") 5 | 6 | try: 7 | 1 % 0 8 | except ZeroDivisionError: 9 | print("ZeroDivisionError") 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/io_buffered_writer.py.exp: -------------------------------------------------------------------------------- 1 | b'' 2 | b'foobarfo' 3 | b'foobarfoobar' 4 | b'foobarfoobar' 5 | b'foo' 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/io_bytesio_ext2.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/io_stringio_with.py: -------------------------------------------------------------------------------- 1 | try: 2 | import uio as io 3 | except ImportError: 4 | import io 5 | 6 | # test __enter__/__exit__ 7 | with io.StringIO() as b: 8 | b.write("foo") 9 | print(b.getvalue()) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/io_write_ext.py.exp: -------------------------------------------------------------------------------- 1 | b'fo' 2 | b'fofoo' 3 | b'fofoooob' 4 | b'fofooooboobar' 5 | b'fofooooboobar' 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/is_isnot.py: -------------------------------------------------------------------------------- 1 | print(1 is 1) 2 | print(1 is 2) 3 | print(1 is not 1) 4 | print(1 is not 2) 5 | 6 | 7 | print([1, 2] is [1, 2]) 8 | a = [1, 2] 9 | b = a 10 | print(b is a) 11 | 12 | # TODO: strings require special "is" handling, postponed 13 | # until qstr refactor. 14 | #print("a" is "a") 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/iter0.py: -------------------------------------------------------------------------------- 1 | # builtin type that is not iterable 2 | try: 3 | for i in 1: 4 | pass 5 | except TypeError: 6 | print('TypeError') 7 | 8 | # builtin type that is iterable, calling __next__ explicitly 9 | print(iter(range(4)).__next__()) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/iter_of_iter.py: -------------------------------------------------------------------------------- 1 | i = iter(iter((1, 2, 3))) 2 | print(list(i)) 3 | i = iter(iter([1, 2, 3])) 4 | print(list(i)) 5 | i = iter(iter({1:2, 3:4, 5:6})) 6 | print(sorted(i)) 7 | # set, see set_iter_of_iter.py 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/lambda1.py: -------------------------------------------------------------------------------- 1 | # lambda 2 | 3 | f = lambda x, y: x + 3 * y 4 | print(f(3, 5)) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/lambda_defargs.py: -------------------------------------------------------------------------------- 1 | # test default args with lambda 2 | 3 | f = lambda x=1: x 4 | print(f(), f(2), f(x=3)) 5 | 6 | y = 'y' 7 | f = lambda x=y: x 8 | print(f()) 9 | 10 | f = lambda x, y=[]: (x, y) 11 | f(0)[1].append(1) 12 | print(f(1), f(x=2), f(3, 4), f(4, y=5)) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/list_clear.py: -------------------------------------------------------------------------------- 1 | # tests list.clear 2 | x = [1, 2, 3, 4] 3 | x.clear() 4 | print(x) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/list_copy.py: -------------------------------------------------------------------------------- 1 | # list copy tests 2 | a = [1, 2, []] 3 | b = a.copy() 4 | a[-1].append(1) 5 | a.append(4) 6 | print(a) 7 | print(b) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/list_count.py: -------------------------------------------------------------------------------- 1 | # list count tests 2 | a = [1, 2, 3] 3 | a = a + a + a 4 | b = [0, 0, a, 0, a, 0] 5 | print(a.count(2)) 6 | print(b.count(a)) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/list_insert.py: -------------------------------------------------------------------------------- 1 | a = [1, 2, 3] 2 | a.insert(1, 42) 3 | print(a) 4 | a.insert(-1, -1) 5 | print(a) 6 | a.insert(99, 99) 7 | print(a) 8 | a.insert(-99, -99) 9 | print(a) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/list_remove.py: -------------------------------------------------------------------------------- 1 | a = [1, 2, 3] 2 | print(a.remove(2)) 3 | print(a) 4 | try: 5 | a.remove(2) 6 | except ValueError: 7 | print("Raised ValueError") 8 | else: 9 | raise AssertionError("Did not raise ValueError") 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/list_reverse.py: -------------------------------------------------------------------------------- 1 | a = [] 2 | for i in range(100): 3 | a.append(i) 4 | a.reverse() 5 | print(a) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/list_sum.py: -------------------------------------------------------------------------------- 1 | # list addition 2 | a = [1,2,3] 3 | b = [4,5,6] 4 | c = a + b 5 | print(c) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/memoryerror.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | 1000 0 999 3 | MemoryError 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/module1.py: -------------------------------------------------------------------------------- 1 | # test behaviour of module objects 2 | 3 | # this module should always exist 4 | import __main__ 5 | 6 | # print module 7 | print(repr(__main__).startswith(">65:]) 4 | print(list(range(10))[:(1<<66)>>65]) 5 | print(list(range(10))[::(1<<66)>>65]) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_center.py: -------------------------------------------------------------------------------- 1 | try: 2 | str.center 3 | except: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | print("foo".center(0)) 8 | print("foo".center(1)) 9 | print("foo".center(3)) 10 | print("foo".center(4)) 11 | print("foo".center(5)) 12 | print("foo".center(6)) 13 | print("foo".center(20)) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_cr_conversion.py: -------------------------------------------------------------------------------- 1 | # this file has CR line endings to test lexer's conversion of them to LF # in triple quoted strings print(repr("""abc def""")) -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_crlf_conversion.py: -------------------------------------------------------------------------------- 1 | # this file has CRLF line endings to test lexer's conversion of them to LF 2 | # in triple quoted strings 3 | print(repr("""abc 4 | def""")) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_endswith_upy.py: -------------------------------------------------------------------------------- 1 | # MicroPython doesn't support tuple argument 2 | 3 | try: 4 | "foobar".endswith(("bar", "sth")) 5 | except TypeError: 6 | print("TypeError") 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_endswith_upy.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_escape.py: -------------------------------------------------------------------------------- 1 | a = "a\1b" 2 | print(len(a)) 3 | print(ord(a[1])) 4 | print(len("a\123b")) 5 | a = "a\12345b" 6 | print(len(a)) 7 | print(ord(a[1])) 8 | 9 | a = "a\xffb" 10 | print(len(a)) 11 | print(ord(a[1])) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_mult.py: -------------------------------------------------------------------------------- 1 | # basic multiplication 2 | print('0' * 5) 3 | 4 | # check negative, 0, positive; lhs and rhs multiplication 5 | for i in (-4, -2, 0, 2, 4): 6 | print(i * '12') 7 | print('12' * i) 8 | 9 | # check that we don't modify existing object 10 | a = '123' 11 | c = a * 3 12 | print(a, c) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_repr.py: -------------------------------------------------------------------------------- 1 | # anything above 0xa0 is printed as Unicode by CPython 2 | # the abobe is CPython implementation detail, stick to ASCII 3 | for c in range(0x80): 4 | print("0x%02x: %s" % (c, repr(chr(c)))) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_startswith_upy.py: -------------------------------------------------------------------------------- 1 | # MicroPython doesn't support tuple argument 2 | 3 | try: 4 | "foobar".startswith(("foo", "sth")) 5 | except TypeError: 6 | print("TypeError") 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_startswith_upy.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/string_upperlow.py: -------------------------------------------------------------------------------- 1 | print("".lower()) 2 | print(" t\tn\nr\rv\vf\f".upper()) 3 | print(" T E S T".lower()) 4 | print("*@a1b2cabc_[]/\\".upper()) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/struct_micropython.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | b'\x01\x00\x00\x00\x00\x00\x00\x00' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/subclass_native4.py: -------------------------------------------------------------------------------- 1 | # Test calling non-special method inherited from native type 2 | 3 | class mylist(list): 4 | pass 5 | 6 | l = mylist([1, 2, 3]) 7 | print(l) 8 | l.append(10) 9 | print(l) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/subclass_native5.py: -------------------------------------------------------------------------------- 1 | # Subclass from 2 bases explicitly subclasses from object 2 | 3 | class Base1(object): 4 | pass 5 | 6 | class Base2(object): 7 | pass 8 | 9 | class Sub(Base1, Base2): 10 | pass 11 | 12 | o = Sub() 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/subclass_native_call.py.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/subclass_native_cmp.py: -------------------------------------------------------------------------------- 1 | # Test calling non-special method inherited from native type 2 | 3 | class mytuple(tuple): 4 | pass 5 | 6 | t = mytuple((1, 2, 3)) 7 | print(t) 8 | print(t == (1, 2, 3)) 9 | print((1, 2, 3) == t) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/subclass_native_iter.py: -------------------------------------------------------------------------------- 1 | # test subclassing a native type which can be iterated over 2 | 3 | class mymap(map): 4 | pass 5 | 6 | m = mymap(lambda x: x + 10, range(4)) 7 | print(list(m)) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/try1.py: -------------------------------------------------------------------------------- 1 | # basic exceptions 2 | x = 1 3 | try: 4 | x.a() 5 | except: 6 | print(x) 7 | 8 | try: 9 | raise IndexError 10 | except IndexError: 11 | print("caught") 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/try3.py: -------------------------------------------------------------------------------- 1 | # nested exceptions 2 | 3 | def f(): 4 | try: 5 | foo() 6 | except: 7 | print("except 1") 8 | try: 9 | baz() 10 | except: 11 | print("except 2") 12 | bar() 13 | 14 | try: 15 | f() 16 | except: 17 | print("f except") 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/try_as_var.py: -------------------------------------------------------------------------------- 1 | try: 2 | raise ValueError(534) 3 | except ValueError as e: 4 | print(type(e), e.args) 5 | 6 | # Var bound in except block is automatically deleted 7 | try: 8 | e 9 | except NameError: 10 | print("NameError") 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/try_continue.py: -------------------------------------------------------------------------------- 1 | # test continue within exception handler 2 | 3 | def f(): 4 | lst = [1, 2, 3] 5 | for x in lst: 6 | print('a', x) 7 | try: 8 | if x == 2: 9 | raise Exception 10 | except Exception: 11 | continue 12 | print('b', x) 13 | f() 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/try_error.py: -------------------------------------------------------------------------------- 1 | # test bad exception match 2 | 3 | try: 4 | try: 5 | a 6 | except 1: 7 | pass 8 | except TypeError: 9 | print("TypeError") 10 | 11 | try: 12 | try: 13 | a 14 | except (1,): 15 | pass 16 | except TypeError: 17 | print("TypeError") 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/try_return.py: -------------------------------------------------------------------------------- 1 | # test use of return with try-except 2 | 3 | def f(l, i): 4 | try: 5 | return l[i] 6 | except IndexError: 7 | print('IndexError') 8 | return -1 9 | 10 | print(f([1], 0)) 11 | print(f([], 0)) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/tuple_count.py: -------------------------------------------------------------------------------- 1 | a = (1, 2, 3) 2 | a = a + a + a 3 | b = (0, 0, a, 0, a, 0) 4 | print(a.count(2)) 5 | print(b.count(a)) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/types2.py: -------------------------------------------------------------------------------- 1 | # Types are hashable 2 | print(hash(type) != 0) 3 | print(hash(int) != 0) 4 | print(hash(list) != 0) 5 | class Foo: pass 6 | print(hash(Foo) != 0) 7 | 8 | print(int == int) 9 | print(int != list) 10 | 11 | d = {} 12 | d[int] = list 13 | d[list] = int 14 | print(len(d)) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/while1.py: -------------------------------------------------------------------------------- 1 | # basic while loop 2 | 3 | x = 0 4 | while x < 2: 5 | y = 0 6 | while y < 2: 7 | z = 0 8 | while z < 2: 9 | z = z + 1 10 | print(x, y, z) 11 | y = y + 1 12 | x = x + 1 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/while_nest_exc.py: -------------------------------------------------------------------------------- 1 | # test nested whiles within a try-except 2 | 3 | while 1: 4 | print(1) 5 | try: 6 | print(2) 7 | while 1: 8 | print(3) 9 | break 10 | except: 11 | print(4) 12 | print(5) 13 | break 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/basics/with_break.py: -------------------------------------------------------------------------------- 1 | class CtxMgr: 2 | 3 | def __enter__(self): 4 | print("__enter__") 5 | return self 6 | 7 | def __exit__(self, a, b, c): 8 | print("__exit__", repr(a), repr(b)) 9 | 10 | for i in range(5): 11 | print(i) 12 | with CtxMgr(): 13 | if i == 3: 14 | break 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/bench.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | 4 | ITERS = 20000000 5 | 6 | def run(f): 7 | t = time.time() 8 | f(ITERS) 9 | t = time.time() - t 10 | print(t) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/bytealloc-1-bytes_n.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num // 1000)): 5 | bytes(10000) 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/bytealloc-2-repeat.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num // 1000)): 5 | b"\0" * 10000 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/bytebuf-1-inplace.py: -------------------------------------------------------------------------------- 1 | # Doing some operation on bytearray 2 | # Inplace - the most memory efficient way 3 | import bench 4 | 5 | def test(num): 6 | for i in iter(range(num//10000)): 7 | ba = bytearray(b"\0" * 1000) 8 | for i in range(len(ba)): 9 | ba[i] += 1 10 | 11 | bench.run(test) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/bytebuf-3-bytarray_map.py: -------------------------------------------------------------------------------- 1 | # Doing some operation on bytearray 2 | # No joins, but still map(). 3 | import bench 4 | 5 | def test(num): 6 | for i in iter(range(num//10000)): 7 | ba = bytearray(b"\0" * 1000) 8 | ba2 = bytearray(map(lambda x: x + 1, ba)) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-1-list_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = list(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-2-list_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = list(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-3-tuple_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = tuple(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-4-tuple_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = tuple(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-5-bytes_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytes(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-6-bytes_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytes(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-7-bytearray_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytearray(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/from_iter-8-bytearray_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytearray(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/func_args-1.1-pos_1.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/func_args-1.2-pos_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a, b, c): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(i, i, i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/func_args-2-pos_default_2_of_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a, b=1, c=2): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/func_args-3.1-kw_1.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(a=i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/func_args-3.2-kw_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a, b, c): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(c=i, b=i, a=i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/func_builtin-1-enum_pos.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//20)): 5 | enumerate([1, 2], 1) 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/func_builtin-2-enum_kw.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//20)): 5 | enumerate(iterable=[1, 2], start=1) 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/funcall-1-inline.py: -------------------------------------------------------------------------------- 1 | # Function call overhead test 2 | # Establish a baseline for performing a trivial operation inline 3 | import bench 4 | 5 | def test(num): 6 | for i in iter(range(num)): 7 | a = i + 1 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/funcall-2-funcall.py: -------------------------------------------------------------------------------- 1 | # Function call overhead test 2 | # Perform the same trivial operation as global function call 3 | import bench 4 | 5 | def f(x): 6 | return x + 1 7 | 8 | def test(num): 9 | for i in iter(range(num)): 10 | a = f(i) 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/loop_count-1-range.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in range(num): 5 | pass 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/loop_count-2-range_iter.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num)): 5 | pass 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/loop_count-3-while_up.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | i = 0 5 | while i < num: 6 | i += 1 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/loop_count-4-while_down_gt.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | while num > 0: 5 | num -= 1 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/loop_count-5-while_down_ne.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | while num != 0: 5 | num -= 1 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/loop_count-5.1-while_down_ne_localvar.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | zero = 0 5 | while num != zero: 6 | num -= 1 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-1-constant.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | i = 0 5 | while i < 20000000: 6 | i += 1 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-2-global.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | ITERS = 20000000 4 | 5 | def test(num): 6 | i = 0 7 | while i < ITERS: 8 | i += 1 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-3-local.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | ITERS = 20000000 6 | i = 0 7 | while i < ITERS: 8 | i += 1 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-4-arg.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | i = 0 6 | while i < num: 7 | i += 1 8 | 9 | bench.run(lambda n:test(20000000)) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-5-class-attr.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | class Foo: 4 | num = 20000000 5 | 6 | def test(num): 7 | i = 0 8 | while i < Foo.num: 9 | i += 1 10 | 11 | bench.run(test) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-6-instance-attr.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | class Foo: 4 | 5 | def __init__(self): 6 | self.num = 20000000 7 | 8 | def test(num): 9 | o = Foo() 10 | i = 0 11 | while i < o.num: 12 | i += 1 13 | 14 | bench.run(test) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-7-instance-meth.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | class Foo: 4 | 5 | def __init__(self): 6 | self._num = 20000000 7 | 8 | def num(self): 9 | return self._num 10 | 11 | def test(num): 12 | o = Foo() 13 | i = 0 14 | while i < o.num(): 15 | i += 1 16 | 17 | bench.run(test) 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-8-namedtuple-1st.py: -------------------------------------------------------------------------------- 1 | import bench 2 | from ucollections import namedtuple 3 | 4 | T = namedtuple("Tup", ["num", "bar"]) 5 | 6 | def test(num): 7 | t = T(20000000, 0) 8 | i = 0 9 | while i < t.num: 10 | i += 1 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/bench/var-8.1-namedtuple-5th.py: -------------------------------------------------------------------------------- 1 | import bench 2 | from ucollections import namedtuple 3 | 4 | T = namedtuple("Tup", ["foo1", "foo2", "foo3", "foo4", "num"]) 5 | 6 | def test(num): 7 | t = T(0, 0, 0, 0, 20000000) 8 | i = 0 9 | while i < t.num: 10 | i += 1 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/cmd_optimise.py: -------------------------------------------------------------------------------- 1 | # cmdline: -O 2 | # test optimisation output 3 | print(__debug__) 4 | assert 0 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/cmd_optimise.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/cmd_parsetree.py: -------------------------------------------------------------------------------- 1 | # cmdline: -v -v -v 2 | # test printing of the parse-tree 3 | 4 | for i in (): 5 | pass 6 | a = None 7 | b = 'str' 8 | c = 'a very long str that will not be interned' 9 | d = b'bytes' 10 | e = b'a very long bytes that will not be interned' 11 | f = 123456789012345678901234567890 12 | g = 123 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/cmd_verbose.py: -------------------------------------------------------------------------------- 1 | # cmdline: -v -v 2 | # test verbose output 3 | print(1) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/repl_autocomplete.py: -------------------------------------------------------------------------------- 1 | # tests for autocompletion 2 | impo sys 3 | not_exist.  4 | not_exist  5 | x = '123' 6 | 1, x.isdi () 7 | i = str 8 | i.lowe ('ABC') 9 | None.  10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/repl_basic.py: -------------------------------------------------------------------------------- 1 | # basic REPL tests 2 | print(1) 3 |  4 | 2 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/repl_basic.py.exp: -------------------------------------------------------------------------------- 1 | MicroPython \.\+ version 2 | Use \.\+ 3 | >>> # basic REPL tests 4 | >>> print(1) 5 | 1 6 | >>> print(1) 7 | 1 8 | >>> 2 9 | 2 10 | >>> 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cmdline/repl_emacs_keys.py: -------------------------------------------------------------------------------- 1 | # REPL tests of GNU-ish readline navigation 2 | # history buffer navigation 3 | 1 4 | 2 5 | 3 6 |  7 |  8 | # input line motion 9 | t = 12 10 | 'boofar fbar' 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/core_function_userattr.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Core,Functions 3 | description: User-defined attributes for functions are not supported 4 | cause: MicroPython is highly optimized for memory usage. 5 | workaround: Use external dictionary, e.g. ``FUNC_X[f] = 0``. 6 | """ 7 | def f(): 8 | pass 9 | 10 | f.x = 0 11 | print(f.x) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/cpydiff/modules/__init__.py -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules/foo.py: -------------------------------------------------------------------------------- 1 | print('foo') 2 | xxx 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules/subpkg/foo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/cpydiff/modules/subpkg/foo.py -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules2/subpkg/bar.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/cpydiff/modules2/subpkg/bar.py -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules_array_containment.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Modules,array 3 | description: Looking for integer not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | import array 8 | print(1 in array.array('B', b'12')) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules_array_deletion.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Modules,array 3 | description: Array deletion not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | import array 8 | a = array.array('b', (1, 2, 3)) 9 | del a[1] 10 | print(a) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules_array_subscrstep.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Modules,array 3 | description: Subscript with step != 1 is not yet implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | import array 8 | a = array.array('b', (1, 2, 3)) 9 | print(a[3:2:2]) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules_deque.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Modules,deque 3 | description: Deque not implemented 4 | cause: Unknown 5 | workaround: Use regular lists. micropython-lib has implementation of collections.deque. 6 | """ 7 | import collections 8 | D = collections.deque() 9 | print(D) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules_struct_fewargs.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Modules,struct 3 | description: Struct pack with too few args, not checked by uPy 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | import struct 8 | try: 9 | print(struct.pack('bb', 1)) 10 | print('Should not get here') 11 | except: 12 | print('struct.error') 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/modules_sys_stdassign.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Modules,sys 3 | description: Overriding sys.stdin, sys.stdout and sys.stderr not possible 4 | cause: They are stored in read-only memory. 5 | workaround: Unknown 6 | """ 7 | import sys 8 | sys.stdin = None 9 | print(sys.stdin) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/syntax_unicode_nameesc.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Syntax,Unicode 3 | description: Unicode name escapes are not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | print("\N{LATIN SMALL LETTER A}") 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_bytearray_sliceassign.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,bytearray 3 | description: Array slice assignment with unsupported RHS 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | b = bytearray(4) 8 | b[0:1] = [1, 2] 9 | print(b) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_bytes_keywords.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,bytes 3 | description: bytes() with keywords not implemented 4 | cause: Unknown 5 | workaround: Pass the encoding as a positional paramter, e.g. ``print(bytes('abc', 'utf-8'))`` 6 | """ 7 | print(bytes('abc', encoding='utf8')) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_bytes_subscrstep.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,bytes 3 | description: Bytes subscription with step != 1 not implemented 4 | cause: MicroPython is highly optimized for memory usage. 5 | workaround: Use explicit loop for this very rare operation. 6 | """ 7 | print(b'123'[0:3:2]) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_exception_chaining.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,Exception 3 | description: Exception chaining not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | try: 8 | raise TypeError 9 | except TypeError: 10 | raise ValueError 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_exception_instancevar.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,Exception 3 | description: User-defined attributes for builtin exceptions are not supported 4 | cause: MicroPython is highly optimized for memory usage. 5 | workaround: Use user-defined exception subclasses. 6 | """ 7 | e = Exception() 8 | e.x = 0 9 | print(e.x) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_float_rounding.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,float 3 | description: uPy and CPython outputs formats may differ 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | print('%.1g' % -9.9) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_list_delete_subscrstep.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,list 3 | description: List delete with step != 1 not implemented 4 | cause: Unknown 5 | workaround: Use explicit loop for this rare operation. 6 | """ 7 | l = [1, 2, 3, 4] 8 | del l[0:4:2] 9 | print(l) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_list_store_noniter.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,list 3 | description: List slice-store with non-iterable on RHS is not implemented 4 | cause: RHS is restricted to be a tuple or list 5 | workaround: Use ``list()`` on RHS to convert the iterable to a list 6 | """ 7 | l = [10, 20] 8 | l[0:1] = range(4) 9 | print(l) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_list_store_subscrstep.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,list 3 | description: List store with step != 1 not implemented 4 | cause: Unknown 5 | workaround: Use explicit loop for this rare operation. 6 | """ 7 | l = [1, 2, 3, 4] 8 | l[0:4:2] = [5, 6] 9 | print(l) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_str_endswith.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,str 3 | description: Start/end indices such as str.endswith(s, start) not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | print('abc'.endswith('c', 1)) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_str_formatsubscr.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,str 3 | description: Attributes/subscr not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | print('{a[0]}'.format(a=[1, 2])) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_str_keywords.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,str 3 | description: str(...) with keywords not implemented 4 | cause: Unknown 5 | workaround: Input the encoding format directly. eg ``print(bytes('abc', 'utf-8'))`` 6 | """ 7 | print(str(b'abc', encoding='utf8')) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_str_rsplitnone.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,str 3 | description: None as first argument for rsplit such as str.rsplit(None, n) not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | print('a a a'.rsplit(None, 1)) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_str_subclassequality.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,str 3 | description: Instance of a subclass of str cannot be compared for equality with an instance of a str 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | class S(str): 8 | pass 9 | 10 | s = S('hello') 11 | print(s == 'hello') 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_str_subscrstep.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,str 3 | description: Subscript with step != 1 is not yet implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | print('abcdefghi'[0:9:2]) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/cpydiff/types_tuple_subscrstep.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,tuple 3 | description: Tuple load with step != 1 not implemented 4 | cause: Unknown 5 | workaround: Unknown 6 | """ 7 | print((1, 2, 3, 4)[0:4:2]) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/framebuf8.py.exp: -------------------------------------------------------------------------------- 1 | --8<-- 2 | 5555555555555555 3 | 5555555555555555 4 | 5555555555555555 5 | 5555555555555555 6 | 5555555555555555 7 | -->8-- 8 | --8<-- 9 | 1155555555555522 10 | 5555555555555555 11 | 5555555555555555 12 | 5555555555555555 13 | 33555555555555ff 14 | -->8-- 15 | 0x33 0x55 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/framebuf_subclass.py.exp: -------------------------------------------------------------------------------- 1 | b'\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x03\x04\x03\x04\x03' 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/machine1.py.exp: -------------------------------------------------------------------------------- 1 | <8-bit memory> 2 | ValueError 3 | ValueError 4 | TypeError 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/machine_pinbase.py.exp: -------------------------------------------------------------------------------- 1 | __init__ 2 | value: None 3 | 1 4 | value: None 5 | 0 6 | value: None 7 | 1 8 | value: 1 9 | value: 0 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/machine_pulse.py.exp: -------------------------------------------------------------------------------- 1 | value: 1 2 | value: 0 3 | 4 | value: 1 5 | value: 0 6 | value: 1 7 | 8 | -2 9 | -1 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/machine_signal.py.exp: -------------------------------------------------------------------------------- 1 | 0 0 2 | 1 1 3 | 1 0 4 | 0 1 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ticks_diff.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/time_ms_us.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ubinascii_micropython.py.exp: -------------------------------------------------------------------------------- 1 | b'31:32:33' 2 | b'' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ucryptolib_aes128_cbc.py.exp: -------------------------------------------------------------------------------- 1 | b'\x1d\x84\xfa\xaa%\x0e9\x143\x8b6\xf8\xdf^yh\xd0\x94g\xf4\xcf\x1d\xa0I)\x8a\xa0\x00u0+C' 2 | b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ucryptolib_aes128_ecb.py.exp: -------------------------------------------------------------------------------- 1 | b'Iz\xfe9\x17\xac\xa4X\x12\x04\x10\xf5K~#\xc7\xac;\xf9\xc6E\xa8\xca~\xf1\xee\xd3f%\xf1\x8d\xfe' 2 | b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ucryptolib_aes128_ecb_enc.py.exp: -------------------------------------------------------------------------------- 1 | b'Iz\xfe9\x17\xac\xa4X\x12\x04\x10\xf5K~#\xc7\xac;\xf9\xc6E\xa8\xca~\xf1\xee\xd3f%\xf1\x8d\xfe' 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ucryptolib_aes128_ecb_inpl.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'Iz\xfe9\x17\xac\xa4X\x12\x04\x10\xf5K~#\xc7\xac;\xf9\xc6E\xa8\xca~\xf1\xee\xd3f%\xf1\x8d\xfe') 2 | bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f') 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ucryptolib_aes128_ecb_into.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'Iz\xfe9\x17\xac\xa4X\x12\x04\x10\xf5K~#\xc7\xac;\xf9\xc6E\xa8\xca~\xf1\xee\xd3f%\xf1\x8d\xfe') 2 | bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f') 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ucryptolib_aes256_cbc.py.exp: -------------------------------------------------------------------------------- 1 | b'\xb4\x0b\xff\xdd\xfc\xb5\x03\x88[m\xc1\x01+:\x03M\x18\xb03\x0f\x971g\x10\xb1\x98>\x9b\x17\xb7-\xb2' 2 | b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ucryptolib_aes256_ecb.py.exp: -------------------------------------------------------------------------------- 1 | b'\xe2\xe0\xdd\xef\xc3\xcd\x88/!>\xf6\xa2\xef/\xd15z+`\xb2\xb2\xd7}!:V>\xeb\x19\xbf|\xea' 2 | b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_array_assign_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x11 2 | 0x2233 3 | 0x4455 4 | 0x66778899 5 | True 6 | 0xaabbccdd 7 | True 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_array_assign_native_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x11 2 | 0x2233 3 | 0x4455 4 | 0x66778899 5 | True 6 | 0x11 7 | 0x1122 8 | 0x11223344 9 | IndexError 10 | TypeError 11 | TypeError 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_array_assign_native_le_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 0x11223344 2 | 0x11223344 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_bytearray.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'01') 2 | 3 | bytearray(b'0123') 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_byteat.py: -------------------------------------------------------------------------------- 1 | try: 2 | import uctypes 3 | except ImportError: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | data = bytearray(b'01234567') 8 | 9 | print(uctypes.bytes_at(uctypes.addressof(data), 4)) 10 | print(uctypes.bytearray_at(uctypes.addressof(data), 4)) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_byteat.py.exp: -------------------------------------------------------------------------------- 1 | b'0123' 2 | bytearray(b'0123') 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_error.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | TypeError 3 | TypeError 4 | TypeError 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x3130 2 | 48 49 3 | TypeError 4 | arr: 48 49 5 | arr of struct: 48 49 6 | IndexError 7 | bf: 48 49 8 | bf 4bit: 3 1 3 0 9 | bytearray(b'21') 10 | bytearray(b'2Q') 11 | bytearray(b'5123') 12 | bytearray(b'51R3') 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_le_float.py.exp: -------------------------------------------------------------------------------- 1 | 12.3400 2 | 12.3400 3 | 12.3400 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_native_float.py.exp: -------------------------------------------------------------------------------- 1 | 12.3400 2 | 12.3400 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_native_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x3130 2 | 48 49 3 | TypeError 4 | arr: 48 49 5 | arr of struct: 48 49 6 | IndexError 7 | bf: 48 49 8 | bf 4bit: 3 1 3 0 9 | bytearray(b'21') 10 | bytearray(b'2Q') 11 | bytearray(b'5123') 12 | bytearray(b'51R3') 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_print.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_ptr_le.py.exp: -------------------------------------------------------------------------------- 1 | 48 2 | 49 3 | 0x3130 4 | 48 49 5 | 48 49 6 | 0x3130 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_ptr_native_le.py.exp: -------------------------------------------------------------------------------- 1 | 48 2 | 49 3 | 0x3130 4 | 48 49 5 | 48 49 6 | 0x3130 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_sizeof.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | 4 4 | TypeError 5 | 6 6 | 1 7 | TypeError 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_sizeof_float.py: -------------------------------------------------------------------------------- 1 | try: 2 | import uctypes 3 | except ImportError: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | print(uctypes.sizeof({'f':uctypes.FLOAT32})) 8 | print(uctypes.sizeof({'f':uctypes.FLOAT64})) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_sizeof_float.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | 8 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_sizeof_layout.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | TypeError 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_sizeof_native.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/extmod/uctypes_sizeof_native.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uctypes_sizeof_od.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | 4 4 | TypeError 5 | 6 6 | 1 7 | TypeError 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ujson_dumps_extra.py: -------------------------------------------------------------------------------- 1 | # test uPy ujson behaviour that's not valid in CPy 2 | 3 | try: 4 | import ujson 5 | except ImportError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | print(ujson.dumps(b'1234')) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ujson_dumps_extra.py.exp: -------------------------------------------------------------------------------- 1 | "1234" 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ujson_dumps_float.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ujson as json 3 | except ImportError: 4 | try: 5 | import json 6 | except ImportError: 7 | print("SKIP") 8 | raise SystemExit 9 | 10 | print(json.dumps(1.2)) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_debug.py: -------------------------------------------------------------------------------- 1 | # test printing debugging info when compiling 2 | try: 3 | import ure 4 | except ImportError: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | ure.compile('^a|b[0-9]\w$', ure.DEBUG) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_debug.py.exp: -------------------------------------------------------------------------------- 1 | 0: rsplit 5 (3) 2 | 2: any 3 | 3: jmp 0 (-5) 4 | 5: save 0 5 | 7: split 14 (5) 6 | 9: assert bol 7 | 10: char a 8 | 12: jmp 23 (9) 9 | 14: char b 10 | 16: class 1 0x30-0x39 11 | 20: namedclass w 12 | 22: assert eol 13 | 23: save 1 14 | 25: match 15 | Bytes: 26, insts: 14 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_split_empty.py.exp: -------------------------------------------------------------------------------- 1 | ['a b c foobar'] 2 | ['foo'] 3 | ['axbc'] 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_split_notimpl.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ure as re 3 | except ImportError: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | r = re.compile('( )') 8 | try: 9 | s = r.split("a b c foobar") 10 | except NotImplementedError: 11 | print('NotImplementedError') 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_split_notimpl.py.exp: -------------------------------------------------------------------------------- 1 | NotImplementedError 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_stack_overflow.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ure as re 3 | except ImportError: 4 | try: 5 | import re 6 | except ImportError: 7 | print("SKIP") 8 | raise SystemExit 9 | 10 | try: 11 | re.match("(a*)*", "aaa") 12 | except RuntimeError: 13 | print("RuntimeError") 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_stack_overflow.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ure_sub_unmatched.py.exp: -------------------------------------------------------------------------------- 1 | 1-a2 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/ussl_basic.py.exp: -------------------------------------------------------------------------------- 1 | ssl_handshake_status: -256 2 | wrap_socket: OSError(5,) 3 | <_SSLSocket 4 | setblocking: NotImplementedError 5 | 4 6 | b'' 7 | read: OSError(-261,) 8 | read: OSError(9,) 9 | write: OSError(9,) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/utimeq1.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/utimeq_stable.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uzlib_decompio.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | b'h' 3 | 2 4 | b'el' 5 | b'lo' 6 | 7 7 | b'' 8 | b'' 9 | 7 10 | b'0000000000' 11 | b'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' 12 | OSError(22,) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/uzlib_decompio_gz.py.exp: -------------------------------------------------------------------------------- 1 | 16 2 | b'h' 3 | 18 4 | b'el' 5 | b'lo' 6 | 31 7 | b'' 8 | b'' 9 | 31 10 | b'hello' 11 | b'hello' 12 | ValueError 13 | OSError(22,) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/vfs_fat_fileio1.py.exp: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | True 5 | True 6 | hello!world! 7 | 12 8 | h 9 | e 10 | o 11 | d 12 | True 13 | [('foo_dir', 16384, 0, 0)] 14 | MemoryError 15 | x0 16 | x1 17 | x2 18 | x3 19 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/vfs_fat_oldproto.py.exp: -------------------------------------------------------------------------------- 1 | [('file.txt', 32768, 0, 6)] 2 | hello! 3 | [] 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/extmod/vfs_userfs.py.exp: -------------------------------------------------------------------------------- 1 | open /data.txt r 2 | b'some data in a text file\n' 3 | stat /usermod1 4 | stat /usermod1.py 5 | open /usermod1.py r 6 | ioctl 4 0 7 | in usermod1 8 | stat /usermod2 9 | stat /usermod2.py 10 | open /usermod2.py r 11 | ioctl 4 0 12 | in usermod2 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/README: -------------------------------------------------------------------------------- 1 | This directory doesn't contain real tests, but code snippets to detect 2 | various interpreter features, which can't be/inconvenient to detecte by 3 | other means. Scripts here are executed by run-tests at the beginning of 4 | testsuite to decide what other test groups to run/exclude. 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/async_check.py: -------------------------------------------------------------------------------- 1 | # check if async/await keywords are supported 2 | async def foo(): 3 | await 1 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/async_check.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/async_check.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/byteorder.py: -------------------------------------------------------------------------------- 1 | import sys 2 | print(sys.byteorder) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/byteorder.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/byteorder.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/complex.py: -------------------------------------------------------------------------------- 1 | try: 2 | complex 3 | print("complex") 4 | except NameError: 5 | print("no") 6 | 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/complex.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/complex.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/const.py: -------------------------------------------------------------------------------- 1 | x = const(1) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/const.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/const.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/coverage.py: -------------------------------------------------------------------------------- 1 | try: 2 | extra_coverage 3 | print('coverage') 4 | except NameError: 5 | print('no') 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/coverage.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/coverage.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/float.py.exp: -------------------------------------------------------------------------------- 1 | 64 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/int_big.py: -------------------------------------------------------------------------------- 1 | # Check whether arbitrary-precision integers (MPZ) are supported 2 | print(1000000000000000000000000000000000000000000000) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/int_big.py.exp: -------------------------------------------------------------------------------- 1 | 1000000000000000000000000000000000000000000000 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/native_check.py: -------------------------------------------------------------------------------- 1 | # this test for the availability of native emitter 2 | @micropython.native 3 | def f(): 4 | pass 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/native_check.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/native_check.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/repl_emacs_check.py: -------------------------------------------------------------------------------- 1 | # Check for emacs keys in REPL 2 | t = +11 3 | t == 2 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/repl_emacs_check.py.exp: -------------------------------------------------------------------------------- 1 | MicroPython \.\+ version 2 | Use \.\+ 3 | >>> # Check for emacs keys in REPL 4 | >>> t = \.\+ 5 | >>> t == 2 6 | True 7 | >>> 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/reverse_ops.py: -------------------------------------------------------------------------------- 1 | class Foo: 2 | 3 | def __radd__(self, other): 4 | pass 5 | 6 | try: 7 | 5 + Foo() 8 | except TypeError: 9 | print("TypeError") 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/reverse_ops.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/reverse_ops.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/set_check.py: -------------------------------------------------------------------------------- 1 | # check if set literal syntax is supported 2 | {1} 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/feature_check/set_check.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/feature_check/set_check.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/array_construct.py: -------------------------------------------------------------------------------- 1 | # test construction of array from array with float type 2 | 3 | try: 4 | from array import array 5 | except ImportError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | print(array('f', array('h', [1, 2]))) 10 | print(array('d', array('f', [1, 2]))) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/builtin_float_abs.py: -------------------------------------------------------------------------------- 1 | # test builtin abs function with float args 2 | 3 | for val in ( 4 | '1.0', 5 | '-1.0', 6 | '0.0', 7 | '-0.0', 8 | 'nan', 9 | '-nan', 10 | 'inf', 11 | '-inf', 12 | ): 13 | print(val, abs(float(val))) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/builtin_float_pow.py: -------------------------------------------------------------------------------- 1 | # test builtin pow function with float args 2 | 3 | print(pow(0.0, 0.0)) 4 | print(pow(0, 1.0)) 5 | print(pow(1.0, 1)) 6 | print(pow(2.0, 3.0)) 7 | print(pow(2.0, -4.0)) 8 | 9 | print(pow(0.0, float('inf'))) 10 | print(pow(0.0, float('-inf'))) 11 | print(pow(0.0, float('nan'))) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/builtin_float_round_intbig.py: -------------------------------------------------------------------------------- 1 | # test round() with floats that return large integers 2 | 3 | for x in (-1e25, 1e25): 4 | print('%.3g' % round(x)) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/bytearray_construct.py: -------------------------------------------------------------------------------- 1 | # test construction of bytearray from array with float type 2 | 3 | try: 4 | from array import array 5 | except ImportError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | print(bytearray(array('f', [1, 2.3]))) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/bytes_construct.py: -------------------------------------------------------------------------------- 1 | # test construction of bytearray from array with float type 2 | 3 | try: 4 | from array import array 5 | except ImportError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | print(bytes(array('f', [1, 2.3]))) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/complex1_intbig.py: -------------------------------------------------------------------------------- 1 | # test basic complex number functionality 2 | 3 | # convert bignum to complex on rhs 4 | ans = 1j + (1 << 70); print("%.5g %.5g" % (ans.real, ans.imag)) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/int_divzero.py: -------------------------------------------------------------------------------- 1 | try: 2 | 1 / 0 3 | except ZeroDivisionError: 4 | print("ZeroDivisionError") 5 | 6 | try: 7 | 0 ** -1 8 | except ZeroDivisionError: 9 | print("ZeroDivisionError") 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/int_power.py: -------------------------------------------------------------------------------- 1 | # negative power should produce float 2 | 3 | x = 2 4 | print(x ** -2) 5 | 6 | x = 3 7 | x **= -2 8 | print('%.5f' % x) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/list_index.py: -------------------------------------------------------------------------------- 1 | x = [1, 2] 2 | 3 | print(x[1]) 4 | 5 | try: 6 | print(x[1.0]) 7 | except TypeError: 8 | print("TypeError") 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/math_fun_intbig.py: -------------------------------------------------------------------------------- 1 | # test the math functions that return ints, with very large results 2 | 3 | try: 4 | import math 5 | except ImportError: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | for fun in (math.ceil, math.floor, math.trunc): 10 | for x in (-1e25, 1e25): 11 | print('%.3g' % fun(x)) 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/python36.py: -------------------------------------------------------------------------------- 1 | # tests for things that only Python 3.6 supports, needing floats 2 | 3 | # underscores in numeric literals 4 | print(1_000.1_8) 5 | print('%.2g' % 1e1_2) 6 | 7 | # underscore supported by int/float constructors 8 | print(float('1_2_3')) 9 | print(float('1_2_3.4')) 10 | print('%.2g' % float('1e1_3')) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/python36.py.exp: -------------------------------------------------------------------------------- 1 | 1000.18 2 | 1e+12 3 | 123.0 4 | 123.4 5 | 1e+13 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/string_format_modulo3.py: -------------------------------------------------------------------------------- 1 | # uPy and CPython outputs differ for the following 2 | print("%.1g" % -9.9) # round up 'g' with '-' sign 3 | print("%.2g" % 99.9) # round up 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/string_format_modulo3.py.exp: -------------------------------------------------------------------------------- 1 | -10 2 | 100 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/true_value.py: -------------------------------------------------------------------------------- 1 | # Test true-ish value handling 2 | 3 | if not 0.0: 4 | print("float 0") 5 | 6 | if not 0+0j: 7 | print("complex 0") 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/float/types.py: -------------------------------------------------------------------------------- 1 | # float types 2 | 3 | print(float) 4 | print(complex) 5 | 6 | print(type(float()) == float) 7 | print(type(complex()) == complex) 8 | 9 | print(type(0.0) == float) 10 | print(type(1j) == complex) 11 | 12 | # hashing float types 13 | 14 | d = dict() 15 | d[float] = complex 16 | d[complex] = float 17 | print(len(d)) 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/gen_context.py: -------------------------------------------------------------------------------- 1 | import gen_context2 2 | 3 | GLOBAL = "GLOBAL" 4 | 5 | def gen(): 6 | print(GLOBAL) 7 | yield 1 8 | 9 | gen_context2.call(gen()) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/gen_context2.py: -------------------------------------------------------------------------------- 1 | def call(g): 2 | next(g) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import1a.py: -------------------------------------------------------------------------------- 1 | import import1b 2 | print(import1b.var) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import1b.py: -------------------------------------------------------------------------------- 1 | var = 123 2 | 3 | def throw(): 4 | raise ValueError 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import2a.py: -------------------------------------------------------------------------------- 1 | from import1b import var 2 | print(var) 3 | 4 | from import1b import var as var2 5 | print(var2) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import3a.py: -------------------------------------------------------------------------------- 1 | from import1b import * 2 | print(var) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import_file.py: -------------------------------------------------------------------------------- 1 | import import1b 2 | print(import1b.__file__) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import_pkg3.py: -------------------------------------------------------------------------------- 1 | from pkg import mod 2 | 3 | print(mod.foo()) 4 | 5 | import pkg.mod 6 | print(mod is pkg.mod) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import_pkg4.py: -------------------------------------------------------------------------------- 1 | # Testing that "recursive" imports (pkg2/__init__.py imports from pkg2) work 2 | import pkg2 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import_pkg5.py: -------------------------------------------------------------------------------- 1 | # This tests relative imports as used in pkg3 2 | import pkg3 3 | import pkg3.mod1 4 | import pkg3.subpkg1.mod1 5 | 6 | pkg3.subpkg1.mod1.foo() 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import_pkg6.py: -------------------------------------------------------------------------------- 1 | # This tests relative imports as used in pkg6 2 | import pkg6 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import_pkg7.py: -------------------------------------------------------------------------------- 1 | # This tests ... relative imports as used in pkg7 and imports beyond package root 2 | import pkg7.subpkg1.subpkg2.mod3 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/import_pkg8.py: -------------------------------------------------------------------------------- 1 | # import with no __init__.py files 2 | import pkg8.mod 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/module_getattr.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/mpy_invalid.py.exp: -------------------------------------------------------------------------------- 1 | mod0 ValueError incompatible .mpy file 2 | mod1 ValueError incompatible .mpy file 3 | mod2 ValueError incompatible .mpy file 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/import/pkg/__init__.py -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg/mod.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | return 42 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg2/__init__.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod1 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg2/mod1.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod2 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg2/mod2.py: -------------------------------------------------------------------------------- 1 | print("in mod2") 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg3/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg3/mod1.py: -------------------------------------------------------------------------------- 1 | print("mod1 __name__:", __name__) 2 | from . import mod2 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg3/mod2.py: -------------------------------------------------------------------------------- 1 | print("mod2 __name__:", __name__) 2 | print("in mod2") 3 | 4 | def foo(): 5 | print("mod2.foo()") 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg3/subpkg1/__init__.py: -------------------------------------------------------------------------------- 1 | print("subpkg1 __name__:", __name__) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg3/subpkg1/mod1.py: -------------------------------------------------------------------------------- 1 | print("subpkg1.mod1 __name__:", __name__) 2 | from ..mod2 import foo 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg6/__init__.py: -------------------------------------------------------------------------------- 1 | from .x import * 2 | print('init') 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg6/x/__init__.py: -------------------------------------------------------------------------------- 1 | from .y import * 2 | print('x') 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg6/x/y.py: -------------------------------------------------------------------------------- 1 | print('y') 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg7/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg7/mod1.py: -------------------------------------------------------------------------------- 1 | print('mod1') 2 | foo = 'mod1.foo' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg7/mod2.py: -------------------------------------------------------------------------------- 1 | print('mod2') 2 | bar = 'mod2.bar' 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg7/subpkg1/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg7/subpkg1/subpkg2/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg7/subpkg1/subpkg2/mod3.py: -------------------------------------------------------------------------------- 1 | from ... import mod1 2 | from ...mod2 import bar 3 | print(mod1.foo) 4 | print(bar) 5 | 6 | # attempted relative import beyond top-level package 7 | try: 8 | from .... import mod1 9 | except ValueError: 10 | print('ValueError') 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/pkg8/mod.py: -------------------------------------------------------------------------------- 1 | print('foo') 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/import/rel_import_inv.py: -------------------------------------------------------------------------------- 1 | try: 2 | from . import foo 3 | except: 4 | print("Invalid relative import caught") 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmargs.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 6 5 | 10 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmbcc.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 10 3 | 20 4 | 30 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmbitops.py: -------------------------------------------------------------------------------- 1 | @micropython.asm_thumb 2 | def clz(r0): 3 | clz(r0, r0) 4 | 5 | print(clz(0xf0)) 6 | print(clz(0x8000)) 7 | 8 | @micropython.asm_thumb 9 | def rbit(r0): 10 | rbit(r0, r0) 11 | 12 | print(hex(rbit(0xf0))) 13 | print(hex(rbit(0x8000))) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmbitops.py.exp: -------------------------------------------------------------------------------- 1 | 24 2 | 16 3 | 0xf000000 4 | 0x10000 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmblbx.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmconst.py: -------------------------------------------------------------------------------- 1 | # test constants in assembler 2 | 3 | @micropython.asm_thumb 4 | def c1(): 5 | movwt(r0, 0xffffffff) 6 | movwt(r1, 0xf0000000) 7 | sub(r0, r0, r1) 8 | print(hex(c1())) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmconst.py.exp: -------------------------------------------------------------------------------- 1 | 0xfffffff 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmdiv.py.exp: -------------------------------------------------------------------------------- 1 | 411 2 | -411 3 | -411 4 | 411 5 | 411 6 | 2 7 | 1 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmfpaddsub.py.exp: -------------------------------------------------------------------------------- 1 | 90 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmfpcmp.py: -------------------------------------------------------------------------------- 1 | @micropython.asm_thumb # test vcmp, vmrs 2 | def f(r0, r1): 3 | vmov(s0, r0) 4 | vcvt_f32_s32(s0, s0) 5 | vmov(s1, r1) 6 | vcvt_f32_s32(s1, s1) 7 | vcmp(s1, s0) 8 | vmrs(r0, FPSCR) 9 | mov(r1, 28) 10 | lsr(r0, r1) 11 | 12 | print(f(0,1)) 13 | print(f(1,1)) 14 | print(f(1,0)) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmfpcmp.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 6 3 | 8 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmfpldrstr.py: -------------------------------------------------------------------------------- 1 | import array 2 | @micropython.asm_thumb # test vldr, vstr 3 | def arrayadd(r0): 4 | vldr(s0, [r0, 0]) 5 | vldr(s1, [r0, 4]) 6 | vadd(s2, s0, s1) 7 | vstr(s2, [r0, 8]) 8 | 9 | z = array.array("f", [2, 4, 10]) 10 | arrayadd(z) 11 | print(z[2]) 12 | 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmfpldrstr.py.exp: -------------------------------------------------------------------------------- 1 | 6.0 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmfpmuldiv.py.exp: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmfpsqrt.py.exp: -------------------------------------------------------------------------------- 1 | -160 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmit.py.exp: -------------------------------------------------------------------------------- 1 | 100 1 2 | 100 200 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmpushpop.py: -------------------------------------------------------------------------------- 1 | @micropython.asm_thumb 2 | def f(r0, r1, r2): 3 | push({r0}) 4 | push({r1, r2}) 5 | pop({r0}) 6 | pop({r1, r2}) 7 | 8 | print(f(0, 1, 2)) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmpushpop.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmrettype.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | False True 3 | 0 0x20000000 0x40000000 -0x80000000 4 | 0 0x20000000 0x40000000 0x80000000 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmshift.py.exp: -------------------------------------------------------------------------------- 1 | 0x246 2 | 0x800000 3 | 0x91 4 | 0x1 5 | 0x91 6 | -0x1 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmspecialregs.py: -------------------------------------------------------------------------------- 1 | @micropython.asm_thumb 2 | def getIPSR(): 3 | mrs(r0, IPSR) 4 | 5 | @micropython.asm_thumb 6 | def getBASEPRI(): 7 | mrs(r0, BASEPRI) 8 | 9 | print(getBASEPRI()) 10 | print(getIPSR()) 11 | 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmspecialregs.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/inlineasm/asmsum.py.exp: -------------------------------------------------------------------------------- 1 | array('l', [100, 200, 300, 400]) 1000 2 | array('b', [10, 20, 30, 40, 50, 60, 70, 80]) 360 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/argv.py: -------------------------------------------------------------------------------- 1 | import sys 2 | print(sys.argv) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/data/file1: -------------------------------------------------------------------------------- 1 | longer line1 2 | line2 3 | line3 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/data/file2: -------------------------------------------------------------------------------- 1 | 1234 -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/file_iter.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/file1") 2 | for l in f: 3 | print(l) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/file_long_read.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/file1") 2 | b = f.read(100) 3 | print(len(b)) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/file_long_read2.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/bigfile1") 2 | b = f.read() 3 | print(len(b)) 4 | print(b) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/file_long_read3.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/bigfile1", "rb") 2 | b = f.read(512) 3 | print(len(b)) 4 | print(b) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/file_readinto_len.py: -------------------------------------------------------------------------------- 1 | b = bytearray(30) 2 | f = open("io/data/file1", "rb") 3 | # 2nd arg (length to read) is extension to CPython 4 | print(f.readinto(b, 8)) 5 | print(b) 6 | 7 | b = bytearray(4) 8 | f = open("io/data/file1", "rb") 9 | print(f.readinto(b, 8)) 10 | print(b) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/file_readinto_len.py.exp: -------------------------------------------------------------------------------- 1 | 8 2 | bytearray(b'longer l\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 3 | 4 4 | bytearray(b'long') 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/file_stdio.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.stdin.fileno()) 4 | print(sys.stdout.fileno()) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/io/resource_stream.py.exp: -------------------------------------------------------------------------------- 1 | 1234 2 | 1234 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/jni/list.py: -------------------------------------------------------------------------------- 1 | import jni 2 | try: 3 | ArrayList = jni.cls("java/util/ArrayList") 4 | except: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | l = ArrayList() 9 | print(l) 10 | l.add("one") 11 | l.add("two") 12 | 13 | print(l.toString()) 14 | print(l) 15 | print(l[0], l[1]) 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/jni/list.py.exp: -------------------------------------------------------------------------------- 1 | [] 2 | [one, two] 3 | [one, two] 4 | one two 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/jni/object.py.exp: -------------------------------------------------------------------------------- 1 | 42 2 | 42 3 | 42 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/jni/system_out.py: -------------------------------------------------------------------------------- 1 | try: 2 | import jni 3 | System = jni.cls("java/lang/System") 4 | except: 5 | print("SKIP") 6 | raise SystemExit 7 | 8 | System.out.println("Hello, Java!") 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/jni/system_out.py.exp: -------------------------------------------------------------------------------- 1 | Hello, Java! 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/const.py.exp: -------------------------------------------------------------------------------- 1 | 123 580 2 | 123 580 3 | 12 46 4 | 1 2 5 | True False 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/const2.py.exp: -------------------------------------------------------------------------------- 1 | 2 | function X 1 3 | class X 1 4 | method X 2 4 4 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/const_error.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 0xffffffff 0xffffffffffffffff 2 | 0x100000000fffffffe 0x100000000000000000ffffffff 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/decorator.py: -------------------------------------------------------------------------------- 1 | # test micropython-specific decorators 2 | 3 | @micropython.bytecode 4 | def f(): 5 | return 'bytecode' 6 | 7 | print(f()) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/decorator.py.exp: -------------------------------------------------------------------------------- 1 | bytecode 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/decorator_error.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/emg_exc.py.exp: -------------------------------------------------------------------------------- 1 | Traceback (most recent call last): 2 | , line 20, in f 3 | ValueError: 1 4 | 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/extreme_exc.py.exp: -------------------------------------------------------------------------------- 1 | Exception() 2 | TypeError( 3 | TypeError( 4 | RuntimeError( 5 | Exception('my exception',) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heap_lock.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | MemoryError 3 | [] 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 0 2 5 | 0 0 6 | 1 7 | 3 8 | 1 9 | 1 2 10 | 1 1 11 | 1 2 3 4 10 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_bytesio.py.exp: -------------------------------------------------------------------------------- 1 | b'1234123412341234123412341234123412341234123412341234123412341234' 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_bytesio2.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_exc_raise.py.exp: -------------------------------------------------------------------------------- 1 | error 2 | ok 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_inst_call.py.exp: -------------------------------------------------------------------------------- 1 | __call__ 2 | __call__ 1 3 | __call__ 1 2 4 | __call__ 1 2 3 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_int_from_bytes.py.exp: -------------------------------------------------------------------------------- 1 | 49 2 | 12849 3 | 50 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_str.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/micropython/heapalloc_str.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_super.py.exp: -------------------------------------------------------------------------------- 1 | B foo 2 | A foo 3 | 42 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/heapalloc_traceback.py.exp: -------------------------------------------------------------------------------- 1 | StopIteration 2 | Traceback (most recent call last): 3 | File , line 23, in test 4 | StopIteration: 5 | 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/kbd_intr.py: -------------------------------------------------------------------------------- 1 | # test the micropython.kbd_intr() function 2 | 3 | import micropython 4 | 5 | try: 6 | micropython.kbd_intr 7 | except AttributeError: 8 | print('SKIP') 9 | raise SystemExit 10 | 11 | # just check we can actually call it 12 | micropython.kbd_intr(3) 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/kbd_intr.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/micropython/tests/micropython/kbd_intr.py.exp -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/memstats.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_closure.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 9 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_const.py: -------------------------------------------------------------------------------- 1 | # test loading constants in native functions 2 | 3 | @micropython.native 4 | def f(): 5 | return b'bytes' 6 | print(f()) 7 | 8 | @micropython.native 9 | def f(): 10 | @micropython.native 11 | def g(): 12 | return 123 13 | return g 14 | print(f()()) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_const.py.exp: -------------------------------------------------------------------------------- 1 | b'bytes' 2 | 123 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_const_intbig.py: -------------------------------------------------------------------------------- 1 | # check loading constants 2 | 3 | @micropython.native 4 | def f(): 5 | return 123456789012345678901234567890 6 | 7 | print(f()) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 123456789012345678901234567890 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_misc.py.exp: -------------------------------------------------------------------------------- 1 | 1 [] 2 2 | 1 [] 3 3 | 3 4 | 6 5 | True 6 | False 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_try.py.exp: -------------------------------------------------------------------------------- 1 | finally 2 | NameError 3 | finally 4 | NameError 5 | 100 6 | 200 7 | 300 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_try_deep.py.exp: -------------------------------------------------------------------------------- 1 | 8 2 | 7 3 | 6 4 | 5 5 | 4 6 | 3 7 | 2 8 | 1 9 | ValueError 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/native_with.py.exp: -------------------------------------------------------------------------------- 1 | __init__ 2 | __enter__ 3 | 1 4 | __exit__ None None None 5 | __init__ 6 | __enter__ 7 | 1 8 | __exit__ name 'fail' isn't defined None 9 | NameError 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/opt_level.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | True 4 | False 5 | Traceback (most recent call last): 6 | File "", line 1, in 7 | NameError: name 'xyz' isn't defined 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/schedule.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | outer 3 | inner 4 | RuntimeError 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/stack_use.py: -------------------------------------------------------------------------------- 1 | # tests stack_use function in micropython module 2 | import micropython 3 | 4 | if not hasattr(micropython, 'stack_use'): 5 | print('SKIP') 6 | else: 7 | print(type(micropython.stack_use())) # output varies 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/stack_use.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_addr.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | bytearray(b'0000') 4 | bytearray(b'1111') 5 | bytearray(b'2222') 6 | bytearray(b'2233') 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_args.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 1 2 4 | 1 2 3 5 | 1 2 3 4 6 | 1 2 3 4 5 7 | 1 2 3 4 5 6 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_binop_comp.py.exp: -------------------------------------------------------------------------------- 1 | 1 == 1 2 | 1 <= 1 3 | 1 >= 1 4 | 2 > 1 5 | 2 >= 1 6 | 2 != 1 7 | 1 < 2 8 | 1 <= 2 9 | 1 != 2 10 | 2 > -1 11 | 2 >= -1 12 | 2 != -1 13 | -2 < 1 14 | -2 <= 1 15 | -2 != 1 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_binop_comp_imm.py: -------------------------------------------------------------------------------- 1 | # comparisons with immediate boundary values 2 | @micropython.viper 3 | def f(a: int): 4 | print(a == -1, a == -255, a == -256, a == -257) 5 | 6 | f(-1) 7 | f(-255) 8 | f(-256) 9 | f(-257) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_binop_comp_imm.py.exp: -------------------------------------------------------------------------------- 1 | True False False False 2 | False True False False 3 | False False True False 4 | False False False True 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_binop_divmod.py.exp: -------------------------------------------------------------------------------- 1 | 0 -6 2 | 1 0 3 | 1 -1 4 | 1 -2 5 | 2 0 6 | 3 0 7 | 6 0 8 | -6 0 9 | -3 0 10 | -2 0 11 | -2 2 12 | -2 4 13 | -1 0 14 | -1 1 15 | -1 -1 16 | -1 0 17 | -2 -4 18 | -2 -2 19 | -2 0 20 | -3 0 21 | -6 0 22 | 6 0 23 | 3 0 24 | 2 0 25 | 1 2 26 | 1 1 27 | 1 0 28 | 0 6 29 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_binop_multi_comp.py.exp: -------------------------------------------------------------------------------- 1 | 1 == 1 2 | 2 > 1 3 | 2 >= 1 4 | 2 != 1 5 | 1 < 2 6 | 2 > -1 7 | 2 >= -1 8 | 2 != -1 9 | -2 <= 1 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_cond.py.exp: -------------------------------------------------------------------------------- 1 | not x False 2 | x True 3 | y 1 4 | z 65536 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_const.py: -------------------------------------------------------------------------------- 1 | # test loading constants in viper functions 2 | 3 | @micropython.viper 4 | def f(): 5 | return b'bytes' 6 | print(f()) 7 | 8 | @micropython.viper 9 | def f(): 10 | @micropython.viper 11 | def g() -> int: 12 | return 123 13 | return g 14 | print(f()()) 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_const.py.exp: -------------------------------------------------------------------------------- 1 | b'bytes' 2 | 123 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_const_intbig.py: -------------------------------------------------------------------------------- 1 | # check loading constants 2 | 3 | @micropython.viper 4 | def f(): 5 | return 123456789012345678901234567890 6 | 7 | print(f()) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 123456789012345678901234567890 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_globals.py.exp: -------------------------------------------------------------------------------- 1 | NameError 2 | 123 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_import.py: -------------------------------------------------------------------------------- 1 | # test import within viper function 2 | 3 | @micropython.viper 4 | def f(): 5 | import micropython 6 | print(micropython.const(1)) 7 | 8 | from micropython import const 9 | print(const(2)) 10 | f() 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_import.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_misc.py.exp: -------------------------------------------------------------------------------- 1 | 6 2 | 3 3 | 0 4 | Ellipsis 5 | 6 6 | 7 7 | 20 8 | 49994955 9 | 1 1 10 | 1 3 11 | (0, 1, False, True) 12 | (1, 3) 13 | [1, 3] 14 | [1, 3] 15 | OSError(1,) 16 | 1 17 | 1 18 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_misc_intbig.py: -------------------------------------------------------------------------------- 1 | import micropython 2 | 3 | # unsigned ints 4 | @micropython.viper 5 | def viper_uint() -> uint: 6 | return uint(-1) 7 | import sys 8 | print(viper_uint() == (sys.maxsize << 1 | 1)) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_misc_intbig.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_ptr16_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 12849 13363 3 | 26212 4 | 26212 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_ptr16_store.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x00\x00\x00\x00') 2 | bytearray(b'BB\x00\x00') 3 | bytearray(b'BBCC') 4 | bytearray(b'DDDD') 5 | bytearray(b'EEEE') 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_ptr32_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x12\x12\x12\x124444') 2 | 0x12121212 0x34343434 3 | 0x46464646 4 | 0x46464646 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_ptr32_store.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00') 2 | bytearray(b'BBBB\x00\x00\x00\x00') 3 | bytearray(b'BBBBCCCC') 4 | bytearray(b'DDDDDDDD') 5 | bytearray(b'EEEEEEEE') 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_ptr8_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 49 50 3 | 202 4 | 202 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_ptr8_store.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x00\x00\x00\x00') 2 | bytearray(b')\x00\x00\x00') 3 | bytearray(b')*\x00\x00') 4 | bytearray(b'++++') 5 | bytearray(b',,,,') 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_subscr.py.exp: -------------------------------------------------------------------------------- 1 | [1, 2, 3] 2 | 1 3 | 2 4 | 3 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_try.py.exp: -------------------------------------------------------------------------------- 1 | finally 2 | NameError 3 | finally 4 | NameError 5 | 100 6 | 200 7 | 300 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/micropython/viper_with.py.exp: -------------------------------------------------------------------------------- 1 | __init__ 2 | __enter__ 3 | 1 4 | __exit__ None None None 5 | __init__ 6 | __enter__ 7 | 1 8 | __exit__ name 'fail' isn't defined None 9 | NameError 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/misc/non_compliant_lexer.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | SyntaxError 5 | NotImplementedError 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/net_hosted/accept_nonblock.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/net_hosted/accept_timeout.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/net_hosted/connect_nonblock.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/net_hosted/connect_poll.py.exp: -------------------------------------------------------------------------------- 1 | 1 4 2 | 1 3 | 1 4 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/net_hosted/ssl_getpeercert.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/net_inet/README: -------------------------------------------------------------------------------- 1 | This directory contains network tests which require Internet connection. 2 | Note that these tests are not run as part of the main testsuite and need 3 | to be run seperately (from the main test/ directory): 4 | 5 | ./run-tests net_inet/*.py 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/net_inet/test_tls_sites.py.exp: -------------------------------------------------------------------------------- 1 | google.com ok 2 | www.google.com ok 3 | api.telegram.org ok 4 | api.pushbullet.com ok 5 | w9rybpfril.execute-api.ap-southeast-2.amazonaws.com ok 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/accel.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | accel = pyb.Accel() 4 | print(accel) 5 | accel.x() 6 | accel.y() 7 | accel.z() 8 | accel.tilt() 9 | accel.filtered_xyz() 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/accel.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/adc.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 50 4 | 25 5 | 30 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/dac.py.exp: -------------------------------------------------------------------------------- 1 | DAC(1, bits=8) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/extint.py.exp: -------------------------------------------------------------------------------- 1 | 6 2 | line: 6 3 | line: 6 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/halerror.py: -------------------------------------------------------------------------------- 1 | # test hal errors 2 | 3 | import pyb 4 | 5 | i2c = pyb.I2C(2, pyb.I2C.MASTER) 6 | try: 7 | i2c.recv(1, 1) 8 | except OSError as e: 9 | print(repr(e)) 10 | 11 | can = pyb.CAN(1, pyb.CAN.NORMAL) 12 | try: 13 | can.send('1', 1, timeout=50) 14 | except OSError as e: 15 | print(repr(e)) 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/halerror.py.exp: -------------------------------------------------------------------------------- 1 | OSError(5,) 2 | OSError(110,) 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/i2c.py.exp: -------------------------------------------------------------------------------- 1 | ValueError -1 2 | ValueError 0 3 | I2C 1 4 | I2C 2 5 | ValueError 3 6 | I2C X 7 | I2C Y 8 | ValueError Z 9 | [] 10 | [76] 11 | True 12 | b'\x01' 13 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/i2c_error.py.exp: -------------------------------------------------------------------------------- 1 | OSError(5,) 2 | OSError(5,) 3 | OSError(5,) 4 | OSError(5,) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/irq.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True False 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/led.py.exp: -------------------------------------------------------------------------------- 1 | LED(1) 2 | LED(2) 3 | LED(3) 4 | LED(4) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/modstm.py.exp: -------------------------------------------------------------------------------- 1 | 0x8000 2 | 0x0 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/pin.py.exp: -------------------------------------------------------------------------------- 1 | Pin(Pin.cpu.C6, mode=Pin.IN) 2 | C6 3 | 6 4 | 2 5 | Pin(Pin.cpu.C6, mode=Pin.IN, pull=Pin.PULL_UP) 6 | 1 7 | Pin(Pin.cpu.C6, mode=Pin.IN, pull=Pin.PULL_DOWN) 8 | 0 9 | 0 10 | 1 11 | 0 12 | 1 13 | 0 14 | 1 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/pyb1.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | True 4 | 12 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/pyb_f405.py: -------------------------------------------------------------------------------- 1 | # test pyb module on F405 MCUs 2 | 3 | import os, pyb 4 | 5 | if not 'STM32F405' in os.uname().machine: 6 | print('SKIP') 7 | raise SystemExit 8 | 9 | print(pyb.freq()) 10 | print(type(pyb.rng())) 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/pyb_f405.py.exp: -------------------------------------------------------------------------------- 1 | (168000000, 168000000, 42000000, 84000000) 2 | 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/pyb_f411.py: -------------------------------------------------------------------------------- 1 | # test pyb module on F411 MCUs 2 | 3 | import os, pyb 4 | 5 | if not 'STM32F411' in os.uname().machine: 6 | print('SKIP') 7 | raise SystemExit 8 | 9 | print(pyb.freq()) 10 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/pyb_f411.py.exp: -------------------------------------------------------------------------------- 1 | (96000000, 96000000, 24000000, 48000000) 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/servo.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 1500 3 | (630, 2410, 1490, 2460, 2190) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/spi.py.exp: -------------------------------------------------------------------------------- 1 | ValueError -1 2 | ValueError 0 3 | SPI 1 4 | SPI 2 5 | ValueError 3 6 | SPI X 7 | SPI Y 8 | ValueError Z 9 | SPI(1) 10 | SPI(1, SPI.MASTER, baudrate=328125, prescaler=256, polarity=1, phase=0, bits=8) 11 | SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) 12 | OSError 13 | b'\xff' 14 | b'\xff' 15 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/switch.py: -------------------------------------------------------------------------------- 1 | from pyb import Switch 2 | 3 | sw = Switch() 4 | print(sw()) 5 | sw.callback(print) 6 | sw.callback(None) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/switch.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/timer.py: -------------------------------------------------------------------------------- 1 | # check basic functionality of the timer class 2 | 3 | import pyb 4 | from pyb import Timer 5 | 6 | tim = Timer(4) 7 | tim = Timer(4, prescaler=100, period=200) 8 | print(tim.prescaler()) 9 | print(tim.period()) 10 | tim.prescaler(300) 11 | print(tim.prescaler()) 12 | tim.period(400) 13 | print(tim.period()) 14 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/timer.py.exp: -------------------------------------------------------------------------------- 1 | 100 2 | 200 3 | 300 4 | 400 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pyb/timer_callback.py.exp: -------------------------------------------------------------------------------- 1 | before cb1 2 | cb1 3 | before cb2 4 | cb2 5 | before cb1 6 | cb1 7 | before cb4 8 | cb4 3 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pybnative/for.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | @micropython.native 4 | def f1(n): 5 | for i in range(n): 6 | print(i) 7 | 8 | f1(4) 9 | 10 | @micropython.native 11 | def f2(r): 12 | for i in r: 13 | print(i) 14 | 15 | f2(range(4)) 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pybnative/for.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 0 6 | 1 7 | 2 8 | 3 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pybnative/while.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | @micropython.native 4 | def f(led, n, d): 5 | led.off() 6 | i = 0 7 | while i < n: 8 | print(i) 9 | led.toggle() 10 | pyb.delay(d) 11 | i += 1 12 | led.off() 13 | 14 | f(pyb.LED(1), 2, 150) 15 | f(pyb.LED(2), 4, 50) 16 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/pybnative/while.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 1 5 | 2 6 | 3 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/stress/dict_copy.py: -------------------------------------------------------------------------------- 1 | # copying a large dictionary 2 | 3 | a = {i:2*i for i in range(1000)} 4 | b = a.copy() 5 | for i in range(1000): 6 | print(i, b[i]) 7 | print(len(b)) 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/stress/dict_create.py: -------------------------------------------------------------------------------- 1 | # create a large dictionary 2 | 3 | d = {} 4 | x = 1 5 | while x < 1000: 6 | d[x] = x 7 | x += 1 8 | print(d[500]) 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/stress/list_sort.py: -------------------------------------------------------------------------------- 1 | # test large list sorting (should not stack overflow) 2 | l = list(range(2000)) 3 | l.sort() 4 | print(l[0], l[-1]) 5 | l.sort(reverse=True) 6 | print(l[0], l[-1]) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/stress/recursion.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | foo() 3 | 4 | try: 5 | foo() 6 | except RuntimeError: 7 | print("RuntimeError") 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/stress/recursive_data.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/stress/recursive_iternext.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | RuntimeError 3 | RuntimeError 4 | RuntimeError 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/thread/thread_exc2.py: -------------------------------------------------------------------------------- 1 | # test raising exception within thread which is not caught 2 | import utime 3 | import _thread 4 | 5 | def thread_entry(): 6 | raise ValueError 7 | 8 | _thread.start_new_thread(thread_entry, ()) 9 | utime.sleep(1) 10 | print('done') 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/thread/thread_exc2.py.exp: -------------------------------------------------------------------------------- 1 | Unhandled exception in thread started by 2 | Traceback (most recent call last): 3 | File \.\+, line 6, in thread_entry 4 | ValueError: 5 | done 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/data/utf-8_1.txt: -------------------------------------------------------------------------------- 1 | Привет 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/data/utf-8_2.txt: -------------------------------------------------------------------------------- 1 | aαbβcγdδ 2 | ぁ🙐 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/file1.py: -------------------------------------------------------------------------------- 1 | f = open("unicode/data/utf-8_1.txt", encoding="utf-8") 2 | l = f.readline() 3 | print(l) 4 | print(len(l)) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/unicode_chr.py: -------------------------------------------------------------------------------- 1 | # test builtin chr with unicode characters 2 | 3 | print(chr(945)) 4 | print(chr(0x800)) 5 | print(chr(0x10000)) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/unicode_index.py: -------------------------------------------------------------------------------- 1 | print("Привет".find("т")) 2 | print("Привет".find("П")) 3 | print("Привет".rfind("т")) 4 | print("Привет".rfind("П")) 5 | print("Привет".index("т")) 6 | print("Привет".index("П")) 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/unicode_iter.py: -------------------------------------------------------------------------------- 1 | for c in "Hello": 2 | print(c) 3 | for c in "Привет": 4 | print(c) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/unicode_ord.py: -------------------------------------------------------------------------------- 1 | # test builtin ord with unicode characters 2 | 3 | print(ord('α')) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/unicode_pos.py: -------------------------------------------------------------------------------- 1 | # str methods with explicit start/end pos 2 | print("Привет".startswith("П")) 3 | print("Привет".startswith("р", 1)) 4 | print("абвба".find("а", 1)) 5 | print("абвба".find("а", 1, -1)) 6 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/unicode_str_format.py: -------------------------------------------------------------------------------- 1 | # test handling of unicode chars in format strings 2 | 3 | print('α'.format()) 4 | print('{α}'.format(α=1)) 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unicode/unicode_str_modulo.py: -------------------------------------------------------------------------------- 1 | # test handling of unicode chars in string % formatting 2 | 3 | print('α' % ()) 4 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unix/ffi_callback.py.exp: -------------------------------------------------------------------------------- 1 | org string: bytearray(b'foobar') 2 | qsort'ed: bytearray(b'abfoor') 3 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unix/ffi_float.py.exp: -------------------------------------------------------------------------------- 1 | 1.230000 2 | 1.230000 3 | 1.772454 4 | 1.000000 5 | 1.000000 6 | 0.886227 7 | 6.000000 8 | 6.000000 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/unix/ffi_float2.py.exp: -------------------------------------------------------------------------------- 1 | 1.772454 2 | 1.000000 3 | 1.000000 4 | 0.886227 5 | 6.000000 6 | 6.000000 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/modwipy.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | Exception 5 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/pin_irq.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | True 5 | True 6 | True 7 | True 8 | True 9 | True 10 | True 11 | True 12 | True 13 | True 14 | Awake 15 | True 16 | Awake 17 | Exception 18 | Exception 19 | Exception 20 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/reset/reset.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/sd.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exception 5 | Exception 6 | Exception 7 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/skipped/rtc_irq.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | True 5 | True 6 | True 7 | True 8 | True 9 | True 10 | Exception 11 | Exception 12 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/wdt.py.exp: -------------------------------------------------------------------------------- 1 | Exception 2 | Exception 3 | Exception 4 | 5 | Exception 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/wlan/machine.py.exp: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | Active 5 | True 6 | True 7 | Exception 8 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tests/wipy/wlan/server.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | True 5 | True 6 | True 7 | True 8 | Exception 9 | Exception 10 | Exception 11 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tools/.gitattributes: -------------------------------------------------------------------------------- 1 | *.tar.gz binary 2 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tools/.gitignore: -------------------------------------------------------------------------------- 1 | tinytest/.gitignore 2 | tinytest/.travis.yml 3 | tinytest/Makefile 4 | tinytest/Makefile.arm-cortex-m3-qemu 5 | tinytest/Makefile.avr 6 | tinytest/TODO 7 | tinytest/portable_demo.c 8 | tinytest/tinytest_demo.c 9 | -------------------------------------------------------------------------------- /src/openmv/src/micropython/tools/gen-changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "MicroPython change log" 4 | 5 | for t in $(git tag | grep -v v1.0-rc1 | sort -rV); do 6 | echo '' 7 | echo '========' 8 | echo '' 9 | git show -s --format=%cD `git rev-list $t --max-count=1` 10 | echo '' 11 | git tag -l $t -n9999 12 | done 13 | -------------------------------------------------------------------------------- /src/openmv/src/omv/py/py_image.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sipeed/kendryte-openmv/9d3a77f6b651ef630100e590d010c09cfe9bcef3/src/openmv/src/omv/py/py_image.c --------------------------------------------------------------------------------