├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── ccpp.yml │ └── docs.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── ACKNOWLEDGEMENTS ├── CODECONVENTIONS.md ├── CODEOFCONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── Makefile ├── README.md ├── conf.py ├── develop │ ├── cmodules.rst │ ├── index.rst │ ├── natmod.rst │ └── qstr.rst ├── differences │ └── index_template.txt ├── esp32 │ ├── general.rst │ ├── img │ │ └── esp32.jpg │ ├── quickref.rst │ └── tutorial │ │ └── intro.rst ├── esp8266 │ ├── general.rst │ ├── img │ │ └── adafruit_products_pinoutstop.jpg │ ├── quickref.rst │ └── tutorial │ │ ├── adc.rst │ │ ├── apa102.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 │ ├── btree.rst │ ├── builtins.rst │ ├── cmath.rst │ ├── esp.rst │ ├── esp32.rst │ ├── framebuf.rst │ ├── gc.rst │ ├── index.rst │ ├── lcd160cr.rst │ ├── machine.ADC.rst │ ├── machine.ADCWiPy.rst │ ├── machine.I2C.rst │ ├── machine.Pin.rst │ ├── machine.RTC.rst │ ├── machine.SD.rst │ ├── machine.SDCard.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.Flash.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 │ ├── uarray.rst │ ├── uasyncio.rst │ ├── ubinascii.rst │ ├── ubluetooth.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 │ ├── filesystem.rst │ ├── glossary.rst │ ├── index.rst │ ├── isr_rules.rst │ ├── mpyfiles.rst │ ├── packages.rst │ ├── pyboard.py.rst │ ├── repl.rst │ └── speed_python.rst ├── static │ ├── customstyle.css │ └── favicon.ico ├── templates │ ├── layout.html │ ├── replace.inc │ ├── topindex.html │ └── versions.html ├── unix │ └── quickref.rst └── 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 ├── cyw43 │ ├── README.md │ ├── cyw43.h │ ├── cyw43_ctrl.c │ ├── cyw43_ll.h │ ├── cyw43_lwip.c │ ├── cywbt.c │ └── libcyw43.a ├── 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 ├── bluetooth │ ├── ble_advertising.py │ ├── ble_simple_central.py │ ├── ble_simple_peripheral.py │ ├── ble_temperature.py │ ├── ble_temperature_central.py │ ├── ble_uart_peripheral.py │ └── ble_uart_repl.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 ├── natmod │ ├── .gitignore │ ├── btree │ │ ├── Makefile │ │ ├── btree_c.c │ │ └── btree_py.py │ ├── features0 │ │ ├── Makefile │ │ └── features0.c │ ├── features1 │ │ ├── Makefile │ │ └── features1.c │ ├── features2 │ │ ├── Makefile │ │ ├── main.c │ │ ├── prod.c │ │ ├── prod.h │ │ └── test.py │ ├── framebuf │ │ ├── Makefile │ │ └── framebuf.c │ ├── uheapq │ │ ├── Makefile │ │ └── uheapq.c │ ├── urandom │ │ ├── Makefile │ │ └── urandom.c │ ├── ure │ │ ├── Makefile │ │ └── ure.c │ └── uzlib │ │ ├── Makefile │ │ └── uzlib.c ├── 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 ├── btstack │ ├── btstack.mk │ ├── btstack_config.h │ ├── modbluetooth_btstack.c │ └── modbluetooth_btstack.h ├── crypto-algorithms │ ├── sha256.c │ └── sha256.h ├── extmod.mk ├── lwip-include │ ├── arch │ │ ├── cc.h │ │ └── perf.h │ └── lwipopts.h ├── machine_i2c.c ├── machine_i2c.h ├── machine_mem.c ├── machine_mem.h ├── machine_pin.c ├── machine_pin.h ├── machine_pinbase.c ├── machine_pinbase.h ├── machine_pulse.c ├── machine_pulse.h ├── machine_pwm.c ├── machine_pwm.h ├── machine_signal.c ├── machine_signal.h ├── machine_spi.c ├── machine_spi.h ├── machine_spiflash.c ├── machine_spiflash.h ├── misc.h ├── modbluetooth.c ├── modbluetooth.h ├── modbluetooth_hci.h ├── modbtree.c ├── modframebuf.c ├── modlwip.c ├── modonewire.c ├── moduasyncio.c ├── modubinascii.c ├── moducryptolib.c ├── moductypes.c ├── moduhashlib.c ├── moduheapq.c ├── modujson.c ├── modurandom.c ├── modure.c ├── moduselect.c ├── modussl_axtls.c ├── modussl_mbedtls.c ├── modutimeq.c ├── moduwebsocket.c ├── moduwebsocket.h ├── moduzlib.c ├── modwebrepl.c ├── network_cyw43.c ├── network_cyw43.h ├── nimble │ ├── bsp │ │ └── bsp.h │ ├── hal │ │ ├── hal_gpio.h │ │ ├── hal_uart.c │ │ └── hal_uart.h │ ├── modbluetooth_nimble.c │ ├── modbluetooth_nimble.h │ ├── nimble.mk │ ├── nimble │ │ ├── nimble_hci_uart.h │ │ ├── nimble_npl_os.h │ │ └── npl_os.c │ └── syscfg │ │ └── syscfg.h ├── re1.5 │ ├── charclass.c │ ├── compilecode.c │ ├── dumpcode.c │ ├── re1.5.h │ └── recursiveloop.c ├── uasyncio │ ├── __init__.py │ ├── core.py │ ├── event.py │ ├── funcs.py │ ├── lock.py │ ├── manifest.py │ ├── stream.py │ └── task.py ├── uos_dupterm.c ├── utime_mphal.c ├── utime_mphal.h ├── uzlib │ ├── adler32.c │ ├── crc32.c │ ├── defl_static.h │ ├── tinf.h │ ├── tinf_compat.h │ ├── tinfgzip.c │ ├── tinflate.c │ ├── tinfzlib.c │ ├── uzlib.h │ └── uzlib_conf.h ├── vfs.c ├── vfs.h ├── vfs_blockdev.c ├── vfs_fat.c ├── vfs_fat.h ├── vfs_fat_diskio.c ├── vfs_fat_file.c ├── vfs_lfs.c ├── vfs_lfs.h ├── vfs_lfsx.c ├── vfs_lfsx_file.c ├── vfs_posix.c ├── vfs_posix.h ├── vfs_posix_file.c ├── vfs_reader.c ├── virtpin.c ├── virtpin.h └── webrepl │ ├── manifest.py │ ├── webrepl.py │ ├── webrepl_setup.py │ └── websocket_helper.py ├── lib ├── README.md ├── cmsis │ └── inc │ │ ├── cmsis_armcc.h │ │ ├── cmsis_armclang.h │ │ ├── cmsis_armclang_ltm.h │ │ ├── cmsis_compiler.h │ │ ├── cmsis_gcc.h │ │ ├── cmsis_iccarm.h │ │ ├── cmsis_version.h │ │ ├── core_armv81mml.h │ │ ├── core_armv8mbl.h │ │ ├── core_armv8mml.h │ │ ├── core_cm0.h │ │ ├── core_cm0plus.h │ │ ├── core_cm1.h │ │ ├── core_cm23.h │ │ ├── core_cm3.h │ │ ├── core_cm33.h │ │ ├── core_cm35p.h │ │ ├── core_cm4.h │ │ ├── core_cm7.h │ │ ├── core_sc000.h │ │ ├── core_sc300.h │ │ ├── mpu_armv7.h │ │ ├── mpu_armv8.h │ │ └── tz_context.h ├── embed │ ├── __errno.c │ └── 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 │ ├── round.c │ ├── scalbn.c │ ├── sin.c │ ├── sinh.c │ ├── sqrt.c │ ├── tan.c │ ├── tanh.c │ ├── tgamma.c │ ├── thumb_vfp_sqrt.c │ └── trunc.c ├── littlefs │ ├── README.md │ ├── lfs1.c │ ├── lfs1.h │ ├── lfs1_util.c │ ├── lfs1_util.h │ ├── lfs2.c │ ├── lfs2.h │ ├── lfs2_util.c │ └── lfs2_util.h ├── mbedtls_errors │ ├── README.md │ ├── do-esp32.sh │ ├── do-mp.sh │ ├── do-test.sh │ ├── error.fmt │ ├── generate_errors.diff │ ├── mp_mbedtls_errors.c │ └── tester.c ├── memzip │ ├── README.md │ ├── import.c │ ├── lexermemzip.c │ ├── make-memzip.py │ ├── memzip.c │ └── memzip.h ├── mp-readline │ ├── readline.c │ └── readline.h ├── netutils │ ├── dhcpserver.c │ ├── dhcpserver.h │ ├── netutils.c │ ├── netutils.h │ └── trace.c ├── oofatfs │ ├── diskio.h │ ├── ff.c │ ├── ff.h │ ├── ffconf.h │ └── ffunicode.c ├── timeutils │ ├── timeutils.c │ └── timeutils.h ├── tinytest │ ├── README │ ├── tinytest.c │ ├── tinytest.h │ └── tinytest_macros.h ├── upytesthelper │ ├── upytesthelper.c │ └── upytesthelper.h └── utils │ ├── gchelper.h │ ├── gchelper_generic.c │ ├── gchelper_m0.s │ ├── gchelper_m3.s │ ├── gchelper_native.c │ ├── interrupt_char.c │ ├── interrupt_char.h │ ├── mpirq.c │ ├── mpirq.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 ├── .gitignore ├── Makefile ├── README.md ├── gccollect.c ├── main.c ├── mpconfigport.h ├── mphalport.h ├── mpy-cross.vcxproj └── qstrdefsport.h ├── ports ├── bare-arm │ ├── Makefile │ ├── main.c │ ├── mpconfigport.h │ ├── mphalport.h │ ├── qstrdefsport.h │ └── stm32f405.ld ├── cc3200 │ ├── FreeRTOS │ │ ├── FreeRTOSConfig.h │ │ ├── License │ │ │ └── license.txt │ │ └── Source │ │ │ ├── croutine.c │ │ │ ├── event_groups.c │ │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── StackMacros.h │ │ │ ├── croutine.h │ │ │ ├── deprecated_definitions.h │ │ │ ├── event_groups.h │ │ │ ├── list.h │ │ │ ├── mpu_prototypes.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── task.h │ │ │ └── timers.h │ │ │ ├── list.c │ │ │ ├── portable │ │ │ ├── GCC │ │ │ │ └── ARM_CM3 │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ └── heap_4.c │ │ │ ├── queue.c │ │ │ ├── tasks.c │ │ │ └── timers.c │ ├── Makefile │ ├── README.md │ ├── application.lds │ ├── application.mk │ ├── appsign.sh │ ├── boards │ │ ├── LAUNCHXL │ │ │ ├── mpconfigboard.h │ │ │ └── pins.csv │ │ ├── WIPY │ │ │ ├── mpconfigboard.h │ │ │ └── pins.csv │ │ ├── cc3200_af.csv │ │ ├── cc3200_prefix.c │ │ └── make-pins.py │ ├── bootmgr │ │ ├── bootgen.sh │ │ ├── bootloader.mk │ │ ├── bootmgr.h │ │ ├── bootmgr.lds │ │ ├── flc.h │ │ ├── main.c │ │ ├── relocator │ │ │ └── relocator.bin │ │ ├── runapp.s │ │ └── sl │ │ │ └── user.h │ ├── fatfs │ │ └── src │ │ │ └── drivers │ │ │ ├── sd_diskio.c │ │ │ ├── sd_diskio.h │ │ │ ├── sflash_diskio.c │ │ │ ├── sflash_diskio.h │ │ │ └── stdcmd.h │ ├── fatfs_port.c │ ├── ftp │ │ ├── ftp.c │ │ ├── ftp.h │ │ ├── updater.c │ │ └── updater.h │ ├── hal │ │ ├── adc.c │ │ ├── adc.h │ │ ├── aes.c │ │ ├── aes.h │ │ ├── cc3200_asm.h │ │ ├── cc3200_hal.c │ │ ├── cc3200_hal.h │ │ ├── cpu.c │ │ ├── cpu.h │ │ ├── crc.c │ │ ├── crc.h │ │ ├── debug.h │ │ ├── des.c │ │ ├── des.h │ │ ├── fault_registers.h │ │ ├── gpio.c │ │ ├── gpio.h │ │ ├── i2c.c │ │ ├── i2c.h │ │ ├── i2s.c │ │ ├── i2s.h │ │ ├── inc │ │ │ ├── asmdefs.h │ │ │ ├── hw_adc.h │ │ │ ├── hw_aes.h │ │ │ ├── hw_apps_config.h │ │ │ ├── hw_apps_rcm.h │ │ │ ├── hw_camera.h │ │ │ ├── hw_common_reg.h │ │ │ ├── hw_des.h │ │ │ ├── hw_dthe.h │ │ │ ├── hw_flash_ctrl.h │ │ │ ├── hw_gpio.h │ │ │ ├── hw_gprcm.h │ │ │ ├── hw_hib1p2.h │ │ │ ├── hw_hib3p3.h │ │ │ ├── hw_i2c.h │ │ │ ├── hw_ints.h │ │ │ ├── hw_mcasp.h │ │ │ ├── hw_mcspi.h │ │ │ ├── hw_memmap.h │ │ │ ├── hw_mmchs.h │ │ │ ├── hw_nvic.h │ │ │ ├── hw_ocp_shared.h │ │ │ ├── hw_shamd5.h │ │ │ ├── hw_stack_die_ctrl.h │ │ │ ├── hw_timer.h │ │ │ ├── hw_types.h │ │ │ ├── hw_uart.h │ │ │ ├── hw_udma.h │ │ │ └── hw_wdt.h │ │ ├── interrupt.c │ │ ├── interrupt.h │ │ ├── pin.c │ │ ├── pin.h │ │ ├── prcm.c │ │ ├── prcm.h │ │ ├── rom.h │ │ ├── rom_map.h │ │ ├── rom_patch.h │ │ ├── sdhost.c │ │ ├── sdhost.h │ │ ├── shamd5.c │ │ ├── shamd5.h │ │ ├── spi.c │ │ ├── spi.h │ │ ├── startup_gcc.c │ │ ├── systick.c │ │ ├── systick.h │ │ ├── timer.c │ │ ├── timer.h │ │ ├── uart.c │ │ ├── uart.h │ │ ├── utils.c │ │ ├── utils.h │ │ ├── wdt.c │ │ └── wdt.h │ ├── main.c │ ├── misc │ │ ├── FreeRTOSHooks.c │ │ ├── antenna.c │ │ ├── antenna.h │ │ ├── help.c │ │ ├── mperror.c │ │ ├── mperror.h │ │ ├── mpirq.c │ │ └── mpirq.h │ ├── mods │ │ ├── modmachine.c │ │ ├── modnetwork.c │ │ ├── modnetwork.h │ │ ├── moduhashlib.c │ │ ├── moduos.c │ │ ├── moduos.h │ │ ├── modusocket.c │ │ ├── modusocket.h │ │ ├── modussl.c │ │ ├── modutime.c │ │ ├── modwipy.c │ │ ├── modwlan.c │ │ ├── modwlan.h │ │ ├── pybadc.c │ │ ├── pybadc.h │ │ ├── pybflash.c │ │ ├── pybflash.h │ │ ├── pybi2c.c │ │ ├── pybi2c.h │ │ ├── pybpin.c │ │ ├── pybpin.h │ │ ├── pybrtc.c │ │ ├── pybrtc.h │ │ ├── pybsd.c │ │ ├── pybsd.h │ │ ├── pybsleep.c │ │ ├── pybsleep.h │ │ ├── pybspi.c │ │ ├── pybspi.h │ │ ├── pybtimer.c │ │ ├── pybtimer.h │ │ ├── pybuart.c │ │ ├── pybuart.h │ │ ├── pybwdt.c │ │ └── pybwdt.h │ ├── mpconfigport.h │ ├── mptask.c │ ├── mptask.h │ ├── mpthreadport.c │ ├── mpthreadport.h │ ├── qstrdefsport.h │ ├── serverstask.c │ ├── serverstask.h │ ├── simplelink │ │ ├── cc_pal.c │ │ ├── cc_pal.h │ │ ├── oslib │ │ │ ├── osi.h │ │ │ └── osi_freertos.c │ │ └── user.h │ ├── telnet │ │ ├── telnet.c │ │ └── telnet.h │ ├── tools │ │ ├── smoke.py │ │ ├── smoke.py.exp │ │ ├── uniflash.py │ │ └── update-wipy.py │ ├── util │ │ ├── cortex_m3_get_sp.s │ │ ├── cryptohash.c │ │ ├── cryptohash.h │ │ ├── fifo.c │ │ ├── fifo.h │ │ ├── gccollect.c │ │ ├── gccollect.h │ │ ├── random.c │ │ ├── random.h │ │ ├── sleeprestore.h │ │ ├── sleeprestore.s │ │ ├── socketfifo.c │ │ └── socketfifo.h │ └── version.h ├── efm32 │ ├── Makefile │ ├── README.md │ ├── boards │ │ ├── ikea │ │ │ ├── board_pins.h │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pin_defs.h │ │ └── tbsense2 │ │ │ ├── board_pins.h │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pin_defs.h │ ├── efr32mg1p-pins.md │ ├── images │ │ ├── efr32-annotated.jpg │ │ └── efr32-pins.png │ ├── main.c │ ├── make-pins │ ├── modcrypto.c │ ├── modmachine.c │ ├── modmachine.h │ ├── modules │ │ ├── NIC.py │ │ ├── __init__.py │ │ └── flashbdev.py │ ├── moduos.c │ ├── modutime.c │ ├── mpconfigport.h │ ├── mphalport.h │ ├── pin.c │ ├── pwm.c │ ├── qstrdefsport.h │ ├── radio.c │ ├── radio.h │ ├── rail │ │ ├── TARGET_EFR32_1 │ │ │ ├── ieee802154_subg_efr32xg1_configurator_out.c │ │ │ ├── ieee802154_subg_efr32xg1_configurator_out.h │ │ │ └── librail_efr32xg1_release.a │ │ ├── TARGET_EFR32_12 │ │ │ └── librail_efr32xg12_release.a │ │ ├── pa.h │ │ ├── protocol │ │ │ ├── ble │ │ │ │ └── rail_ble.h │ │ │ └── ieee802154 │ │ │ │ └── rail_ieee802154.h │ │ ├── pti.h │ │ ├── rail.h │ │ ├── rail_assert_error_codes.h │ │ ├── rail_chip_specific.h │ │ ├── rail_types.h │ │ └── timing_state.h │ ├── uart_core.c │ ├── zrepl │ ├── zrepl.c │ └── zrepl.h ├── esp32 │ ├── Makefile │ ├── README.md │ ├── README.ulp.md │ ├── boards │ │ ├── GENERIC │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── GENERIC_D2WD │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── GENERIC_OTA │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── sdkconfig.board │ │ ├── GENERIC_SPIRAM │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── TINYPICO │ │ │ ├── manifest.py │ │ │ ├── modules │ │ │ │ ├── dotstar.py │ │ │ │ └── tinypico.py │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── sdkconfig.board │ │ ├── manifest.py │ │ ├── manifest_release.py │ │ ├── sdkconfig.240mhz │ │ ├── sdkconfig.base │ │ ├── sdkconfig.ble │ │ └── sdkconfig.spiram │ ├── esp32_partition.c │ ├── esp32_rmt.c │ ├── esp32_ulp.c │ ├── espneopixel.c │ ├── fatfs_port.c │ ├── gccollect.c │ ├── gccollect.h │ ├── help.c │ ├── machine_adc.c │ ├── machine_dac.c │ ├── machine_hw_spi.c │ ├── machine_i2c.c │ ├── machine_pin.c │ ├── machine_pwm.c │ ├── machine_rtc.c │ ├── machine_rtc.h │ ├── machine_sdcard.c │ ├── machine_timer.c │ ├── machine_touchpad.c │ ├── machine_uart.c │ ├── machine_wdt.c │ ├── main.c │ ├── makeimg.py │ ├── memory.h │ ├── modesp.c │ ├── modesp.h │ ├── modesp32.c │ ├── modesp32.h │ ├── modmachine.c │ ├── modmachine.h │ ├── modnetwork.c │ ├── modnetwork.h │ ├── modsocket.c │ ├── modules │ │ ├── _boot.py │ │ ├── apa106.py │ │ ├── flashbdev.py │ │ ├── inisetup.py │ │ └── neopixel.py │ ├── moduos.c │ ├── modutime.c │ ├── mpconfigport.h │ ├── mphalport.c │ ├── mphalport.h │ ├── mpthreadport.c │ ├── mpthreadport.h │ ├── network_lan.c │ ├── network_ppp.c │ ├── nimble.c │ ├── partitions-2MiB.csv │ ├── partitions-ota.csv │ ├── partitions.csv │ ├── qstrdefsport.h │ ├── uart.c │ └── uart.h ├── esp8266 │ ├── Makefile │ ├── README.md │ ├── boards │ │ ├── GENERIC │ │ │ ├── manifest.py │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── GENERIC_1M │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── GENERIC_512K │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── eagle.rom.addr.v6.ld │ │ ├── esp8266_1m.ld │ │ ├── esp8266_2m.ld │ │ ├── esp8266_512k.ld │ │ ├── esp8266_common.ld │ │ ├── esp8266_ota.ld │ │ ├── manifest.py │ │ └── manifest_release.py │ ├── esp_init_data.c │ ├── esp_mphal.c │ ├── esp_mphal.h │ ├── espapa102.c │ ├── espapa102.h │ ├── espneopixel.c │ ├── espneopixel.h │ ├── esppwm.c │ ├── esppwm.h │ ├── ets_alt_task.c │ ├── ets_alt_task.h │ ├── etshal.h │ ├── fatfs_port.c │ ├── gccollect.c │ ├── gccollect.h │ ├── gchelper.s │ ├── help.c │ ├── hspi.c │ ├── hspi.h │ ├── hspi_register.h │ ├── lexerstr32.c │ ├── machine_adc.c │ ├── machine_hspi.c │ ├── machine_pin.c │ ├── machine_pwm.c │ ├── machine_rtc.c │ ├── machine_uart.c │ ├── machine_wdt.c │ ├── main.c │ ├── makeimg.py │ ├── modesp.c │ ├── modmachine.c │ ├── modmachine.h │ ├── modnetwork.c │ ├── modpyb.c │ ├── modules │ │ ├── _boot.py │ │ ├── apa102.py │ │ ├── flashbdev.py │ │ ├── inisetup.py │ │ ├── neopixel.py │ │ ├── ntptime.py │ │ └── port_diag.py │ ├── moduos.c │ ├── modutime.c │ ├── mpconfigport.h │ ├── posix_helpers.c │ ├── qstrdefsport.h │ ├── strtoll.c │ ├── uart.c │ ├── uart.h │ ├── uart_register.h │ ├── user_config.h │ └── xtirq.h ├── javascript │ ├── JSBackend.patch │ ├── Makefile │ ├── README.md │ ├── library.h │ ├── library.js │ ├── main.c │ ├── modutime.c │ ├── mpconfigport.h │ ├── mphalport.c │ ├── mphalport.h │ ├── node_run.sh │ ├── qstrdefsport.h │ └── wrapper.js ├── mimxrt │ ├── Makefile │ ├── README.md │ ├── board_init.c │ ├── boards │ │ ├── MIMXRT1010_EVK │ │ │ ├── evkmimxrt1010_flexspi_nor_config.h │ │ │ ├── flash_config.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.c │ │ │ └── pins.h │ │ ├── MIMXRT1011.ld │ │ ├── MIMXRT1020_EVK │ │ │ ├── evkmimxrt1020_flexspi_nor_config.h │ │ │ ├── flash_config.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.c │ │ │ └── pins.h │ │ ├── MIMXRT1021.ld │ │ ├── MIMXRT1060_EVK │ │ │ ├── evkmimxrt1060_flexspi_nor_config.h │ │ │ ├── flash_config.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.c │ │ │ └── pins.h │ │ ├── MIMXRT1062.ld │ │ └── TEENSY40 │ │ │ ├── flash_config.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.c │ │ │ ├── pins.h │ │ │ └── teensy40_flexspi_nor_config.h │ ├── led.c │ ├── led.h │ ├── machine_led.c │ ├── main.c │ ├── modmachine.c │ ├── modutime.c │ ├── mpconfigport.h │ ├── mphalport.c │ ├── mphalport.h │ ├── pin.c │ ├── pin.h │ ├── qstrdefsport.h │ ├── tusb_config.h │ └── tusb_port.c ├── minimal │ ├── Makefile │ ├── README.md │ ├── frozentest.mpy │ ├── frozentest.py │ ├── main.c │ ├── mpconfigport.h │ ├── mphalport.h │ ├── qstrdefsport.h │ ├── stm32f405.ld │ └── uart_core.c ├── nrf │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── bluetooth_conf.h │ ├── boards │ │ ├── actinius_icarus │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── arduino_primo │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── blueio_tag_evim │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── common.ld │ │ ├── dvk_bl652 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── evk_nina_b1 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── feather52 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── ibk_blyst_nano │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── idk_blyst_nano │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── make-pins.py │ │ ├── memory.ld │ │ ├── microbit │ │ │ ├── custom_nrf51822_s110_microbit.ld │ │ │ ├── modules │ │ │ │ ├── AUTHORS │ │ │ │ ├── LICENSE │ │ │ │ ├── boardmodules.h │ │ │ │ ├── boardmodules.mk │ │ │ │ ├── iters.c │ │ │ │ ├── iters.h │ │ │ │ ├── microbitconstimage.c │ │ │ │ ├── microbitconstimage.h │ │ │ │ ├── microbitconstimagetuples.c │ │ │ │ ├── microbitdisplay.c │ │ │ │ ├── microbitdisplay.h │ │ │ │ ├── microbitfont.h │ │ │ │ ├── microbitimage.c │ │ │ │ ├── microbitimage.h │ │ │ │ ├── modmicrobit.c │ │ │ │ └── modmicrobit.h │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── nrf51_prefix.c │ │ ├── nrf51x22_256k_16k.ld │ │ ├── nrf51x22_256k_32k.ld │ │ ├── nrf52832_512k_64k.ld │ │ ├── nrf52840-mdk-usb-dongle │ │ │ ├── README.md │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── nrf52840_open_bootloader.ld │ │ │ └── pins.csv │ │ ├── nrf52840_1M_256k.ld │ │ ├── nrf52_prefix.c │ │ ├── nrf9160_1M_256k.ld │ │ ├── nrf9160_1M_256k_secure.ld │ │ ├── nrf91_prefix.c │ │ ├── particle_xenon │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10000 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10001 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10028 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10031 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10040 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10056 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10059 │ │ │ ├── modules │ │ │ │ ├── boardmodules.h │ │ │ │ ├── boardmodules.mk │ │ │ │ └── recover_uicr_regout0.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── pca10090 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ │ ├── s110_8.0.0.ld │ │ ├── s132_6.1.1.ld │ │ ├── s140_6.1.1.ld │ │ └── wt51822_s4at │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ └── pins.csv │ ├── device │ │ ├── startup_nrf51822.c │ │ ├── startup_nrf52832.c │ │ ├── startup_nrf52840.c │ │ └── startup_nrf9160.c │ ├── drivers │ │ ├── bluetooth │ │ │ ├── ble_drv.c │ │ │ ├── ble_drv.h │ │ │ ├── ble_uart.c │ │ │ ├── ble_uart.h │ │ │ ├── bluetooth_common.mk │ │ │ ├── download_ble_stack.sh │ │ │ └── ringbuffer.h │ │ ├── flash.c │ │ ├── flash.h │ │ ├── rng.c │ │ ├── rng.h │ │ ├── secureboot │ │ │ ├── secureboot.mk │ │ │ └── secureboot_main.c │ │ ├── softpwm.c │ │ ├── softpwm.h │ │ ├── ticker.c │ │ ├── ticker.h │ │ └── usb │ │ │ ├── tusb_config.h │ │ │ ├── usb_cdc.c │ │ │ ├── usb_cdc.h │ │ │ └── usb_descriptors.c │ ├── examples │ │ ├── mountsd.py │ │ ├── musictest.py │ │ ├── nrf52_pwm.py │ │ ├── nrf52_servo.py │ │ ├── powerup.py │ │ ├── seeed_tft.py │ │ ├── ssd1306_mod.py │ │ ├── ubluepy_eddystone.py │ │ ├── ubluepy_scan.py │ │ └── ubluepy_temp.py │ ├── fatfs_port.c │ ├── freeze │ │ └── test.py │ ├── gccollect.c │ ├── gccollect.h │ ├── help.c │ ├── main.c │ ├── modules │ │ ├── ble │ │ │ ├── help_sd.h │ │ │ └── modble.c │ │ ├── board │ │ │ ├── led.c │ │ │ ├── led.h │ │ │ └── modboard.c │ │ ├── machine │ │ │ ├── adc.c │ │ │ ├── adc.h │ │ │ ├── i2c.c │ │ │ ├── i2c.h │ │ │ ├── modmachine.c │ │ │ ├── modmachine.h │ │ │ ├── pin.c │ │ │ ├── pin.h │ │ │ ├── pwm.c │ │ │ ├── pwm.h │ │ │ ├── rtcounter.c │ │ │ ├── rtcounter.h │ │ │ ├── spi.c │ │ │ ├── spi.h │ │ │ ├── temp.c │ │ │ ├── temp.h │ │ │ ├── timer.c │ │ │ ├── timer.h │ │ │ ├── uart.c │ │ │ └── uart.h │ │ ├── music │ │ │ ├── modmusic.c │ │ │ ├── modmusic.h │ │ │ ├── musictunes.c │ │ │ └── musictunes.h │ │ ├── ubluepy │ │ │ ├── modubluepy.c │ │ │ ├── modubluepy.h │ │ │ ├── ubluepy_characteristic.c │ │ │ ├── ubluepy_constants.c │ │ │ ├── ubluepy_delegate.c │ │ │ ├── ubluepy_descriptor.c │ │ │ ├── ubluepy_peripheral.c │ │ │ ├── ubluepy_scan_entry.c │ │ │ ├── ubluepy_scanner.c │ │ │ ├── ubluepy_service.c │ │ │ └── ubluepy_uuid.c │ │ ├── uos │ │ │ ├── microbitfs.c │ │ │ ├── microbitfs.h │ │ │ └── moduos.c │ │ └── utime │ │ │ └── modutime.c │ ├── mpconfigdevice_nrf51822.h │ ├── mpconfigdevice_nrf52832.h │ ├── mpconfigdevice_nrf52840.h │ ├── mpconfigdevice_nrf9160.h │ ├── mpconfigport.h │ ├── mphalport.c │ ├── mphalport.h │ ├── nrf51_af.csv │ ├── nrf52_af.csv │ ├── nrf91_af.csv │ ├── nrfx_config.h │ ├── nrfx_glue.h │ ├── nrfx_log.h │ ├── pin_defs_nrf5.h │ ├── pin_named_pins.c │ └── qstrdefsport.h ├── pic16bit │ ├── Makefile │ ├── board.c │ ├── board.h │ ├── main.c │ ├── modpyb.c │ ├── modpyb.h │ ├── modpybled.c │ ├── modpybswitch.c │ ├── mpconfigport.h │ ├── pic16bit_mphal.c │ ├── pic16bit_mphal.h │ ├── qstrdefsport.h │ └── unistd.h ├── powerpc │ ├── Makefile │ ├── README.md │ ├── frozentest.mpy │ ├── frozentest.py │ ├── head.S │ ├── main.c │ ├── mpconfigport.h │ ├── mphalport.h │ ├── powerpc.lds │ ├── qstrdefsport.h │ ├── uart_lpc_serial.c │ ├── uart_lpc_serial.h │ ├── uart_potato.c │ ├── uart_potato.h │ └── unistd.h ├── qemu-arm │ ├── Makefile │ ├── Makefile.test │ ├── README.md │ ├── main.c │ ├── modmachine.c │ ├── moduos.c │ ├── mpconfigport.h │ ├── mphalport.h │ ├── mps2.ld │ ├── nrf51.ld │ ├── qstrdefsport.h │ ├── startup.c │ ├── stm32.ld │ ├── test-frzmpy │ │ └── native_frozen_align.py │ ├── test_main.c │ ├── uart.c │ └── uart.h ├── samd │ ├── Makefile │ ├── README.md │ ├── boards │ │ ├── ADAFRUIT_FEATHER_M0_EXPRESS │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── ADAFRUIT_ITSYBITSY_M4_EXPRESS │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── ADAFRUIT_TRINKET_M0 │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── MINISAM_M4 │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── SAMD21_XPLAINED_PRO │ │ │ ├── mpconfigboard.h │ │ │ └── mpconfigboard.mk │ │ ├── samd21x18a.ld │ │ └── samd51g19a.ld │ ├── main.c │ ├── modmachine.c │ ├── modutime.c │ ├── mpconfigport.h │ ├── mphalport.c │ ├── mphalport.h │ ├── qstrdefsport.h │ ├── samd_isr.c │ ├── samd_soc.c │ ├── samd_soc.h │ ├── sections.ld │ ├── tusb_config.h │ └── tusb_port.c ├── stm32 │ ├── Makefile │ ├── README.md │ ├── accel.c │ ├── accel.h │ ├── adc.c │ ├── adc.h │ ├── autoflash │ ├── boards │ │ ├── ADAFRUIT_F405_EXPRESS │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── B_L072Z_LRWAN1 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l0xx_hal_conf.h │ │ ├── B_L475E_IOT01A │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l4xx_hal_conf.h │ │ ├── CERB40 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── ESPRUINO_PICO │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── HYDRABUS │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── LIMIFROG │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l4xx_hal_conf.h │ │ ├── MIKROE_CLICKER2_STM32 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NADHAT_PYBF405 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NETDUINO_PLUS_2 │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NUCLEO_F091RC │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f0xx_hal_conf.h │ │ ├── NUCLEO_F401RE │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NUCLEO_F411RE │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NUCLEO_F412ZG │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NUCLEO_F413ZH │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NUCLEO_F429ZI │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NUCLEO_F446RE │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── NUCLEO_F722ZE │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── NUCLEO_F746ZG │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── NUCLEO_F767ZI │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── NUCLEO_H743ZI │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32h7xx_hal_conf.h │ │ ├── NUCLEO_L073RZ │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l0xx_hal_conf.h │ │ ├── NUCLEO_L432KC │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l4xx_hal_conf.h │ │ ├── NUCLEO_L452RE │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l4xx_hal_conf.h │ │ ├── NUCLEO_L476RG │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l4xx_hal_conf.h │ │ ├── NUCLEO_WB55 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32wbxx_hal_conf.h │ │ ├── OLIMEX_E407 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── PYBD_SF2 │ │ │ ├── bdev.c │ │ │ ├── board_init.c │ │ │ ├── f722_qspi.ld │ │ │ ├── manifest.py │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── PYBD_SF3 │ │ │ ├── bdev.c │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── PYBD_SF6 │ │ │ ├── bdev.c │ │ │ ├── board_init.c │ │ │ ├── f767.ld │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── PYBLITEV10 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── PYBV10 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── PYBV11 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── PYBV3 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── PYBV4 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── STM32F411DISC │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── STM32F429DISC │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── STM32F439 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── STM32F4DISC │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ ├── staccel.py │ │ │ └── stm32f4xx_hal_conf.h │ │ ├── STM32F769DISC │ │ │ ├── board_init.c │ │ │ ├── f769_qspi.ld │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── STM32F7DISC │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32f7xx_hal_conf.h │ │ ├── STM32L476DISC │ │ │ ├── bdev.c │ │ │ ├── board_init.c │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l4xx_hal_conf.h │ │ ├── STM32L496GDISC │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32l4xx_hal_conf.h │ │ ├── USBDONGLE_WB55 │ │ │ ├── mpconfigboard.h │ │ │ ├── mpconfigboard.mk │ │ │ ├── pins.csv │ │ │ └── stm32wbxx_hal_conf.h │ │ ├── common_basic.ld │ │ ├── common_bl.ld │ │ ├── common_blifs.ld │ │ ├── common_ifs.ld │ │ ├── make-pins.py │ │ ├── manifest.py │ │ ├── openocd_stm32f4.cfg │ │ ├── openocd_stm32f7.cfg │ │ ├── openocd_stm32l4.cfg │ │ ├── pllvalues.py │ │ ├── stm32f091_af.csv │ │ ├── stm32f091xc.ld │ │ ├── stm32f0xx_hal_conf_base.h │ │ ├── stm32f401_af.csv │ │ ├── stm32f401xd.ld │ │ ├── stm32f401xe.ld │ │ ├── stm32f405.ld │ │ ├── stm32f405_af.csv │ │ ├── stm32f411.ld │ │ ├── stm32f411_af.csv │ │ ├── stm32f412_af.csv │ │ ├── stm32f412zx.ld │ │ ├── stm32f413_af.csv │ │ ├── stm32f413xg.ld │ │ ├── stm32f413xh.ld │ │ ├── stm32f429.ld │ │ ├── stm32f429_af.csv │ │ ├── stm32f439.ld │ │ ├── stm32f439_af.csv │ │ ├── stm32f4xx_hal_conf_base.h │ │ ├── stm32f4xx_prefix.c │ │ ├── stm32f722.ld │ │ ├── stm32f722_af.csv │ │ ├── stm32f746.ld │ │ ├── stm32f746_af.csv │ │ ├── stm32f767.ld │ │ ├── stm32f767_af.csv │ │ ├── stm32f769.ld │ │ ├── stm32f7xx_hal_conf_base.h │ │ ├── stm32h743.ld │ │ ├── stm32h743_af.csv │ │ ├── stm32h7xx_hal_conf_base.h │ │ ├── stm32l072_af.csv │ │ ├── stm32l072xz.ld │ │ ├── stm32l0xx_hal_conf_base.h │ │ ├── stm32l432.ld │ │ ├── stm32l432_af.csv │ │ ├── stm32l452_af.csv │ │ ├── stm32l452xe.ld │ │ ├── stm32l476_af.csv │ │ ├── stm32l476xe.ld │ │ ├── stm32l476xg.ld │ │ ├── stm32l496_af.csv │ │ ├── stm32l496xg.ld │ │ ├── stm32l4xx_hal_conf_base.h │ │ ├── stm32wb55_af.csv │ │ ├── stm32wb55xg.ld │ │ └── stm32wbxx_hal_conf_base.h │ ├── btstack.c │ ├── bufhelper.c │ ├── bufhelper.h │ ├── can.c │ ├── can.h │ ├── dac.c │ ├── dac.h │ ├── dma.c │ ├── dma.h │ ├── eth.c │ ├── eth.h │ ├── extint.c │ ├── extint.h │ ├── factoryreset.c │ ├── factoryreset.h │ ├── fatfs_port.c │ ├── fdcan.c │ ├── flash.c │ ├── flash.h │ ├── flashbdev.c │ ├── font_petme128_8x8.h │ ├── gccollect.c │ ├── gccollect.h │ ├── help.c │ ├── i2c.c │ ├── i2c.h │ ├── i2cslave.c │ ├── i2cslave.h │ ├── irq.c │ ├── irq.h │ ├── lcd.c │ ├── lcd.h │ ├── led.c │ ├── led.h │ ├── lwip_inc │ │ ├── arch │ │ │ ├── cc.h │ │ │ └── sys_arch.h │ │ └── lwipopts.h │ ├── machine_adc.c │ ├── machine_i2c.c │ ├── machine_spi.c │ ├── machine_timer.c │ ├── machine_uart.c │ ├── main.c │ ├── make-stmconst.py │ ├── mbedtls │ │ ├── mbedtls_config.h │ │ └── mbedtls_port.c │ ├── mboot │ │ ├── Makefile │ │ ├── README.md │ │ ├── dfu.h │ │ ├── elem.c │ │ ├── ffconf.h │ │ ├── fsload.c │ │ ├── fwupdate.py │ │ ├── gzstream.c │ │ ├── gzstream.h │ │ ├── main.c │ │ ├── mboot.h │ │ ├── mboot.py │ │ ├── mphalport.h │ │ ├── stm32_generic.ld │ │ ├── vfs.h │ │ ├── vfs_fat.c │ │ └── vfs_lfs.c │ ├── modbluetooth_hci.c │ ├── modmachine.c │ ├── modmachine.h │ ├── modnetwork.c │ ├── modnetwork.h │ ├── modnwcc3k.c │ ├── modnwwiznet5k.c │ ├── modpyb.c │ ├── modstm.c │ ├── moduos.c │ ├── modusocket.c │ ├── modutime.c │ ├── mpconfigboard_common.h │ ├── mpconfigport.h │ ├── mpconfigport.mk │ ├── mpconfigport_nanbox.h │ ├── mphalport.c │ ├── mphalport.h │ ├── mpthreadport.c │ ├── mpthreadport.h │ ├── mpu.h │ ├── network_lan.c │ ├── network_wiznet5k.c │ ├── nimble.c │ ├── pendsv.c │ ├── pendsv.h │ ├── pin.c │ ├── pin.h │ ├── pin_defs_stm32.c │ ├── pin_defs_stm32.h │ ├── pin_named_pins.c │ ├── pin_static_af.h │ ├── portmodules.h │ ├── powerctrl.c │ ├── powerctrl.h │ ├── powerctrlboot.c │ ├── pyb_can.c │ ├── pyb_i2c.c │ ├── pyb_spi.c │ ├── pybcdc.inf_template │ ├── pybthread.c │ ├── pybthread.h │ ├── qspi.c │ ├── qspi.h │ ├── qstrdefsport.h │ ├── resethandler.s │ ├── resethandler_m0.s │ ├── rfcore.c │ ├── rfcore.h │ ├── rng.c │ ├── rng.h │ ├── rtc.c │ ├── rtc.h │ ├── sdcard.c │ ├── sdcard.h │ ├── sdio.c │ ├── sdio.h │ ├── sdram.c │ ├── sdram.h │ ├── servo.c │ ├── servo.h │ ├── softtimer.c │ ├── softtimer.h │ ├── spi.c │ ├── spi.h │ ├── spibdev.c │ ├── stm32_it.c │ ├── stm32_it.h │ ├── storage.c │ ├── storage.h │ ├── system_stm32.c │ ├── systick.c │ ├── systick.h │ ├── timer.c │ ├── timer.h │ ├── uart.c │ ├── uart.h │ ├── usb.c │ ├── usb.h │ ├── usbd_cdc_interface.c │ ├── usbd_cdc_interface.h │ ├── usbd_conf.c │ ├── usbd_conf.h │ ├── usbd_desc.c │ ├── usbd_desc.h │ ├── usbd_hid_interface.c │ ├── usbd_hid_interface.h │ ├── usbd_msc_interface.c │ ├── usbd_msc_interface.h │ ├── usbdev │ │ ├── class │ │ │ ├── inc │ │ │ │ ├── usbd_cdc_msc_hid.h │ │ │ │ ├── usbd_cdc_msc_hid0.h │ │ │ │ ├── usbd_msc_bot.h │ │ │ │ └── usbd_msc_scsi.h │ │ │ └── src │ │ │ │ ├── usbd_cdc_msc_hid.c │ │ │ │ ├── usbd_msc_bot.c │ │ │ │ └── usbd_msc_scsi.c │ │ └── core │ │ │ ├── inc │ │ │ ├── usbd_core.h │ │ │ ├── usbd_ctlreq.h │ │ │ ├── usbd_def.h │ │ │ └── usbd_ioreq.h │ │ │ └── src │ │ │ ├── usbd_core.c │ │ │ ├── usbd_ctlreq.c │ │ │ └── usbd_ioreq.c │ ├── usbhost │ │ ├── Class │ │ │ ├── AUDIO │ │ │ │ ├── Inc │ │ │ │ │ └── usbh_audio.h │ │ │ │ └── Src │ │ │ │ │ └── usbh_audio.c │ │ │ ├── CDC │ │ │ │ ├── Inc │ │ │ │ │ └── usbh_cdc.h │ │ │ │ └── Src │ │ │ │ │ └── usbh_cdc.c │ │ │ ├── HID │ │ │ │ ├── Inc │ │ │ │ │ ├── usbh_hid.h │ │ │ │ │ ├── usbh_hid_keybd.h │ │ │ │ │ ├── usbh_hid_mouse.h │ │ │ │ │ ├── usbh_hid_parser.h │ │ │ │ │ └── usbh_hid_usage.h │ │ │ │ └── Src │ │ │ │ │ ├── usbh_hid.c │ │ │ │ │ ├── usbh_hid_keybd.c │ │ │ │ │ ├── usbh_hid_mouse.c │ │ │ │ │ └── usbh_hid_parser.c │ │ │ ├── MSC │ │ │ │ ├── Inc │ │ │ │ │ ├── usbh_msc.h │ │ │ │ │ ├── usbh_msc_bot.h │ │ │ │ │ └── usbh_msc_scsi.h │ │ │ │ └── Src │ │ │ │ │ ├── usbh_msc.c │ │ │ │ │ ├── usbh_msc_bot.c │ │ │ │ │ └── usbh_msc_scsi.c │ │ │ ├── MTP │ │ │ │ ├── Inc │ │ │ │ │ ├── usbh_mtp.h │ │ │ │ │ └── usbh_mtp_ptp.h │ │ │ │ └── Src │ │ │ │ │ ├── usbh_mtp.c │ │ │ │ │ └── usbh_mtp_ptp.c │ │ │ └── Template │ │ │ │ ├── Inc │ │ │ │ └── usbh_template.h │ │ │ │ └── Src │ │ │ │ └── usbh_template.c │ │ └── Core │ │ │ ├── Inc │ │ │ ├── usbh_conf_template.h │ │ │ ├── usbh_core.h │ │ │ ├── usbh_ctlreq.h │ │ │ ├── usbh_def.h │ │ │ ├── usbh_ioreq.h │ │ │ └── usbh_pipes.h │ │ │ └── Src │ │ │ ├── usbh_conf_template.c │ │ │ ├── usbh_core.c │ │ │ ├── usbh_ctlreq.c │ │ │ ├── usbh_ioreq.c │ │ │ └── usbh_pipes.c │ ├── usrsw.c │ ├── usrsw.h │ ├── wdt.c │ └── wdt.h ├── teensy │ ├── Makefile │ ├── README.md │ ├── add-memzip.sh │ ├── core │ │ ├── Arduino.h │ │ ├── HardwareSerial.h │ │ ├── analog.c │ │ ├── avr_functions.h │ │ ├── core_pins.h │ │ ├── mk20dx128.c │ │ ├── mk20dx128.h │ │ ├── pins_arduino.h │ │ ├── pins_teensy.c │ │ ├── usb_desc.c │ │ ├── usb_desc.h │ │ ├── usb_dev.c │ │ ├── usb_dev.h │ │ ├── usb_mem.c │ │ ├── usb_mem.h │ │ ├── usb_names.h │ │ ├── usb_serial.c │ │ ├── usb_serial.h │ │ └── yield.c │ ├── hal_ftm.c │ ├── hal_ftm.h │ ├── hal_gpio.c │ ├── help.c │ ├── lcd.c │ ├── led.c │ ├── led.h │ ├── lexerfrozen.c │ ├── lexermemzip.h │ ├── main.c │ ├── make-pins.py │ ├── memzip_files │ │ ├── boot.py │ │ └── main.py │ ├── mk20dx256.ld │ ├── mk20dx256_af.csv │ ├── mk20dx256_prefix.c │ ├── modpyb.c │ ├── mpconfigport.h │ ├── pin_defs_teensy.c │ ├── pin_defs_teensy.h │ ├── qstrdefsport.h │ ├── reg.c │ ├── reg.h │ ├── servo.c │ ├── servo.h │ ├── std.h │ ├── teensy_hal.c │ ├── teensy_hal.h │ ├── teensy_pins.csv │ ├── timer.c │ ├── timer.h │ ├── uart.c │ ├── uart.h │ ├── usb.c │ └── usb.h ├── unix │ ├── .gitignore │ ├── Makefile │ ├── alloc.c │ ├── btstack_usb.c │ ├── coverage.c │ ├── fatfs_port.c │ ├── gccollect.c │ ├── input.c │ ├── input.h │ ├── main.c │ ├── modffi.c │ ├── modjni.c │ ├── modmachine.c │ ├── modos.c │ ├── modtermios.c │ ├── modtime.c │ ├── moduos_vfs.c │ ├── moduselect.c │ ├── modusocket.c │ ├── mpconfigport.h │ ├── mpconfigport.mk │ ├── mphalport.h │ ├── mpthreadport.c │ ├── mpthreadport.h │ ├── qstrdefsport.h │ ├── unix_mphal.c │ └── variants │ │ ├── coverage │ │ ├── frzmpy │ │ │ ├── frzmpy1.py │ │ │ ├── frzmpy2.py │ │ │ ├── frzmpy_pkg1 │ │ │ │ └── __init__.py │ │ │ ├── frzmpy_pkg2 │ │ │ │ └── mod.py │ │ │ └── frzqstr.py │ │ ├── frzstr │ │ │ ├── frzstr1.py │ │ │ ├── frzstr_pkg1 │ │ │ │ └── __init__.py │ │ │ └── frzstr_pkg2 │ │ │ │ └── mod.py │ │ ├── manifest.py │ │ ├── mpconfigvariant.h │ │ └── mpconfigvariant.mk │ │ ├── dev │ │ ├── manifest.py │ │ ├── mpconfigvariant.h │ │ └── mpconfigvariant.mk │ │ ├── fast │ │ ├── mpconfigvariant.h │ │ └── mpconfigvariant.mk │ │ ├── freedos │ │ ├── mpconfigvariant.h │ │ └── mpconfigvariant.mk │ │ ├── manifest.py │ │ ├── minimal │ │ ├── mpconfigvariant.h │ │ └── mpconfigvariant.mk │ │ ├── nanbox │ │ ├── mpconfigvariant.h │ │ └── mpconfigvariant.mk │ │ └── standard │ │ ├── mpconfigvariant.h │ │ └── mpconfigvariant.mk ├── 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 └── zephyr │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Kbuild │ ├── Makefile │ ├── Makefile.zephyr │ ├── README.md │ ├── boards │ ├── 96b_carbon.conf │ ├── disco_l475_iot1.conf │ ├── frdm_k64f.conf │ ├── frdm_kw41z.conf │ ├── mimxrt1050_evk.conf │ ├── qemu_cortex_m3.conf │ ├── qemu_x86.conf │ ├── reel_board.conf │ └── rv32m1_vega_ri5cy.conf │ ├── help.c │ ├── machine_i2c.c │ ├── machine_pin.c │ ├── main.c │ ├── make-bin-testsuite │ ├── make-minimal │ ├── modmachine.c │ ├── modmachine.h │ ├── moduos.c │ ├── modusocket.c │ ├── modutime.c │ ├── modzephyr.c │ ├── modzephyr.h │ ├── modzsensor.c │ ├── mpconfigport.h │ ├── mpconfigport_bin_testsuite.h │ ├── mpconfigport_minimal.h │ ├── mphalport.h │ ├── prj.conf │ ├── prj_minimal.conf │ ├── src │ ├── Makefile │ ├── zephyr_getchar.c │ ├── zephyr_getchar.h │ └── zephyr_start.c │ ├── uart_core.c │ ├── z_config.mk │ └── zephyr_storage.c ├── 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 ├── dynruntime.h ├── dynruntime.mk ├── 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 ├── emitnxtensawin.c ├── formatfloat.c ├── formatfloat.h ├── frozenmod.c ├── frozenmod.h ├── gc.c ├── gc.h ├── grammar.h ├── lexer.c ├── lexer.h ├── makecompresseddata.py ├── makemoduledefs.py ├── makeqstrdata.py ├── 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 ├── nativeglue.h ├── nlr.c ├── nlr.h ├── nlrpowerpc.c ├── 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 ├── pairheap.c ├── pairheap.h ├── parse.c ├── parse.h ├── parsenum.c ├── parsenum.h ├── parsenumbase.c ├── parsenumbase.h ├── persistentcode.c ├── persistentcode.h ├── profile.c ├── profile.h ├── py.mk ├── pystack.c ├── pystack.h ├── qstr.c ├── qstr.h ├── qstrdefs.h ├── reader.c ├── reader.h ├── repl.c ├── repl.h ├── ringbuf.c ├── 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 │ ├── annotate_var.py │ ├── annotate_var.py.exp │ ├── 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 │ ├── assign_expr.py │ ├── assign_expr.py.exp │ ├── assign_expr_syntaxerror.py │ ├── assign_expr_syntaxerror.py.exp │ ├── 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_buffer.py │ ├── builtin_eval_error.py │ ├── builtin_exec.py │ ├── builtin_exec_buffer.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_next_arg2.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_decode.py │ ├── bytearray_intbig.py │ ├── bytearray_slice_assign.py │ ├── bytes.py │ ├── bytes_add.py │ ├── bytes_add_array.py │ ├── bytes_add_bytearray.py │ ├── bytes_add_endian.py │ ├── bytes_compare.py │ ├── bytes_compare2.py │ ├── bytes_compare3.py │ ├── bytes_compare3.py.exp │ ├── bytes_compare_array.py │ ├── bytes_compare_bytearray.py │ ├── bytes_construct.py │ ├── bytes_construct_array.py │ ├── bytes_construct_bytearray.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_bases.py │ ├── class_bind_self.py │ ├── class_binop.py │ ├── class_call.py │ ├── class_contains.py │ ├── class_delattr_setattr.py │ ├── class_descriptor.py │ ├── class_dict.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_ordereddict.py │ ├── class_ordereddict.py.exp │ ├── 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_pending.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 │ ├── generator_throw_nested.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 │ ├── memoryview_itemsize.py │ ├── memoryview_slice_assign.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_bytearray.py │ ├── op_error_intbig.py │ ├── op_error_memoryview.py │ ├── op_precedence.py │ ├── ordereddict1.py │ ├── ordereddict_eq.py │ ├── ordereddict_eq.py.exp │ ├── parser.py │ ├── parser.py.exp │ ├── python34.py │ ├── python34.py.exp │ ├── python36.py │ ├── python36.py.exp │ ├── return1.py │ ├── scope.py │ ├── scope_implicit.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_indices.py │ ├── slice_intbig.py │ ├── slots_bool_len.py │ ├── special_comparisons.py │ ├── special_comparisons2.py │ ├── special_methods.py │ ├── special_methods2.py │ ├── special_methods2.py.exp │ ├── 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_endian.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 │ ├── subclass_native_str.py │ ├── syntaxerror.py │ ├── syntaxerror_return.py │ ├── sys1.py │ ├── sys_exit.py │ ├── sys_getsizeof.py │ ├── true_value.py │ ├── try1.py │ ├── try2.py │ ├── try3.py │ ├── try4.py │ ├── try_as_var.py │ ├── try_continue.py │ ├── try_else.py │ ├── try_else_finally.py │ ├── try_error.py │ ├── try_except_break.py │ ├── try_except_break.py.exp │ ├── try_finally1.py │ ├── try_finally2.py │ ├── try_finally_break.py │ ├── try_finally_break2.py │ ├── try_finally_continue.py │ ├── try_finally_continue.py.exp │ ├── try_finally_loops.py │ ├── try_finally_return.py │ ├── try_finally_return2.py │ ├── try_finally_return3.py │ ├── try_finally_return4.py │ ├── try_finally_return5.py │ ├── try_reraise.py │ ├── try_reraise2.py │ ├── try_return.py │ ├── tuple1.py │ ├── tuple_compare.py │ ├── tuple_count.py │ ├── tuple_index.py │ ├── tuple_mult.py │ ├── tuple_slice.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 ├── 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 │ ├── repl_inspect.py │ ├── repl_inspect.py.exp │ ├── repl_micropyinspect │ ├── repl_micropyinspect.py │ ├── repl_micropyinspect.py.exp │ ├── repl_words_move.py │ └── repl_words_move.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_all.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 │ ├── modules3 │ │ ├── __init__.py │ │ └── foo.py │ ├── modules_array_containment.py │ ├── modules_array_deletion.py │ ├── modules_array_subscrstep.py │ ├── modules_deque.py │ ├── modules_json_nonserializable.py │ ├── modules_os_environ.py │ ├── modules_os_getenv.py │ ├── modules_os_getenv_argcount.py │ ├── modules_struct_fewargs.py │ ├── modules_struct_manyargs.py │ ├── modules_sys_stdassign.py │ ├── syntax_assign_expr.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_dict_keys_set.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_subscrstep.py │ └── types_tuple_subscrstep.py ├── esp32 │ ├── check_err_str.py │ ├── check_err_str.py.exp │ ├── esp32_idf_heap_info.py │ ├── esp32_idf_heap_info.py.exp │ ├── partition_ota.py │ ├── partition_ota.py.exp │ └── resolve_on_connect.py ├── extmod │ ├── btree1.py │ ├── btree1.py.exp │ ├── btree_error.py │ ├── btree_error.py.exp │ ├── btree_gc.py │ ├── btree_gc.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 │ ├── machine_timer.py │ ├── machine_timer.py.exp │ ├── ticks_diff.py │ ├── ticks_diff.py.exp │ ├── time_ms_us.py │ ├── time_ms_us.py.exp │ ├── uasyncio_await_return.py │ ├── uasyncio_await_return.py.exp │ ├── uasyncio_basic.py │ ├── uasyncio_basic.py.exp │ ├── uasyncio_basic2.py │ ├── uasyncio_basic2.py.exp │ ├── uasyncio_cancel_fair.py │ ├── uasyncio_cancel_fair.py.exp │ ├── uasyncio_cancel_fair2.py │ ├── uasyncio_cancel_fair2.py.exp │ ├── uasyncio_cancel_self.py │ ├── uasyncio_cancel_self.py.exp │ ├── uasyncio_cancel_task.py │ ├── uasyncio_cancel_task.py.exp │ ├── uasyncio_event.py │ ├── uasyncio_event.py.exp │ ├── uasyncio_event_fair.py │ ├── uasyncio_event_fair.py.exp │ ├── uasyncio_exception.py │ ├── uasyncio_exception.py.exp │ ├── uasyncio_fair.py │ ├── uasyncio_fair.py.exp │ ├── uasyncio_gather.py │ ├── uasyncio_gather.py.exp │ ├── uasyncio_get_event_loop.py │ ├── uasyncio_heaplock.py │ ├── uasyncio_heaplock.py.exp │ ├── uasyncio_lock.py │ ├── uasyncio_lock.py.exp │ ├── uasyncio_lock_cancel.py │ ├── uasyncio_lock_cancel.py.exp │ ├── uasyncio_loop_stop.py │ ├── uasyncio_loop_stop.py.exp │ ├── uasyncio_micropython.py │ ├── uasyncio_micropython.py.exp │ ├── uasyncio_new_event_loop.py │ ├── uasyncio_new_event_loop.py.exp │ ├── uasyncio_set_exception_handler.py │ ├── uasyncio_set_exception_handler.py.exp │ ├── uasyncio_wait_for.py │ ├── uasyncio_wait_for.py.exp │ ├── uasyncio_wait_task.py │ ├── uasyncio_wait_task.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_ctr.py │ ├── ucryptolib_aes128_ctr.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_dumps_ordereddict.py │ ├── ujson_load.py │ ├── ujson_loads.py │ ├── ujson_loads_bytes.py │ ├── ujson_loads_bytes.py.exp │ ├── 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 │ ├── uselect_poll_udp.py │ ├── usocket_udp_nonblock.py │ ├── ussl_basic.py │ ├── ussl_basic.py.exp │ ├── ussl_keycert.py │ ├── ussl_keycert.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_blockdev.py │ ├── vfs_blockdev.py.exp │ ├── vfs_fat_fileio1.py │ ├── vfs_fat_fileio1.py.exp │ ├── vfs_fat_fileio2.py │ ├── vfs_fat_fileio2.py.exp │ ├── vfs_fat_finaliser.py │ ├── vfs_fat_finaliser.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_fat_ramdisklarge.py │ ├── vfs_fat_ramdisklarge.py.exp │ ├── vfs_lfs.py │ ├── vfs_lfs.py.exp │ ├── vfs_lfs_corrupt.py │ ├── vfs_lfs_corrupt.py.exp │ ├── vfs_lfs_error.py │ ├── vfs_lfs_error.py.exp │ ├── vfs_lfs_file.py │ ├── vfs_lfs_file.py.exp │ ├── vfs_lfs_mount.py │ ├── vfs_lfs_mount.py.exp │ ├── vfs_lfs_mtime.py │ ├── vfs_lfs_mtime.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 │ ├── bytearray.py │ ├── bytearray.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 │ ├── repl_words_move_check.py │ ├── repl_words_move_check.py.exp │ ├── reverse_ops.py │ ├── reverse_ops.py.exp │ ├── set_check.py │ ├── set_check.py.exp │ ├── slice.py │ ├── slice.py.exp │ ├── uio_module.py │ └── uio_module.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 │ ├── complex_reverse_op.py │ ├── complex_special_methods.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 │ ├── lexer.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 │ ├── math_isclose.py │ ├── math_isclose.py.exp │ ├── 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_long_dyn.py │ ├── import_long_dyn2.py │ ├── import_override.py │ ├── import_override.py.exp │ ├── import_pkg1.py │ ├── import_pkg2.py │ ├── import_pkg3.py │ ├── import_pkg4.py │ ├── import_pkg5.py │ ├── import_pkg6.py │ ├── import_pkg7.py │ ├── import_pkg8.py │ ├── import_star_error.py │ ├── module_getattr.py │ ├── module_getattr.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 ├── internal_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 ├── 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 │ ├── heap_locked.py │ ├── heap_locked.py.exp │ ├── heapalloc.py │ ├── heapalloc.py.exp │ ├── heapalloc_bytesio.py │ ├── heapalloc_bytesio.py.exp │ ├── heapalloc_bytesio2.py │ ├── heapalloc_bytesio2.py.exp │ ├── heapalloc_exc_compressed.py │ ├── heapalloc_exc_compressed.py.exp │ ├── heapalloc_exc_compressed_emg_exc.py │ ├── heapalloc_exc_compressed_emg_exc.py.exp │ ├── heapalloc_exc_raise.py │ ├── heapalloc_exc_raise.py.exp │ ├── heapalloc_fail_bytearray.py │ ├── heapalloc_fail_bytearray.py.exp │ ├── heapalloc_fail_dict.py │ ├── heapalloc_fail_dict.py.exp │ ├── heapalloc_fail_list.py │ ├── heapalloc_fail_list.py.exp │ ├── heapalloc_fail_memoryview.py │ ├── heapalloc_fail_memoryview.py.exp │ ├── heapalloc_fail_set.py │ ├── heapalloc_fail_set.py.exp │ ├── heapalloc_fail_tuple.py │ ├── heapalloc_fail_tuple.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 │ ├── heapalloc_yield_from.py │ ├── heapalloc_yield_from.py.exp │ ├── import_mpy_invalid.py │ ├── import_mpy_invalid.py.exp │ ├── import_mpy_native_gc.py │ ├── import_mpy_native_gc.py.exp │ ├── import_mpy_native_x64.py │ ├── import_mpy_native_x64.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_gen.py │ ├── native_gen.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 │ ├── opt_level_lineno.py │ ├── opt_level_lineno.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_arith_uint.py │ ├── viper_binop_arith_uint.py.exp │ ├── viper_binop_bitwise_uint.py │ ├── viper_binop_bitwise_uint.py.exp │ ├── viper_binop_comp.py │ ├── viper_binop_comp.py.exp │ ├── viper_binop_comp_imm.py │ ├── viper_binop_comp_imm.py.exp │ ├── viper_binop_comp_uint.py │ ├── viper_binop_comp_uint.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_types.py │ ├── viper_types.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_atexit.py │ ├── sys_atexit.py.exp │ ├── sys_exc_info.py │ ├── sys_settrace_features.py │ ├── sys_settrace_generator.py │ ├── sys_settrace_generator.py.exp │ ├── sys_settrace_loop.py │ ├── sys_settrace_loop.py.exp │ └── sys_settrace_subdir │ │ ├── trace_generic.py │ │ └── trace_importme.py ├── multi_bluetooth │ ├── ble_characteristic.py │ ├── ble_characteristic.py.exp │ ├── ble_gap_advertise.py │ ├── ble_gap_advertise.py.exp │ ├── ble_gap_connect.py │ ├── ble_gap_connect.py.exp │ ├── ble_gap_device_name.py │ ├── ble_gap_device_name.py.exp │ ├── ble_gatt_data_transfer.py │ ├── ble_gatt_data_transfer.py.exp │ ├── ble_gattc_discover_services.py │ └── ble_gattc_discover_services.py.exp ├── multi_net │ ├── ssl_data.py │ ├── ssl_data.py.exp │ ├── tcp_accept_recv.py │ ├── tcp_client_rst.py │ ├── tcp_data.py │ ├── uasyncio_tcp_client_rst.py │ ├── uasyncio_tcp_client_rst.py.exp │ ├── uasyncio_tcp_close_write.py │ ├── uasyncio_tcp_close_write.py.exp │ ├── uasyncio_tcp_readexactly.py │ ├── uasyncio_tcp_readexactly.py.exp │ ├── uasyncio_tcp_server_client.py │ └── uasyncio_tcp_server_client.py.exp ├── 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 │ ├── getaddrinfo.py │ ├── test_tls_sites.py │ ├── test_tls_sites.py.exp │ ├── tls_num_errors.py │ ├── tls_num_errors.py.exp │ ├── tls_text_errors.py │ ├── uasyncio_cancel_stream.py │ ├── uasyncio_cancel_stream.py.exp │ ├── uasyncio_open_connection.py │ ├── uasyncio_open_connection.py.exp │ ├── uasyncio_tcp_read_headers.py │ └── uasyncio_tcp_read_headers.py.exp ├── perf_bench │ ├── benchrun.py │ ├── bm_chaos.py │ ├── bm_fannkuch.py │ ├── bm_fft.py │ ├── bm_float.py │ ├── bm_hexiom.py │ ├── bm_nqueens.py │ ├── bm_pidigits.py │ ├── misc_aes.py │ ├── misc_mandel.py │ ├── misc_pystone.py │ ├── misc_raytrace.py │ ├── viper_call0.py │ ├── viper_call1a.py │ ├── viper_call1b.py │ ├── viper_call1c.py │ ├── viper_call2a.py │ └── viper_call2b.py ├── pyb │ ├── accel.py │ ├── accel.py.exp │ ├── adc.py │ ├── adc.py.exp │ ├── adcall.py │ ├── adcall.py.exp │ ├── board_pybv1x.py │ ├── board_pybv1x.py.exp │ ├── can.py │ ├── can.py.exp │ ├── can2.py │ ├── can2.py.exp │ ├── dac.py │ ├── dac.py.exp │ ├── extint.py │ ├── extint.py.exp │ ├── i2c.py │ ├── i2c.py.exp │ ├── i2c_accel.py │ ├── i2c_accel.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 ├── qemu-arm │ ├── native_test.py │ └── native_test.py.exp ├── run-internalbench.py ├── run-multitests.py ├── run-natmodtests.py ├── run-perfbench.py ├── 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 │ ├── qstr_limit.py │ ├── qstr_limit.py.exp │ ├── 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 │ ├── stress_schedule.py │ ├── stress_schedule.py.exp │ ├── 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_slice.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 │ └── time.py └── 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 ├── codeformat.py ├── codestats.sh ├── dfu.py ├── file2h.py ├── gen-changelog.sh ├── gen-cpydiff.py ├── gendoc.py ├── insert-usb-ids.py ├── make-frozen.py ├── makemanifest.py ├── metrics.py ├── mpy-tool.py ├── mpy_bin2res.py ├── mpy_cross_all.py ├── mpy_ld.py ├── pyboard.py ├── pydfu.py ├── tinytest-codegen.py ├── uf2conv.py ├── uncrustify.cfg ├── upip.py └── upip_utarfile.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: micropython 2 | -------------------------------------------------------------------------------- /docs/esp32/img/esp32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/esp32/img/esp32.jpg -------------------------------------------------------------------------------- /docs/esp8266/img/adafruit_products_pinoutstop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/esp8266/img/adafruit_products_pinoutstop.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/pyboard_servo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/pyboard/tutorial/img/pyboard_servo.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/pyboard_usb_micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/pyboard/tutorial/img/pyboard_usb_micro.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_amp_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/pyboard/tutorial/img/skin_amp_1.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_amp_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/pyboard/tutorial/img/skin_amp_2.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_lcd_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/pyboard/tutorial/img/skin_lcd_1.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_lcd_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/pyboard/tutorial/img/skin_lcd_2.jpg -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/docs/static/favicon.ico -------------------------------------------------------------------------------- /drivers/README.md: -------------------------------------------------------------------------------- 1 | This directory contains drivers for specific hardware. The drivers are 2 | intended to work across multiple ports. 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /drivers/cc3100/inc/netapp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/drivers/cc3100/inc/netapp.h -------------------------------------------------------------------------------- /drivers/cyw43/libcyw43.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/drivers/cyw43/libcyw43.a -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/SDdatalogger/cardreader.py: -------------------------------------------------------------------------------- 1 | # cardread.py 2 | # This is called when the user enters cardreader mode. It does nothing. 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/embedding/mpconfigport.h: -------------------------------------------------------------------------------- 1 | #include "mpconfigport_minimal.h" 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/micropython.py: -------------------------------------------------------------------------------- 1 | # micropython module placeholder for CPython 2 | 3 | # Dummy function decorators 4 | 5 | 6 | def nodecor(x): 7 | return x 8 | 9 | 10 | bytecode = native = viper = nodecor 11 | -------------------------------------------------------------------------------- /examples/natmod/.gitignore: -------------------------------------------------------------------------------- 1 | *.mpy 2 | -------------------------------------------------------------------------------- /examples/natmod/btree/btree_py.py: -------------------------------------------------------------------------------- 1 | # Implemented in Python to support keyword arguments 2 | def open(stream, *, flags=0, cachesize=0, pagesize=0, minkeypage=0): 3 | return _open(stream, flags, cachesize, pagesize, minkeypage) 4 | -------------------------------------------------------------------------------- /examples/natmod/features2/prod.c: -------------------------------------------------------------------------------- 1 | #include "prod.h" 2 | 3 | float prod_array(int n, float *ar) { 4 | float ans = 1; 5 | for (int i = 0; i < n; ++i) { 6 | ans *= ar[i]; 7 | } 8 | return ans; 9 | } 10 | -------------------------------------------------------------------------------- /examples/natmod/features2/prod.h: -------------------------------------------------------------------------------- 1 | float prod_array(int n, float *ar); 2 | -------------------------------------------------------------------------------- /extmod/axtls-include/version.h: -------------------------------------------------------------------------------- 1 | #define AXTLS_VERSION "(no version)" 2 | -------------------------------------------------------------------------------- /extmod/nimble/bsp/bsp.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /extmod/nimble/hal/hal_gpio.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /extmod/uzlib/tinf.h: -------------------------------------------------------------------------------- 1 | /* Compatibility header for the original tinf lib/older versions of uzlib. 2 | Note: may be removed in the future, please migrate to uzlib.h. */ 3 | #include "uzlib.h" 4 | -------------------------------------------------------------------------------- /extmod/webrepl/manifest.py: -------------------------------------------------------------------------------- 1 | freeze(".", ("webrepl.py", "webrepl_setup.py", "websocket_helper.py",)) 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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, MP_ERROR_TEXT("abort() called")); 7 | } 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/libm_dbl/ldexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ldexp(double x, int n) 4 | { 5 | return scalbn(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/mbedtls_errors/do-test.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash -e 2 | # Generate mp_mbedtls_errors.c and build the tester app 3 | ./do-mp.sh 4 | cc -o tester -I../mbedtls/include/ mp_mbedtls_errors.c tester.c 5 | -------------------------------------------------------------------------------- /logo/1bit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/1bit-logo.png -------------------------------------------------------------------------------- /logo/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/logo.jpg -------------------------------------------------------------------------------- /logo/micropythonpowered-art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/micropythonpowered-art.png -------------------------------------------------------------------------------- /logo/trans-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/trans-logo.png -------------------------------------------------------------------------------- /logo/upython-with-micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/upython-with-micro.jpg -------------------------------------------------------------------------------- /logo/upython-with-micro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/upython-with-micro.png -------------------------------------------------------------------------------- /logo/vector-logo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/vector-logo-2.png -------------------------------------------------------------------------------- /logo/vector-logo-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/logo/vector-logo-3.png -------------------------------------------------------------------------------- /mpy-cross/.gitignore: -------------------------------------------------------------------------------- 1 | mpy-cross 2 | -------------------------------------------------------------------------------- /mpy-cross/mphalport.h: -------------------------------------------------------------------------------- 1 | // prevent including extmod/virtpin.h 2 | #define mp_hal_pin_obj_t 3 | -------------------------------------------------------------------------------- /mpy-cross/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | -------------------------------------------------------------------------------- /ports/bare-arm/mphalport.h: -------------------------------------------------------------------------------- 1 | // empty file 2 | -------------------------------------------------------------------------------- /ports/bare-arm/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/cc3200/bootmgr/relocator/relocator.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/ports/cc3200/bootmgr/relocator/relocator.bin -------------------------------------------------------------------------------- /ports/efm32/boards/ikea/board_pins.h: -------------------------------------------------------------------------------- 1 | #define USART_TX_PORT gpioPortB 2 | #define USART_TX_PIN 15 3 | #define USART_TX_LOCATION 10 // ? found in af_pins.h somehow 4 | #define USART_RX_PORT gpioPortB 5 | #define USART_RX_PIN 14 6 | #define USART_RX_LOCATION 8 // ? 7 | -------------------------------------------------------------------------------- /ports/efm32/boards/ikea/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "gecko" 2 | #define MICROPY_HW_MCU_NAME "efr32mg1p" 3 | 4 | -------------------------------------------------------------------------------- /ports/efm32/boards/ikea/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | EFM_FAMILY = efr32mg1p 2 | RAIL_FAMILY = efr32xg1x 3 | EFM_DEV = EFR32MG1P132F256GM32 4 | MCU_SERIES = CORTEX_M4 5 | RAIL_LIB = $(RAIL_DIR)/TARGET_EFR32_1/librail_efr32xg1_release.a 6 | -------------------------------------------------------------------------------- /ports/efm32/boards/tbsense2/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "tbsense2" 2 | #define MICROPY_HW_MCU_NAME "efr32mg12p" 3 | 4 | -------------------------------------------------------------------------------- /ports/efm32/boards/tbsense2/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | EFM_FAMILY = efr32mg12p 2 | RAIL_FAMILY = efr32xg1x 3 | EFM_DEV = EFR32MG12P332F1024GL125 4 | MCU_SERIES = CORTEX_M4 5 | RAIL_LIB = $(RAIL_DIR)/TARGET_EFR32_12/librail_efr32xg12_release.a 6 | -------------------------------------------------------------------------------- /ports/efm32/images/efr32-annotated.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/ports/efm32/images/efr32-annotated.jpg -------------------------------------------------------------------------------- /ports/efm32/images/efr32-pins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/ports/efm32/images/efr32-pins.png -------------------------------------------------------------------------------- /ports/efm32/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | -------------------------------------------------------------------------------- /ports/efm32/rail/TARGET_EFR32_1/librail_efr32xg1_release.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/ports/efm32/rail/TARGET_EFR32_1/librail_efr32xg1_release.a -------------------------------------------------------------------------------- /ports/efm32/rail/TARGET_EFR32_12/librail_efr32xg12_release.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/ports/efm32/rail/TARGET_EFR32_12/librail_efr32xg12_release.a -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "ESP32 module" 2 | #define MICROPY_HW_MCU_NAME "ESP32" 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | SDKCONFIG += boards/sdkconfig.base 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC_D2WD/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Generic ESP32-D2WD module" 2 | #define MICROPY_HW_MCU_NAME "ESP32-D2WD" 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC_D2WD/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | SDKCONFIG += boards/sdkconfig.base 2 | PART_SRC = partitions-2MiB.csv 3 | FLASH_SIZE = 2MB 4 | FLASH_MODE = dio 5 | FLASH_FREQ = 40m 6 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC_OTA/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "4MB/OTA module" 2 | #define MICROPY_HW_MCU_NAME "ESP32" 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC_OTA/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | SDKCONFIG += boards/sdkconfig.base 2 | SDKCONFIG += boards/GENERIC_OTA/sdkconfig.board 3 | 4 | PART_SRC = partitions-ota.csv 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC_OTA/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y 2 | 3 | # ESP-IDF v3: 4 | CONFIG_APP_ROLLBACK_ENABLE=y 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC_SPIRAM/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "ESP32 module (spiram)" 2 | #define MICROPY_HW_MCU_NAME "ESP32" 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/GENERIC_SPIRAM/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | SDKCONFIG += boards/sdkconfig.base 2 | SDKCONFIG += boards/sdkconfig.spiram 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/TINYPICO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/TINYPICO/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "TinyPICO" 2 | #define MICROPY_HW_MCU_NAME "ESP32-PICO-D4" 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/TINYPICO/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | CONFIG_SPIRAM_SPEED_80M=y 4 | CONFIG_ESP32_REV_MIN_1=y 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/sdkconfig.240mhz: -------------------------------------------------------------------------------- 1 | # MicroPython on ESP32, ESP IDF configuration with 240MHz CPU 2 | CONFIG_ESP32_DEFAULT_CPU_FREQ_80= 3 | CONFIG_ESP32_DEFAULT_CPU_FREQ_160= 4 | CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y 5 | CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 6 | -------------------------------------------------------------------------------- /ports/esp32/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /ports/esp32/modesp.h: -------------------------------------------------------------------------------- 1 | void esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32_t numBytes, uint8_t timing); 2 | -------------------------------------------------------------------------------- /ports/esp32/modules/_boot.py: -------------------------------------------------------------------------------- 1 | import gc 2 | import uos 3 | from flashbdev import bdev 4 | 5 | try: 6 | if bdev: 7 | uos.mount(bdev, "/") 8 | except OSError: 9 | import inisetup 10 | 11 | vfs = inisetup.setup() 12 | 13 | gc.collect() 14 | -------------------------------------------------------------------------------- /ports/esp32/modules/apa106.py: -------------------------------------------------------------------------------- 1 | # APA106driver for MicroPython on ESP32 2 | # MIT license; Copyright (c) 2016 Damien P. George 3 | 4 | from neopixel import NeoPixel 5 | 6 | 7 | class APA106(NeoPixel): 8 | ORDER = (0, 1, 2, 3) 9 | -------------------------------------------------------------------------------- /ports/esp32/modules/flashbdev.py: -------------------------------------------------------------------------------- 1 | from esp32 import Partition 2 | 3 | bdev = Partition.find(Partition.TYPE_DATA, label="vfs") 4 | bdev = bdev[0] if bdev else None 5 | -------------------------------------------------------------------------------- /ports/esp8266/boards/GENERIC/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | include("$(MPY_DIR)/extmod/uasyncio/manifest.py") 3 | -------------------------------------------------------------------------------- /ports/esp8266/boards/GENERIC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | LD_FILES = boards/esp8266_2m.ld 2 | 3 | MICROPY_PY_BTREE ?= 1 4 | MICROPY_VFS_FAT ?= 1 5 | MICROPY_VFS_LFS2 ?= 1 6 | 7 | FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py 8 | -------------------------------------------------------------------------------- /ports/esp8266/boards/GENERIC_1M/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | LD_FILES = boards/esp8266_1m.ld 2 | 3 | MICROPY_PY_BTREE ?= 1 4 | MICROPY_VFS_LFS2 ?= 1 5 | -------------------------------------------------------------------------------- /ports/esp8266/boards/GENERIC_512K/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "ESP module (512K)" 2 | #define MICROPY_HW_MCU_NAME "ESP8266" 3 | 4 | #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE) 5 | -------------------------------------------------------------------------------- /ports/esp8266/boards/GENERIC_512K/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | LD_FILES = boards/esp8266_512k.ld 2 | -------------------------------------------------------------------------------- /ports/esp8266/boards/manifest.py: -------------------------------------------------------------------------------- 1 | freeze("$(PORT_DIR)/modules") 2 | freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py")) 3 | freeze("$(MPY_DIR)/drivers/dht", "dht.py") 4 | freeze("$(MPY_DIR)/drivers/onewire") 5 | include("$(MPY_DIR)/extmod/webrepl/manifest.py") 6 | -------------------------------------------------------------------------------- /ports/esp8266/espneopixel.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H 2 | #define MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H 3 | 4 | void esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32_t numBytes, bool is800KHz); 5 | 6 | #endif // MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H 7 | -------------------------------------------------------------------------------- /ports/esp8266/user_config.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /ports/javascript/node_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | node $(dirname $0)/build/micropython.js "$@" 3 | -------------------------------------------------------------------------------- /ports/javascript/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1010_EVK/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = MIMXRT1011 2 | MCU_VARIANT = MIMXRT1011DAE5A 3 | 4 | JLINK_PATH = /media/RT1010-EVK/ 5 | 6 | deploy: $(BUILD)/firmware.bin 7 | cp $< $(JLINK_PATH) 8 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1020_EVK/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = MIMXRT1021 2 | MCU_VARIANT = MIMXRT1021DAG5A 3 | 4 | JLINK_PATH ?= /media/RT1020-EVK/ 5 | 6 | deploy: $(BUILD)/firmware.bin 7 | cp $< $(JLINK_PATH) 8 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1021.ld: -------------------------------------------------------------------------------- 1 | /* 24kiB stack. */ 2 | __stack_size__ = 0x6000; 3 | _estack = __StackTop; 4 | _sstack = __StackLimit; 5 | 6 | /* Use second OCRAM bank for GC heap. */ 7 | _gc_heap_start = ORIGIN(m_data2); 8 | _gc_heap_end = ORIGIN(m_data2) + LENGTH(m_data2); 9 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1060_EVK/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = MIMXRT1062 2 | MCU_VARIANT = MIMXRT1062DVJ6A 3 | 4 | JLINK_PATH ?= /media/RT1060-EVK/ 5 | 6 | deploy: $(BUILD)/firmware.bin 7 | cp $< $(JLINK_PATH) 8 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1062.ld: -------------------------------------------------------------------------------- 1 | /* 32kiB stack. */ 2 | __stack_size__ = 0x8000; 3 | _estack = __StackTop; 4 | _sstack = __StackLimit; 5 | 6 | /* Use second OCRAM bank for GC heap. */ 7 | _gc_heap_start = ORIGIN(m_data2); 8 | _gc_heap_end = ORIGIN(m_data2) + LENGTH(m_data2); 9 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/TEENSY40/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = MIMXRT1062 2 | MCU_VARIANT = MIMXRT1062DVJ6A 3 | 4 | deploy: $(BUILD)/firmware.hex 5 | teensy_loader_cli --mcu=imxrt1062 -v -w $< 6 | -------------------------------------------------------------------------------- /ports/mimxrt/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/minimal/frozentest.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/ports/minimal/frozentest.mpy -------------------------------------------------------------------------------- /ports/minimal/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 | -------------------------------------------------------------------------------- /ports/minimal/mphalport.h: -------------------------------------------------------------------------------- 1 | static inline mp_uint_t mp_hal_ticks_ms(void) { 2 | return 0; 3 | } 4 | static inline void mp_hal_set_interrupt_char(char c) { 5 | } 6 | -------------------------------------------------------------------------------- /ports/minimal/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/nrf/.gitignore: -------------------------------------------------------------------------------- 1 | # Nordic files 2 | ##################### 3 | drivers/bluetooth/s1*/ 4 | -------------------------------------------------------------------------------- /ports/nrf/boards/actinius_icarus/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m33 2 | MCU_VARIANT = nrf91 3 | MCU_SUB_VARIANT = nrf9160 4 | LD_FILES += boards/nrf9160_1M_256k.ld 5 | 6 | NRF_DEFINES += -DNRF9160_XXAA -DNRF_TRUSTZONE_NONSECURE 7 | -------------------------------------------------------------------------------- /ports/nrf/boards/arduino_primo/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | FLASHER = pyocd 7 | 8 | NRF_DEFINES += -DNRF52832_XXAA 9 | -------------------------------------------------------------------------------- /ports/nrf/boards/blueio_tag_evim/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | FLASHER = idap 7 | 8 | NRF_DEFINES += -DNRF52832_XXAA 9 | -------------------------------------------------------------------------------- /ports/nrf/boards/dvk_bl652/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | 7 | NRF_DEFINES += -DNRF52832_XXAA 8 | CFLAGS += -DBLUETOOTH_LFCLK_RC 9 | -------------------------------------------------------------------------------- /ports/nrf/boards/evk_nina_b1/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | 7 | NRF_DEFINES += -DNRF52832_XXAA 8 | -------------------------------------------------------------------------------- /ports/nrf/boards/feather52/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | 7 | NRF_DEFINES += -DNRF52832_XXAA 8 | 9 | -------------------------------------------------------------------------------- /ports/nrf/boards/ibk_blyst_nano/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | FLASHER = idap 7 | 8 | NRF_DEFINES += -DNRF52832_XXAA 9 | -------------------------------------------------------------------------------- /ports/nrf/boards/idk_blyst_nano/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | FLASHER = idap 7 | 8 | NRF_DEFINES += -DNRF52832_XXAA 9 | -------------------------------------------------------------------------------- /ports/nrf/boards/microbit/custom_nrf51822_s110_microbit.ld: -------------------------------------------------------------------------------- 1 | _fs_size = 12K; 2 | -------------------------------------------------------------------------------- /ports/nrf/boards/microbit/modules/iters.h: -------------------------------------------------------------------------------- 1 | 2 | #include "py/runtime.h" 3 | 4 | mp_obj_t microbit_repeat_iterator(mp_obj_t iterable); 5 | -------------------------------------------------------------------------------- /ports/nrf/boards/nrf52840-mdk-usb-dongle/nrf52840_open_bootloader.ld: -------------------------------------------------------------------------------- 1 | _ram_start = 0x20000008; 2 | _flash_start = 0x1000; 3 | -------------------------------------------------------------------------------- /ports/nrf/boards/nrf9160_1M_256k_secure.ld: -------------------------------------------------------------------------------- 1 | /* Specify the memory areas */ 2 | MEMORY 3 | { 4 | FLASH_TEXT (rx) : ORIGIN = 0x00000000, LENGTH = 32K 5 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K 6 | } 7 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10000/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m0 2 | MCU_VARIANT = nrf51 3 | MCU_SUB_VARIANT = nrf51822 4 | SOFTDEV_VERSION = 8.0.0 5 | LD_FILES += boards/nrf51x22_256k_16k.ld 6 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10000/pins.csv: -------------------------------------------------------------------------------- 1 | UART_RTS,P8 2 | UART_TX,P9 3 | UART_CTS,P10 4 | UART_RX,P11 5 | LED_RED,P21 6 | LED_GREEN,P22 7 | LED_BLUE,P23 8 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10001/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m0 2 | MCU_VARIANT = nrf51 3 | MCU_SUB_VARIANT = nrf51822 4 | SOFTDEV_VERSION = 8.0.0 5 | LD_FILES += boards/nrf51x22_256k_16k.ld 6 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10028/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m0 2 | MCU_VARIANT = nrf51 3 | MCU_SUB_VARIANT = nrf51822 4 | SOFTDEV_VERSION = 8.0.0 5 | LD_FILES += boards/nrf51x22_256k_32k.ld 6 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10031/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m0 2 | MCU_VARIANT = nrf51 3 | MCU_SUB_VARIANT = nrf51822 4 | SOFTDEV_VERSION = 8.0.0 5 | LD_FILES += boards/nrf51x22_256k_32k.ld 6 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10031/pins.csv: -------------------------------------------------------------------------------- 1 | UART_RTS,P8 2 | UART_TX,P9 3 | UART_CTS,P10 4 | UART_RX,P11 5 | LED_RED,P21 6 | LED_GREEN,P22 7 | LED_BLUE,P23 8 | P15,P15 9 | P16,P16 10 | P17,P17 11 | P18,P18 12 | P19,P19 13 | P20,P20 14 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10040/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52832 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52832_512k_64k.ld 6 | 7 | NRF_DEFINES += -DNRF52832_XXAA 8 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10056/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52840 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52840_1M_256k.ld 6 | 7 | NRF_DEFINES += -DNRF52840_XXAA 8 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10059/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m4 2 | MCU_VARIANT = nrf52 3 | MCU_SUB_VARIANT = nrf52840 4 | SOFTDEV_VERSION = 6.1.1 5 | LD_FILES += boards/nrf52840_1M_256k.ld 6 | 7 | NRF_DEFINES += -DNRF52840_XXAA 8 | -------------------------------------------------------------------------------- /ports/nrf/boards/pca10090/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m33 2 | MCU_VARIANT = nrf91 3 | MCU_SUB_VARIANT = nrf9160 4 | LD_FILES += boards/nrf9160_1M_256k.ld 5 | 6 | NRF_DEFINES += -DNRF9160_XXAA -DNRF_TRUSTZONE_NONSECURE 7 | -------------------------------------------------------------------------------- /ports/nrf/boards/s132_6.1.1.ld: -------------------------------------------------------------------------------- 1 | /* GNU linker script for s132 SoftDevice version 6.1.1 */ 2 | 3 | _sd_size = 0x00026000; 4 | _sd_ram = 0x000039c0; 5 | -------------------------------------------------------------------------------- /ports/nrf/boards/s140_6.1.1.ld: -------------------------------------------------------------------------------- 1 | /* GNU linker script for s140 SoftDevice version 6.1.1 */ 2 | 3 | _sd_size = 0x00026000; 4 | _sd_ram = 0x000039c0; 5 | -------------------------------------------------------------------------------- /ports/nrf/boards/wt51822_s4at/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = m0 2 | MCU_VARIANT = nrf51 3 | MCU_SUB_VARIANT = nrf51822 4 | SOFTDEV_VERSION = 8.0.0 5 | LD_FILES += boards/nrf51x22_256k_16k.ld 6 | 7 | CFLAGS += -DBLUETOOTH_LFCLK_RC 8 | -------------------------------------------------------------------------------- /ports/nrf/boards/wt51822_s4at/pins.csv: -------------------------------------------------------------------------------- 1 | P1,P1 2 | P2,P2 3 | P3,P3 4 | P4,P4 5 | P9,P9 6 | P10,P10 7 | P13,P13 8 | -------------------------------------------------------------------------------- /ports/nrf/freeze/test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | def hello(): 5 | print("Hello %s!" % sys.platform) 6 | -------------------------------------------------------------------------------- /ports/nrf/modules/music/modmusic.h: -------------------------------------------------------------------------------- 1 | #ifndef __MICROPY_INCLUDED_MICROBIT_MUSIC_H__ 2 | #define __MICROPY_INCLUDED_MICROBIT_MUSIC_H__ 3 | 4 | void microbit_music_init0(void); 5 | void microbit_music_tick(void); 6 | 7 | #endif // __MICROPY_INCLUDED_MICROBIT_MUSIC_H__ 8 | -------------------------------------------------------------------------------- /ports/pic16bit/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/powerpc/frozentest.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/ports/powerpc/frozentest.mpy -------------------------------------------------------------------------------- /ports/powerpc/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 | -------------------------------------------------------------------------------- /ports/powerpc/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/qemu-arm/mphalport.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "uart.h" 3 | 4 | #define mp_hal_stdin_rx_chr() (0) 5 | #define mp_hal_stdout_tx_strn_cooked(s, l) uart_tx_strn((s), (l)) 6 | -------------------------------------------------------------------------------- /ports/qemu-arm/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/qemu-arm/uart.h: -------------------------------------------------------------------------------- 1 | void uart_init(void); 2 | void uart_tx_strn(const char *buf, size_t len); 3 | -------------------------------------------------------------------------------- /ports/samd/README.md: -------------------------------------------------------------------------------- 1 | Port of MicroPython to Microchip SAMD MCUs 2 | ========================================== 3 | 4 | Supports SAMD21 and SAMD51. 5 | 6 | Features: 7 | - REPL over USB VCP 8 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_FEATHER_M0_EXPRESS/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Feather M0 Express" 2 | #define MICROPY_HW_MCU_NAME "SAMD21G18A" 3 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_FEATHER_M0_EXPRESS/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD21 2 | CMSIS_MCU = SAMD21G18A 3 | LD_FILES = boards/samd21x18a.ld sections.ld 4 | TEXT0 = 0x2000 5 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_ITSYBITSY_M4_EXPRESS/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD51 2 | CMSIS_MCU = SAMD51G19A 3 | LD_FILES = boards/samd51g19a.ld sections.ld 4 | TEXT0 = 0x4000 5 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_TRINKET_M0/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Trinket M0" 2 | #define MICROPY_HW_MCU_NAME "SAMD21E18A" 3 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_TRINKET_M0/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD21 2 | CMSIS_MCU = SAMD21E18A 3 | LD_FILES = boards/samd21x18a.ld sections.ld 4 | TEXT0 = 0x2000 5 | -------------------------------------------------------------------------------- /ports/samd/boards/MINISAM_M4/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | # https://www.minifigboards.com/mini-sam-m4/mini-sam-m4-hardware/ 2 | MCU_SERIES = SAMD51 3 | CMSIS_MCU = SAMD51G19A 4 | LD_FILES = boards/samd51g19a.ld sections.ld 5 | TEXT0 = 0x4000 6 | -------------------------------------------------------------------------------- /ports/samd/boards/SAMD21_XPLAINED_PRO/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "SAMD21-XPLAINED-PRO" 2 | #define MICROPY_HW_MCU_NAME "SAMD21J18A" 3 | -------------------------------------------------------------------------------- /ports/samd/boards/SAMD21_XPLAINED_PRO/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD21 2 | CMSIS_MCU = SAMD21J18A 3 | LD_FILES = boards/samd21x18a.ld sections.ld 4 | TEXT0 = 0x2000 5 | -------------------------------------------------------------------------------- /ports/samd/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/CERB40/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F405xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/HYDRABUS/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F405xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/LIMIFROG/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = l4 2 | CMSIS_MCU = STM32L476xx 3 | AF_FILE = boards/stm32l476_af.csv 4 | LD_FILES = boards/stm32l476xe.ld boards/common_basic.ld 5 | -------------------------------------------------------------------------------- /ports/stm32/boards/NETDUINO_PLUS_2/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F405xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F401RE/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F401xE 3 | AF_FILE = boards/stm32f401_af.csv 4 | LD_FILES = boards/stm32f401xe.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F411RE/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F411xE 3 | AF_FILE = boards/stm32f411_af.csv 4 | LD_FILES = boards/stm32f411.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F412ZG/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F412Zx 3 | AF_FILE = boards/stm32f412_af.csv 4 | LD_FILES = boards/stm32f412zx.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F413ZH/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F413xx 3 | AF_FILE = boards/stm32f413_af.csv 4 | LD_FILES = boards/stm32f413xh.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08060000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F446RE/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F446xx 3 | AF_FILE = boards/stm32f429_af.csv 4 | LD_FILES = boards/stm32f411.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F722ZE/board_init.c: -------------------------------------------------------------------------------- 1 | #include "py/mphal.h" 2 | 3 | void board_early_init(void) { 4 | // Turn off the USB switch 5 | #define USB_PowerSwitchOn pin_G6 6 | mp_hal_pin_output(USB_PowerSwitchOn); 7 | mp_hal_pin_low(USB_PowerSwitchOn); 8 | } 9 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F722ZE/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f7 2 | CMSIS_MCU = STM32F722xx 3 | AF_FILE = boards/stm32f722_af.csv 4 | LD_FILES = boards/stm32f722.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_L452RE/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = l4 2 | CMSIS_MCU = STM32L452xx 3 | AF_FILE = boards/stm32l452_af.csv 4 | LD_FILES = boards/stm32l452xe.ld boards/common_basic.ld 5 | OPENOCD_CONFIG = boards/openocd_stm32l4.cfg 6 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_L476RG/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = l4 2 | CMSIS_MCU = STM32L476xx 3 | AF_FILE = boards/stm32l476_af.csv 4 | LD_FILES = boards/stm32l476xg.ld boards/common_basic.ld 5 | OPENOCD_CONFIG = boards/openocd_stm32l4.cfg 6 | -------------------------------------------------------------------------------- /ports/stm32/boards/OLIMEX_E407/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F407xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF2/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | include("$(MPY_DIR)/extmod/webrepl/manifest.py") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF3/bdev.c: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/bdev.c" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF3/board_init.c: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/board_init.c" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF3/stm32f7xx_hal_conf.h: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/stm32f7xx_hal_conf.h" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF6/bdev.c: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/bdev.c" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF6/board_init.c: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/board_init.c" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF6/stm32f7xx_hal_conf.h: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/stm32f7xx_hal_conf.h" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBLITEV10/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F411xE 3 | AF_FILE = boards/stm32f411_af.csv 4 | LD_FILES = boards/stm32f411.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV3/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F405xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV4/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F405xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32F411DISC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F411xE 3 | AF_FILE = boards/stm32f411_af.csv 4 | LD_FILES = boards/stm32f411.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32F429DISC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F429xx 3 | AF_FILE = boards/stm32f429_af.csv 4 | LD_FILES = boards/stm32f429.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32F439/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F439xx 3 | AF_FILE = boards/stm32f439_af.csv 4 | LD_FILES = boards/stm32f439.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32F4DISC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F407xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32L476DISC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = l4 2 | CMSIS_MCU = STM32L476xx 3 | AF_FILE = boards/stm32l476_af.csv 4 | LD_FILES = boards/stm32l476xg.ld boards/common_basic.ld 5 | OPENOCD_CONFIG = boards/openocd_stm32l4.cfg 6 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32L496GDISC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = l4 2 | CMSIS_MCU = STM32L496xx 3 | AF_FILE = boards/stm32l496_af.csv 4 | LD_FILES = boards/stm32l496xg.ld boards/common_basic.ld 5 | OPENOCD_CONFIG = boards/openocd_stm32l4.cfg 6 | -------------------------------------------------------------------------------- /ports/stm32/boards/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(MPY_DIR)/extmod/uasyncio/manifest.py") 2 | freeze("$(MPY_DIR)/drivers/dht", "dht.py") 3 | freeze("$(MPY_DIR)/drivers/display", ("lcd160cr.py", "lcd160cr_test.py")) 4 | freeze("$(MPY_DIR)/drivers/onewire", "onewire.py") 5 | -------------------------------------------------------------------------------- /ports/stm32/lwip_inc/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /ports/teensy/core/Arduino.h: -------------------------------------------------------------------------------- 1 | //#include "WProgram.h" 2 | #include "core_pins.h" 3 | #include "pins_arduino.h" 4 | -------------------------------------------------------------------------------- /ports/teensy/lexermemzip.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H 2 | #define MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H 3 | 4 | mp_lexer_t *mp_lexer_new_from_memzip_file(const char *filename); 5 | 6 | #endif // MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H 7 | -------------------------------------------------------------------------------- /ports/teensy/memzip_files/main.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | print("Executing main.py") 4 | 5 | led = pyb.LED(1) 6 | 7 | led.on() 8 | pyb.delay(100) 9 | led.off() 10 | pyb.delay(100) 11 | led.on() 12 | pyb.delay(100) 13 | led.off() 14 | -------------------------------------------------------------------------------- /ports/teensy/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/unix/.gitignore: -------------------------------------------------------------------------------- 1 | micropython 2 | micropython-* 3 | *.py 4 | *.gcov 5 | -------------------------------------------------------------------------------- /ports/unix/input.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROPY_INCLUDED_UNIX_INPUT_H 2 | #define MICROPY_INCLUDED_UNIX_INPUT_H 3 | 4 | char *prompt(char *p); 5 | void prompt_read_history(void); 6 | void prompt_write_history(void); 7 | 8 | #endif // MICROPY_INCLUDED_UNIX_INPUT_H 9 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzmpy1.py: -------------------------------------------------------------------------------- 1 | print('frzmpy1') 2 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzmpy2.py: -------------------------------------------------------------------------------- 1 | raise ZeroDivisionError 2 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzmpy_pkg1/__init__.py: -------------------------------------------------------------------------------- 1 | # test frozen package with __init__.py 2 | print('frzmpy_pkg1.__init__') 3 | x = 1 4 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzmpy_pkg2/mod.py: -------------------------------------------------------------------------------- 1 | # test frozen package without __init__.py 2 | print('frzmpy_pkg2.mod') 3 | class Foo: 4 | x = 1 5 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzqstr.py: -------------------------------------------------------------------------------- 1 | # Checks for regression on MP_QSTR_NULL 2 | def returns_NULL(): 3 | return "NULL" 4 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzstr/frzstr1.py: -------------------------------------------------------------------------------- 1 | print('frzstr1') 2 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzstr/frzstr_pkg1/__init__.py: -------------------------------------------------------------------------------- 1 | # test frozen package with __init__.py 2 | print('frzstr_pkg1.__init__') 3 | x = 1 4 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzstr/frzstr_pkg2/mod.py: -------------------------------------------------------------------------------- 1 | # test frozen package without __init__.py 2 | print('frzstr_pkg2.mod') 3 | class Foo: 4 | x = 1 5 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/manifest.py: -------------------------------------------------------------------------------- 1 | freeze_as_str("frzstr") 2 | freeze_as_mpy("frzmpy") 3 | -------------------------------------------------------------------------------- /ports/unix/variants/dev/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/variants/manifest.py") 2 | 3 | include("$(MPY_DIR)/extmod/uasyncio/manifest.py") 4 | -------------------------------------------------------------------------------- /ports/unix/variants/dev/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | PROG ?= micropython-dev 2 | 3 | FROZEN_MANIFEST ?= $(VARIANT_DIR)/manifest.py 4 | 5 | MICROPY_ROM_TEXT_COMPRESSION = 1 6 | MICROPY_VFS_FAT = 1 7 | MICROPY_VFS_LFS1 = 1 8 | MICROPY_VFS_LFS2 = 1 9 | MICROPY_PY_BLUETOOTH = 1 10 | -------------------------------------------------------------------------------- /ports/unix/variants/fast/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | # build synthetically fast interpreter for benchmarking 2 | 3 | COPT += "-fno-crossjumping -O2" 4 | 5 | PROG = micropython-fast 6 | 7 | FROZEN_MANIFEST = 8 | -------------------------------------------------------------------------------- /ports/unix/variants/manifest.py: -------------------------------------------------------------------------------- 1 | freeze_as_mpy('$(MPY_DIR)/tools', 'upip.py') 2 | freeze_as_mpy('$(MPY_DIR)/tools', 'upip_utarfile.py', opt=3) 3 | -------------------------------------------------------------------------------- /ports/unix/variants/nanbox/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | # build interpreter with nan-boxing as object model (object repr D) 2 | PROG = micropython-nanbox 3 | 4 | MICROPY_FORCE_32BIT = 1 5 | -------------------------------------------------------------------------------- /ports/unix/variants/standard/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | # This is the default variant when you `make` the Unix port. 2 | 3 | PROG ?= micropython 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ports/zephyr/.gitignore: -------------------------------------------------------------------------------- 1 | outdir/ 2 | -------------------------------------------------------------------------------- /ports/zephyr/Kbuild: -------------------------------------------------------------------------------- 1 | #subdir-ccflags-y += -I$(SOURCE_DIR)/../mylib/include 2 | 3 | obj-y += src/ 4 | -------------------------------------------------------------------------------- /ports/zephyr/boards/96b_carbon.conf: -------------------------------------------------------------------------------- 1 | # TODO: Enable networking 2 | CONFIG_NETWORKING=y 3 | -------------------------------------------------------------------------------- /ports/zephyr/boards/disco_l475_iot1.conf: -------------------------------------------------------------------------------- 1 | # Sensors 2 | CONFIG_HTS221=y 3 | CONFIG_LIS3MDL=y 4 | CONFIG_LPS22HB=y 5 | CONFIG_LSM6DSL=y 6 | -------------------------------------------------------------------------------- /ports/zephyr/boards/frdm_kw41z.conf: -------------------------------------------------------------------------------- 1 | # Hardware features 2 | CONFIG_I2C=y 3 | 4 | # Sensor drivers 5 | CONFIG_FXOS8700=y 6 | CONFIG_FXOS8700_MODE_HYBRID=y 7 | CONFIG_FXOS8700_TEMP=y 8 | -------------------------------------------------------------------------------- /ports/zephyr/boards/qemu_cortex_m3.conf: -------------------------------------------------------------------------------- 1 | # Interrupt-driven UART console has emulation artifacts under QEMU, 2 | # disable it 3 | CONFIG_CONSOLE_SUBSYS=n 4 | 5 | # Networking drivers 6 | # SLIP driver for QEMU 7 | CONFIG_NET_SLIP_TAP=y 8 | -------------------------------------------------------------------------------- /ports/zephyr/boards/qemu_x86.conf: -------------------------------------------------------------------------------- 1 | # Interrupt-driven UART console has emulation artifacts under QEMU, 2 | # disable it 3 | CONFIG_CONSOLE_SUBSYS=n 4 | 5 | # Networking drivers 6 | # SLIP driver for QEMU 7 | CONFIG_NET_SLIP_TAP=y 8 | -------------------------------------------------------------------------------- /ports/zephyr/boards/reel_board.conf: -------------------------------------------------------------------------------- 1 | # Flash drivers 2 | CONFIG_FLASH=y 3 | CONFIG_FLASH_MAP=y 4 | CONFIG_MPU_ALLOW_FLASH_WRITE=y 5 | -------------------------------------------------------------------------------- /ports/zephyr/boards/rv32m1_vega_ri5cy.conf: -------------------------------------------------------------------------------- 1 | # Flash drivers 2 | CONFIG_FLASH=y 3 | CONFIG_FLASH_MAP=y 4 | -------------------------------------------------------------------------------- /tests/basics/0prelim.py: -------------------------------------------------------------------------------- 1 | # all tests need print to work! make sure it does work 2 | 3 | print(1) 4 | print('abc') 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/annotate_var.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | 1 3 | (1, 2) 4 | NameError 5 | 1 6 | -------------------------------------------------------------------------------- /tests/basics/array_micropython.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/assign_expr.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | True 3 | 2 4 | 4 5 5 | 5 6 | 1 5 5 7 | 5 8 | any True 9 | 8 10 | 123 11 | any True 12 | 8 13 | [(1, 0), (2, 2), (3, 6), (4, 12)] 14 | 4 15 | -------------------------------------------------------------------------------- /tests/basics/assign_expr_syntaxerror.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | [1, 2, 3, 4] 4 | [-1] 5 | [[0, 0], [1, 1]] 6 | [[0, 1], [0, 1]] 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/async_def.py.exp: -------------------------------------------------------------------------------- 1 | decorator 2 | foo 3 | StopIteration 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | enter 10 | exit 11 | BaseException 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/builtin_bin_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin bin function 2 | 3 | print(bin(12345678901234567890)) 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/builtin_ellipsis.py: -------------------------------------------------------------------------------- 1 | # tests that .../Ellipsis exists 2 | 3 | print(...) 4 | print(Ellipsis) 5 | 6 | print(... == Ellipsis) 7 | 8 | # Test that Ellipsis can be hashed 9 | print(type(hash(Ellipsis))) 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/builtin_hex_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin hex function 2 | 3 | print(hex(12345678901234567890)) 4 | print(hex(0x12345678901234567890)) 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/builtin_oct_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin oct function 2 | 3 | print(oct(12345678901234567890)) 4 | print(oct(0o12345670123456701234)) 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/bytearray_decode.py: -------------------------------------------------------------------------------- 1 | try: 2 | print(bytearray(b'').decode()) 3 | print(bytearray(b'abc').decode()) 4 | except AttributeError: 5 | print("SKIP") 6 | raise SystemExit 7 | -------------------------------------------------------------------------------- /tests/basics/bytearray_intbig.py: -------------------------------------------------------------------------------- 1 | print(bytearray(2**65 - (2**65 - 1))) 2 | -------------------------------------------------------------------------------- /tests/basics/bytes_add.py: -------------------------------------------------------------------------------- 1 | # test bytes + other 2 | 3 | print(b"123" + b"456") 4 | 5 | print(b"123" + b"") # RHS is empty, can be optimised 6 | print(b"" + b"123") # LHS is empty, can be optimised 7 | -------------------------------------------------------------------------------- /tests/basics/bytes_add_bytearray.py: -------------------------------------------------------------------------------- 1 | # test bytes + bytearray 2 | 3 | print(b"123" + bytearray(2)) 4 | 5 | print(b"" + bytearray(1)) # LHS is empty but can't be optimised 6 | -------------------------------------------------------------------------------- /tests/basics/bytes_compare2.py: -------------------------------------------------------------------------------- 1 | print(b"1" == 1) 2 | -------------------------------------------------------------------------------- /tests/basics/bytes_compare3.py.exp: -------------------------------------------------------------------------------- 1 | ######## 2 | False 3 | ######## 4 | False 5 | -------------------------------------------------------------------------------- /tests/basics/bytes_compare_bytearray.py: -------------------------------------------------------------------------------- 1 | print(b"123" == bytearray(b"123")) 2 | print(b'123' < bytearray(b"124")) 3 | print(b'123' > bytearray(b"122")) 4 | print(bytearray(b"23") in b"1234") 5 | -------------------------------------------------------------------------------- /tests/basics/bytes_construct_bytearray.py: -------------------------------------------------------------------------------- 1 | # test construction of bytes from bytearray 2 | 3 | print(bytes(bytearray(4))) 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/bytes_format_modulo.py.exp: -------------------------------------------------------------------------------- 1 | b'%' 2 | b'=1=' 3 | b'=1=2=' 4 | b'=str=' 5 | b"=b'str'=" 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/class_emptybases.py: -------------------------------------------------------------------------------- 1 | class A(): 2 | pass 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/class_misc.py: -------------------------------------------------------------------------------- 1 | # converting user instance to buffer 2 | class C: 3 | pass 4 | 5 | c = C() 6 | try: 7 | d = bytes(c) 8 | except TypeError: 9 | print('TypeError') 10 | -------------------------------------------------------------------------------- /tests/basics/class_ordereddict.py.exp: -------------------------------------------------------------------------------- 1 | ['a', 'b', 'c', 'd', 'e'] 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/dict_fixed.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | TypeError 3 | TypeError 4 | TypeError 5 | TypeError 6 | TypeError 7 | TypeError 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/dict_get.py: -------------------------------------------------------------------------------- 1 | for d in {}, {42:2}: 2 | print(d.get(42)) 3 | print(d.get(42,2)) 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/errno1.py.exp: -------------------------------------------------------------------------------- 1 | 2 | [Errno ] EIO 3 | 9999 4 | uerrno 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/exception_chain.py.exp: -------------------------------------------------------------------------------- 1 | Warning: exception chaining not supported 2 | Caught Exception 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/fun1.py: -------------------------------------------------------------------------------- 1 | # calling a function 2 | 3 | def f(): 4 | print(1) 5 | f() 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/fun_str.py: -------------------------------------------------------------------------------- 1 | # test str of function 2 | 3 | def f(): 4 | pass 5 | print(str(f)[:8]) 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/generator2.py: -------------------------------------------------------------------------------- 1 | gen = (i for i in range(10)) 2 | for i in gen: 3 | print(i) 4 | -------------------------------------------------------------------------------- /tests/basics/generator_pep479.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | RuntimeError 3 | StopIteration 4 | 1 5 | RuntimeError 6 | 0 7 | RuntimeError 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/io_buffered_writer.py.exp: -------------------------------------------------------------------------------- 1 | b'' 2 | b'foobarfo' 3 | b'foobarfoobar' 4 | b'foobarfoobar' 5 | b'foo' 6 | -------------------------------------------------------------------------------- /tests/basics/io_bytesio_ext2.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/io_write_ext.py.exp: -------------------------------------------------------------------------------- 1 | b'fo' 2 | b'fofoo' 3 | b'fofoooob' 4 | b'fofooooboobar' 5 | b'fofooooboobar' 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/lambda1.py: -------------------------------------------------------------------------------- 1 | # lambda 2 | 3 | f = lambda x, y: x + 3 * y 4 | print(f(3, 5)) 5 | -------------------------------------------------------------------------------- /tests/basics/list_clear.py: -------------------------------------------------------------------------------- 1 | # tests list.clear 2 | x = [1, 2, 3, 4] 3 | x.clear() 4 | print(x) 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/list_reverse.py: -------------------------------------------------------------------------------- 1 | a = [] 2 | for i in range(100): 3 | a.append(i) 4 | a.reverse() 5 | print(a) 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/memoryerror.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | 1000 0 999 3 | MemoryError 4 | -------------------------------------------------------------------------------- /tests/basics/module2.py: -------------------------------------------------------------------------------- 1 | # uPy behaviour only: builtin modules are read-only 2 | import sys 3 | try: 4 | sys.x = 1 5 | except AttributeError: 6 | print("AttributeError") 7 | -------------------------------------------------------------------------------- /tests/basics/module2.py.exp: -------------------------------------------------------------------------------- 1 | AttributeError 2 | -------------------------------------------------------------------------------- /tests/basics/object1.py: -------------------------------------------------------------------------------- 1 | # test builtin object() 2 | 3 | # creation 4 | object() 5 | 6 | # printing 7 | print(repr(object())[:7]) 8 | -------------------------------------------------------------------------------- /tests/basics/parser.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | -------------------------------------------------------------------------------- /tests/basics/python34.py.exp: -------------------------------------------------------------------------------- 1 | None 2 | ['a', 'b'] 3 | ('a', 'b') {'kw_arg': None} 4 | 2 5 | 1 6 | SyntaxError 7 | SyntaxError 8 | SyntaxError 9 | SyntaxError 10 | SyntaxError 11 | SyntaxError 12 | 3.4 13 | 3 4 14 | IndexError('foo',) 15 | -------------------------------------------------------------------------------- /tests/basics/python36.py.exp: -------------------------------------------------------------------------------- 1 | 100000 2 | 165 3 | 65535 4 | 123 5 | 83 6 | -------------------------------------------------------------------------------- /tests/basics/return1.py: -------------------------------------------------------------------------------- 1 | # test return statement 2 | 3 | def f(): 4 | return 5 | print(f()) 6 | 7 | def g(): 8 | return 1 9 | print(g()) 10 | 11 | def f(x): 12 | return 1 if x else 2 13 | print(f(0), f(1)) 14 | -------------------------------------------------------------------------------- /tests/basics/set_clear.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(s.clear()) 3 | print(list(s)) 4 | -------------------------------------------------------------------------------- /tests/basics/set_comprehension.py: -------------------------------------------------------------------------------- 1 | print({a for a in range(5)}) 2 | -------------------------------------------------------------------------------- /tests/basics/set_containment.py: -------------------------------------------------------------------------------- 1 | for i in 1, 2: 2 | for o in {}, {1}, {2}: 3 | print("{} in {}: {}".format(i, o, i in o)) 4 | print("{} not in {}: {}".format(i, o, i not in o)) 5 | -------------------------------------------------------------------------------- /tests/basics/set_copy.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | t = s.copy() 3 | s.add(5) 4 | t.add(7) 5 | for i in s, t: 6 | print(sorted(i)) 7 | -------------------------------------------------------------------------------- /tests/basics/set_discard.py: -------------------------------------------------------------------------------- 1 | s = {1, 2} 2 | print(s.discard(1)) 3 | print(list(s)) 4 | -------------------------------------------------------------------------------- /tests/basics/set_intersection.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(sorted(s)) 3 | print(sorted(s.intersection({1, 3}))) 4 | print(sorted(s.intersection([3, 4]))) 5 | 6 | print(s.intersection_update([1])) 7 | print(sorted(s)) 8 | -------------------------------------------------------------------------------- /tests/basics/set_isdisjoint.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(s.isdisjoint({1})) 3 | print(s.isdisjoint([2])) 4 | print(s.isdisjoint([])) 5 | print(s.isdisjoint({7,8,9,10})) 6 | print(s.isdisjoint([7,8,9,1])) 7 | -------------------------------------------------------------------------------- /tests/basics/set_isfooset.py: -------------------------------------------------------------------------------- 1 | sets = [set(), {1}, {1, 2, 3}, {3, 4, 5}, {5, 6, 7}] 2 | args = sets + [[1], [1, 2], [1, 2 ,3]] 3 | for i in sets: 4 | for j in args: 5 | print(i.issubset(j)) 6 | print(i.issuperset(j)) 7 | -------------------------------------------------------------------------------- /tests/basics/set_iter.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | l = list(s) 3 | l.sort() 4 | print(l) 5 | 6 | -------------------------------------------------------------------------------- /tests/basics/set_iter_of_iter.py: -------------------------------------------------------------------------------- 1 | i = iter(iter({1, 2, 3})) 2 | print(sorted(i)) 3 | -------------------------------------------------------------------------------- /tests/basics/set_specialmeth.py: -------------------------------------------------------------------------------- 1 | # set object with special methods 2 | 3 | s = {1, 2} 4 | print(s.__contains__(1)) 5 | print(s.__contains__(3)) 6 | -------------------------------------------------------------------------------- /tests/basics/set_symmetric_difference.py: -------------------------------------------------------------------------------- 1 | print(sorted({1,2}.symmetric_difference({2,3}))) 2 | print(sorted({1,2}.symmetric_difference([2,3]))) 3 | s = {1,2} 4 | print(s.symmetric_difference_update({2,3})) 5 | print(sorted(s)) 6 | -------------------------------------------------------------------------------- /tests/basics/set_union.py: -------------------------------------------------------------------------------- 1 | print(sorted({1}.union({2}))) 2 | -------------------------------------------------------------------------------- /tests/basics/set_unop.py: -------------------------------------------------------------------------------- 1 | # test set unary operations 2 | 3 | print(bool(set())) 4 | print(bool(set('abc'))) 5 | 6 | print(len(set())) 7 | print(len(set('abc'))) 8 | 9 | try: 10 | hash(set('abc')) 11 | except TypeError: 12 | print('TypeError') 13 | -------------------------------------------------------------------------------- /tests/basics/set_update.py: -------------------------------------------------------------------------------- 1 | s = {1} 2 | s.update() 3 | print(s) 4 | s.update([2]) 5 | print(sorted(s)) 6 | s.update([1,3], [2,2,4]) 7 | print(sorted(s)) 8 | -------------------------------------------------------------------------------- /tests/basics/slice_intbig.py: -------------------------------------------------------------------------------- 1 | # test slicing when arguments are bignums 2 | 3 | print(list(range(10))[(1<<66)>>65:]) 4 | print(list(range(10))[:(1<<66)>>65]) 5 | print(list(range(10))[::(1<<66)>>65]) 6 | -------------------------------------------------------------------------------- /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""")) -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/string_endswith_upy.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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}: {}".format(c, repr(chr(c)))) 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/string_startswith_upy.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/struct_micropython.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | b'\x01\x00\x00\x00\x00\x00\x00\x00' 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/subclass_native_call.py.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/subclass_native_str.py: -------------------------------------------------------------------------------- 1 | # Test subclassing built-in str 2 | 3 | class S(str): 4 | pass 5 | 6 | s = S('hello') 7 | print(s == 'hello') 8 | print('hello' == s) 9 | print(s == 'Hello') 10 | print('Hello' == s) 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/try_except_break.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 4 4 | -------------------------------------------------------------------------------- /tests/basics/try_finally_continue.py.exp: -------------------------------------------------------------------------------- 1 | 4 0 2 | continue 3 | 4 1 4 | continue 5 | 4 2 6 | continue 7 | 4 3 8 | continue 9 | None 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/basics/tuple_slice.py: -------------------------------------------------------------------------------- 1 | # tuple slicing 2 | 3 | x = (1, 2, 3 * 4) 4 | 5 | print(x[1:]) 6 | print(x[:-1]) 7 | print(x[2:3]) 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_optimise.py: -------------------------------------------------------------------------------- 1 | # cmdline: -O 2 | # test optimisation output 3 | print(__debug__) 4 | assert 0 5 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_optimise.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_verbose.py: -------------------------------------------------------------------------------- 1 | # cmdline: -v -v 2 | # test verbose output 3 | print(1) 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cmdline/repl_basic.py: -------------------------------------------------------------------------------- 1 | # basic REPL tests 2 | print(1) 3 |  4 | 2 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cmdline/repl_inspect.py: -------------------------------------------------------------------------------- 1 | # cmdline: -c print("test") -i 2 | # -c option combined with -i option results in REPL 3 | -------------------------------------------------------------------------------- /tests/cmdline/repl_inspect.py.exp: -------------------------------------------------------------------------------- 1 | test 2 | MicroPython \.\+ version 3 | Use \.\+ 4 | >>> # cmdline: -c print("test") -i 5 | >>> # -c option combined with -i option results in REPL 6 | >>> 7 | -------------------------------------------------------------------------------- /tests/cmdline/repl_micropyinspect: -------------------------------------------------------------------------------- 1 | import uos 2 | 3 | uos.putenv('MICROPYINSPECT', '1') 4 | -------------------------------------------------------------------------------- /tests/cmdline/repl_micropyinspect.py: -------------------------------------------------------------------------------- 1 | # cmdline: cmdline/repl_micropyinspect 2 | # setting MICROPYINSPECT environment variable before program exit triggers REPL 3 | -------------------------------------------------------------------------------- /tests/cmdline/repl_micropyinspect.py.exp: -------------------------------------------------------------------------------- 1 | MicroPython \.\+ version 2 | Use \.\+ 3 | >>> # cmdline: cmdline/repl_micropyinspect 4 | >>> # setting MICROPYINSPECT environment variable before program exit triggers REPL 5 | >>> 6 | -------------------------------------------------------------------------------- /tests/cpydiff/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/cpydiff/modules/__init__.py -------------------------------------------------------------------------------- /tests/cpydiff/modules/foo.py: -------------------------------------------------------------------------------- 1 | print("foo") 2 | xxx 3 | -------------------------------------------------------------------------------- /tests/cpydiff/modules/subpkg/foo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/cpydiff/modules/subpkg/foo.py -------------------------------------------------------------------------------- /tests/cpydiff/modules2/subpkg/bar.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/cpydiff/modules2/subpkg/bar.py -------------------------------------------------------------------------------- /tests/cpydiff/modules3/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["foo"] 2 | -------------------------------------------------------------------------------- /tests/cpydiff/modules3/foo.py: -------------------------------------------------------------------------------- 1 | def hello(): 2 | print("hello") 3 | -------------------------------------------------------------------------------- /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 | 9 | print(1 in array.array("B", b"12")) 10 | -------------------------------------------------------------------------------- /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 | 9 | a = array.array("b", (1, 2, 3)) 10 | del a[1] 11 | print(a) 12 | -------------------------------------------------------------------------------- /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 | 9 | a = array.array("b", (1, 2, 3)) 10 | print(a[3:2:2]) 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cpydiff/types_dict_keys_set.py: -------------------------------------------------------------------------------- 1 | """ 2 | categories: Types,dict 3 | description: Dictionary keys view does not behave as a set. 4 | cause: Not implemented. 5 | workaround: Explicitly convert keys to a set before using set operations. 6 | """ 7 | print({1: 2, 3: 4}.keys() & {1}) 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/esp32/check_err_str.py.exp: -------------------------------------------------------------------------------- 1 | [Errno 2] ENOENT 2 | (-5379, 'ESP_ERR_OTA_VALIDATE_FAILED') 3 | exc: 4 | -5379 5 | -------------------------------------------------------------------------------- /tests/esp32/esp32_idf_heap_info.py.exp: -------------------------------------------------------------------------------- 1 | HEAP_DATA >2: True 2 | HEAP_DATA [True, True, True, True] 3 | HEAP_EXEC >2: True 4 | HEAP_EXEC [True, True, True, True] 5 | [] 6 | -------------------------------------------------------------------------------- /tests/extmod/btree_error.py.exp: -------------------------------------------------------------------------------- 1 | OSError True 2 | read 24 3 | OSError(1000,) 4 | read 24 5 | ioctl 2 6 | OSError(1001,) 7 | -------------------------------------------------------------------------------- /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 | b'\x06\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x07' 3 | TypeError 4 | TypeError 5 | -------------------------------------------------------------------------------- /tests/extmod/machine1.py.exp: -------------------------------------------------------------------------------- 1 | <8-bit memory> 2 | ValueError 3 | ValueError 4 | TypeError 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/machine_signal.py.exp: -------------------------------------------------------------------------------- 1 | 0 0 2 | 1 1 3 | 1 0 4 | 0 1 5 | -------------------------------------------------------------------------------- /tests/extmod/machine_timer.py.exp: -------------------------------------------------------------------------------- 1 | one-shot 2 | periodic 3 | periodic 4 | periodic 5 | -------------------------------------------------------------------------------- /tests/extmod/ticks_diff.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/extmod/time_ms_us.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_await_return.py.exp: -------------------------------------------------------------------------------- 1 | 42 2 | 42 3 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_basic.py.exp: -------------------------------------------------------------------------------- 1 | start 2 | after sleep 3 | short 4 | long 5 | negative 6 | took 20 40 0 7 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_basic2.py.exp: -------------------------------------------------------------------------------- 1 | main start 2 | forever start 3 | main done 4 | 42 5 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_cancel_fair2.py.exp: -------------------------------------------------------------------------------- 1 | sleep a 2 | sleep b 0 3 | sleep b 1 4 | sleep b 2 5 | cancelled a 6 | done b 0 7 | done b 1 8 | done b 2 9 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_cancel_self.py.exp: -------------------------------------------------------------------------------- 1 | task start 2 | can't cancel self 3 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_event_fair.py.exp: -------------------------------------------------------------------------------- 1 | sleep 0 2 | wait 2 3 | sleep 1 4 | wait 3 5 | sleep 0 6 | sleep 1 7 | wait 2 8 | sleep 0 9 | sleep 1 10 | wait 3 11 | sleep 0 12 | sleep 1 13 | wait 2 14 | wait 3 15 | wait 2 16 | wait 3 17 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_exception.py.exp: -------------------------------------------------------------------------------- 1 | main start 2 | ValueError 1 3 | main start 4 | task start 5 | ValueError 2 6 | main start 7 | ValueError 3 8 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_fair.py.exp: -------------------------------------------------------------------------------- 1 | task start 1 2 | task start 2 3 | task work 2 4 | task start 3 5 | task work 3 6 | task start 4 7 | task work 2 8 | task work 3 9 | task work 2 10 | task work 2 11 | task work 3 12 | task work 2 13 | finish 14 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_heaplock.py.exp: -------------------------------------------------------------------------------- 1 | start 2 | 1 0 3 | 2 0 4 | sleep 5 | 1 1 6 | 1 2 7 | 2 1 8 | 1 3 9 | 2 2 10 | 2 3 11 | finish 12 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_lock_cancel.py.exp: -------------------------------------------------------------------------------- 1 | task 0 start 2 | task 1 start 3 | task 2 start 4 | task 3 start 5 | task 1 cancel 6 | task 2 cancel 7 | task 0 lock_flag False 8 | task 0 done 9 | task 3 lock_flag False 10 | task 3 done 11 | False 12 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_loop_stop.py.exp: -------------------------------------------------------------------------------- 1 | run 0 2 | start 3 | sleep 4 | run 1 5 | run 2 6 | task 7 | end 8 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_micropython.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | task start 1 3 | task end 1 4 | 2 5 | task start 2 6 | timeout 7 | finish 8 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_new_event_loop.py.exp: -------------------------------------------------------------------------------- 1 | start 2 | task 0 3 | stop 4 | start 5 | task 0 6 | stop 7 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_set_exception_handler.py.exp: -------------------------------------------------------------------------------- 1 | None 2 | True 3 | sleep 4 | custom_handler ValueError(0, 1) 5 | sleep 6 | custom_handler ValueError(1, 2) 7 | custom_handler ValueError(2, 3) 8 | done 9 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_wait_for.py.exp: -------------------------------------------------------------------------------- 1 | task start 1 2 | task end 1 3 | 2 4 | task start 2 5 | timeout 6 | task_catch start 7 | ignore cancel 8 | task_catch done 9 | TimeoutError 10 | task start 11 | ValueError 12 | task start 3 13 | task end 3 14 | 6 15 | finish 16 | -------------------------------------------------------------------------------- /tests/extmod/uasyncio_wait_task.py.exp: -------------------------------------------------------------------------------- 1 | start 2 | task 1 3 | task 2 4 | ---- 5 | start 6 | hello 7 | world 8 | took 40 40 9 | task_raise 10 | ValueError 11 | -------------------------------------------------------------------------------- /tests/extmod/ubinascii_micropython.py.exp: -------------------------------------------------------------------------------- 1 | b'31:32:33' 2 | b'' 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_array_assign_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x11 2 | 0x2233 3 | 0x4455 4 | 0x66778899 5 | True 6 | 0xaabbccdd 7 | True 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_array_assign_native_le_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 0x11223344 2 | 0x11223344 3 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_bytearray.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'01') 2 | 3 | bytearray(b'0123') 4 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_byteat.py.exp: -------------------------------------------------------------------------------- 1 | b'0123' 2 | bytearray(b'0123') 3 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_error.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | TypeError 3 | TypeError 4 | TypeError 5 | TypeError 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_le_float.py.exp: -------------------------------------------------------------------------------- 1 | 12.3400 2 | 12.3400 3 | 12.3400 4 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_native_float.py.exp: -------------------------------------------------------------------------------- 1 | 12.3400 2 | 12.3400 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_print.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_ptr_le.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | 48 4 | 49 5 | 0x3130 6 | 48 49 7 | 48 49 8 | 0x3130 9 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_ptr_native_le.py.exp: -------------------------------------------------------------------------------- 1 | 48 2 | 49 3 | 0x3130 4 | 48 49 5 | 48 49 6 | 0x3130 7 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | 4 4 | TypeError 5 | 6 6 | 1 7 | TypeError 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_float.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | 8 3 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_layout.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | TypeError 4 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_native.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/extmod/uctypes_sizeof_native.py.exp -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_od.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | 4 4 | TypeError 5 | 6 6 | 1 7 | TypeError 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/ujson_dumps_extra.py.exp: -------------------------------------------------------------------------------- 1 | "1234" 2 | -------------------------------------------------------------------------------- /tests/extmod/ujson_loads_bytes.py.exp: -------------------------------------------------------------------------------- 1 | [1, 2] 2 | [None] 3 | -------------------------------------------------------------------------------- /tests/extmod/ure_debug.py: -------------------------------------------------------------------------------- 1 | # test printing debugging info when compiling 2 | try: 3 | import ure 4 | 5 | ure.DEBUG 6 | except (ImportError, AttributeError): 7 | print("SKIP") 8 | raise SystemExit 9 | 10 | ure.compile("^a|b[0-9]\w$", ure.DEBUG) 11 | -------------------------------------------------------------------------------- /tests/extmod/ure_split_empty.py.exp: -------------------------------------------------------------------------------- 1 | ['a b c foobar'] 2 | ['foo'] 3 | ['axbc'] 4 | -------------------------------------------------------------------------------- /tests/extmod/ure_split_notimpl.py.exp: -------------------------------------------------------------------------------- 1 | NotImplementedError 2 | -------------------------------------------------------------------------------- /tests/extmod/ure_stack_overflow.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | -------------------------------------------------------------------------------- /tests/extmod/ure_sub_unmatched.py.exp: -------------------------------------------------------------------------------- 1 | 1-a2 2 | -------------------------------------------------------------------------------- /tests/extmod/ussl_basic.py.exp: -------------------------------------------------------------------------------- 1 | wrap_socket: OSError(-256, 'CONN_LOST') 2 | <_SSLSocket 3 | 4 4 | b'' 5 | read: OSError(-261,) 6 | read: OSError(9,) 7 | write: OSError(9,) 8 | -------------------------------------------------------------------------------- /tests/extmod/ussl_keycert.py.exp: -------------------------------------------------------------------------------- 1 | ValueError('invalid key',) 2 | TypeError("can't convert 'NoneType' object to str implicitly",) 3 | ValueError('invalid cert',) 4 | -------------------------------------------------------------------------------- /tests/extmod/utimeq1.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/extmod/utimeq_stable.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extmod/vfs_fat_finaliser.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | x0 3 | x1 4 | x2 5 | x3 6 | -------------------------------------------------------------------------------- /tests/extmod/vfs_fat_oldproto.py.exp: -------------------------------------------------------------------------------- 1 | [('file.txt', 32768, 0, 6)] 2 | hello! 3 | [] 4 | -------------------------------------------------------------------------------- /tests/extmod/vfs_fat_ramdisklarge.py.exp: -------------------------------------------------------------------------------- 1 | statvfs: (32768, 32768, 131054, 131053, 131053, 0, 0, 0, 0, 255) 2 | statvfs: (32768, 32768, 131054, 131052, 131052, 0, 0, 0, 0, 255) 3 | test file 4 | -------------------------------------------------------------------------------- /tests/extmod/vfs_lfs_corrupt.py.exp: -------------------------------------------------------------------------------- 1 | test 2 | statvfs OSError 3 | read OSError 4 | write OSError 5 | close OSError 6 | flush OSError 7 | test 8 | statvfs OSError 9 | read OSError 10 | write OSError 11 | close OSError 12 | flush OSError 13 | -------------------------------------------------------------------------------- /tests/extmod/vfs_lfs_mount.py.exp: -------------------------------------------------------------------------------- 1 | test 2 | hello from lfs 3 | package 4 | hello from lfs 5 | test 6 | hello from lfs 7 | package 8 | hello from lfs 9 | -------------------------------------------------------------------------------- /tests/extmod/vfs_lfs_mtime.py.exp: -------------------------------------------------------------------------------- 1 | test 2 | mtime=True 3 | True True 4 | True 5 | True 6 | True 7 | mtime=False 8 | True 9 | True 10 | True 11 | mtime=True 12 | True 13 | True 14 | -------------------------------------------------------------------------------- /tests/feature_check/async_check.py: -------------------------------------------------------------------------------- 1 | # check if async/await keywords are supported 2 | async def foo(): 3 | await 1 4 | -------------------------------------------------------------------------------- /tests/feature_check/async_check.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/async_check.py.exp -------------------------------------------------------------------------------- /tests/feature_check/bytearray.py: -------------------------------------------------------------------------------- 1 | try: 2 | bytearray 3 | print("bytearray") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /tests/feature_check/bytearray.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/bytearray.py.exp -------------------------------------------------------------------------------- /tests/feature_check/byteorder.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.byteorder) 4 | -------------------------------------------------------------------------------- /tests/feature_check/byteorder.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/byteorder.py.exp -------------------------------------------------------------------------------- /tests/feature_check/complex.py: -------------------------------------------------------------------------------- 1 | try: 2 | complex 3 | print("complex") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /tests/feature_check/complex.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/complex.py.exp -------------------------------------------------------------------------------- /tests/feature_check/const.py: -------------------------------------------------------------------------------- 1 | x = const(1) 2 | -------------------------------------------------------------------------------- /tests/feature_check/const.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/const.py.exp -------------------------------------------------------------------------------- /tests/feature_check/coverage.py: -------------------------------------------------------------------------------- 1 | try: 2 | extra_coverage 3 | print("coverage") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /tests/feature_check/coverage.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/coverage.py.exp -------------------------------------------------------------------------------- /tests/feature_check/float.py.exp: -------------------------------------------------------------------------------- 1 | 64 2 | -------------------------------------------------------------------------------- /tests/feature_check/int_big.py: -------------------------------------------------------------------------------- 1 | # Check whether arbitrary-precision integers (MPZ) are supported 2 | print(1000000000000000000000000000000000000000000000) 3 | -------------------------------------------------------------------------------- /tests/feature_check/int_big.py.exp: -------------------------------------------------------------------------------- 1 | 1000000000000000000000000000000000000000000000 2 | -------------------------------------------------------------------------------- /tests/feature_check/native_check.py: -------------------------------------------------------------------------------- 1 | # this test for the availability of native emitter 2 | @micropython.native 3 | def f(): 4 | pass 5 | -------------------------------------------------------------------------------- /tests/feature_check/native_check.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/native_check.py.exp -------------------------------------------------------------------------------- /tests/feature_check/repl_emacs_check.py: -------------------------------------------------------------------------------- 1 | # Check for emacs keys in REPL 2 | t = +11 3 | t == 2 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/feature_check/repl_words_move_check.py: -------------------------------------------------------------------------------- 1 | # just check if ctrl+w is supported, because it makes sure that 2 | # both MICROPY_REPL_EMACS_WORDS_MOVE and MICROPY_REPL_EXTRA_WORDS_MOVE are enabled. 3 | t = 1231 4 | t == 1 5 | -------------------------------------------------------------------------------- /tests/feature_check/repl_words_move_check.py.exp: -------------------------------------------------------------------------------- 1 | MicroPython \.\+ version 2 | Use \.\+ 3 | >>> # Check for emacs keys in REPL 4 | >>> t = \.\+ 5 | >>> t == 2 6 | True 7 | >>> 8 | -------------------------------------------------------------------------------- /tests/feature_check/reverse_ops.py: -------------------------------------------------------------------------------- 1 | class Foo: 2 | def __radd__(self, other): 3 | pass 4 | 5 | 6 | try: 7 | 5 + Foo() 8 | except TypeError: 9 | print("TypeError") 10 | -------------------------------------------------------------------------------- /tests/feature_check/reverse_ops.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/reverse_ops.py.exp -------------------------------------------------------------------------------- /tests/feature_check/set_check.py: -------------------------------------------------------------------------------- 1 | # check if set literal syntax is supported 2 | {1} 3 | -------------------------------------------------------------------------------- /tests/feature_check/set_check.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/set_check.py.exp -------------------------------------------------------------------------------- /tests/feature_check/slice.py: -------------------------------------------------------------------------------- 1 | try: 2 | slice 3 | print("slice") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /tests/feature_check/slice.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/slice.py.exp -------------------------------------------------------------------------------- /tests/feature_check/uio_module.py: -------------------------------------------------------------------------------- 1 | try: 2 | import uio 3 | 4 | print("uio") 5 | except ImportError: 6 | print("no") 7 | -------------------------------------------------------------------------------- /tests/feature_check/uio_module.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/feature_check/uio_module.py.exp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/float/complex1_intbig.py: -------------------------------------------------------------------------------- 1 | # test basic complex number functionality 2 | 3 | # convert bignum to complex on rhs 4 | ans = 1j + (1 << 70) 5 | print("%.5g %.5g" % (ans.real, ans.imag)) 6 | -------------------------------------------------------------------------------- /tests/float/complex_reverse_op.py: -------------------------------------------------------------------------------- 1 | # test complex interacting with special reverse methods 2 | 3 | 4 | class A: 5 | def __radd__(self, x): 6 | print("__radd__") 7 | return 2 8 | 9 | 10 | print(1j + A()) 11 | -------------------------------------------------------------------------------- /tests/float/complex_special_methods.py: -------------------------------------------------------------------------------- 1 | # test complex interacting with special methods 2 | 3 | 4 | class A: 5 | def __add__(self, x): 6 | print("__add__") 7 | return 1 8 | 9 | 10 | print(A() + 1j) 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/float/lexer.py: -------------------------------------------------------------------------------- 1 | # since black code formatter does not allow leading decimal point with nothing 2 | # before it, we need to test it explicitly 3 | 4 | # fmt: off 5 | print(.1) 6 | # fmt: on 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/float/python36.py.exp: -------------------------------------------------------------------------------- 1 | 1000.18 2 | 1e+12 3 | 123.0 4 | 123.4 5 | 1e+13 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/float/string_format_modulo3.py.exp: -------------------------------------------------------------------------------- 1 | -10 2 | 100 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/import/gen_context.py: -------------------------------------------------------------------------------- 1 | import gen_context2 2 | 3 | GLOBAL = "GLOBAL" 4 | 5 | 6 | def gen(): 7 | print(GLOBAL) 8 | yield 1 9 | 10 | 11 | gen_context2.call(gen()) 12 | -------------------------------------------------------------------------------- /tests/import/gen_context2.py: -------------------------------------------------------------------------------- 1 | def call(g): 2 | next(g) 3 | -------------------------------------------------------------------------------- /tests/import/import1a.py: -------------------------------------------------------------------------------- 1 | import import1b 2 | 3 | print(import1b.var) 4 | -------------------------------------------------------------------------------- /tests/import/import1b.py: -------------------------------------------------------------------------------- 1 | var = 123 2 | 3 | 4 | def throw(): 5 | raise ValueError 6 | -------------------------------------------------------------------------------- /tests/import/import2a.py: -------------------------------------------------------------------------------- 1 | from import1b import var 2 | 3 | print(var) 4 | 5 | from import1b import var as var2 6 | 7 | print(var2) 8 | -------------------------------------------------------------------------------- /tests/import/import3a.py: -------------------------------------------------------------------------------- 1 | from import1b import * 2 | 3 | print(var) 4 | -------------------------------------------------------------------------------- /tests/import/import_file.py: -------------------------------------------------------------------------------- 1 | import import1b 2 | 3 | print(import1b.__file__) 4 | -------------------------------------------------------------------------------- /tests/import/import_long_dyn.py: -------------------------------------------------------------------------------- 1 | from import_long_dyn2 import * 2 | -------------------------------------------------------------------------------- /tests/import/import_long_dyn2.py: -------------------------------------------------------------------------------- 1 | globals()["long_long_very_long_long_name"] = 1 2 | -------------------------------------------------------------------------------- /tests/import/import_override.py.exp: -------------------------------------------------------------------------------- 1 | import import1b None 0 2 | 456 3 | -------------------------------------------------------------------------------- /tests/import/import_pkg3.py: -------------------------------------------------------------------------------- 1 | from pkg import mod 2 | 3 | print(mod.foo()) 4 | 5 | import pkg.mod 6 | 7 | print(mod is pkg.mod) 8 | -------------------------------------------------------------------------------- /tests/import/import_pkg4.py: -------------------------------------------------------------------------------- 1 | # Testing that "recursive" imports (pkg2/__init__.py imports from pkg2) work 2 | import pkg2 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/import/import_pkg6.py: -------------------------------------------------------------------------------- 1 | # This tests relative imports as used in pkg6 2 | import pkg6 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/import/import_pkg8.py: -------------------------------------------------------------------------------- 1 | # import with no __init__.py files 2 | import pkg8.mod 3 | -------------------------------------------------------------------------------- /tests/import/module_getattr.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /tests/import/pkg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/import/pkg/__init__.py -------------------------------------------------------------------------------- /tests/import/pkg/mod.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | return 42 3 | -------------------------------------------------------------------------------- /tests/import/pkg2/__init__.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod1 2 | -------------------------------------------------------------------------------- /tests/import/pkg2/mod1.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod2 2 | -------------------------------------------------------------------------------- /tests/import/pkg2/mod2.py: -------------------------------------------------------------------------------- 1 | print("in mod2") 2 | -------------------------------------------------------------------------------- /tests/import/pkg3/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/import/pkg3/mod1.py: -------------------------------------------------------------------------------- 1 | print("mod1 __name__:", __name__) 2 | from . import mod2 3 | -------------------------------------------------------------------------------- /tests/import/pkg3/mod2.py: -------------------------------------------------------------------------------- 1 | print("mod2 __name__:", __name__) 2 | print("in mod2") 3 | 4 | 5 | def foo(): 6 | print("mod2.foo()") 7 | -------------------------------------------------------------------------------- /tests/import/pkg3/subpkg1/__init__.py: -------------------------------------------------------------------------------- 1 | print("subpkg1 __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/import/pkg3/subpkg1/mod1.py: -------------------------------------------------------------------------------- 1 | print("subpkg1.mod1 __name__:", __name__) 2 | from ..mod2 import foo 3 | -------------------------------------------------------------------------------- /tests/import/pkg6/__init__.py: -------------------------------------------------------------------------------- 1 | from .x import * 2 | 3 | print("init") 4 | -------------------------------------------------------------------------------- /tests/import/pkg6/x/__init__.py: -------------------------------------------------------------------------------- 1 | from .y import * 2 | 3 | print("x") 4 | -------------------------------------------------------------------------------- /tests/import/pkg6/x/y.py: -------------------------------------------------------------------------------- 1 | print("y") 2 | -------------------------------------------------------------------------------- /tests/import/pkg7/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/import/pkg7/mod1.py: -------------------------------------------------------------------------------- 1 | print("mod1") 2 | foo = "mod1.foo" 3 | -------------------------------------------------------------------------------- /tests/import/pkg7/mod2.py: -------------------------------------------------------------------------------- 1 | print("mod2") 2 | bar = "mod2.bar" 3 | -------------------------------------------------------------------------------- /tests/import/pkg7/subpkg1/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/import/pkg7/subpkg1/subpkg2/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/import/pkg8/mod.py: -------------------------------------------------------------------------------- 1 | print("foo") 2 | -------------------------------------------------------------------------------- /tests/import/rel_import_inv.py: -------------------------------------------------------------------------------- 1 | try: 2 | from . import foo 3 | except: 4 | print("Invalid relative import caught") 5 | -------------------------------------------------------------------------------- /tests/inlineasm/asmargs.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 6 5 | 10 6 | -------------------------------------------------------------------------------- /tests/inlineasm/asmbcc.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 10 3 | 20 4 | 30 5 | -------------------------------------------------------------------------------- /tests/inlineasm/asmbitops.py.exp: -------------------------------------------------------------------------------- 1 | 24 2 | 16 3 | 0xf000000 4 | 0x10000 5 | -------------------------------------------------------------------------------- /tests/inlineasm/asmblbx.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /tests/inlineasm/asmconst.py: -------------------------------------------------------------------------------- 1 | # test constants in assembler 2 | 3 | 4 | @micropython.asm_thumb 5 | def c1(): 6 | movwt(r0, 0xFFFFFFFF) 7 | movwt(r1, 0xF0000000) 8 | sub(r0, r0, r1) 9 | 10 | 11 | print(hex(c1())) 12 | -------------------------------------------------------------------------------- /tests/inlineasm/asmconst.py.exp: -------------------------------------------------------------------------------- 1 | 0xfffffff 2 | -------------------------------------------------------------------------------- /tests/inlineasm/asmdiv.py.exp: -------------------------------------------------------------------------------- 1 | 411 2 | -411 3 | -411 4 | 411 5 | 411 6 | 2 7 | 1 8 | -------------------------------------------------------------------------------- /tests/inlineasm/asmfpaddsub.py.exp: -------------------------------------------------------------------------------- 1 | 90 2 | -------------------------------------------------------------------------------- /tests/inlineasm/asmfpcmp.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 6 3 | 8 4 | -------------------------------------------------------------------------------- /tests/inlineasm/asmfpldrstr.py.exp: -------------------------------------------------------------------------------- 1 | 6.0 2 | -------------------------------------------------------------------------------- /tests/inlineasm/asmfpmuldiv.py.exp: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /tests/inlineasm/asmfpsqrt.py.exp: -------------------------------------------------------------------------------- 1 | -160 2 | -------------------------------------------------------------------------------- /tests/inlineasm/asmit.py.exp: -------------------------------------------------------------------------------- 1 | 100 1 2 | 100 200 3 | -------------------------------------------------------------------------------- /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 | 9 | print(f(0, 1, 2)) 10 | -------------------------------------------------------------------------------- /tests/inlineasm/asmpushpop.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /tests/inlineasm/asmrettype.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | False True 3 | 0 0x20000000 0x40000000 -0x80000000 4 | 0 0x20000000 0x40000000 0x80000000 5 | -------------------------------------------------------------------------------- /tests/inlineasm/asmshift.py.exp: -------------------------------------------------------------------------------- 1 | 0x246 2 | 0x800000 3 | 0x91 4 | 0x1 5 | 0x91 6 | -0x1 7 | -------------------------------------------------------------------------------- /tests/inlineasm/asmspecialregs.py: -------------------------------------------------------------------------------- 1 | @micropython.asm_thumb 2 | def getIPSR(): 3 | mrs(r0, IPSR) 4 | 5 | 6 | @micropython.asm_thumb 7 | def getBASEPRI(): 8 | mrs(r0, BASEPRI) 9 | 10 | 11 | print(getBASEPRI()) 12 | print(getIPSR()) 13 | -------------------------------------------------------------------------------- /tests/inlineasm/asmspecialregs.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | -------------------------------------------------------------------------------- /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 | b'\x01\x02\x03\x04' 10 4 | -------------------------------------------------------------------------------- /tests/internal_bench/bench.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | 4 | ITERS = 20000000 5 | 6 | 7 | def run(f): 8 | t = time.time() 9 | f(ITERS) 10 | t = time.time() - t 11 | print(t) 12 | -------------------------------------------------------------------------------- /tests/internal_bench/bytealloc-1-bytes_n.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 1000)): 6 | bytes(10000) 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/bytealloc-2-repeat.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 1000)): 6 | b"\0" * 10000 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-1-list_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = list(l) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-2-list_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = list(map(lambda x: x, l)) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-3-tuple_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = tuple(l) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-4-tuple_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = tuple(map(lambda x: x, l)) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-5-bytes_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = bytes(l) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-6-bytes_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = bytes(map(lambda x: x, l)) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-7-bytearray_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = bytearray(l) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/from_iter-8-bytearray_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 10000)): 6 | l = [0] * 1000 7 | l2 = bytearray(map(lambda x: x, l)) 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/func_args-1.1-pos_1.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def func(a): 5 | pass 6 | 7 | 8 | def test(num): 9 | for i in iter(range(num)): 10 | func(i) 11 | 12 | 13 | bench.run(test) 14 | -------------------------------------------------------------------------------- /tests/internal_bench/func_args-1.2-pos_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def func(a, b, c): 5 | pass 6 | 7 | 8 | def test(num): 9 | for i in iter(range(num)): 10 | func(i, i, i) 11 | 12 | 13 | bench.run(test) 14 | -------------------------------------------------------------------------------- /tests/internal_bench/func_args-2-pos_default_2_of_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def func(a, b=1, c=2): 5 | pass 6 | 7 | 8 | def test(num): 9 | for i in iter(range(num)): 10 | func(i) 11 | 12 | 13 | bench.run(test) 14 | -------------------------------------------------------------------------------- /tests/internal_bench/func_args-3.1-kw_1.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def func(a): 5 | pass 6 | 7 | 8 | def test(num): 9 | for i in iter(range(num)): 10 | func(a=i) 11 | 12 | 13 | bench.run(test) 14 | -------------------------------------------------------------------------------- /tests/internal_bench/func_args-3.2-kw_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def func(a, b, c): 5 | pass 6 | 7 | 8 | def test(num): 9 | for i in iter(range(num)): 10 | func(c=i, b=i, a=i) 11 | 12 | 13 | bench.run(test) 14 | -------------------------------------------------------------------------------- /tests/internal_bench/func_builtin-1-enum_pos.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 20)): 6 | enumerate([1, 2], 1) 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/func_builtin-2-enum_kw.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num // 20)): 6 | enumerate(iterable=[1, 2], start=1) 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/loop_count-1-range.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in range(num): 6 | pass 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/loop_count-2-range_iter.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | for i in iter(range(num)): 6 | pass 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/loop_count-3-while_up.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | i = 0 6 | while i < num: 7 | i += 1 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/loop_count-4-while_down_gt.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | while num > 0: 6 | num -= 1 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/loop_count-5-while_down_ne.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | while num != 0: 6 | num -= 1 7 | 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /tests/internal_bench/loop_count-5.1-while_down_ne_localvar.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | zero = 0 6 | while num != zero: 7 | num -= 1 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/var-1-constant.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | i = 0 6 | while i < 20000000: 7 | i += 1 8 | 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/var-2-global.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | ITERS = 20000000 4 | 5 | 6 | def test(num): 7 | i = 0 8 | while i < ITERS: 9 | i += 1 10 | 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /tests/internal_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 | 11 | bench.run(test) 12 | -------------------------------------------------------------------------------- /tests/internal_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 | 10 | bench.run(lambda n: test(20000000)) 11 | -------------------------------------------------------------------------------- /tests/internal_bench/var-5-class-attr.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | class Foo: 5 | num = 20000000 6 | 7 | 8 | def test(num): 9 | i = 0 10 | while i < Foo.num: 11 | i += 1 12 | 13 | 14 | bench.run(test) 15 | -------------------------------------------------------------------------------- /tests/io/argv.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.argv) 4 | -------------------------------------------------------------------------------- /tests/io/data/file1: -------------------------------------------------------------------------------- 1 | longer line1 2 | line2 3 | line3 4 | -------------------------------------------------------------------------------- /tests/io/data/file2: -------------------------------------------------------------------------------- 1 | 1234 -------------------------------------------------------------------------------- /tests/io/file_iter.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/file1") 2 | for l in f: 3 | print(l) 4 | -------------------------------------------------------------------------------- /tests/io/file_long_read.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/file1") 2 | b = f.read(100) 3 | print(len(b)) 4 | -------------------------------------------------------------------------------- /tests/io/file_long_read2.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/bigfile1") 2 | b = f.read() 3 | print(len(b)) 4 | print(b) 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/io/file_stdio.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.stdin.fileno()) 4 | print(sys.stdout.fileno()) 5 | -------------------------------------------------------------------------------- /tests/io/resource_stream.py.exp: -------------------------------------------------------------------------------- 1 | 1234 2 | 1234 3 | -------------------------------------------------------------------------------- /tests/jni/list.py.exp: -------------------------------------------------------------------------------- 1 | [] 2 | [one, two] 3 | [one, two] 4 | one two 5 | -------------------------------------------------------------------------------- /tests/jni/object.py.exp: -------------------------------------------------------------------------------- 1 | 42 2 | 42 3 | 42 4 | -------------------------------------------------------------------------------- /tests/jni/system_out.py: -------------------------------------------------------------------------------- 1 | try: 2 | import jni 3 | 4 | System = jni.cls("java/lang/System") 5 | except: 6 | print("SKIP") 7 | raise SystemExit 8 | 9 | System.out.println("Hello, Java!") 10 | -------------------------------------------------------------------------------- /tests/jni/system_out.py.exp: -------------------------------------------------------------------------------- 1 | Hello, Java! 2 | -------------------------------------------------------------------------------- /tests/micropython/const.py.exp: -------------------------------------------------------------------------------- 1 | 123 580 2 | 123 580 3 | 12 46 4 | 1 2 5 | True False 6 | -------------------------------------------------------------------------------- /tests/micropython/const2.py.exp: -------------------------------------------------------------------------------- 1 | 2 | function X 1 3 | class X 1 4 | method X 2 4 4 5 | -------------------------------------------------------------------------------- /tests/micropython/const_error.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | SyntaxError 5 | SyntaxError 6 | SyntaxError 7 | SyntaxError 8 | SyntaxError 9 | SyntaxError 10 | -------------------------------------------------------------------------------- /tests/micropython/const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 0xffffffff 0xffffffffffffffff 2 | 0x100000000fffffffe 0x100000000000000000ffffffff 3 | -------------------------------------------------------------------------------- /tests/micropython/decorator.py: -------------------------------------------------------------------------------- 1 | # test micropython-specific decorators 2 | 3 | 4 | @micropython.bytecode 5 | def f(): 6 | return "bytecode" 7 | 8 | 9 | print(f()) 10 | -------------------------------------------------------------------------------- /tests/micropython/decorator.py.exp: -------------------------------------------------------------------------------- 1 | bytecode 2 | -------------------------------------------------------------------------------- /tests/micropython/decorator_error.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | -------------------------------------------------------------------------------- /tests/micropython/emg_exc.py.exp: -------------------------------------------------------------------------------- 1 | Traceback (most recent call last): 2 | , line 22, in f 3 | ValueError: 1 4 | 5 | -------------------------------------------------------------------------------- /tests/micropython/extreme_exc.py.exp: -------------------------------------------------------------------------------- 1 | Exception() 2 | TypeError( 3 | TypeError( 4 | RuntimeError( 5 | Exception('my exception',) 6 | -------------------------------------------------------------------------------- /tests/micropython/heap_lock.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | MemoryError 3 | 1 4 | MemoryError 5 | [] 6 | -------------------------------------------------------------------------------- /tests/micropython/heap_locked.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_bytesio.py.exp: -------------------------------------------------------------------------------- 1 | b'1234123412341234123412341234123412341234123412341234123412341234' 2 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_bytesio2.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_exc_compressed.py.exp: -------------------------------------------------------------------------------- 1 | NameError name 'name' isn't defined 2 | KeyError pop from an empty set 3 | name 'name' isn't defined 4 | pop from an empty set 5 | NameError 6 | KeyError 7 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_exc_compressed_emg_exc.py.exp: -------------------------------------------------------------------------------- 1 | NameError name 'name' isn't defined 2 | KeyError pop from an empty set 3 | name 'name' isn't defined 4 | pop from an empty set 5 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_exc_raise.py.exp: -------------------------------------------------------------------------------- 1 | error 2 | ok 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_dict.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: create dict 2 | MemoryError: dict.items 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_list.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: list index 2 | MemoryError: list get slice 3 | MemoryError: list extend slice 4 | [1, 2] 5 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_memoryview.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: memoryview create 2 | MemoryError: memoryview subscr get 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_set.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: set create 2 | MemoryError: set copy 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_tuple.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: tuple create 2 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_inst_call.py.exp: -------------------------------------------------------------------------------- 1 | __call__ 2 | __call__ 1 3 | __call__ 1 2 4 | __call__ 1 2 3 5 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_int_from_bytes.py.exp: -------------------------------------------------------------------------------- 1 | 49 2 | 12849 3 | 50 4 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_str.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/micropython/heapalloc_str.py.exp -------------------------------------------------------------------------------- /tests/micropython/heapalloc_super.py.exp: -------------------------------------------------------------------------------- 1 | B foo 2 | A foo 3 | 42 4 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_traceback.py.exp: -------------------------------------------------------------------------------- 1 | StopIteration 2 | Traceback (most recent call last): 3 | File , line 25, in test 4 | StopIteration: 5 | 6 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_yield_from.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 1 5 | -------------------------------------------------------------------------------- /tests/micropython/import_mpy_invalid.py.exp: -------------------------------------------------------------------------------- 1 | mod0 ValueError incompatible .mpy file 2 | mod1 ValueError incompatible .mpy file 3 | mod2 ValueError incompatible .mpy file 4 | mod3 ValueError incompatible .mpy file 5 | -------------------------------------------------------------------------------- /tests/micropython/import_mpy_native_gc.py.exp: -------------------------------------------------------------------------------- 1 | 3628800 2 | -------------------------------------------------------------------------------- /tests/micropython/import_mpy_native_x64.py.exp: -------------------------------------------------------------------------------- 1 | mod0 ValueError incompatible .mpy arch 2 | mod1 OK 3 | mod2 OK 4 | -------------------------------------------------------------------------------- /tests/micropython/kbd_intr.py.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osresearch/micropython/ae63736fbe99a05e3afede48e53853fff38757fe/tests/micropython/kbd_intr.py.exp -------------------------------------------------------------------------------- /tests/micropython/memstats.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | -------------------------------------------------------------------------------- /tests/micropython/native_closure.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 9 4 | -------------------------------------------------------------------------------- /tests/micropython/native_const.py.exp: -------------------------------------------------------------------------------- 1 | b'bytes' 2 | 123 3 | -------------------------------------------------------------------------------- /tests/micropython/native_const_intbig.py: -------------------------------------------------------------------------------- 1 | # check loading constants 2 | 3 | 4 | @micropython.native 5 | def f(): 6 | return 123456789012345678901234567890 7 | 8 | 9 | print(f()) 10 | -------------------------------------------------------------------------------- /tests/micropython/native_const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 123456789012345678901234567890 2 | -------------------------------------------------------------------------------- /tests/micropython/native_gen.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 5 4 | [0, 1, 2] 5 | -------------------------------------------------------------------------------- /tests/micropython/native_misc.py.exp: -------------------------------------------------------------------------------- 1 | 1 [] 2 2 | 1 [] 3 3 | 3 4 | 6 5 | True 6 | False 7 | -------------------------------------------------------------------------------- /tests/micropython/native_try.py.exp: -------------------------------------------------------------------------------- 1 | finally 2 | NameError 3 | finally 4 | NameError 5 | 100 6 | 200 7 | 300 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/opt_level.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | True 4 | False 5 | -------------------------------------------------------------------------------- /tests/micropython/opt_level_lineno.py.exp: -------------------------------------------------------------------------------- 1 | Traceback (most recent call last): 2 | File "", line 1, in 3 | NameError: name 'xyz' isn't defined 4 | -------------------------------------------------------------------------------- /tests/micropython/schedule.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | outer 3 | inner 4 | RuntimeError 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/stack_use.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /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 | 10 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/viper_binop_arith_uint.py.exp: -------------------------------------------------------------------------------- 1 | add 2 | 3 3 3 | 4294967293 4294967293 4 | sub 5 | 4294967295 1 6 | 1 4294967295 7 | mul 8 | 6 6 9 | 4294967290 4294967290 10 | 6 6 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 7 | f(-1) 8 | f(-255) 9 | f(-256) 10 | f(-257) 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/viper_binop_comp_uint.py.exp: -------------------------------------------------------------------------------- 1 | 1 1 == <= >= 2 | 2 1 > >= != 3 | 1 2 < <= != 4 | 2 -1 < <= != 5 | -2 1 > >= != 6 | -2 -1 < <= != 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/viper_cond.py.exp: -------------------------------------------------------------------------------- 1 | not x False 2 | x True 3 | y 1 4 | z 65536 5 | -------------------------------------------------------------------------------- /tests/micropython/viper_const.py.exp: -------------------------------------------------------------------------------- 1 | b'bytes' 2 | 123 3 | -------------------------------------------------------------------------------- /tests/micropython/viper_const_intbig.py: -------------------------------------------------------------------------------- 1 | # check loading constants 2 | 3 | 4 | @micropython.viper 5 | def f(): 6 | return 123456789012345678901234567890 7 | 8 | 9 | print(f()) 10 | -------------------------------------------------------------------------------- /tests/micropython/viper_const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 123456789012345678901234567890 2 | -------------------------------------------------------------------------------- /tests/micropython/viper_globals.py.exp: -------------------------------------------------------------------------------- 1 | NameError 2 | 123 3 | -------------------------------------------------------------------------------- /tests/micropython/viper_import.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 8 | 9 | import sys 10 | 11 | print(viper_uint() == (sys.maxsize << 1 | 1)) 12 | -------------------------------------------------------------------------------- /tests/micropython/viper_misc_intbig.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/micropython/viper_ptr16_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 12849 13363 3 | 26212 4 | 26212 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/viper_ptr32_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x12\x12\x12\x124444') 2 | 0x12121212 0x34343434 3 | 0x46464646 4 | 0x46464646 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/viper_ptr8_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 49 50 3 | 202 4 | 202 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/micropython/viper_subscr.py.exp: -------------------------------------------------------------------------------- 1 | [1, 2, 3] 2 | 1 3 | 2 4 | 3 5 | -------------------------------------------------------------------------------- /tests/micropython/viper_try.py.exp: -------------------------------------------------------------------------------- 1 | finally 2 | NameError 3 | finally 4 | NameError 5 | 100 6 | 200 7 | 300 8 | -------------------------------------------------------------------------------- /tests/micropython/viper_types.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | True 3 | False 4 | True 5 | False 6 | True 7 | False 8 | True 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/misc/non_compliant_lexer.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | SyntaxError 5 | NotImplementedError 6 | -------------------------------------------------------------------------------- /tests/misc/sys_atexit.py.exp: -------------------------------------------------------------------------------- 1 | done before exit 2 | done at exit: ok 3 | -------------------------------------------------------------------------------- /tests/multi_bluetooth/ble_gap_advertise.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | gap_advertise(100_000, connectable=False) 3 | gap_advertise(20_000, connectable=True) 4 | gap_advertise(None) 5 | --- instance1 --- 6 | adv_types: [0, 2] 7 | adv_data: b'\x02\x01\x06\x04\xffMPY' 8 | -------------------------------------------------------------------------------- /tests/multi_net/ssl_data.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'client to server' 3 | --- instance1 --- 4 | b'server to client' 5 | -------------------------------------------------------------------------------- /tests/multi_net/uasyncio_tcp_client_rst.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'GET / HTTP' 3 | OSError 104 4 | --- instance1 --- 5 | 6 | -------------------------------------------------------------------------------- /tests/multi_net/uasyncio_tcp_close_write.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | server running 3 | read: b'' 4 | close 5 | done 6 | --- instance1 --- 7 | read: b'x' 8 | close 9 | write 10 | OSError 11 | -------------------------------------------------------------------------------- /tests/multi_net/uasyncio_tcp_readexactly.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | server running 3 | close 4 | done 5 | --- instance1 --- 6 | b'ab' 7 | b'' 8 | b'c' 9 | EOFError 10 | b'' 11 | -------------------------------------------------------------------------------- /tests/multi_net/uasyncio_tcp_server_client.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | server running 3 | echo: b'client data' 4 | close 5 | done 6 | --- instance1 --- 7 | write: b'client data' 8 | read: b'client data' 9 | -------------------------------------------------------------------------------- /tests/net_hosted/accept_nonblock.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/net_hosted/accept_timeout.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/net_hosted/connect_nonblock.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/net_hosted/connect_poll.py.exp: -------------------------------------------------------------------------------- 1 | 1 20 2 | 1 3 | 1 4 4 | -------------------------------------------------------------------------------- /tests/net_hosted/ssl_getpeercert.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/net_inet/tls_num_errors.py.exp: -------------------------------------------------------------------------------- 1 | heap is locked 2 | wrap: True 3 | -------------------------------------------------------------------------------- /tests/net_inet/uasyncio_cancel_stream.py.exp: -------------------------------------------------------------------------------- 1 | start 2 | cancelling 3 | waiting 4 | cancelled 5 | done 6 | -------------------------------------------------------------------------------- /tests/net_inet/uasyncio_open_connection.py.exp: -------------------------------------------------------------------------------- 1 | write GET 2 | read response 3 | read: b'HTTP/1.1 200 OK' 4 | close 5 | done 6 | -------------------------------------------------------------------------------- /tests/net_inet/uasyncio_tcp_read_headers.py.exp: -------------------------------------------------------------------------------- 1 | write GET 2 | b'HTTP/1.1 200 OK' 3 | b'Content-Type: text/html' 4 | b'Content-Length: 54' 5 | b'Connection: close' 6 | b'Vary: Accept-Encoding' 7 | b'ETag: "54306c85-36"' 8 | b'Accept-Ranges: bytes' 9 | close 10 | done 11 | -------------------------------------------------------------------------------- /tests/pyb/accel.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | if not hasattr(pyb, "Accel"): 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | accel = pyb.Accel() 8 | print(accel) 9 | accel.x() 10 | accel.y() 11 | accel.z() 12 | accel.tilt() 13 | accel.filtered_xyz() 14 | -------------------------------------------------------------------------------- /tests/pyb/accel.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/pyb/adc.py.exp: -------------------------------------------------------------------------------- 1 | 3 | 50 4 | 25 5 | 30 6 | -------------------------------------------------------------------------------- /tests/pyb/can2.py.exp: -------------------------------------------------------------------------------- 1 | (1, True, 0, b'') 2 | (2, True, 1, b'') 3 | (3, True, 2, b'') 4 | False 5 | -------------------------------------------------------------------------------- /tests/pyb/dac.py.exp: -------------------------------------------------------------------------------- 1 | DAC(1, bits=8) 2 | -------------------------------------------------------------------------------- /tests/pyb/extint.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | line: 4 3 | line: 4 4 | -------------------------------------------------------------------------------- /tests/pyb/i2c.py.exp: -------------------------------------------------------------------------------- 1 | ValueError -1 2 | ValueError 0 3 | I2C 1 4 | [] 5 | -------------------------------------------------------------------------------- /tests/pyb/i2c_accel.py.exp: -------------------------------------------------------------------------------- 1 | [76] 2 | True 3 | b'\x01' 4 | -------------------------------------------------------------------------------- /tests/pyb/i2c_error.py.exp: -------------------------------------------------------------------------------- 1 | OSError(5,) 2 | OSError(5,) 3 | OSError(5,) 4 | OSError(5,) 5 | -------------------------------------------------------------------------------- /tests/pyb/irq.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True False 3 | -------------------------------------------------------------------------------- /tests/pyb/led.py.exp: -------------------------------------------------------------------------------- 1 | LED(1) 2 | LED(2) 3 | LED(3) 4 | -------------------------------------------------------------------------------- /tests/pyb/modstm.py.exp: -------------------------------------------------------------------------------- 1 | 0x8000 2 | 0x0 3 | -------------------------------------------------------------------------------- /tests/pyb/pin.py.exp: -------------------------------------------------------------------------------- 1 | Pin(Pin.cpu.A7, mode=Pin.IN) 2 | A7 3 | 7 4 | 0 5 | Pin(Pin.cpu.A7, mode=Pin.IN, pull=Pin.PULL_UP) 6 | 1 7 | Pin(Pin.cpu.A7, mode=Pin.IN, pull=Pin.PULL_DOWN) 8 | 0 9 | 0 10 | 1 11 | 0 12 | 1 13 | 0 14 | 1 15 | -------------------------------------------------------------------------------- /tests/pyb/pyb1.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | True 4 | 12 5 | -------------------------------------------------------------------------------- /tests/pyb/pyb_f405.py.exp: -------------------------------------------------------------------------------- 1 | (168000000, 168000000, 42000000, 84000000) 2 | 3 | OSError(5,) 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/pyb/pyb_f411.py.exp: -------------------------------------------------------------------------------- 1 | (96000000, 96000000, 24000000, 48000000) 2 | -------------------------------------------------------------------------------- /tests/pyb/servo.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 1500 3 | (630, 2410, 1490, 2460, 2190) 4 | -------------------------------------------------------------------------------- /tests/pyb/spi.py.exp: -------------------------------------------------------------------------------- 1 | ValueError -1 2 | ValueError 0 3 | SPI 1 4 | SPI 2 5 | SPI(1) 6 | SPI(1, SPI.MASTER, baudrate= , polarity=1, phase=0, bits=8) 7 | SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) 8 | OSError 9 | b'\xff' 10 | b'\xff' 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/pyb/switch.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /tests/pyb/timer.py.exp: -------------------------------------------------------------------------------- 1 | 100 2 | 200 3 | 300 4 | 400 5 | 100 6 | 0.001 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/pybnative/for.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 0 6 | 1 7 | 2 8 | 3 9 | -------------------------------------------------------------------------------- /tests/pybnative/while.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 1 5 | 2 6 | 3 7 | -------------------------------------------------------------------------------- /tests/qemu-arm/native_test.py: -------------------------------------------------------------------------------- 1 | import native_frozen_align 2 | 3 | native_frozen_align.native_x(1) 4 | native_frozen_align.native_y(2) 5 | native_frozen_align.native_z(3) 6 | -------------------------------------------------------------------------------- /tests/qemu-arm/native_test.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 4 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/stress/recursion.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | foo() 3 | 4 | 5 | try: 6 | foo() 7 | except RuntimeError: 8 | print("RuntimeError") 9 | -------------------------------------------------------------------------------- /tests/stress/recursive_data.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | -------------------------------------------------------------------------------- /tests/stress/recursive_iternext.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | RuntimeError 3 | RuntimeError 4 | RuntimeError 5 | -------------------------------------------------------------------------------- /tests/thread/stress_schedule.py.exp: -------------------------------------------------------------------------------- 1 | PASS 2 | -------------------------------------------------------------------------------- /tests/thread/thread_exc2.py.exp: -------------------------------------------------------------------------------- 1 | Unhandled exception in thread started by 2 | Traceback (most recent call last): 3 | File \.\+, line 7, in thread_entry 4 | ValueError: 5 | done 6 | -------------------------------------------------------------------------------- /tests/unicode/data/utf-8_1.txt: -------------------------------------------------------------------------------- 1 | Привет 2 | -------------------------------------------------------------------------------- /tests/unicode/data/utf-8_2.txt: -------------------------------------------------------------------------------- 1 | aαbβcγdδ 2 | ぁ🙐 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/unicode/unicode_index.py: -------------------------------------------------------------------------------- 1 | print("Привет".find("т")) 2 | print("Привет".find("П")) 3 | print("Привет".rfind("т")) 4 | print("Привет".rfind("П")) 5 | print("Привет".index("т")) 6 | print("Привет".index("П")) 7 | -------------------------------------------------------------------------------- /tests/unicode/unicode_iter.py: -------------------------------------------------------------------------------- 1 | for c in "Hello": 2 | print(c) 3 | for c in "Привет": 4 | print(c) 5 | -------------------------------------------------------------------------------- /tests/unicode/unicode_ord.py: -------------------------------------------------------------------------------- 1 | # test builtin ord with unicode characters 2 | 3 | print(ord("α")) 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/unicode/unicode_slice.py: -------------------------------------------------------------------------------- 1 | # Test slicing of Unicode strings 2 | 3 | s = "Привет" 4 | 5 | print(s[:]) 6 | print(s[2:]) 7 | print(s[:5]) 8 | print(s[2:5]) 9 | print(s[2:5:1]) 10 | print(s[2:10]) 11 | print(s[-3:10]) 12 | print(s[-4:10]) 13 | -------------------------------------------------------------------------------- /tests/unicode/unicode_str_format.py: -------------------------------------------------------------------------------- 1 | # test handling of unicode chars in format strings 2 | 3 | print("α".format()) 4 | print("{α}".format(α=1)) 5 | -------------------------------------------------------------------------------- /tests/unicode/unicode_str_modulo.py: -------------------------------------------------------------------------------- 1 | # test handling of unicode chars in string % formatting 2 | 3 | print("α" % ()) 4 | -------------------------------------------------------------------------------- /tests/unix/ffi_callback.py.exp: -------------------------------------------------------------------------------- 1 | org string: bytearray(b'foobar') 2 | qsort'ed: bytearray(b'abfoor') 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/wipy/modwipy.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | Exception 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/wipy/reset/reset.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/wipy/sd.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exception 5 | Exception 6 | Exception 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/wipy/wdt.py.exp: -------------------------------------------------------------------------------- 1 | Exception 2 | Exception 3 | Exception 4 | 5 | Exception 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/wipy/wlan/machine.py.exp: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | Active 5 | True 6 | True 7 | Exception 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/.gitattributes: -------------------------------------------------------------------------------- 1 | *.tar.gz binary 2 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------