├── tests ├── io │ ├── data │ │ ├── file2 │ │ └── file1 │ ├── argv.py │ ├── file_iter.py │ ├── file_long_read.py │ ├── file_long_read2.py │ ├── file_long_read3.py │ ├── file_stdio.py │ └── file_readinto_len.py.exp ├── extmod │ ├── ssl_poll.py.exp │ ├── ticks_diff.py.exp │ ├── asyncio_as_uasyncio.py.exp │ ├── hashlib_final.py.exp │ ├── uctypes_sizeof_native.py.exp │ ├── json_dumps_extra.py.exp │ ├── vfs_lfs_superblock.py.exp │ ├── machine_disable_irq.py.exp │ ├── re_stack_overflow.py.exp │ ├── time_ms_us.py.exp │ ├── re_split_notimpl.py.exp │ ├── ssl_cadata.py.exp │ ├── websocket_toobig.py.exp │ ├── machine_signal.py.exp │ ├── uctypes_native_float.py.exp │ ├── uctypes_sizeof_float.py.exp │ ├── deflate_compress_memory_error.py.exp │ ├── random_basic.py.exp │ ├── ssl_keycert_pkcs8.py.exp │ ├── uctypes_byteat.py.exp │ ├── uctypes_sizeof_layout.py.exp │ ├── asyncio_cancel_self.py.exp │ ├── framebuf_palette.py.exp │ ├── machine_uart_tx.py.exp │ ├── uctypes_sizeof_od.py.exp │ ├── vfs_fat_finaliser.py.exp │ ├── vfs_fat_mtime.py.exp │ ├── re_split_empty.py.exp │ ├── uctypes_array_assign_native_le_intbig.py.exp │ ├── vfs_fat_oldproto.py.exp │ ├── vfs_posix_ilistdir_filter.py.exp │ ├── machine_soft_timer.py.exp │ ├── vfs_posix_enoent.py.exp │ ├── re_limit.py.exp │ ├── ssl_ioctl.py.exp │ ├── uctypes_ptr_native_le.py.exp │ ├── machine_rtc.py.exp │ ├── uctypes_bytearray.py.exp │ ├── btree_closed.py.exp │ ├── uctypes_ptr_le.py.exp │ ├── uctypes_addressof.py.exp │ ├── uctypes_error.py.exp │ ├── uctypes_print.py.exp │ ├── btree_error.py.exp │ ├── uctypes_array_assign_le.py.exp │ ├── asyncio_iterator_event.py.exp │ ├── tls_dtls.py.exp │ ├── asyncio_event_queue.py.exp │ ├── asyncio_micropython.py.exp │ ├── cryptolib_aes128_ecb_enc.py.exp │ ├── tls_sslcontext_micropython.py.exp │ ├── machine_pinbase.py.exp │ ├── time_time_ns.py.exp │ ├── machine_pulse.py.exp │ ├── ssl_keycert.py.exp │ ├── vfs_posix_readonly.py.exp │ ├── machine_i2s_rate.py.exp │ ├── select_ipoll.py.exp │ ├── vfs_fat_ramdisklarge.py.exp │ ├── ssl_basic.py.exp │ ├── uctypes_array_assign_native_le.py.exp │ └── vfs_fat_fileio1.py.exp ├── import │ ├── pkg │ │ ├── __init__.py │ │ └── mod.py │ ├── broken │ │ ├── zerodiv.py │ │ └── pkg2_and_zerodiv.py │ ├── pkg6 │ │ ├── x │ │ │ ├── y.py │ │ │ └── __init__.py │ │ └── __init__.py │ ├── pkg8 │ │ └── mod.py │ ├── pkg2 │ │ ├── mod2.py │ │ ├── mod1.py │ │ └── __init__.py │ ├── pkg9 │ │ ├── mod2.py │ │ ├── mod1.py │ │ └── __init__.py │ ├── import_circular.py │ ├── gen_context2.py │ ├── pkgstar_all_inval │ │ └── __init__.py │ ├── import_long_dyn.py │ ├── pkg3 │ │ ├── __init__.py │ │ ├── subpkg1 │ │ │ ├── __init__.py │ │ │ └── mod1.py │ │ ├── mod1.py │ │ └── mod2.py │ ├── pkg7 │ │ ├── __init__.py │ │ ├── mod1.py │ │ ├── mod2.py │ │ └── subpkg1 │ │ │ ├── __init__.py │ │ │ └── subpkg2 │ │ │ └── __init__.py │ ├── import1a.py │ ├── import3a.py │ ├── circular │ │ ├── sub.py │ │ └── main.py │ ├── import_long_dyn2.py │ ├── pkgstar_all_array │ │ └── funcs.py │ ├── import_pkg8.py │ ├── import1b.py │ ├── import_pkg6.py │ ├── ext │ │ ├── os.py │ │ ├── sys.py │ │ ├── micropython.py │ │ └── usys.py │ ├── import_pkg4.py │ ├── rel_import_inv.py │ ├── import_pkg3.py │ ├── import2a.py │ ├── import_pkg7.py │ ├── import_file.py │ ├── import_pkg5.py │ └── gen_context.py ├── cpydiff │ ├── modules │ │ ├── __init__.py │ │ ├── subpkg │ │ │ └── foo.py │ │ └── foo.py │ └── modules2 │ │ └── subpkg │ │ └── bar.py ├── feature_check │ ├── const.py.exp │ ├── slice.py.exp │ ├── async_check.py.exp │ ├── bytearray.py.exp │ ├── byteorder.py.exp │ ├── complex.py.exp │ ├── coverage.py.exp │ ├── reverse_ops.py.exp │ ├── set_check.py.exp │ ├── target_info.py.exp │ ├── fstring.py.exp │ ├── native_check.py.exp │ ├── inlineasm_rv32.py.exp │ ├── inlineasm_thumb.py.exp │ ├── const.py │ ├── inlineasm_rv32_zba.py.exp │ ├── inlineasm_thumb2.py.exp │ ├── inlineasm_xtensa.py.exp │ ├── int_64.py.exp │ ├── byteorder.py │ ├── int_big.py.exp │ ├── set_check.py │ ├── int_64.py │ ├── repl_emacs_check.py │ ├── fstring.py │ ├── slice.py │ ├── complex.py │ ├── bytearray.py │ ├── coverage.py │ ├── async_check.py │ ├── int_big.py │ ├── native_check.py │ ├── inlineasm_thumb.py │ ├── inlineasm_xtensa.py │ ├── inlineasm_rv32.py │ └── reverse_ops.py ├── micropython │ ├── kbd_intr.py.exp │ ├── heapalloc_str.py.exp │ ├── const_math.py.exp │ ├── decorator.py.exp │ ├── heap_locked.py.exp │ ├── heapalloc_bytesio2.py.exp │ ├── stack_use.py.exp │ ├── viper_import.py.exp │ ├── viper_large_jump.py.exp │ ├── viper_misc_intbig.py.exp │ ├── native_closure.py.exp │ ├── native_const.py.exp │ ├── viper_const.py.exp │ ├── emg_exc.py.native.exp │ ├── heapalloc_exc_raise.py.exp │ ├── memstats.py.exp │ ├── viper_globals.py.exp │ ├── heapalloc_super.py.exp │ ├── native_fun_attrs_code.py.exp │ ├── opt_level.py.exp │ ├── viper_storeattr.py.exp │ ├── decorator_error.py.exp │ ├── heapalloc_int_from_bytes.py.exp │ ├── heapalloc_yield_from.py.exp │ ├── native_while.py.exp │ ├── viper_subscr.py.exp │ ├── heapalloc_fail_tuple.py.exp │ ├── schedule.py.exp │ ├── viper_const_intbig.py.exp │ ├── viper_misc2.py.exp │ ├── import_mpy_native_gc.py.exp │ ├── native_const_intbig.py.exp │ ├── native_for.py.exp │ ├── viper_cond.py.exp │ ├── const.py.exp │ ├── ringio_big.py.exp │ ├── viper_misc.py.exp │ ├── viper_ptr8_load.py.exp │ ├── heap_lock.py.exp │ ├── heapalloc_fail_set.py.exp │ ├── heapalloc_traceback.py.native.exp │ ├── heapalloc_fail_dict.py.exp │ ├── viper_ptr16_load.py.exp │ ├── viper_unop.py.exp │ ├── const2.py.exp │ ├── heapalloc_inst_call.py.exp │ ├── native_fun_attrs.py.exp │ ├── viper_args.py.exp │ ├── const_float.py.exp │ ├── import_mpy_native.py.exp │ ├── native_misc.py.exp │ ├── native_try.py.exp │ ├── native_try_deep.py.exp │ ├── viper_subscr_multi.py.exp │ ├── viper_try.py.exp │ ├── viper_types.py.exp │ ├── emg_exc.py.exp │ ├── heapalloc_bytesio.py.exp │ ├── const_intbig.py.exp │ ├── heapalloc_fail_memoryview.py.exp │ ├── extreme_exc.py.exp │ ├── viper_ptr32_load.py.exp │ ├── const_error.py.exp │ ├── viper_binop_comp_uint.py.exp │ ├── heapalloc_fail_list.py.exp │ ├── viper_binop_comp_imm.py.exp │ ├── heapalloc_traceback.py.exp │ ├── native_gen.py.exp │ ├── opt_level_lineno.py.exp │ ├── viper_binop_multi_comp.py.exp │ ├── test_normalize_newlines.py.exp │ ├── viper_misc3.py.exp │ ├── import_mpy_invalid.py.exp │ ├── viper_addr.py.exp │ ├── viper_ptr16_store.py.exp │ ├── decorator.py │ ├── viper_ptr8_store.py.exp │ └── viper_binop_arith_uint.py.exp ├── ports │ ├── renesas-ra │ │ ├── i2c.py.exp │ │ ├── uart1.py.exp │ │ ├── freq.py.exp │ │ ├── pin.py.exp │ │ └── rtc_init.py.exp │ ├── qemu │ │ ├── viper_test.py.exp │ │ ├── mpy_arch_flags_test.py.exp │ │ ├── native_test.py.exp │ │ ├── asm_test.py.exp │ │ ├── viper_test.py │ │ └── native_test.py │ ├── stm32 │ │ ├── accel.py.exp │ │ ├── switch.py.exp │ │ ├── dac.py.exp │ │ ├── irq.py.exp │ │ ├── modstm.py.exp │ │ ├── pyb1.py.exp │ │ ├── extint.py.exp │ │ ├── led.py.exp │ │ ├── i2c_accel.py.exp │ │ ├── pyb_f411.py.exp │ │ ├── i2c.py.exp │ │ ├── timer.py.exp │ │ ├── i2c_error.py.exp │ │ ├── servo.py.exp │ │ ├── adc.py.exp │ │ ├── pyb_f405.py.exp │ │ ├── can2.py.exp │ │ ├── timer_callback.py.exp │ │ └── switch.py │ ├── cc3200 │ │ ├── reset │ │ │ └── reset.py.exp │ │ ├── modwipy.py.exp │ │ ├── sd.py.exp │ │ ├── wdt.py.exp │ │ ├── wlan │ │ │ ├── machine.py.exp │ │ │ └── server.py.exp │ │ └── skipped │ │ │ └── rtc_irq.py.exp │ ├── rp2 │ │ ├── rp2_machine_idle.py.exp │ │ ├── rp2_thread_reset_part1.py.exp │ │ ├── rp2_thread_reset_part2.py.exp │ │ ├── rp2_lightsleep.py.exp │ │ └── rp2_uart.py.exp │ ├── webassembly │ │ ├── promise_with_resolvers.mjs.exp │ │ ├── globals.mjs.exp │ │ ├── py_proxy_has.mjs.exp │ │ ├── iterator.mjs.exp │ │ ├── asyncio_await_resolve_no_arg.mjs.exp │ │ ├── js_proxy_iterator.mjs.exp │ │ ├── py_proxy_get.mjs.exp │ │ ├── basic.js.exp │ │ ├── filesystem.mjs.exp │ │ ├── py_proxy_set.mjs.exp │ │ ├── jsffi_create_proxy.mjs.exp │ │ ├── asyncio_sleep.mjs.exp │ │ ├── await_error_handling.mjs.exp │ │ ├── py_proxy_identity.mjs.exp │ │ ├── py_proxy_delete.mjs.exp │ │ ├── override_new.mjs.exp │ │ ├── fun_py_callback_js.mjs.exp │ │ ├── various.js.exp │ │ ├── this_behaviour.mjs.exp │ │ ├── run_python_async_no_await.mjs.exp │ │ ├── py_proxy_to_js.mjs.exp │ │ ├── js_proxy_attribute.mjs.exp │ │ ├── register_js_module.js.exp │ │ ├── jsffi_to_js.mjs.exp │ │ └── py_proxy_dict_undefined.mjs.exp │ ├── unix │ │ ├── ffi_callback.py.exp │ │ ├── ffi_float2.py.exp │ │ └── mod_os.py.exp │ └── esp32 │ │ ├── check_err_str.py.exp │ │ └── esp32_idf_heap_info.py.exp ├── basics │ ├── slice_op.py.exp │ ├── module2.py.exp │ ├── string_escape_invalid.py.exp │ ├── subclass_native_call.py.exp │ ├── array_micropython.py.exp │ ├── bytes_compare2.py │ ├── bytes_escape_unicode.py.exp │ ├── try_except_break.py.exp │ ├── class_emptybases.py │ ├── fun_code_micropython.py.exp │ ├── io_bytesio_ext2.py.exp │ ├── set_union.py │ ├── set_comprehension.py │ ├── bytearray_intbig.py │ ├── memoryerror.py.exp │ ├── memoryview_slice_size.py.exp │ ├── op_error_literal.py.exp │ ├── parser.py.exp │ ├── bytes_compare3.py.exp │ ├── set_iter_of_iter.py │ ├── fun1.py │ ├── set_clear.py │ ├── set_discard.py │ ├── string_fstring_invalid.py.exp │ ├── struct_micropython.py.exp │ ├── lambda1.py │ ├── set_iter.py │ ├── sys_stdio_buffer.py.exp │ ├── generator2.py │ ├── is_isnot.py │ ├── list_clear.py │ ├── dict_get.py │ ├── fun_str.py │ ├── list_sum.py │ ├── builtin_bin_intbig.py │ ├── io_write_ext.py.exp │ ├── is_isnot_literal.py.exp │ ├── 0prelim.py │ ├── compare_multi.py │ ├── list_reverse.py │ ├── slice_optimise.py.exp │ ├── dict_clear.py │ ├── fun_annotations.py │ ├── generator_pep479.py.exp │ ├── generator_throw_multi_arg.py.exp │ ├── nanbox_smallint.py.exp │ ├── string_format_cp310.py.exp │ ├── bytes_construct_bytearray.py │ ├── dict_fixed.py.exp │ ├── python34.py.exp │ ├── dict_iterator.py │ ├── exception_chain.py.exp │ ├── set_copy.py │ ├── tuple_slice.py │ ├── builtin_abs.py │ ├── int_bytes_optional_args_cp311.py.exp │ ├── object1.py │ ├── tuple_count.py │ ├── errno1.py.exp │ ├── string_escape_invalid.py │ ├── assign_expr_syntaxerror.py.exp │ ├── builtin_hex_intbig.py │ ├── builtin_oct_intbig.py │ ├── dict_copy.py │ ├── list_copy.py │ ├── set_specialmeth.py │ ├── int_big_pow.py │ ├── int_big_unary.py │ ├── for_return.py │ ├── list_count.py │ ├── set_update.py │ ├── bytes_escape_unicode.py │ ├── bytes_gen.py │ ├── fun_code_full.py.exp │ ├── string_cr_conversion.py │ ├── string_upperlow.py │ ├── andor.py │ ├── assign1.py │ ├── bytes_construct_intbig.py │ ├── int2.py │ ├── builtin_hash_gen.py │ ├── bytes_add_bytearray.py │ ├── builtin_pow.py │ ├── builtin_round.py │ ├── dict_specialmeth.py │ ├── fun2.py │ ├── bytearray_count.py │ ├── fun3.py │ ├── ifexpr.py │ ├── module2.py │ ├── string_crlf_conversion.py │ ├── bytes_compare_bytearray.py │ ├── list_insert.py │ ├── bytearray_decode.py │ └── special_methods_intbig.py ├── cmdline │ ├── cmd_compile_only.py.exp │ ├── cmd_optimise.py.exp │ ├── cmd_sys_exit_0.py.exp │ ├── cmd_sys_exit_none.py.exp │ ├── cmd_compile_only_error.py.exp │ ├── cmd_sys_exit_error.py.exp │ ├── repl_basic.py │ ├── cmd_file_variable.py.exp │ ├── cmd_verbose.py │ ├── repl_micropyinspect │ ├── cmd_optimise.py │ ├── cmd_module_atexit.py.exp │ ├── repl_inspect.py │ ├── cmd_sys_exit_0.py │ ├── repl_sys_ps1_ps2.py │ ├── cmd_module_atexit_exc.py.exp │ ├── cmd_sys_exit_error.py │ ├── cmd_sys_exit_none.py │ └── repl_micropyinspect.py ├── unicode │ ├── data │ │ ├── utf-8_1.txt │ │ ├── utf-8_2.txt │ │ └── utf-8_invalid.txt │ ├── unicode_ord.py │ ├── unicode_iter.py │ ├── unicode_str_modulo.py │ ├── file1.py │ ├── unicode_chr.py │ ├── unicode_str_format.py │ └── file_invalid.py ├── inlineasm │ ├── rv32 │ │ ├── asmcsr.py.exp │ │ ├── asmloadstore.py.exp │ │ ├── asmstack.py.exp │ │ ├── asmzba.py.exp │ │ ├── asmargs.py.exp │ │ ├── asmjump.py.exp │ │ ├── asmconst.py.exp │ │ ├── asmrettype.py.exp │ │ ├── asmarith.py.exp │ │ ├── asmsum.py.exp │ │ ├── asmdivmul.py.exp │ │ ├── asmdata.py.exp │ │ └── asmshift.py.exp │ ├── thumb │ │ ├── asmblbx.py.exp │ │ ├── asmfpaddsub.py.exp │ │ ├── asmfpldrstr.py.exp │ │ ├── asmfpmuldiv.py.exp │ │ ├── asmfpsqrt.py.exp │ │ ├── asmconst.py.exp │ │ ├── asmpushpop.py.exp │ │ ├── asmfpcmp.py.exp │ │ ├── asmit.py.exp │ │ ├── asmspecialregs.py.exp │ │ ├── asmbcc.py.exp │ │ ├── asmargs.py.exp │ │ ├── asmbitops.py.exp │ │ ├── asmerrors.py.exp │ │ ├── asmdiv.py.exp │ │ ├── asmshift.py.exp │ │ ├── asmdata.py.exp │ │ ├── asmrettype.py.exp │ │ ├── asmsum.py.exp │ │ └── asmerrors.py │ └── xtensa │ │ ├── asmjump.py.exp │ │ ├── asmmisc.py.exp │ │ └── asmargs.py.exp ├── jni │ ├── object.py.exp │ ├── system_out.py.exp │ └── list.py.exp ├── net_hosted │ ├── accept_nonblock.py.exp │ ├── accept_timeout.py.exp │ ├── connect_nonblock.py.exp │ ├── connect_poll.py.exp │ └── ssl_getpeercert.py.exp ├── thread │ ├── stress_schedule.py.exp │ ├── thread_coop.py.exp │ ├── thread_heap_lock.py.exp │ ├── disable_irq.py.exp │ └── thread_exc2.py.native.exp ├── float │ ├── float_format_ftoe.py.exp │ ├── python36.py.exp │ ├── int_power.py │ ├── list_index.py │ ├── true_value.py │ ├── builtin_float_round_intbig.py │ ├── complex1_intbig.py │ └── lexer.py ├── perf_bench │ ├── core_import_mpy_multi.py.exp │ └── core_import_mpy_single.py.exp ├── stress │ ├── recursive_data.py.exp │ ├── fun_call_limit.py.exp │ ├── recursive_iternext.py.exp │ ├── recursion.py │ ├── qstr_limit_str_modulo.py.exp │ ├── bytecode_limit.py.exp │ └── list_sort.py ├── net_inet │ ├── ssl_cert.py.exp │ ├── tls_text_errors.py.exp │ ├── test_sslcontext_client.py.exp │ ├── tls_num_errors.py.exp │ ├── asyncio_cancel_stream.py.exp │ ├── isrg.der │ ├── mpycert.der │ └── asyncio_open_connection.py.exp ├── misc │ ├── sys_atexit.py.exp │ ├── cexample_module.py.exp │ ├── cexample_subclass.py.exp │ ├── non_compliant_lexer.py.exp │ ├── sys_settrace_cov.py.exp │ └── cexample_class.py.exp ├── multi_bluetooth │ ├── perf_l2cap.py.exp │ └── perf_gatt_notify.py.exp ├── frozen │ ├── frozentest.mpy │ └── README.md ├── multi_net │ ├── ec_cert.der │ ├── ec_key.der │ ├── rsa_cert.der │ ├── rsa_key.der │ ├── expired_cert.der │ ├── asyncio_tcp_client_rst.py.exp │ ├── ssl_cert_ec.py.exp │ ├── ssl_cert_rsa.py.exp │ ├── udp_recv_dontwait.py.exp │ ├── sslcontext_server_client.py.exp │ ├── sslcontext_server_client_ciphers.py.exp │ ├── sslcontext_server_client_files.py.exp │ ├── asyncio_tcp_readall.py.exp │ ├── sslcontext_check_hostname_error.py.exp │ └── asyncio_tcp_readexactly.py.exp ├── internal_bench │ ├── loop_count-1-range.py │ ├── loop_count-4-while_down_gt.py │ ├── loop_count-5-while_down_ne.py │ ├── loop_count-2-range_iter.py │ ├── loop_count-3-while_up.py │ ├── var-1-constant.py │ ├── bytealloc-1-bytes_n.py │ ├── bytealloc-2-repeat.py │ └── var-4-arg.py ├── multi_espnow │ └── 10_simple_data.py.exp └── target_wiring │ └── nrf.py ├── ports ├── nrf │ ├── boards │ │ ├── deploy.md │ │ ├── MICROBIT │ │ │ ├── custom_nrf51822_s110_microbit.ld │ │ │ └── modules │ │ │ │ └── iters.h │ │ ├── ARDUINO_NANO_33_BLE_SENSE │ │ │ └── nano_bootloader.ld │ │ ├── WT51822_S4AT │ │ │ └── pins.csv │ │ ├── PCA10000 │ │ │ └── pins.csv │ │ ├── s132_6.1.1.ld │ │ ├── s140_6.1.1.ld │ │ └── s140_7.3.0.ld │ ├── .gitignore │ ├── freeze │ │ └── test.py │ └── modules │ │ └── manifest.py ├── esp8266 │ ├── user_config.h │ └── boards │ │ ├── ESP8266_GENERIC │ │ └── mpconfigboard.mk │ │ └── manifest.py ├── alif │ ├── lwip_inc │ │ └── arch │ │ │ └── sys_arch.h │ ├── qstrdefsport.h │ ├── mcu │ │ └── pins_prefix.c │ └── modules │ │ └── he │ │ └── _boot.py ├── bare-arm │ └── mphalport.h ├── esp32 │ ├── .gitignore │ └── boards │ │ ├── ESP32_GENERIC │ │ ├── sdkconfig.unicore │ │ ├── mpconfigboard.cmake │ │ └── sdkconfig.d2wd │ │ ├── SIL_MANT1S │ │ ├── pins.csv │ │ └── manifest.py │ │ ├── UM_OMGS3 │ │ ├── board.md │ │ ├── manifest.py │ │ └── pins.csv │ │ ├── UM_PROS3 │ │ ├── board.md │ │ ├── manifest.py │ │ └── sdkconfig.board │ │ ├── UM_NANOS3 │ │ ├── board.md │ │ ├── manifest.py │ │ └── sdkconfig.board │ │ ├── UM_TINYS2 │ │ ├── board.md │ │ ├── manifest.py │ │ └── sdkconfig.board │ │ ├── UM_TINYS3 │ │ ├── board.md │ │ ├── manifest.py │ │ └── sdkconfig.board │ │ ├── UM_FEATHERS2 │ │ ├── board.md │ │ └── manifest.py │ │ ├── UM_FEATHERS3 │ │ ├── board.md │ │ └── manifest.py │ │ ├── UM_TINYPICO │ │ ├── board.md │ │ └── manifest.py │ │ ├── UM_FEATHERS2NEO │ │ ├── board.md │ │ └── manifest.py │ │ ├── UM_FEATHERS3NEO │ │ ├── board.md │ │ └── manifest.py │ │ ├── UM_TINYWATCHS3 │ │ └── board.md │ │ ├── UM_RGBTOUCH_MINI │ │ ├── board.md │ │ └── manifest.py │ │ ├── M5STACK_ATOM │ │ └── manifest.py │ │ ├── LOLIN_C3_MINI │ │ ├── manifest.py │ │ └── sdkconfig.board │ │ ├── LOLIN_S2_MINI │ │ ├── manifest.py │ │ └── sdkconfig.board │ │ ├── ESP32_GENERIC_C5 │ │ └── sdkconfig.board │ │ ├── ESP32_GENERIC_S3 │ │ └── sdkconfig.board │ │ ├── SPARKFUN_IOT_REDBOARD_ESP32 │ │ └── manifest.py │ │ ├── sdkconfig.p4_wifi_c5 │ │ ├── sdkconfig.p4_wifi_c6 │ │ ├── LOLIN_S2_PICO │ │ ├── manifest.py │ │ └── sdkconfig.board │ │ ├── LILYGO_TTGO_LORA32 │ │ ├── manifest.py │ │ └── board.md │ │ ├── SIL_WESP32 │ │ └── mpconfigboard.h │ │ ├── OLIMEX_ESP32_EVB │ │ ├── mpconfigboard.h │ │ ├── board.md │ │ ├── sdkconfig.board │ │ └── mpconfigboard.cmake │ │ ├── OLIMEX_ESP32_POE │ │ ├── mpconfigboard.h │ │ ├── board.md │ │ └── mpconfigboard.cmake │ │ ├── pins_prefix.c │ │ ├── SOLDERED_NULA_MINI │ │ └── pins.csv │ │ ├── M5STACK_NANOC6 │ │ └── pins.csv │ │ ├── ESP32_GENERIC_P4 │ │ └── mpconfigboard.cmake │ │ ├── ESP32_GENERIC_S2 │ │ └── mpconfigboard.cmake │ │ ├── UM_TINYC6 │ │ └── sdkconfig.board │ │ ├── sdkconfig.riscv │ │ └── ESP32_GENERIC_C3 │ │ └── sdkconfig.c3usb ├── rp2 │ ├── lwip_inc │ │ └── arch │ │ │ └── sys_arch.h │ ├── boards │ │ ├── WEACTSTUDIO │ │ │ ├── pins.csv │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_FLASH_2M.cmake │ │ │ ├── mpconfigvariant_FLASH_4M.cmake │ │ │ ├── mpconfigvariant_FLASH_8M.cmake │ │ │ ├── manifest.py │ │ │ └── modules │ │ │ │ └── board.py │ │ ├── W5100S_EVB_PICO │ │ │ ├── pins.csv │ │ │ └── manifest.py │ │ ├── W5500_EVB_PICO │ │ │ ├── pins.csv │ │ │ └── manifest.py │ │ ├── SPARKFUN_THINGPLUS │ │ │ ├── pins.csv │ │ │ └── mpconfigboard.cmake │ │ ├── ADAFRUIT_FEATHER_RP2040 │ │ │ ├── pins.csv │ │ │ └── mpconfigboard.cmake │ │ ├── ADAFRUIT_ITSYBITSY_RP2040 │ │ │ ├── pins.csv │ │ │ └── mpconfigboard.cmake │ │ ├── GARATRONIC_PYBSTICK26_RP2040 │ │ │ ├── pins.csv │ │ │ └── mpconfigboard.cmake │ │ ├── RPI_PICO2 │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_RISCV.cmake │ │ │ └── mpconfigboard.cmake │ │ ├── RPI_PICO2_W │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_RISCV.cmake │ │ │ └── manifest.py │ │ ├── SEEED_XIAO_RP2350 │ │ │ ├── mpconfigvariant.cmake │ │ │ └── mpconfigvariant_RISCV.cmake │ │ ├── PIMORONI_PICOLIPO │ │ │ └── mpconfigboard.cmake │ │ ├── PIMORONI_TINY2040 │ │ │ └── mpconfigboard.cmake │ │ ├── SPARKFUN_IOTREDBOARD_RP2350 │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_RISCV.cmake │ │ │ └── manifest.py │ │ ├── SPARKFUN_PROMICRO_RP2350 │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_RISCV.cmake │ │ │ └── mpconfigboard.cmake │ │ ├── SPARKFUN_THINGPLUS_RP2350 │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_RISCV.cmake │ │ │ └── manifest.py │ │ ├── SPARKFUN_XRP_CONTROLLER │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_RISCV.cmake │ │ │ └── manifest.py │ │ ├── ADAFRUIT_QTPY_RP2040 │ │ │ └── mpconfigboard.cmake │ │ ├── POLOLU_3PI_2040_ROBOT │ │ │ └── mpconfigboard.cmake │ │ ├── SPARKFUN_IOTNODE_LORAWAN_RP2350 │ │ │ ├── mpconfigvariant.cmake │ │ │ ├── mpconfigvariant_RISCV.cmake │ │ │ └── manifest.py │ │ ├── SPARKFUN_PROMICRO │ │ │ └── mpconfigboard.cmake │ │ ├── NULLBITS_BIT_C_PRO │ │ │ ├── manifest.py │ │ │ └── pins.csv │ │ ├── WEACTSTUDIO_RP2350B_CORE │ │ │ ├── manifest.py │ │ │ ├── mpconfigvariant.cmake │ │ │ └── mpconfigvariant_RISCV.cmake │ │ ├── SIL_RP2040_SHIM │ │ │ └── manifest.py │ │ ├── RPI_PICO │ │ │ └── mpconfigboard.cmake │ │ ├── MACHDYNE_WERKZEUG │ │ │ └── mpconfigboard.cmake │ │ ├── RPI_PICO_W │ │ │ └── manifest.py │ │ ├── SPARKFUN_XRP_CONTROLLER_BETA │ │ │ └── manifest.py │ │ └── manifest.py │ └── qstrdefsport.h ├── mimxrt │ ├── lwip_inc │ │ └── arch │ │ │ └── sys_arch.h │ ├── qstrdefsport.h │ ├── hal │ │ ├── pin_mux.h │ │ └── peripherals.h │ └── boards │ │ ├── TEENSY41 │ │ └── manifest.py │ │ ├── MIMXRT1020_EVK │ │ └── manifest.py │ │ ├── MIMXRT1050_EVK │ │ └── manifest.py │ │ ├── MIMXRT1060_EVK │ │ ├── manifest.py │ │ └── board.md │ │ ├── MIMXRT1064_EVK │ │ ├── manifest.py │ │ └── board.md │ │ ├── MIMXRT1170_EVK │ │ └── manifest.py │ │ ├── SEEED_ARCH_MIX │ │ └── manifest.py │ │ └── manifest.py ├── stm32 │ ├── lwip_inc │ │ └── arch │ │ │ └── sys_arch.h │ └── boards │ │ ├── common_isr_ram │ │ └── common_isr_extratext.ld │ │ ├── manifest_pyboard.py │ │ ├── PYBD_SF3 │ │ ├── bdev.c │ │ ├── board_init.c │ │ └── stm32f7xx_hal_conf.h │ │ ├── PYBD_SF6 │ │ ├── bdev.c │ │ └── stm32f7xx_hal_conf.h │ │ ├── GARATRONIC_PYBSTICK26_F411 │ │ └── manifest.py │ │ ├── PYBLITEV10 │ │ ├── mpconfigvariant_DP.mk │ │ ├── mpconfigvariant_THREAD.mk │ │ ├── mpconfigvariant_NETWORK.mk │ │ └── mpconfigvariant_DP_THREAD.mk │ │ ├── PYBV10 │ │ ├── mpconfigvariant_DP.mk │ │ ├── mpconfigvariant_THREAD.mk │ │ ├── mpconfigvariant_NETWORK.mk │ │ ├── mpconfigvariant_DP_THREAD.mk │ │ └── manifest.py │ │ ├── PYBV11 │ │ ├── mpconfigvariant_DP.mk │ │ ├── mpconfigvariant_THREAD.mk │ │ ├── mpconfigvariant_NETWORK.mk │ │ └── mpconfigvariant_DP_THREAD.mk │ │ ├── WEACT_F411_BLACKPILL │ │ ├── mpconfigvariant_V13.mk │ │ ├── mpconfigvariant_V31_XTAL_8M.mk │ │ ├── mpconfigvariant_V13_FLASH_4M.mk │ │ ├── mpconfigvariant_V20_FLASH_4M.mk │ │ └── mpconfigvariant_V31_FLASH_8M.mk │ │ ├── NUCLEO_H743ZI2 │ │ ├── board_init.c │ │ ├── stm32h7xx_hal_conf.h │ │ └── mpconfigboard.mk │ │ ├── LEGO_HUB_NO7 │ │ ├── manifest.py │ │ ├── bdev.c │ │ ├── bluetooth_init_cc2564C_1.5.c │ │ └── hub_display.h │ │ ├── manifest.py │ │ ├── NUCLEO_F429ZI │ │ └── manifest.py │ │ ├── NUCLEO_F439ZI │ │ └── manifest.py │ │ ├── NUCLEO_F746ZG │ │ └── manifest.py │ │ ├── NUCLEO_F756ZG │ │ └── manifest.py │ │ ├── NUCLEO_F767ZI │ │ └── manifest.py │ │ ├── NUCLEO_H723ZG │ │ └── manifest.py │ │ ├── NUCLEO_H743ZI │ │ └── manifest.py │ │ ├── OLIMEX_E407 │ │ └── manifest.py │ │ ├── STM32F769DISC │ │ └── manifest.py │ │ ├── STM32F7DISC │ │ └── manifest.py │ │ ├── STM32H573I_DK │ │ └── manifest.py │ │ ├── VCC_GND_F407ZG │ │ └── manifest.py │ │ ├── OPENMV_N6 │ │ └── manifest.py │ │ ├── ESPRUINO_PICO │ │ └── deploy.md │ │ ├── PYBD_SF2 │ │ └── manifest.py │ │ ├── LIMIFROG │ │ └── mpconfigboard.mk │ │ └── LEGO_HUB_NO6 │ │ └── hub_display.h ├── windows │ ├── variants │ │ ├── manifest.py │ │ ├── standard │ │ │ └── mpconfigvariant.mk │ │ └── dev │ │ │ ├── manifest.py │ │ │ └── mpconfigvariant.mk │ ├── micropython.rc │ └── .gitignore ├── renesas-ra │ ├── lwip_inc │ │ └── arch │ │ │ └── sys_arch.h │ ├── boards │ │ ├── manifest.py │ │ ├── EK_RA4M1 │ │ │ └── manifest.py │ │ └── RA4M1_CLICKER │ │ │ └── manifest.py │ └── mpconfigport.mk ├── samd │ ├── boards │ │ ├── manifest.py │ │ ├── ADAFRUIT_QTPY_SAMD21 │ │ │ ├── mpconfigvariant_SPIFLASH.mk │ │ │ └── mpconfigboard.mk │ │ ├── SAMD_GENERIC_D51X19 │ │ │ └── mpconfigboard.h │ │ ├── SAMD_GENERIC_D51X20 │ │ │ └── mpconfigboard.h │ │ ├── ADAFRUIT_TRINKET_M0 │ │ │ └── mpconfigboard.mk │ │ ├── SAMD_GENERIC_D21X18 │ │ │ └── mpconfigboard.mk │ │ ├── SEEED_XIAO_SAMD21 │ │ │ └── mpconfigboard.mk │ │ ├── ADAFRUIT_NEOKEY_TRINKEY │ │ │ └── mpconfigboard.mk │ │ └── SPARKFUN_SAMD21_DEV_BREAKOUT │ │ │ └── mpconfigboard.mk │ ├── qstrdefsport.h │ └── mcu │ │ ├── samd21 │ │ └── manifest.py │ │ └── samd51 │ │ └── manifest.py ├── unix │ └── variants │ │ ├── coverage │ │ ├── frzmpy │ │ │ ├── frzmpy1.py │ │ │ ├── frzmpy2.py │ │ │ ├── frzqstr.py │ │ │ ├── frzmpy_pkg1 │ │ │ │ └── __init__.py │ │ │ └── frzmpy_pkg2 │ │ │ │ └── mod.py │ │ └── frzstr │ │ │ ├── frzstr1.py │ │ │ ├── frzstr_pkg1 │ │ │ └── __init__.py │ │ │ └── frzstr_pkg2 │ │ │ └── mod.py │ │ ├── manifest.py │ │ ├── standard │ │ ├── manifest.py │ │ └── mpconfigvariant.mk │ │ └── nanbox │ │ └── mpconfigvariant.mk ├── minimal │ ├── qstrdefsport.h │ └── mphalport.h ├── powerpc │ └── qstrdefsport.h ├── qemu │ ├── qstrdefsport.h │ └── test-frzmpy │ │ └── frozen_viper.py ├── webassembly │ ├── variants │ │ ├── standard │ │ │ ├── mpconfigvariant.mk │ │ │ └── mpconfigvariant.h │ │ └── pyscript │ │ │ └── mpconfigvariant.mk │ ├── node_run.sh │ └── qstrdefsport.h ├── pic16bit │ └── qstrdefsport.h ├── zephyr │ ├── boards │ │ ├── mimxrt685_evk_cm33.conf │ │ ├── 96b_carbon.conf │ │ ├── nrf5340dk_nrf5340_cpuapp.conf │ │ ├── rv32m1_vega_ri5cy.conf │ │ ├── pocketbeagle_2_am6254_a53.conf │ │ ├── nucleo_h743zi.conf │ │ ├── reel_board.conf │ │ ├── disco_l475_iot1.conf │ │ ├── mimxrt1020_evk.overlay │ │ ├── mimxrt1020_evk │ │ │ ├── mpconfigport.h │ │ │ └── manifest.py │ │ ├── frdm_kw41z.conf │ │ └── nrf9151dk_nrf9151.conf │ ├── qstrdefsport.h │ └── thread.conf ├── embed │ └── port │ │ └── mphalport.h └── cc3200 │ ├── bootmgr │ └── relocator │ │ └── relocator.bin │ └── boards │ └── WIPY │ └── deploy.md ├── examples ├── embedding │ └── Makefile.upylib ├── natmod │ ├── .gitignore │ └── features2 │ │ └── prod.h ├── usercmodule │ └── subpackage │ │ ├── README.md │ │ └── qstrdefsexamplepackage.h ├── SDdatalogger │ └── cardreader.py └── hwapi │ └── hwconfig_z_frdm_k64f.py ├── extmod ├── nimble │ ├── bsp │ │ └── bsp.h │ └── hal │ │ └── hal_gpio.h ├── axtls-include │ └── version.h └── libmetal │ └── metal │ └── system │ └── micropython │ ├── alloc.h │ ├── log.h │ ├── sleep.h │ └── sys.h ├── tools ├── mpremote │ ├── .gitignore │ ├── requirements.txt │ ├── mpremote.py │ ├── mpremote │ │ └── __main__.py │ └── tests │ │ └── test_eval_exec_run.sh.exp ├── .gitattributes └── make_pinout_diagram │ └── weact_pinout.png ├── .github └── FUNDING.yml ├── mpy-cross ├── qstrdefsport.h └── mphalport.h ├── logo ├── logo.jpg ├── 1bit-logo.png ├── trans-logo.png ├── vector-logo-2.ico ├── vector-logo-2.png ├── vector-logo-3.png ├── upython-with-micro.jpg ├── upython-with-micro.png └── micropythonpowered-art.png ├── docs ├── requirements.txt ├── static │ └── favicon.ico ├── esp32 │ ├── img │ │ └── esp32.jpg │ └── tutorial │ │ └── img │ │ └── mem32_gpio_output.jpg ├── develop │ └── img │ │ ├── bitmap.png │ │ ├── linprob.png │ │ └── collision.png ├── rp2 │ └── img │ │ └── pico_pinout.png ├── mimxrt │ └── img │ │ └── teensy_4.1.jpg ├── renesas-ra │ └── img │ │ └── ek_ra6m2_board.jpg ├── samd │ └── img │ │ └── itsybitsy_m4_express.jpg ├── pyboard │ └── tutorial │ │ └── img │ │ ├── skin_amp_1.jpg │ │ ├── skin_amp_2.jpg │ │ ├── skin_lcd_1.jpg │ │ ├── skin_lcd_2.jpg │ │ ├── pyboard_servo.jpg │ │ ├── pyboard_usb_micro.jpg │ │ └── fading_leds_breadboard_fritzing.png └── esp8266 │ └── img │ └── adafruit_products_pinoutstop.jpg ├── drivers ├── cc3100 │ └── inc │ │ └── netapp.h └── README.md ├── lib ├── libm_dbl │ ├── ldexp.c │ ├── lgamma.c │ └── log10.c └── mbedtls_errors │ └── do-test.sh └── shared └── README.md /tests/io/data/file2: -------------------------------------------------------------------------------- 1 | 1234 -------------------------------------------------------------------------------- /ports/nrf/boards/deploy.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/extmod/ssl_poll.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/import/pkg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpydiff/modules/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/const.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/slice.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/micropython/kbd_intr.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/ports/renesas-ra/i2c.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/embedding/Makefile.upylib: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/natmod/.gitignore: -------------------------------------------------------------------------------- 1 | *.mpy 2 | -------------------------------------------------------------------------------- /extmod/nimble/bsp/bsp.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /tests/cpydiff/modules/subpkg/foo.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpydiff/modules2/subpkg/bar.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/extmod/ticks_diff.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/feature_check/async_check.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/bytearray.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/byteorder.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/complex.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/coverage.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/reverse_ops.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/set_check.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/target_info.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_str.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/mpremote/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: micropython 2 | -------------------------------------------------------------------------------- /extmod/nimble/hal/hal_gpio.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /ports/esp8266/user_config.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /tests/basics/slice_op.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_compile_only.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_optimise.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_sys_exit_0.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_sys_exit_none.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/extmod/asyncio_as_uasyncio.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/extmod/hashlib_final.py.exp: -------------------------------------------------------------------------------- 1 | done 2 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_native.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/feature_check/fstring.py.exp: -------------------------------------------------------------------------------- 1 | a=1 2 | -------------------------------------------------------------------------------- /tests/feature_check/native_check.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/import/broken/zerodiv.py: -------------------------------------------------------------------------------- 1 | 1 / 0 2 | -------------------------------------------------------------------------------- /tests/import/pkg6/x/y.py: -------------------------------------------------------------------------------- 1 | print("y") 2 | -------------------------------------------------------------------------------- /tests/import/pkg8/mod.py: -------------------------------------------------------------------------------- 1 | print("foo") 2 | -------------------------------------------------------------------------------- /tests/micropython/const_math.py.exp: -------------------------------------------------------------------------------- 1 | 1.0 2 | -------------------------------------------------------------------------------- /tests/ports/qemu/viper_test.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /tests/ports/renesas-ra/uart1.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/ports/stm32/accel.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ports/stm32/switch.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /tests/unicode/data/utf-8_1.txt: -------------------------------------------------------------------------------- 1 | Привет 2 | -------------------------------------------------------------------------------- /tools/.gitattributes: -------------------------------------------------------------------------------- 1 | *.tar.gz binary 2 | -------------------------------------------------------------------------------- /ports/alif/lwip_inc/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /ports/bare-arm/mphalport.h: -------------------------------------------------------------------------------- 1 | // empty file 2 | -------------------------------------------------------------------------------- /ports/esp32/.gitignore: -------------------------------------------------------------------------------- 1 | managed_components/ 2 | -------------------------------------------------------------------------------- /ports/rp2/lwip_inc/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /tests/basics/module2.py.exp: -------------------------------------------------------------------------------- 1 | AttributeError 2 | -------------------------------------------------------------------------------- /tests/basics/string_escape_invalid.py.exp: -------------------------------------------------------------------------------- 1 | \z 2 | -------------------------------------------------------------------------------- /tests/basics/subclass_native_call.py.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_compile_only_error.py.exp: -------------------------------------------------------------------------------- 1 | CRASH -------------------------------------------------------------------------------- /tests/cmdline/cmd_sys_exit_error.py.exp: -------------------------------------------------------------------------------- 1 | CRASH -------------------------------------------------------------------------------- /tests/extmod/json_dumps_extra.py.exp: -------------------------------------------------------------------------------- 1 | "1234" 2 | -------------------------------------------------------------------------------- /tests/import/pkg2/mod2.py: -------------------------------------------------------------------------------- 1 | print("in mod2") 2 | -------------------------------------------------------------------------------- /tests/import/pkg9/mod2.py: -------------------------------------------------------------------------------- 1 | from . import mod2 2 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmcsr.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | 5 3 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmblbx.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmfpaddsub.py.exp: -------------------------------------------------------------------------------- 1 | 90 2 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmfpldrstr.py.exp: -------------------------------------------------------------------------------- 1 | 6.0 2 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmfpmuldiv.py.exp: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmfpsqrt.py.exp: -------------------------------------------------------------------------------- 1 | -160 2 | -------------------------------------------------------------------------------- /tests/jni/object.py.exp: -------------------------------------------------------------------------------- 1 | 42 2 | 42 3 | 42 4 | -------------------------------------------------------------------------------- /tests/jni/system_out.py.exp: -------------------------------------------------------------------------------- 1 | Hello, Java! 2 | -------------------------------------------------------------------------------- /tests/micropython/decorator.py.exp: -------------------------------------------------------------------------------- 1 | bytecode 2 | -------------------------------------------------------------------------------- /tests/micropython/heap_locked.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | -------------------------------------------------------------------------------- /tests/net_hosted/accept_nonblock.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/net_hosted/accept_timeout.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/ports/cc3200/reset/reset.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ports/renesas-ra/freq.py.exp: -------------------------------------------------------------------------------- 1 | freq: OK 2 | -------------------------------------------------------------------------------- /tests/ports/rp2/rp2_machine_idle.py.exp: -------------------------------------------------------------------------------- 1 | PASS 2 | -------------------------------------------------------------------------------- /tests/ports/stm32/dac.py.exp: -------------------------------------------------------------------------------- 1 | DAC(1, bits=8) 2 | -------------------------------------------------------------------------------- /tests/thread/stress_schedule.py.exp: -------------------------------------------------------------------------------- 1 | PASS 2 | -------------------------------------------------------------------------------- /tests/thread/thread_coop.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | -------------------------------------------------------------------------------- /ports/mimxrt/lwip_inc/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO25 2 | -------------------------------------------------------------------------------- /ports/stm32/lwip_inc/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /ports/windows/variants/manifest.py: -------------------------------------------------------------------------------- 1 | require("ssl") 2 | -------------------------------------------------------------------------------- /tests/basics/array_micropython.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | -------------------------------------------------------------------------------- /tests/basics/bytes_compare2.py: -------------------------------------------------------------------------------- 1 | print(b"1" == 1) 2 | -------------------------------------------------------------------------------- /tests/cpydiff/modules/foo.py: -------------------------------------------------------------------------------- 1 | print("foo") 2 | xxx 3 | -------------------------------------------------------------------------------- /tests/extmod/vfs_lfs_superblock.py.exp: -------------------------------------------------------------------------------- 1 | [] 2 | [] 3 | -------------------------------------------------------------------------------- /tests/feature_check/inlineasm_rv32.py.exp: -------------------------------------------------------------------------------- 1 | rv32 2 | -------------------------------------------------------------------------------- /tests/feature_check/inlineasm_thumb.py.exp: -------------------------------------------------------------------------------- 1 | thumb 2 | -------------------------------------------------------------------------------- /tests/float/float_format_ftoe.py.exp: -------------------------------------------------------------------------------- 1 | 8.89e+32 2 | -------------------------------------------------------------------------------- /tests/import/pkg2/mod1.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod2 2 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmconst.py.exp: -------------------------------------------------------------------------------- 1 | 0xfffffff 2 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmpushpop.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 7 3 | -------------------------------------------------------------------------------- /tests/inlineasm/xtensa/asmjump.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_bytesio2.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/micropython/stack_use.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/micropython/viper_import.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /tests/micropython/viper_large_jump.py.exp: -------------------------------------------------------------------------------- 1 | 600 2 | -------------------------------------------------------------------------------- /tests/micropython/viper_misc_intbig.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/net_hosted/connect_nonblock.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/perf_bench/core_import_mpy_multi.py.exp: -------------------------------------------------------------------------------- 1 | 123 2 | -------------------------------------------------------------------------------- /tests/ports/qemu/mpy_arch_flags_test.py.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/ports/qemu/native_test.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 4 4 | -------------------------------------------------------------------------------- /tests/ports/renesas-ra/pin.py.exp: -------------------------------------------------------------------------------- 1 | pass 2 | pass 3 | -------------------------------------------------------------------------------- /tests/ports/stm32/irq.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True False 3 | -------------------------------------------------------------------------------- /tests/ports/stm32/modstm.py.exp: -------------------------------------------------------------------------------- 1 | 0x8000 2 | 0x0 3 | -------------------------------------------------------------------------------- /tests/stress/recursive_data.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | -------------------------------------------------------------------------------- /tests/thread/thread_heap_lock.py.exp: -------------------------------------------------------------------------------- 1 | [1, 2, 3] 2 | -------------------------------------------------------------------------------- /tests/unicode/data/utf-8_2.txt: -------------------------------------------------------------------------------- 1 | aαbβcγdδ 2 | ぁ🙐 3 | -------------------------------------------------------------------------------- /ports/renesas-ra/lwip_inc/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/W5100S_EVB_PICO/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO25 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/W5500_EVB_PICO/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO25 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/common_isr_ram/common_isr_extratext.ld: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/basics/bytes_escape_unicode.py.exp: -------------------------------------------------------------------------------- 1 | b'\\u1234' 2 | -------------------------------------------------------------------------------- /tests/basics/try_except_break.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 4 4 | -------------------------------------------------------------------------------- /tests/extmod/machine_disable_irq.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | -------------------------------------------------------------------------------- /tests/extmod/re_stack_overflow.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | -------------------------------------------------------------------------------- /tests/extmod/time_ms_us.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | -------------------------------------------------------------------------------- /tests/feature_check/const.py: -------------------------------------------------------------------------------- 1 | x = const(1) 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/feature_check/inlineasm_rv32_zba.py.exp: -------------------------------------------------------------------------------- 1 | rv32_zba 2 | -------------------------------------------------------------------------------- /tests/feature_check/inlineasm_thumb2.py.exp: -------------------------------------------------------------------------------- 1 | thumb2 2 | -------------------------------------------------------------------------------- /tests/feature_check/inlineasm_xtensa.py.exp: -------------------------------------------------------------------------------- 1 | xtensa 2 | -------------------------------------------------------------------------------- /tests/feature_check/int_64.py.exp: -------------------------------------------------------------------------------- 1 | 4611686018427387904 2 | -------------------------------------------------------------------------------- /tests/import/import_circular.py: -------------------------------------------------------------------------------- 1 | import circular.main 2 | -------------------------------------------------------------------------------- /tests/import/pkg/mod.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | return 42 3 | -------------------------------------------------------------------------------- /tests/import/pkg2/__init__.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod1 2 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmloadstore.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmstack.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 2 4 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmfpcmp.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 6 3 | 8 4 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmit.py.exp: -------------------------------------------------------------------------------- 1 | 100 1 2 | 100 200 3 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmspecialregs.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | -------------------------------------------------------------------------------- /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/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/viper_const.py.exp: -------------------------------------------------------------------------------- 1 | b'bytes' 2 | 123 3 | -------------------------------------------------------------------------------- /tests/net_inet/ssl_cert.py.exp: -------------------------------------------------------------------------------- 1 | b'HTTP/1.1 200 OK\r\n' 2 | -------------------------------------------------------------------------------- /tests/perf_bench/core_import_mpy_single.py.exp: -------------------------------------------------------------------------------- 1 | 123 2 | -------------------------------------------------------------------------------- /tests/ports/stm32/pyb1.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | True 4 | 12 5 | -------------------------------------------------------------------------------- /tests/stress/fun_call_limit.py.exp: -------------------------------------------------------------------------------- 1 | 32 2 | SyntaxError 3 | -------------------------------------------------------------------------------- /mpy-cross/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_THINGPLUS/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO25 2 | -------------------------------------------------------------------------------- /ports/samd/boards/manifest.py: -------------------------------------------------------------------------------- 1 | freeze("$(PORT_DIR)/modules") 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/manifest_pyboard.py: -------------------------------------------------------------------------------- 1 | require("lcd160cr") 2 | -------------------------------------------------------------------------------- /tests/basics/class_emptybases.py: -------------------------------------------------------------------------------- 1 | class A(): 2 | pass 3 | -------------------------------------------------------------------------------- /tests/basics/fun_code_micropython.py.exp: -------------------------------------------------------------------------------- 1 | AttributeError 2 | -------------------------------------------------------------------------------- /tests/basics/io_bytesio_ext2.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/basics/set_union.py: -------------------------------------------------------------------------------- 1 | print(sorted({1}.union({2}))) 2 | -------------------------------------------------------------------------------- /tests/extmod/re_split_notimpl.py.exp: -------------------------------------------------------------------------------- 1 | NotImplementedError 2 | -------------------------------------------------------------------------------- /tests/extmod/ssl_cadata.py.exp: -------------------------------------------------------------------------------- 1 | ValueError('invalid cert',) 2 | -------------------------------------------------------------------------------- /tests/extmod/websocket_toobig.py.exp: -------------------------------------------------------------------------------- 1 | ioctl: ENOBUFS: True 2 | -------------------------------------------------------------------------------- /tests/import/gen_context2.py: -------------------------------------------------------------------------------- 1 | def call(g): 2 | next(g) 3 | -------------------------------------------------------------------------------- /tests/import/pkg9/mod1.py: -------------------------------------------------------------------------------- 1 | def mod1(): 2 | print("mod1") 3 | -------------------------------------------------------------------------------- /tests/import/pkgstar_all_inval/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = 42 2 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmzba.py.exp: -------------------------------------------------------------------------------- 1 | 0x28 2 | 0x3c 3 | 0x64 4 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmbcc.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 10 3 | 20 4 | 30 5 | -------------------------------------------------------------------------------- /tests/inlineasm/xtensa/asmmisc.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | 2 4 | -------------------------------------------------------------------------------- /tests/micropython/emg_exc.py.native.exp: -------------------------------------------------------------------------------- 1 | ValueError: 1 2 | 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_exc_raise.py.exp: -------------------------------------------------------------------------------- 1 | error 2 | ok 3 | -------------------------------------------------------------------------------- /tests/micropython/memstats.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | -------------------------------------------------------------------------------- /tests/micropython/viper_globals.py.exp: -------------------------------------------------------------------------------- 1 | NameError 2 | 123 3 | -------------------------------------------------------------------------------- /tests/net_hosted/connect_poll.py.exp: -------------------------------------------------------------------------------- 1 | 1 20 2 | 1 3 | 1 4 4 | -------------------------------------------------------------------------------- /tests/ports/stm32/extint.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | line: 4 3 | line: 4 4 | -------------------------------------------------------------------------------- /tests/ports/stm32/led.py.exp: -------------------------------------------------------------------------------- 1 | LED(1) 2 | LED(2) 3 | LED(3) 4 | -------------------------------------------------------------------------------- /tests/ports/webassembly/promise_with_resolvers.mjs.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/thread/disable_irq.py.exp: -------------------------------------------------------------------------------- 1 | count 2000 True 2 | PASS 3 | -------------------------------------------------------------------------------- /ports/rp2/boards/ADAFRUIT_FEATHER_RP2040/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO13 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/ADAFRUIT_ITSYBITSY_RP2040/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO11 2 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzmpy1.py: -------------------------------------------------------------------------------- 1 | print("frzmpy1") 2 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzstr/frzstr1.py: -------------------------------------------------------------------------------- 1 | print("frzstr1") 2 | -------------------------------------------------------------------------------- /tests/basics/set_comprehension.py: -------------------------------------------------------------------------------- 1 | print({a for a in range(5)}) 2 | -------------------------------------------------------------------------------- /tests/extmod/machine_signal.py.exp: -------------------------------------------------------------------------------- 1 | 0 0 2 | 1 1 3 | 1 0 4 | 0 1 5 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_native_float.py.exp: -------------------------------------------------------------------------------- 1 | 12.3400 2 | 12.3400 3 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_float.py.exp: -------------------------------------------------------------------------------- 1 | 4 2 | 8 3 | 8 4 | 16 5 | -------------------------------------------------------------------------------- /tests/import/import_long_dyn.py: -------------------------------------------------------------------------------- 1 | from import_long_dyn2 import * 2 | -------------------------------------------------------------------------------- /tests/import/pkg3/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 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/inlineasm/rv32/asmargs.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 6 5 | 10 6 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmargs.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 6 5 | 10 6 | -------------------------------------------------------------------------------- /tests/inlineasm/xtensa/asmargs.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 6 5 | 10 6 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_super.py.exp: -------------------------------------------------------------------------------- 1 | B foo 2 | A foo 3 | 42 4 | -------------------------------------------------------------------------------- /tests/micropython/native_fun_attrs_code.py.exp: -------------------------------------------------------------------------------- 1 | AttributeError 2 | -------------------------------------------------------------------------------- /tests/micropython/opt_level.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | True 4 | False 5 | -------------------------------------------------------------------------------- /tests/micropython/viper_storeattr.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 7 3 | hello 4 | X 5 | -------------------------------------------------------------------------------- /tests/net_hosted/ssl_getpeercert.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/net_inet/tls_text_errors.py.exp: -------------------------------------------------------------------------------- 1 | ######## 2 | wrap: True 3 | -------------------------------------------------------------------------------- /tests/ports/rp2/rp2_thread_reset_part1.py.exp: -------------------------------------------------------------------------------- 1 | Part 1 complete... 2 | -------------------------------------------------------------------------------- /tests/ports/stm32/i2c_accel.py.exp: -------------------------------------------------------------------------------- 1 | [76] 2 | True 3 | b'\x01' 4 | -------------------------------------------------------------------------------- /examples/natmod/features2/prod.h: -------------------------------------------------------------------------------- 1 | float prod_array(int n, float *ar); 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/GARATRONIC_PYBSTICK26_RP2040/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO23 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF3/bdev.c: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/bdev.c" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF6/bdev.c: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/bdev.c" 2 | -------------------------------------------------------------------------------- /tests/extmod/deflate_compress_memory_error.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | b'' 3 | -------------------------------------------------------------------------------- /tests/extmod/random_basic.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | 0 4 | ValueError 5 | -------------------------------------------------------------------------------- /tests/extmod/ssl_keycert_pkcs8.py.exp: -------------------------------------------------------------------------------- 1 | ValueError('invalid cert',) 2 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_byteat.py.exp: -------------------------------------------------------------------------------- 1 | b'0123' 2 | bytearray(b'0123') 3 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_layout.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | TypeError 4 | -------------------------------------------------------------------------------- /tests/import/import1a.py: -------------------------------------------------------------------------------- 1 | import import1b 2 | 3 | print(import1b.var) 4 | -------------------------------------------------------------------------------- /tests/import/import3a.py: -------------------------------------------------------------------------------- 1 | from import1b import * 2 | 3 | print(var) 4 | -------------------------------------------------------------------------------- /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/inlineasm/rv32/asmjump.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | 0 4 | 0 5 | 0 6 | 0 7 | -------------------------------------------------------------------------------- /tests/jni/list.py.exp: -------------------------------------------------------------------------------- 1 | [] 2 | [one, two] 3 | [one, two] 4 | one two 5 | -------------------------------------------------------------------------------- /tests/micropython/decorator_error.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_int_from_bytes.py.exp: -------------------------------------------------------------------------------- 1 | 49 2 | 12849 3 | 50 4 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_yield_from.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 1 5 | -------------------------------------------------------------------------------- /tests/micropython/native_while.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 1 5 | 2 6 | 3 7 | -------------------------------------------------------------------------------- /tests/micropython/viper_subscr.py.exp: -------------------------------------------------------------------------------- 1 | [1, 2, 3] 2 | 1 3 | 2 4 | 3 5 | -------------------------------------------------------------------------------- /tests/misc/sys_atexit.py.exp: -------------------------------------------------------------------------------- 1 | done before exit 2 | done at exit: ok 3 | -------------------------------------------------------------------------------- /tests/net_inet/test_sslcontext_client.py.exp: -------------------------------------------------------------------------------- 1 | b'HTTP/1.1 200 OK\r\n' 2 | -------------------------------------------------------------------------------- /tests/net_inet/tls_num_errors.py.exp: -------------------------------------------------------------------------------- 1 | heap is locked 2 | wrap: True 3 | -------------------------------------------------------------------------------- /tests/ports/webassembly/globals.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | True 4 | False 5 | -------------------------------------------------------------------------------- /extmod/axtls-include/version.h: -------------------------------------------------------------------------------- 1 | #define AXTLS_VERSION "(no version)" 2 | -------------------------------------------------------------------------------- /extmod/libmetal/metal/system/micropython/alloc.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /extmod/libmetal/metal/system/micropython/log.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /extmod/libmetal/metal/system/micropython/sleep.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /ports/nrf/boards/MICROBIT/custom_nrf51822_s110_microbit.ld: -------------------------------------------------------------------------------- 1 | _fs_size = 12K; 2 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzmpy2.py: -------------------------------------------------------------------------------- 1 | raise ZeroDivisionError 2 | -------------------------------------------------------------------------------- /tests/basics/bytearray_intbig.py: -------------------------------------------------------------------------------- 1 | print(bytearray(2**65 - (2**65 - 1))) 2 | -------------------------------------------------------------------------------- /tests/basics/memoryerror.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | 1000 0 999 3 | MemoryError 4 | -------------------------------------------------------------------------------- /tests/basics/memoryview_slice_size.py.exp: -------------------------------------------------------------------------------- 1 | 2 | OverflowError 3 | -------------------------------------------------------------------------------- /tests/basics/op_error_literal.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | TypeError 3 | TypeError 4 | -------------------------------------------------------------------------------- /tests/basics/parser.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | -------------------------------------------------------------------------------- /tests/cmdline/repl_basic.py: -------------------------------------------------------------------------------- 1 | # basic REPL tests 2 | print(1) 3 |  4 | 2 5 | -------------------------------------------------------------------------------- /tests/extmod/asyncio_cancel_self.py.exp: -------------------------------------------------------------------------------- 1 | task start 2 | can't cancel self 3 | -------------------------------------------------------------------------------- /tests/feature_check/byteorder.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.byteorder) 4 | -------------------------------------------------------------------------------- /tests/import/pkg3/subpkg1/__init__.py: -------------------------------------------------------------------------------- 1 | print("subpkg1 __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/import/pkg7/subpkg1/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmbitops.py.exp: -------------------------------------------------------------------------------- 1 | 24 2 | 16 3 | 0xf000000 4 | 0x10000 5 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmerrors.py.exp: -------------------------------------------------------------------------------- 1 | expecting an assembler instruction 2 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_tuple.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: tuple create 2 | -------------------------------------------------------------------------------- /tests/micropython/schedule.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | outer 3 | inner 4 | RuntimeError 5 | -------------------------------------------------------------------------------- /tests/micropython/viper_const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 123456789012345678901234567890 2 | -------------------------------------------------------------------------------- /tests/micropython/viper_misc2.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\xa4\x8aH\xee\xce\xec') 2 | -------------------------------------------------------------------------------- /tests/misc/cexample_module.py.exp: -------------------------------------------------------------------------------- 1 | 2 | cexample 3 | 4 4 | -------------------------------------------------------------------------------- /tests/ports/cc3200/modwipy.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | Exception 5 | -------------------------------------------------------------------------------- /tests/ports/renesas-ra/rtc_init.py.exp: -------------------------------------------------------------------------------- 1 | 2 | (2014, 1, 1, 1, 0, 0, 1) 3 | -------------------------------------------------------------------------------- /tests/ports/stm32/pyb_f411.py.exp: -------------------------------------------------------------------------------- 1 | (96000000, 96000000, 24000000, 48000000) 2 | -------------------------------------------------------------------------------- /logo/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/logo.jpg -------------------------------------------------------------------------------- /ports/alif/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC/sdkconfig.unicore: -------------------------------------------------------------------------------- 1 | CONFIG_FREERTOS_UNICORE=y 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/SIL_MANT1S/pins.csv: -------------------------------------------------------------------------------- 1 | I2C_SCL,GPIO32 2 | I2C_SDA,GPIO33 3 | 4 | -------------------------------------------------------------------------------- /ports/mimxrt/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/minimal/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/powerpc/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/qemu/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/rp2/boards/GARATRONIC_PYBSTICK26_RP2040/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO2/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO2_W/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/samd/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/GARATRONIC_PYBSTICK26_F411/manifest.py: -------------------------------------------------------------------------------- 1 | require("ssd1306") 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBLITEV10/mpconfigvariant_DP.mk: -------------------------------------------------------------------------------- 1 | MICROPY_FLOAT_IMPL = double 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV10/mpconfigvariant_DP.mk: -------------------------------------------------------------------------------- 1 | MICROPY_FLOAT_IMPL = double 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV11/mpconfigvariant_DP.mk: -------------------------------------------------------------------------------- 1 | MICROPY_FLOAT_IMPL = double 2 | -------------------------------------------------------------------------------- /ports/webassembly/variants/standard/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | JSFLAGS += -s ASYNCIFY 2 | -------------------------------------------------------------------------------- /ports/windows/micropython.rc: -------------------------------------------------------------------------------- 1 | app ICON "../../logo/vector-logo-2.ico" 2 | -------------------------------------------------------------------------------- /tests/basics/bytes_compare3.py.exp: -------------------------------------------------------------------------------- 1 | ######## 2 | False 3 | ######## 4 | False 5 | -------------------------------------------------------------------------------- /tests/basics/set_iter_of_iter.py: -------------------------------------------------------------------------------- 1 | i = iter(iter({1, 2, 3})) 2 | print(sorted(i)) 3 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_file_variable.py.exp: -------------------------------------------------------------------------------- 1 | __file__ = cmdline/cmd_file_variable.py 2 | -------------------------------------------------------------------------------- /tests/extmod/framebuf_palette.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | True 5 | True 6 | -------------------------------------------------------------------------------- /tests/extmod/machine_uart_tx.py.exp: -------------------------------------------------------------------------------- 1 | 2400 True 2 | 9600 True 3 | 115200 True 4 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_sizeof_od.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | 4 4 | TypeError 5 | 6 6 | 1 7 | -------------------------------------------------------------------------------- /tests/extmod/vfs_fat_finaliser.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | x0 3 | x1 4 | x2 5 | x3 6 | -------------------------------------------------------------------------------- /tests/extmod/vfs_fat_mtime.py.exp: -------------------------------------------------------------------------------- 1 | test 2 | True True 3 | True 4 | -------------------------------------------------------------------------------- /tests/float/python36.py.exp: -------------------------------------------------------------------------------- 1 | 1000.18 2 | 1e+12 3 | 123.0 4 | 123.4 5 | 1e+13 6 | -------------------------------------------------------------------------------- /tests/import/broken/pkg2_and_zerodiv.py: -------------------------------------------------------------------------------- 1 | import pkg2 2 | import broken.zerodiv 3 | -------------------------------------------------------------------------------- /tests/import/circular/sub.py: -------------------------------------------------------------------------------- 1 | from circular.main import x 2 | 3 | y = x + 20 4 | -------------------------------------------------------------------------------- /tests/import/import_long_dyn2.py: -------------------------------------------------------------------------------- 1 | globals()["long_long_very_long_long_name"] = 1 2 | -------------------------------------------------------------------------------- /tests/import/pkg7/subpkg1/subpkg2/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /tests/import/pkgstar_all_array/funcs.py: -------------------------------------------------------------------------------- 1 | def dynamicFun(): 2 | return 777 3 | -------------------------------------------------------------------------------- /tests/io/file_iter.py: -------------------------------------------------------------------------------- 1 | f = open("data/file1") 2 | for l in f: 3 | print(l) 4 | -------------------------------------------------------------------------------- /tests/micropython/import_mpy_native_gc.py.exp: -------------------------------------------------------------------------------- 1 | 123456 2 | 13 3 | 123456 4 | 13 5 | -------------------------------------------------------------------------------- /tests/micropython/native_const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 123456789012345678901234567890 2 | -------------------------------------------------------------------------------- /tests/micropython/native_for.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 0 6 | 1 7 | 2 8 | 3 9 | -------------------------------------------------------------------------------- /tests/micropython/viper_cond.py.exp: -------------------------------------------------------------------------------- 1 | not x False 2 | x True 3 | y 1 4 | z 65536 5 | -------------------------------------------------------------------------------- /tests/ports/rp2/rp2_thread_reset_part2.py.exp: -------------------------------------------------------------------------------- 1 | Starting 2 | Written 3 | Removed 4 | -------------------------------------------------------------------------------- /tests/ports/stm32/i2c.py.exp: -------------------------------------------------------------------------------- 1 | ValueError -1 2 | ValueError 0 3 | I2C 1 4 | [] 5 | -------------------------------------------------------------------------------- /tests/ports/stm32/timer.py.exp: -------------------------------------------------------------------------------- 1 | 100 2 | 200 3 | 300 4 | 400 5 | 100 6 | 0.001 7 | -------------------------------------------------------------------------------- /tests/ports/webassembly/py_proxy_has.mjs.exp: -------------------------------------------------------------------------------- 1 | false 2 | true 3 | false 4 | true 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_OMGS3/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the OMGS3. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_PROS3/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the ProS3. 2 | -------------------------------------------------------------------------------- /ports/mimxrt/hal/pin_mux.h: -------------------------------------------------------------------------------- 1 | // Empty file, necessary for compilation with NXP MCU SDK 2 | -------------------------------------------------------------------------------- /ports/pic16bit/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | -------------------------------------------------------------------------------- /ports/rp2/boards/SEEED_XIAO_RP2350/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF3/board_init.c: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/board_init.c" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV10/mpconfigvariant_THREAD.mk: -------------------------------------------------------------------------------- 1 | CFLAGS += -DMICROPY_PY_THREAD=1 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV11/mpconfigvariant_THREAD.mk: -------------------------------------------------------------------------------- 1 | CFLAGS += -DMICROPY_PY_THREAD=1 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/WEACT_F411_BLACKPILL/mpconfigvariant_V13.mk: -------------------------------------------------------------------------------- 1 | BOARD_VERSION = 13 2 | -------------------------------------------------------------------------------- /ports/zephyr/boards/mimxrt685_evk_cm33.conf: -------------------------------------------------------------------------------- 1 | # Hardware features 2 | CONFIG_SPI=y 3 | -------------------------------------------------------------------------------- /tests/basics/fun1.py: -------------------------------------------------------------------------------- 1 | # calling a function 2 | 3 | def f(): 4 | print(1) 5 | f() 6 | -------------------------------------------------------------------------------- /tests/basics/set_clear.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(s.clear()) 3 | print(list(s)) 4 | -------------------------------------------------------------------------------- /tests/basics/set_discard.py: -------------------------------------------------------------------------------- 1 | s = {1, 2} 2 | print(s.discard(1)) 3 | print(list(s)) 4 | -------------------------------------------------------------------------------- /tests/basics/string_fstring_invalid.py.exp: -------------------------------------------------------------------------------- 1 | \ 2 | # 3 | SyntaxError 4 | SyntaxError 5 | -------------------------------------------------------------------------------- /tests/basics/struct_micropython.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | b'\x01\x00\x00\x00\x00\x00\x00\x00' 3 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_verbose.py: -------------------------------------------------------------------------------- 1 | # cmdline: -v -v 2 | # test verbose output 3 | print(1) 4 | -------------------------------------------------------------------------------- /tests/extmod/re_split_empty.py.exp: -------------------------------------------------------------------------------- 1 | ['a b c foobar'] 2 | ['foo'] 3 | ['axbc'] 4 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_array_assign_native_le_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 0x11223344 2 | 0x11223344 3 | -------------------------------------------------------------------------------- /tests/extmod/vfs_fat_oldproto.py.exp: -------------------------------------------------------------------------------- 1 | [('file.txt', 32768, 0, 6)] 2 | hello! 3 | [] 4 | -------------------------------------------------------------------------------- /tests/extmod/vfs_posix_ilistdir_filter.py.exp: -------------------------------------------------------------------------------- 1 | ['...a', '..a', '.a', 'a..b', 'a.b'] 2 | -------------------------------------------------------------------------------- /tests/feature_check/int_big.py.exp: -------------------------------------------------------------------------------- 1 | 1000000000000000000000000000000000000000000000 2 | -------------------------------------------------------------------------------- /tests/import/import_pkg8.py: -------------------------------------------------------------------------------- 1 | # import with no __init__.py files 2 | import pkg8.mod 3 | -------------------------------------------------------------------------------- /tests/import/pkg3/mod1.py: -------------------------------------------------------------------------------- 1 | print("mod1 __name__:", __name__) 2 | from . import mod2 3 | -------------------------------------------------------------------------------- /tests/micropython/const.py.exp: -------------------------------------------------------------------------------- 1 | 123 580 2 | 123 580 3 | 12 46 4 | 1 2 5 | True False 6 | -------------------------------------------------------------------------------- /tests/micropython/ringio_big.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/ports/webassembly/iterator.mjs.exp: -------------------------------------------------------------------------------- 1 | a 2 | b 3 | c 4 | 1 5 | 2 6 | 3 7 | True 8 | -------------------------------------------------------------------------------- /logo/1bit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/1bit-logo.png -------------------------------------------------------------------------------- /mpy-cross/mphalport.h: -------------------------------------------------------------------------------- 1 | // prevent including extmod/virtpin.h 2 | #define mp_hal_pin_obj_t 3 | -------------------------------------------------------------------------------- /ports/alif/mcu/pins_prefix.c: -------------------------------------------------------------------------------- 1 | #include "py/mphal.h" 2 | #include "extmod/modmachine.h" 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_NANOS3/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the NanoS3. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYS2/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the TinyS2. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYS3/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the TinyS3. 2 | -------------------------------------------------------------------------------- /ports/mimxrt/hal/peripherals.h: -------------------------------------------------------------------------------- 1 | // Empty file, necessary for compilation with NXP MCU SDK 2 | -------------------------------------------------------------------------------- /ports/nrf/.gitignore: -------------------------------------------------------------------------------- 1 | # Nordic files 2 | ##################### 3 | drivers/bluetooth/s1*/ 4 | -------------------------------------------------------------------------------- /ports/nrf/boards/ARDUINO_NANO_33_BLE_SENSE/nano_bootloader.ld: -------------------------------------------------------------------------------- 1 | _flash_start = 0xe0000; 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO2/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_BOARD "weactstudio_16MiB") 2 | -------------------------------------------------------------------------------- /ports/rp2/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | Q(/lib) 4 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBLITEV10/mpconfigvariant_THREAD.mk: -------------------------------------------------------------------------------- 1 | CFLAGS += -DMICROPY_PY_THREAD=1 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV10/mpconfigvariant_NETWORK.mk: -------------------------------------------------------------------------------- 1 | MICROPY_PY_NETWORK_WIZNET5K = 5200 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV11/mpconfigvariant_NETWORK.mk: -------------------------------------------------------------------------------- 1 | MICROPY_PY_NETWORK_WIZNET5K = 5200 2 | -------------------------------------------------------------------------------- /ports/webassembly/node_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | node $(dirname $0)/build/micropython.js "$@" 3 | -------------------------------------------------------------------------------- /ports/zephyr/boards/96b_carbon.conf: -------------------------------------------------------------------------------- 1 | # TODO: Enable networking 2 | CONFIG_NETWORKING=y 3 | -------------------------------------------------------------------------------- /ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.conf: -------------------------------------------------------------------------------- 1 | CONFIG_FLASH=y 2 | CONFIG_FLASH_MAP=y 3 | -------------------------------------------------------------------------------- /tests/basics/lambda1.py: -------------------------------------------------------------------------------- 1 | # lambda 2 | 3 | f = lambda x, y: x + 3 * y 4 | print(f(3, 5)) 5 | -------------------------------------------------------------------------------- /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/sys_stdio_buffer.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | True 5 | True 6 | True 7 | -------------------------------------------------------------------------------- /tests/cmdline/repl_micropyinspect: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | os.putenv('MICROPYINSPECT', '1') 4 | -------------------------------------------------------------------------------- /tests/extmod/machine_soft_timer.py.exp: -------------------------------------------------------------------------------- 1 | one-shot 2 | periodic 3 | periodic 4 | periodic 5 | -------------------------------------------------------------------------------- /tests/extmod/vfs_posix_enoent.py.exp: -------------------------------------------------------------------------------- 1 | getcwd(): OSError(2,) 2 | VfsPosix(): OSError(2,) 3 | -------------------------------------------------------------------------------- /tests/import/import1b.py: -------------------------------------------------------------------------------- 1 | var = 123 2 | 3 | 4 | def throw(): 5 | raise ValueError 6 | -------------------------------------------------------------------------------- /tests/import/import_pkg6.py: -------------------------------------------------------------------------------- 1 | # This tests relative imports as used in pkg6 2 | import pkg6 3 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmdiv.py.exp: -------------------------------------------------------------------------------- 1 | 411 2 | -411 3 | -411 4 | 411 5 | 411 6 | 2 7 | 1 8 | -------------------------------------------------------------------------------- /tests/io/file_long_read.py: -------------------------------------------------------------------------------- 1 | f = open("data/file1") 2 | b = f.read(100) 3 | print(len(b)) 4 | -------------------------------------------------------------------------------- /tests/micropython/viper_misc.py.exp: -------------------------------------------------------------------------------- 1 | 6 2 | 3 3 | 0 4 | Ellipsis 5 | 6 6 | 10 7 | 7 8 | 20 9 | -------------------------------------------------------------------------------- /tests/micropython/viper_ptr8_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 49 50 3 | 202 4 | 202 5 | -------------------------------------------------------------------------------- /tests/multi_bluetooth/perf_l2cap.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | 3 | --- instance1 --- 4 | 5 | -------------------------------------------------------------------------------- /tests/ports/qemu/asm_test.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | False True 4 | -2147483648 5 | 2147483648 6 | -------------------------------------------------------------------------------- /tests/ports/qemu/viper_test.py: -------------------------------------------------------------------------------- 1 | import frozen_viper 2 | 3 | frozen_viper.viper_add(1, 2) 4 | -------------------------------------------------------------------------------- /tests/ports/webassembly/asyncio_await_resolve_no_arg.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | None 5 | 4 6 | -------------------------------------------------------------------------------- /tests/ports/webassembly/js_proxy_iterator.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | one ['1'] 4 | two ['2'] 5 | -------------------------------------------------------------------------------- /tests/ports/webassembly/py_proxy_get.mjs.exp: -------------------------------------------------------------------------------- 1 | true 2 | true 3 | true 4 | true 5 | true 6 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx~=7.2.6 2 | sphinxcontrib.jquery==4.1 3 | sphinx-rtd-theme==3.0.2 4 | -------------------------------------------------------------------------------- /logo/trans-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/trans-logo.png -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS2/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the FeatherS2. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS3/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the FeatherS3. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYPICO/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the TinyPICO. 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Pimoroni Pico LiPo 4MB 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/PIMORONI_TINY2040/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Pimoroni Tiny 2040 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO2_W/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_IOTREDBOARD_RP2350/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_PROMICRO_RP2350/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_THINGPLUS_RP2350/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_XRP_CONTROLLER/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_BOARD "weactstudio_2MiB") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_BOARD "weactstudio_4MiB") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_BOARD "weactstudio_8MiB") 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_H743ZI2/board_init.c: -------------------------------------------------------------------------------- 1 | #include "boards/NUCLEO_H743ZI/board_init.c" 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBLITEV10/mpconfigvariant_NETWORK.mk: -------------------------------------------------------------------------------- 1 | MICROPY_PY_NETWORK_WIZNET5K = 5200 2 | -------------------------------------------------------------------------------- /tests/basics/generator2.py: -------------------------------------------------------------------------------- 1 | gen = (i for i in range(10)) 2 | for i in gen: 3 | print(i) 4 | -------------------------------------------------------------------------------- /tests/basics/is_isnot.py: -------------------------------------------------------------------------------- 1 | print([1, 2] is [1, 2]) 2 | a = [1, 2] 3 | b = a 4 | print(b is a) 5 | -------------------------------------------------------------------------------- /tests/basics/list_clear.py: -------------------------------------------------------------------------------- 1 | # tests list.clear 2 | x = [1, 2, 3, 4] 3 | x.clear() 4 | print(x) 5 | -------------------------------------------------------------------------------- /tests/extmod/re_limit.py.exp: -------------------------------------------------------------------------------- 1 | Error 2 | Error 3 | Error 4 | Error 5 | Error 6 | Error 7 | Error 8 | -------------------------------------------------------------------------------- /tests/extmod/ssl_ioctl.py.exp: -------------------------------------------------------------------------------- 1 | -1 OSError 2 | 0 OSError 3 | 10 OSError 4 | 4 0 5 | 3 32 6 | 4 0 7 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_ptr_native_le.py.exp: -------------------------------------------------------------------------------- 1 | 48 2 | 49 3 | 0x3130 4 | 48 49 5 | 48 49 6 | 0x3130 7 | -------------------------------------------------------------------------------- /tests/feature_check/set_check.py: -------------------------------------------------------------------------------- 1 | # check if set literal syntax is supported 2 | print({1}) 3 | -------------------------------------------------------------------------------- /tests/import/circular/main.py: -------------------------------------------------------------------------------- 1 | x = 1 2 | import circular.sub 3 | 4 | print(circular.sub.y) 5 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmshift.py.exp: -------------------------------------------------------------------------------- 1 | 0x246 2 | 0x800000 3 | 0x91 4 | 0x1 5 | 0x91 6 | -0x1 7 | -------------------------------------------------------------------------------- /tests/micropython/heap_lock.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | MemoryError 3 | 1 4 | MemoryError 5 | [] 6 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_set.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: set create 2 | MemoryError: set copy 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_traceback.py.native.exp: -------------------------------------------------------------------------------- 1 | StopIteration 2 | StopIteration: 3 | 4 | -------------------------------------------------------------------------------- /tests/ports/cc3200/sd.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exception 5 | Exception 6 | Exception 7 | -------------------------------------------------------------------------------- /tests/ports/stm32/i2c_error.py.exp: -------------------------------------------------------------------------------- 1 | OSError(5,) 2 | OSError(5,) 3 | OSError(5,) 4 | OSError(5,) 5 | -------------------------------------------------------------------------------- /tests/ports/stm32/servo.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 1500 3 | (630, 2410, 1490, 2460, 2190) 4 | -------------------------------------------------------------------------------- /docs/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/static/favicon.ico -------------------------------------------------------------------------------- /logo/vector-logo-2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/vector-logo-2.ico -------------------------------------------------------------------------------- /logo/vector-logo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/vector-logo-2.png -------------------------------------------------------------------------------- /logo/vector-logo-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/vector-logo-3.png -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS2NEO/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the FeatherS2 Neo. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS3NEO/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the FeatherS3 Neo. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYWATCHS3/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the TinyWATCH S3. 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/ADAFRUIT_QTPY_RP2040/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Adafruit QT Py RP2040 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/POLOLU_3PI_2040_ROBOT/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Pololu 3pi+ 2040 Robot 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SEEED_XIAO_RP2350/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_IOTNODE_LORAWAN_RP2350/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_PROMICRO/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for SparkFun Pro Micro RP2040 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_THINGPLUS/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for SparkFun Thing Plus RP2040 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/stm32f7xx_hal_conf.h: -------------------------------------------------------------------------------- 1 | #include "boards/PYBD_SF2/stm32f7xx_hal_conf.h" 2 | -------------------------------------------------------------------------------- /ports/webassembly/variants/standard/mpconfigvariant.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_VARIANT_ENABLE_JS_HOOK (1) 2 | -------------------------------------------------------------------------------- /ports/windows/.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.*sdf 3 | *.suo 4 | *.sln 5 | *.filters 6 | .vs/* 7 | *.VC.*db 8 | -------------------------------------------------------------------------------- /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/fun_str.py: -------------------------------------------------------------------------------- 1 | # test str of function 2 | 3 | def f(): 4 | pass 5 | print(str(f)[:8]) 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/extmod/machine_rtc.py.exp: -------------------------------------------------------------------------------- 1 | 2020 1 1 0 0 2 | 2020 1 1 0 0 3 | 2020 1 1 0 0 4 | 2020 1 1 0 0 5 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_bytearray.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'01') 2 | 3 | bytearray(b'0123') 4 | -------------------------------------------------------------------------------- /tests/feature_check/int_64.py: -------------------------------------------------------------------------------- 1 | # Check whether 64-bit long integers are supported 2 | print(1 << 62) 3 | -------------------------------------------------------------------------------- /tests/feature_check/repl_emacs_check.py: -------------------------------------------------------------------------------- 1 | # Check for emacs keys in REPL 2 | t = +11 3 | t == 2 4 | -------------------------------------------------------------------------------- /tests/import/ext/os.py: -------------------------------------------------------------------------------- 1 | print("os from filesystem") 2 | 3 | from uos import * 4 | 5 | extra = 1 6 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmconst.py.exp: -------------------------------------------------------------------------------- 1 | 0xfffffff 2 | 0x12345678 3 | 0x7ff 4 | 0xffffffff 5 | 0x1001 6 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_dict.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: create dict 2 | MemoryError: dict.items 3 | -------------------------------------------------------------------------------- /tests/micropython/viper_ptr16_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 12849 13363 3 | 26212 4 | 26212 5 | -------------------------------------------------------------------------------- /tests/micropython/viper_unop.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | -2 4 | 0 5 | -1 6 | 2 7 | -1 8 | -2 9 | 1 10 | -------------------------------------------------------------------------------- /tests/misc/cexample_subclass.py.exp: -------------------------------------------------------------------------------- 1 | 2 | AttributeError 3 | AttributeError 4 | 0 5 | 123 6 | -------------------------------------------------------------------------------- /tests/net_inet/asyncio_cancel_stream.py.exp: -------------------------------------------------------------------------------- 1 | start 2 | cancelling 3 | waiting 4 | cancelled 5 | done 6 | -------------------------------------------------------------------------------- /tests/net_inet/isrg.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/net_inet/isrg.der -------------------------------------------------------------------------------- /tests/ports/stm32/adc.py.exp: -------------------------------------------------------------------------------- 1 | 3 | 50 4 | 25 5 | 30 6 | -------------------------------------------------------------------------------- /tests/ports/webassembly/basic.js.exp: -------------------------------------------------------------------------------- 1 | hello 2 | hello from webassembly 3 | 4 | -------------------------------------------------------------------------------- /tests/unicode/unicode_ord.py: -------------------------------------------------------------------------------- 1 | # test builtin ord with unicode characters 2 | 3 | print(ord("α")) 4 | -------------------------------------------------------------------------------- /docs/esp32/img/esp32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/esp32/img/esp32.jpg -------------------------------------------------------------------------------- /ports/esp32/boards/UM_NANOS3/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_OMGS3/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_PROS3/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_RGBTOUCH_MINI/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the RGB Touch Mini. 2 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYS2/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYS3/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/TEENSY41/manifest.py: -------------------------------------------------------------------------------- 1 | include("../manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/nrf/freeze/test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | def hello(): 5 | print("Hello %s!" % sys.platform) 6 | -------------------------------------------------------------------------------- /ports/rp2/boards/ADAFRUIT_FEATHER_RP2040/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Adafruit Feather RP2040 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_PROMICRO_RP2350/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_THINGPLUS_RP2350/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_XRP_CONTROLLER/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/zephyr/boards/rv32m1_vega_ri5cy.conf: -------------------------------------------------------------------------------- 1 | # Flash drivers 2 | CONFIG_FLASH=y 3 | CONFIG_FLASH_MAP=y 4 | -------------------------------------------------------------------------------- /tests/basics/builtin_bin_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin bin function 2 | 3 | print(bin(12345678901234567890)) 4 | -------------------------------------------------------------------------------- /tests/extmod/btree_closed.py.exp: -------------------------------------------------------------------------------- 1 | ValueError 2 | ValueError 3 | ValueError 4 | ValueError 5 | 6 | -------------------------------------------------------------------------------- /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/import/pkg3/subpkg1/mod1.py: -------------------------------------------------------------------------------- 1 | print("subpkg1.mod1 __name__:", __name__) 2 | from ..mod2 import foo 3 | -------------------------------------------------------------------------------- /tests/import/pkg9/__init__.py: -------------------------------------------------------------------------------- 1 | from .mod1 import mod1 2 | 3 | 4 | def mod2(): 5 | print("mod2") 6 | -------------------------------------------------------------------------------- /tests/io/file_long_read2.py: -------------------------------------------------------------------------------- 1 | f = open("data/bigfile1") 2 | b = f.read() 3 | print(len(b)) 4 | print(b) 5 | -------------------------------------------------------------------------------- /tests/micropython/const2.py.exp: -------------------------------------------------------------------------------- 1 | 2 | function X 1 3 | class X 1 4 | method X 2 4 4 5 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_inst_call.py.exp: -------------------------------------------------------------------------------- 1 | __call__ 2 | __call__ 1 3 | __call__ 1 2 4 | __call__ 1 2 3 5 | -------------------------------------------------------------------------------- /tests/micropython/native_fun_attrs.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | AttributeError 5 | -------------------------------------------------------------------------------- /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/ports/unix/ffi_callback.py.exp: -------------------------------------------------------------------------------- 1 | org string: bytearray(b'foobar') 2 | qsort'ed: bytearray(b'abfoor') 3 | -------------------------------------------------------------------------------- /tests/ports/unix/ffi_float2.py.exp: -------------------------------------------------------------------------------- 1 | 1.77245 2 | 1.00000 3 | 1.00000 4 | 0.88623 5 | 6.00000 6 | 6.00000 7 | -------------------------------------------------------------------------------- /tests/ports/webassembly/filesystem.mjs.exp: -------------------------------------------------------------------------------- 1 | testmod 1 2 | testmod 1 3 | testmod: PyProxy { _ref: 3 } 1 4 | -------------------------------------------------------------------------------- /tests/stress/recursive_iternext.py.exp: -------------------------------------------------------------------------------- 1 | RuntimeError 2 | RuntimeError 3 | RuntimeError 4 | RuntimeError 5 | -------------------------------------------------------------------------------- /tests/unicode/unicode_iter.py: -------------------------------------------------------------------------------- 1 | for c in "Hello": 2 | print(c) 3 | for c in "Привет": 4 | print(c) 5 | -------------------------------------------------------------------------------- /docs/develop/img/bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/develop/img/bitmap.png -------------------------------------------------------------------------------- /docs/develop/img/linprob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/develop/img/linprob.png -------------------------------------------------------------------------------- /docs/rp2/img/pico_pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/rp2/img/pico_pinout.png -------------------------------------------------------------------------------- /drivers/cc3100/inc/netapp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/drivers/cc3100/inc/netapp.h -------------------------------------------------------------------------------- /examples/usercmodule/subpackage/README.md: -------------------------------------------------------------------------------- 1 | This is an example of a user C module that includes subpackages. 2 | -------------------------------------------------------------------------------- /logo/upython-with-micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/upython-with-micro.jpg -------------------------------------------------------------------------------- /logo/upython-with-micro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/upython-with-micro.png -------------------------------------------------------------------------------- /ports/esp32/boards/M5STACK_ATOM/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/SIL_MANT1S/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS3/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYPICO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /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/rp2/boards/ADAFRUIT_ITSYBITSY_RP2040/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Adafruit ItsyBitsy RP2040 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_IOTREDBOARD_RP2350/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("./modules") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_H743ZI2/stm32h7xx_hal_conf.h: -------------------------------------------------------------------------------- 1 | #include "boards/NUCLEO_H743ZI/stm32h7xx_hal_conf.h" 2 | -------------------------------------------------------------------------------- /ports/zephyr/boards/pocketbeagle_2_am6254_a53.conf: -------------------------------------------------------------------------------- 1 | # Hardware features 2 | CONFIG_I2C=y 3 | CONFIG_GPIO=y 4 | -------------------------------------------------------------------------------- /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/is_isnot_literal.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | False 3 | False 4 | True 5 | True 6 | False 7 | False 8 | True 9 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_optimise.py: -------------------------------------------------------------------------------- 1 | # cmdline: -O 2 | # test optimisation output 3 | print(__debug__) 4 | assert 0 5 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_addressof.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 4 4 | 8 5 | 16 6 | 32 7 | 64 8 | 128 9 | True 10 | -------------------------------------------------------------------------------- /tests/frozen/frozentest.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/frozen/frozentest.mpy -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmdata.py.exp: -------------------------------------------------------------------------------- 1 | 0x12345678 2 | 0x20000000 3 | 0x40000000 4 | 0x80000000 5 | 0xfffffffe 6 | -------------------------------------------------------------------------------- /tests/micropython/const_float.py.exp: -------------------------------------------------------------------------------- 1 | 2.5 2 | -0.3 3 | 2.2 6.25 4 | 0.5 0.25 5 | -------------------------------------------------------------------------------- /tests/micropython/import_mpy_native.py.exp: -------------------------------------------------------------------------------- 1 | mod0 ValueError incompatible .mpy arch 2 | mod1 OK 3 | mod2 OK 4 | -------------------------------------------------------------------------------- /tests/micropython/native_misc.py.exp: -------------------------------------------------------------------------------- 1 | 1 [] 2 2 | 1 [] 3 3 | 3 4 | 6 5 | True 6 | False 7 | 1 2 3 5 8 | 1 2 3 4 9 | -------------------------------------------------------------------------------- /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/viper_subscr_multi.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x03\x02') 2 | bytearray(b'\x03\x02') 3 | 0x1020304 4 | -------------------------------------------------------------------------------- /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/multi_net/ec_cert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/multi_net/ec_cert.der -------------------------------------------------------------------------------- /tests/multi_net/ec_key.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/multi_net/ec_key.der -------------------------------------------------------------------------------- /tests/multi_net/rsa_cert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/multi_net/rsa_cert.der -------------------------------------------------------------------------------- /tests/multi_net/rsa_key.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/multi_net/rsa_key.der -------------------------------------------------------------------------------- /tests/net_inet/mpycert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/net_inet/mpycert.der -------------------------------------------------------------------------------- /tests/ports/webassembly/py_proxy_set.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 'set' on proxy: trap returned falsish for property 'bar' 3 | -------------------------------------------------------------------------------- /docs/develop/img/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/develop/img/collision.png -------------------------------------------------------------------------------- /docs/mimxrt/img/teensy_4.1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/mimxrt/img/teensy_4.1.jpg -------------------------------------------------------------------------------- /examples/usercmodule/subpackage/qstrdefsexamplepackage.h: -------------------------------------------------------------------------------- 1 | Q(example_package.foo) 2 | Q(example_package.foo.bar) 3 | -------------------------------------------------------------------------------- /ports/embed/port/mphalport.h: -------------------------------------------------------------------------------- 1 | // Define so there's no dependency on extmod/virtpin.h 2 | #define mp_hal_pin_obj_t 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/LOLIN_C3_MINI/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("./modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/LOLIN_S2_MINI/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("./modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS2NEO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS3NEO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1020_EVK/manifest.py: -------------------------------------------------------------------------------- 1 | include("../manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1050_EVK/manifest.py: -------------------------------------------------------------------------------- 1 | include("../manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1060_EVK/manifest.py: -------------------------------------------------------------------------------- 1 | include("../manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1064_EVK/manifest.py: -------------------------------------------------------------------------------- 1 | include("../manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1170_EVK/manifest.py: -------------------------------------------------------------------------------- 1 | include("../manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/SEEED_ARCH_MIX/manifest.py: -------------------------------------------------------------------------------- 1 | include("../manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/renesas-ra/boards/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(MPY_DIR)/extmod/asyncio") 2 | require("dht") 3 | require("onewire") 4 | -------------------------------------------------------------------------------- /ports/rp2/boards/NULLBITS_BIT_C_PRO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | module("board.py") 3 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_IOTNODE_LORAWAN_RP2350/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | set(PICO_PLATFORM "rp2350-riscv") 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/LEGO_HUB_NO7/manifest.py: -------------------------------------------------------------------------------- 1 | # Use shared manifest. 2 | include("$(PORT_DIR)/boards/LEGO_HUB_NO6") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/WEACT_F411_BLACKPILL/mpconfigvariant_V31_XTAL_8M.mk: -------------------------------------------------------------------------------- 1 | BOARD_VERSION = 31 2 | XTAL_FREQ_MHZ = 8 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(MPY_DIR)/extmod/asyncio") 2 | 3 | require("dht") 4 | require("onewire") 5 | -------------------------------------------------------------------------------- /ports/windows/variants/standard/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | # This is the default variant when you `make` the Windows port. 2 | -------------------------------------------------------------------------------- /ports/zephyr/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | Q(/flash/lib) 4 | Q(/sd/lib) 5 | -------------------------------------------------------------------------------- /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/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/list_reverse.py: -------------------------------------------------------------------------------- 1 | a = [] 2 | for i in range(100): 3 | a.append(i) 4 | a.reverse() 5 | print(a) 6 | -------------------------------------------------------------------------------- /tests/basics/slice_optimise.py.exp: -------------------------------------------------------------------------------- 1 | KeyError (slice(None, None, None),) 2 | [slice(None, 'a', None), 'b'] [1, 2] 3 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_error.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | TypeError 3 | TypeError 4 | TypeError 5 | TypeError 6 | TypeError 7 | -------------------------------------------------------------------------------- /tests/extmod/uctypes_print.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/feature_check/fstring.py: -------------------------------------------------------------------------------- 1 | # check whether f-strings (PEP-498) are supported 2 | a = 1 3 | print(f"a={a}") 4 | -------------------------------------------------------------------------------- /tests/feature_check/slice.py: -------------------------------------------------------------------------------- 1 | try: 2 | slice 3 | print("slice") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /tests/io/file_long_read3.py: -------------------------------------------------------------------------------- 1 | f = open("data/bigfile1", "rb") 2 | b = f.read(512) 3 | print(len(b)) 4 | print(b) 5 | -------------------------------------------------------------------------------- /tests/micropython/emg_exc.py.exp: -------------------------------------------------------------------------------- 1 | Traceback (most recent call last): 2 | , line 21, in f 3 | ValueError: 1 4 | 5 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_bytesio.py.exp: -------------------------------------------------------------------------------- 1 | b'1234123412341234123412341234123412341234123412341234123412341234' 2 | -------------------------------------------------------------------------------- /tests/ports/cc3200/wdt.py.exp: -------------------------------------------------------------------------------- 1 | Exception 2 | Exception 3 | Exception 4 | 5 | Exception 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/ports/stm32/pyb_f405.py.exp: -------------------------------------------------------------------------------- 1 | (168000000, 168000000, 42000000, 84000000) 2 | 3 | OSError(5,) 4 | -------------------------------------------------------------------------------- /tests/ports/unix/mod_os.py.exp: -------------------------------------------------------------------------------- 1 | TEST_VALUE 2 | TEST_VALUE 3 | None 4 | TEST_DEFAULT_VALUE 5 | 0 6 | True 4 7 | 2 8 | -------------------------------------------------------------------------------- /tests/ports/webassembly/jsffi_create_proxy.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | 1 4 | 1 5 | PyProxy { _ref: 3 } 6 | [ 2 ] 7 | -------------------------------------------------------------------------------- /lib/libm_dbl/ldexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ldexp(double x, int n) 4 | { 5 | return scalbn(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /logo/micropythonpowered-art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/logo/micropythonpowered-art.png -------------------------------------------------------------------------------- /ports/renesas-ra/boards/EK_RA4M1/manifest.py: -------------------------------------------------------------------------------- 1 | # We do not want to include default frozen modules, 2 | require("sdcard") 3 | -------------------------------------------------------------------------------- /ports/renesas-ra/mpconfigport.mk: -------------------------------------------------------------------------------- 1 | # Enable/disable extra modules 2 | 3 | # VFS FAT FS support 4 | MICROPY_VFS_FAT ?= 1 5 | -------------------------------------------------------------------------------- /ports/rp2/boards/NULLBITS_BIT_C_PRO/pins.csv: -------------------------------------------------------------------------------- 1 | LED,GPIO16 2 | LED_RED,GPIO16 3 | LED_GREEN,GPIO17 4 | LED_BLUE,GPIO18 5 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO_RP2350B_CORE/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F429ZI/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F439ZI/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F746ZG/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F756ZG/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_F767ZI/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_H723ZG/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_H743ZI/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/OLIMEX_E407/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV10/mpconfigvariant_DP_THREAD.mk: -------------------------------------------------------------------------------- 1 | MICROPY_FLOAT_IMPL = double 2 | CFLAGS += -DMICROPY_PY_THREAD=1 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV11/mpconfigvariant_DP_THREAD.mk: -------------------------------------------------------------------------------- 1 | MICROPY_FLOAT_IMPL = double 2 | CFLAGS += -DMICROPY_PY_THREAD=1 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32F769DISC/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32F7DISC/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/STM32H573I_DK/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/WEACT_F411_BLACKPILL/mpconfigvariant_V13_FLASH_4M.mk: -------------------------------------------------------------------------------- 1 | BOARD_VERSION = 13 2 | SPI_FLASH_SIZE_MB = 4 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/WEACT_F411_BLACKPILL/mpconfigvariant_V20_FLASH_4M.mk: -------------------------------------------------------------------------------- 1 | BOARD_VERSION = 20 2 | SPI_FLASH_SIZE_MB = 4 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/WEACT_F411_BLACKPILL/mpconfigvariant_V31_FLASH_8M.mk: -------------------------------------------------------------------------------- 1 | BOARD_VERSION = 31 2 | SPI_FLASH_SIZE_MB = 8 3 | -------------------------------------------------------------------------------- /ports/webassembly/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | // *FORMAT-OFF* 3 | Q(/lib) 4 | Q(asyncio.core) 5 | -------------------------------------------------------------------------------- /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/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/generator_pep479.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | RuntimeError 3 | StopIteration 4 | 1 5 | RuntimeError 6 | 0 7 | RuntimeError 8 | -------------------------------------------------------------------------------- /tests/basics/generator_throw_multi_arg.py.exp: -------------------------------------------------------------------------------- 1 | 123 2 | GeneratorExit () 3 | 456 4 | 123 5 | GeneratorExit (123,) 6 | 456 7 | -------------------------------------------------------------------------------- /tests/basics/nanbox_smallint.py.exp: -------------------------------------------------------------------------------- 1 | 2147483648 2 | 70368744177663 3 | -70368744177664 4 | 2147483649 5 | 35184372088833 6 | -------------------------------------------------------------------------------- /tests/basics/string_format_cp310.py.exp: -------------------------------------------------------------------------------- 1 | {:0s} >ab< 2 | {:06s} >ab0000< 3 | {:<06s} >ab0000< 4 | {:>06s} >0000ab< 5 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_module_atexit.py.exp: -------------------------------------------------------------------------------- 1 | ['cmdline.cmd_module_atexit', 'cmdline/cmd_module_atexit.py'] 2 | start 3 | done 4 | -------------------------------------------------------------------------------- /tests/cmdline/repl_inspect.py: -------------------------------------------------------------------------------- 1 | # cmdline: -i -c print("test") 2 | # -c option combined with -i option results in REPL 3 | -------------------------------------------------------------------------------- /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/uctypes_array_assign_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x11 2 | 0x2233 3 | 0x4455 4 | 0x66778899 5 | True 6 | 0xaabbccdd 7 | True 8 | -------------------------------------------------------------------------------- /tests/feature_check/complex.py: -------------------------------------------------------------------------------- 1 | try: 2 | complex 3 | print("complex") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /tests/multi_net/expired_cert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/multi_net/expired_cert.der -------------------------------------------------------------------------------- /tests/ports/cc3200/wlan/machine.py.exp: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | Active 5 | True 6 | True 7 | Exception 8 | -------------------------------------------------------------------------------- /tests/ports/esp32/check_err_str.py.exp: -------------------------------------------------------------------------------- 1 | [Errno 2] ENOENT 2 | (-5379, 'ESP_ERR_OTA_VALIDATE_FAILED') 3 | exc: 4 | -5379 5 | -------------------------------------------------------------------------------- /tests/ports/stm32/can2.py.exp: -------------------------------------------------------------------------------- 1 | (1, True, True, 0, b'') 2 | (2, True, True, 1, b'') 3 | (3, True, True, 2, b'') 4 | False 5 | -------------------------------------------------------------------------------- /tests/ports/webassembly/asyncio_sleep.mjs.exp: -------------------------------------------------------------------------------- 1 | main start 2 | True 3 | main end 4 | task start 5 | True 6 | task end 7 | -------------------------------------------------------------------------------- /tests/unicode/unicode_str_modulo.py: -------------------------------------------------------------------------------- 1 | # test handling of unicode chars in string % formatting 2 | 3 | print("α" % ()) 4 | -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC_C5/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/SPARKFUN_IOT_REDBOARD_ESP32/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("sdcard") 3 | -------------------------------------------------------------------------------- /ports/renesas-ra/boards/RA4M1_CLICKER/manifest.py: -------------------------------------------------------------------------------- 1 | # We do not want to include default frozen modules, 2 | require("sdcard") 3 | -------------------------------------------------------------------------------- /ports/rp2/boards/SIL_RP2040_SHIM/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/rp2/boards/W5100S_EVB_PICO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/rp2/boards/W5500_EVB_PICO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBLITEV10/mpconfigvariant_DP_THREAD.mk: -------------------------------------------------------------------------------- 1 | MICROPY_FLOAT_IMPL = double 2 | CFLAGS += -DMICROPY_PY_THREAD=1 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/VCC_GND_F407ZG/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | -------------------------------------------------------------------------------- /ports/windows/variants/dev/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/variants/manifest.py") 2 | include("$(MPY_DIR)/extmod/asyncio") 3 | -------------------------------------------------------------------------------- /tests/basics/bytes_construct_bytearray.py: -------------------------------------------------------------------------------- 1 | # test construction of bytes from bytearray 2 | 3 | print(bytes(bytearray(4))) 4 | -------------------------------------------------------------------------------- /tests/basics/dict_fixed.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | TypeError 3 | TypeError 4 | TypeError 5 | TypeError 6 | TypeError 7 | TypeError 8 | -------------------------------------------------------------------------------- /tests/basics/python34.py.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 1 3 | SyntaxError 4 | SyntaxError 5 | SyntaxError 6 | 3.4 7 | 3 4 8 | IndexError('foo',) 9 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_sys_exit_0.py: -------------------------------------------------------------------------------- 1 | # cmdline: 2 | # test sys.exit(0) - success exit code 3 | import sys 4 | 5 | sys.exit(0) 6 | -------------------------------------------------------------------------------- /tests/feature_check/bytearray.py: -------------------------------------------------------------------------------- 1 | try: 2 | bytearray 3 | print("bytearray") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /tests/import/import_pkg4.py: -------------------------------------------------------------------------------- 1 | # Testing that "recursive" imports (pkg2/__init__.py imports from pkg2) work 2 | import pkg2 3 | -------------------------------------------------------------------------------- /tests/import/rel_import_inv.py: -------------------------------------------------------------------------------- 1 | try: 2 | from . import foo 3 | except: 4 | print("Invalid relative import caught") 5 | -------------------------------------------------------------------------------- /tests/micropython/const_intbig.py.exp: -------------------------------------------------------------------------------- 1 | 0xffffffff 0xffffffffffffffff 2 | 0x100000000fffffffe 0x100000000000000000ffffffff 3 | -------------------------------------------------------------------------------- /tests/micropython/heapalloc_fail_memoryview.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError: memoryview create 2 | MemoryError: memoryview subscr get 3 | -------------------------------------------------------------------------------- /tests/misc/non_compliant_lexer.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | SyntaxError 5 | NotImplementedError 6 | -------------------------------------------------------------------------------- /tests/multi_net/asyncio_tcp_client_rst.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'GET / HTTP' 3 | OSError 104 4 | --- instance1 --- 5 | 6 | -------------------------------------------------------------------------------- /tests/multi_net/ssl_cert_ec.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'client to server' 3 | --- instance1 --- 4 | b'server to client' 5 | -------------------------------------------------------------------------------- /tests/multi_net/ssl_cert_rsa.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'client to server' 3 | --- instance1 --- 4 | b'server to client' 5 | -------------------------------------------------------------------------------- /tests/net_inet/asyncio_open_connection.py.exp: -------------------------------------------------------------------------------- 1 | write GET 2 | read response 3 | read: b'HTTP/1.1 200 OK' 4 | close 5 | done 6 | -------------------------------------------------------------------------------- /tests/ports/webassembly/await_error_handling.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | (, 'Error', 'test') 4 | 3 5 | true Error test 6 | -------------------------------------------------------------------------------- /tests/ports/webassembly/py_proxy_identity.mjs.exp: -------------------------------------------------------------------------------- 1 | PyProxy { _ref: 3 } PyProxy { _ref: 3 } 2 | true 3 | callback 4 | -------------------------------------------------------------------------------- /tests/unicode/file1.py: -------------------------------------------------------------------------------- 1 | f = open("data/utf-8_1.txt", encoding="utf-8") 2 | l = f.readline() 3 | print(l) 4 | print(len(l)) 5 | -------------------------------------------------------------------------------- /docs/renesas-ra/img/ek_ra6m2_board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/renesas-ra/img/ek_ra6m2_board.jpg -------------------------------------------------------------------------------- /docs/samd/img/itsybitsy_m4_express.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/samd/img/itsybitsy_m4_express.jpg -------------------------------------------------------------------------------- /examples/SDdatalogger/cardreader.py: -------------------------------------------------------------------------------- 1 | # cardread.py 2 | # This is called when the user enters cardreader mode. It does nothing. 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/sdkconfig.p4_wifi_c5: -------------------------------------------------------------------------------- 1 | # Most settings are in sdkconfig.p4_wifi_common 2 | CONFIG_SLAVE_IDF_TARGET_ESP32C5=y 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/sdkconfig.p4_wifi_c6: -------------------------------------------------------------------------------- 1 | # Most settings are in sdkconfig.p4_wifi_common 2 | CONFIG_SLAVE_IDF_TARGET_ESP32C6=y 3 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_IOTNODE_LORAWAN_RP2350/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("sdcard") 4 | -------------------------------------------------------------------------------- /ports/unix/variants/manifest.py: -------------------------------------------------------------------------------- 1 | add_library("unix-ffi", "$(MPY_LIB_DIR)/unix-ffi") 2 | require("mip-cmdline") 3 | require("ssl") 4 | -------------------------------------------------------------------------------- /ports/zephyr/boards/nucleo_h743zi.conf: -------------------------------------------------------------------------------- 1 | # flash config 2 | CONFIG_FLASH=y 3 | CONFIG_FLASH_MAP=y 4 | CONFIG_FLASH_PAGE_LAYOUT=y 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/exception_chain.py.exp: -------------------------------------------------------------------------------- 1 | Caught Exception 2 | Warning: exception chaining not supported 3 | Caught Exception: Runtime 4 | -------------------------------------------------------------------------------- /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/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/cmdline/repl_sys_ps1_ps2.py: -------------------------------------------------------------------------------- 1 | # test changing ps1/ps2 2 | import sys 3 | sys.ps1 = "PS1" 4 | sys.ps2 = "PS2" 5 | (1 + 6 | 2) 7 | -------------------------------------------------------------------------------- /tests/feature_check/coverage.py: -------------------------------------------------------------------------------- 1 | try: 2 | extra_coverage 3 | print("coverage") 4 | except NameError: 5 | print("no") 6 | -------------------------------------------------------------------------------- /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/micropython/extreme_exc.py.exp: -------------------------------------------------------------------------------- 1 | Exception() 2 | TypeError( 3 | TypeError( 4 | RuntimeError( 5 | Exception('my exception',) 6 | -------------------------------------------------------------------------------- /tests/multi_net/udp_recv_dontwait.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | True 3 | True 4 | True 5 | b'abcdefgh' 6 | --- instance1 --- 7 | 8 8 | -------------------------------------------------------------------------------- /tests/ports/stm32/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/ports/webassembly/py_proxy_delete.mjs.exp: -------------------------------------------------------------------------------- 1 | False 2 | 'deleteProperty' on proxy: trap returned falsish for property 'sort' 3 | -------------------------------------------------------------------------------- /tests/unicode/data/utf-8_invalid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tests/unicode/data/utf-8_invalid.txt -------------------------------------------------------------------------------- /tools/mpremote/requirements.txt: -------------------------------------------------------------------------------- 1 | pyserial >= 3.3 2 | importlib_metadata >= 1.4; python_version < "3.8" 3 | platformdirs >= 4.3.7 4 | -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_amp_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/pyboard/tutorial/img/skin_amp_1.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_amp_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/pyboard/tutorial/img/skin_amp_2.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_lcd_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/pyboard/tutorial/img/skin_lcd_1.jpg -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/skin_lcd_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/pyboard/tutorial/img/skin_lcd_2.jpg -------------------------------------------------------------------------------- /ports/esp32/boards/LOLIN_S2_PICO/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("./modules") 3 | require("ssd1306") 4 | -------------------------------------------------------------------------------- /ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | # There are no common .mk settings among the variants, so this file is empty. 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/rp2/boards/WEACTSTUDIO_RP2350B_CORE/mpconfigvariant.cmake: -------------------------------------------------------------------------------- 1 | # Set the ARM-based RP2350 platform 2 | set(PICO_PLATFORM "rp2350") 3 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_QTPY_SAMD21/mpconfigvariant_SPIFLASH.mk: -------------------------------------------------------------------------------- 1 | CFLAGS += -DMICROPY_HW_SPIFLASH=1 2 | MICROPY_HW_CODESIZE ?= 232K 3 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBV10/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | include("$(PORT_DIR)/boards/manifest_pyboard.py") 3 | -------------------------------------------------------------------------------- /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/standard/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/variants/manifest.py") 2 | 3 | include("$(MPY_DIR)/extmod/asyncio") 4 | -------------------------------------------------------------------------------- /ports/windows/variants/dev/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | FROZEN_MANIFEST ?= $(VARIANT_DIR)/manifest.py 2 | 3 | MICROPY_ROM_TEXT_COMPRESSION = 1 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/int_bytes_optional_args_cp311.py.exp: -------------------------------------------------------------------------------- 1 | b'\n' 2 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00d' 3 | 1 4 | 256 5 | b'\n' 6 | b'd' 7 | -------------------------------------------------------------------------------- /tests/basics/object1.py: -------------------------------------------------------------------------------- 1 | # test builtin object() 2 | 3 | # creation 4 | object() 5 | 6 | # printing 7 | print(repr(object())[:7]) 8 | -------------------------------------------------------------------------------- /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/cmdline/cmd_module_atexit_exc.py.exp: -------------------------------------------------------------------------------- 1 | ['cmdline.cmd_module_atexit_exc', 'cmdline/cmd_module_atexit_exc.py'] 2 | start 3 | done 4 | -------------------------------------------------------------------------------- /tests/extmod/asyncio_iterator_event.py.exp: -------------------------------------------------------------------------------- 1 | bar 0 2 | bar 1 3 | bar 2 4 | good: asyncio iterator is still pending, exiting 5 | end main 6 | -------------------------------------------------------------------------------- /tests/extmod/tls_dtls.py.exp: -------------------------------------------------------------------------------- 1 | Wrapped DTLS Server 2 | Failed to wrap DTLS Server with invalid client_id 3 | Wrapped DTLS Client 4 | OK 5 | -------------------------------------------------------------------------------- /tests/import/ext/sys.py: -------------------------------------------------------------------------------- 1 | # sys is always builtin and cannot be overridden by the filesystem. 2 | print("ERROR: sys from filesystem") 3 | -------------------------------------------------------------------------------- /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/pkg3/mod2.py: -------------------------------------------------------------------------------- 1 | print("mod2 __name__:", __name__) 2 | print("in mod2") 3 | 4 | 5 | def foo(): 6 | print("mod2.foo()") 7 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmrettype.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | False True 3 | 0 0x20000000 0x40000000 -0x80000000 4 | 0 0x20000000 0x40000000 0x80000000 5 | -------------------------------------------------------------------------------- /tests/io/file_stdio.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.stdin.fileno()) 4 | print(sys.stdout.fileno()) 5 | print(sys.stderr.fileno()) 6 | -------------------------------------------------------------------------------- /tests/micropython/viper_ptr32_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x12\x12\x12\x124444') 2 | 0x12121212 0x34343434 3 | 0x46464646 4 | 0x46464646 5 | -------------------------------------------------------------------------------- /tests/ports/stm32/switch.py: -------------------------------------------------------------------------------- 1 | from pyb import Switch 2 | 3 | sw = Switch() 4 | print(sw()) 5 | sw.callback(print) 6 | sw.callback(None) 7 | -------------------------------------------------------------------------------- /tools/mpremote/mpremote.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | from mpremote import main 5 | 6 | sys.exit(main.main()) 7 | -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/pyboard_servo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/pyboard/tutorial/img/pyboard_servo.jpg -------------------------------------------------------------------------------- /drivers/README.md: -------------------------------------------------------------------------------- 1 | This directory contains C drivers for specific hardware. The drivers are 2 | intended to work across multiple ports. 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/LILYGO_TTGO_LORA32/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | require("ssd1306") 4 | -------------------------------------------------------------------------------- /ports/esp32/boards/SIL_WESP32/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Silicognition wESP32" 2 | #define MICROPY_HW_MCU_NAME "ESP32" 3 | -------------------------------------------------------------------------------- /ports/nrf/modules/manifest.py: -------------------------------------------------------------------------------- 1 | module("_mkfs.py", base_path="$(PORT_DIR)/modules/scripts", opt=3) 2 | include("$(MPY_DIR)/extmod/asyncio") 3 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Raspberry Pi Pico 2 | set(PICO_BOARD "pico") 3 | set(PICO_PLATFORM "rp2040") 4 | -------------------------------------------------------------------------------- /ports/stm32/boards/OPENMV_N6/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | require("bundle-networking") 3 | require("aioble") 4 | -------------------------------------------------------------------------------- /tests/basics/errno1.py.exp: -------------------------------------------------------------------------------- 1 | 2 | [Errno ] EIO 3 | [Errno ] EIO: details 4 | ( , 'details', 'more details') 5 | 9999 6 | errno 7 | -------------------------------------------------------------------------------- /tests/basics/string_escape_invalid.py: -------------------------------------------------------------------------------- 1 | # Test invalid escape characters. 2 | # CPython issues a SyntaxWarning for this. 3 | 4 | print("\z") 5 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_sys_exit_error.py: -------------------------------------------------------------------------------- 1 | # cmdline: 2 | # test sys.exit() functionality and exit codes 3 | import sys 4 | 5 | sys.exit(123) 6 | -------------------------------------------------------------------------------- /tests/cmdline/cmd_sys_exit_none.py: -------------------------------------------------------------------------------- 1 | # cmdline: 2 | # test sys.exit(None) - should exit with code 0 3 | import sys 4 | 5 | sys.exit(None) 6 | -------------------------------------------------------------------------------- /tests/extmod/asyncio_event_queue.py.exp: -------------------------------------------------------------------------------- 1 | main started 2 | foo waiting 3 | asyncio still pending, unlocking event 4 | foo done 5 | main done 6 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmarith.py.exp: -------------------------------------------------------------------------------- 1 | 0xfe 2 | 0x111 3 | 1 4 | 0 5 | 0 6 | 0 7 | 1 8 | 0 9 | 0 10 | 0 11 | 0 12 | 1 13 | 0 14 | 1 15 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmrettype.py.exp: -------------------------------------------------------------------------------- 1 | 1 2 | False True 3 | 0 0x20000000 0x40000000 -0x80000000 4 | 0 0x20000000 0x40000000 0x80000000 5 | -------------------------------------------------------------------------------- /tests/misc/sys_settrace_cov.py.exp: -------------------------------------------------------------------------------- 1 | FRAME 2 | LASTI \\d\+ 3 | -------------------------------------------------------------------------------- /tests/multi_net/sslcontext_server_client.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'client to server' 3 | --- instance1 --- 4 | b'server to client' 5 | -------------------------------------------------------------------------------- /tests/ports/webassembly/override_new.mjs.exp: -------------------------------------------------------------------------------- 1 | 2 | MyClass1 new 3 | 1 4 | MyClass2 static new 5 | 2 6 | MyClass2 new 7 | 3 8 | -------------------------------------------------------------------------------- /tests/stress/recursion.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | foo() 3 | 4 | 5 | try: 6 | foo() 7 | except RuntimeError: 8 | print("RuntimeError") 9 | -------------------------------------------------------------------------------- /tools/make_pinout_diagram/weact_pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/tools/make_pinout_diagram/weact_pinout.png -------------------------------------------------------------------------------- /tools/mpremote/mpremote/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | from mpremote import main 5 | 6 | sys.exit(main.main()) 7 | -------------------------------------------------------------------------------- /tools/mpremote/tests/test_eval_exec_run.sh.exp: -------------------------------------------------------------------------------- 1 | mpremote 2 | before sleep 3 | after sleep 4 | 3 5 | [{'a': 'b'}, (1, 2, 3), True] 6 | run 7 | -------------------------------------------------------------------------------- /docs/esp32/tutorial/img/mem32_gpio_output.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/esp32/tutorial/img/mem32_gpio_output.jpg -------------------------------------------------------------------------------- /ports/cc3200/bootmgr/relocator/relocator.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/ports/cc3200/bootmgr/relocator/relocator.bin -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | set(SDKCONFIG_DEFAULTS 2 | boards/sdkconfig.base 3 | boards/sdkconfig.ble 4 | ) 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/OLIMEX_ESP32_EVB/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Olimex ESP32 ETH" 2 | #define MICROPY_HW_MCU_NAME "ESP32" 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/OLIMEX_ESP32_POE/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Olimex ESP32 ETH" 2 | #define MICROPY_HW_MCU_NAME "ESP32" 3 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1060_EVK/board.md: -------------------------------------------------------------------------------- 1 | The port for this board is experimental. It is made based on the documentation, but was not yet tested. -------------------------------------------------------------------------------- /ports/mimxrt/boards/MIMXRT1064_EVK/board.md: -------------------------------------------------------------------------------- 1 | The port for this board is experimental. It is made based on the documentation, but was not yet tested. -------------------------------------------------------------------------------- /ports/stm32/boards/LEGO_HUB_NO7/bdev.c: -------------------------------------------------------------------------------- 1 | // LEGO_HUB_NO7 is identical to LEGO_HUB_NO6 in this regard. 2 | 3 | #include "../LEGO_HUB_NO6/bdev.c" 4 | -------------------------------------------------------------------------------- /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/frzstr/frzstr_pkg1/__init__.py: -------------------------------------------------------------------------------- 1 | # test frozen package with __init__.py 2 | print("frzstr_pkg1.__init__") 3 | x = 1 4 | -------------------------------------------------------------------------------- /ports/zephyr/thread.conf: -------------------------------------------------------------------------------- 1 | # CONFIG_DYNAMIC_THREAD=y 2 | CONFIG_THREAD_CUSTOM_DATA=y 3 | CONFIG_THREAD_MONITOR=y 4 | CONFIG_THREAD_STACK_INFO=y 5 | -------------------------------------------------------------------------------- /tests/basics/assign_expr_syntaxerror.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | SyntaxError 5 | SyntaxError 6 | [[0, 1], [0, 1]] 7 | -------------------------------------------------------------------------------- /tests/basics/builtin_hex_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin hex function 2 | 3 | print(hex(12345678901234567890)) 4 | print(hex(0x12345678901234567890)) 5 | -------------------------------------------------------------------------------- /tests/basics/builtin_oct_intbig.py: -------------------------------------------------------------------------------- 1 | # test builtin oct function 2 | 3 | print(oct(12345678901234567890)) 4 | print(oct(0o12345670123456701234)) 5 | -------------------------------------------------------------------------------- /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/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/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/extmod/asyncio_micropython.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | OverflowError 3 | task start 1 4 | task end 1 5 | 2 6 | task start 2 7 | timeout 8 | finish 9 | -------------------------------------------------------------------------------- /tests/extmod/cryptolib_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/tls_sslcontext_micropython.py.exp: -------------------------------------------------------------------------------- 1 | TypeError 2 | AttributeError on load 3 | AttributeError on store 4 | AttributeError on delete 5 | -------------------------------------------------------------------------------- /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/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/micropython/const_error.py.exp: -------------------------------------------------------------------------------- 1 | SyntaxError 2 | SyntaxError 3 | SyntaxError 4 | SyntaxError 5 | SyntaxError 6 | SyntaxError 7 | SyntaxError 8 | -------------------------------------------------------------------------------- /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/multi_bluetooth/perf_gatt_notify.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | gap_advertise 3 | gap_disconnect: True 4 | --- instance1 --- 5 | gap_connect 6 | -------------------------------------------------------------------------------- /tests/multi_net/sslcontext_server_client_ciphers.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'client to server' 3 | --- instance1 --- 4 | b'server to client' 5 | -------------------------------------------------------------------------------- /tests/multi_net/sslcontext_server_client_files.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'client to server' 3 | --- instance1 --- 4 | b'server to client' 5 | -------------------------------------------------------------------------------- /tests/ports/webassembly/fun_py_callback_js.mjs.exp: -------------------------------------------------------------------------------- 1 | f0 run 2 | f1 run 3 | f2 start 4 | f2 end 5 | f3 start 6 | f2 start 7 | f2 end 8 | f3 end 9 | -------------------------------------------------------------------------------- /tests/ports/webassembly/various.js.exp: -------------------------------------------------------------------------------- 1 | 2 | 13 3 | main { a: 1 } 4 | ======= 5 | ======= 6 | OK1 7 | OK2 8 | set_timeout_callback 9 | -------------------------------------------------------------------------------- /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_str_format.py: -------------------------------------------------------------------------------- 1 | # test handling of unicode chars in format strings 2 | 3 | print("α".format()) 4 | print("{α}".format(α=1)) 5 | -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/pyboard_usb_micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/pyboard/tutorial/img/pyboard_usb_micro.jpg -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd: -------------------------------------------------------------------------------- 1 | # Setting specific to d2wd 2 | CONFIG_ESPTOOLPY_FLASHMODE_DIO=y 3 | CONFIG_ESPTOOLPY_FLASHFREQ_40M=y 4 | -------------------------------------------------------------------------------- /ports/esp32/boards/pins_prefix.c: -------------------------------------------------------------------------------- 1 | #include "py/obj.h" 2 | #include "extmod/modmachine.h" 3 | #include "machine_pin.h" 4 | #include "genhdr/pins.h" 5 | -------------------------------------------------------------------------------- /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/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/s140_7.3.0.ld: -------------------------------------------------------------------------------- 1 | /* GNU linker script for s140 SoftDevice version 7.3.0 */ 2 | 3 | _sd_size = 0x00027000; 4 | _sd_ram = 0x0000e000; 5 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO/modules/board.py: -------------------------------------------------------------------------------- 1 | from machine import Pin 2 | 3 | led = Pin(25, Pin.OUT, value=0) 4 | key = Pin(23, Pin.IN, Pin.PULL_UP) 5 | -------------------------------------------------------------------------------- /ports/rp2/boards/WEACTSTUDIO_RP2350B_CORE/mpconfigvariant_RISCV.cmake: -------------------------------------------------------------------------------- 1 | # Set the RISC-V-based RP2350 platform 2 | set(PICO_PLATFORM "rp2350-riscv") 3 | -------------------------------------------------------------------------------- /ports/unix/variants/nanbox/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | # build interpreter with nan-boxing as object model (object repr D) 2 | 3 | MICROPY_FORCE_32BIT = 1 4 | -------------------------------------------------------------------------------- /ports/webassembly/variants/pyscript/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | JSFLAGS += -s ALLOW_MEMORY_GROWTH 2 | 3 | FROZEN_MANIFEST ?= variants/pyscript/manifest.py 4 | -------------------------------------------------------------------------------- /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_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/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/time_time_ns.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 | -------------------------------------------------------------------------------- /tests/feature_check/async_check.py: -------------------------------------------------------------------------------- 1 | # check if async/await keywords are supported 2 | async def foo(): 3 | await 1 4 | 5 | 6 | print("async") 7 | -------------------------------------------------------------------------------- /tests/frozen/README.md: -------------------------------------------------------------------------------- 1 | This is a .mpy built against the current .mpy version that can be used to test 2 | freezing without a dependency on mpy-cross. 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/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/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/multi_net/asyncio_tcp_readall.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | server running 3 | close 4 | done 5 | --- instance1 --- 6 | b'abc' 7 | b'' 8 | b'' 9 | -------------------------------------------------------------------------------- /tests/ports/cc3200/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 | -------------------------------------------------------------------------------- /tests/ports/rp2/rp2_lightsleep.py.exp: -------------------------------------------------------------------------------- 1 | abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv 2 | DONE 3 | -------------------------------------------------------------------------------- /tests/ports/webassembly/this_behaviour.mjs.exp: -------------------------------------------------------------------------------- 1 | func0 undefined 2 | func1 123 undefined 3 | func2 123 456 undefined 4 | func3 123 456 789 undefined 5 | -------------------------------------------------------------------------------- /tests/thread/thread_exc2.py.native.exp: -------------------------------------------------------------------------------- 1 | Unhandled exception in thread started by 2 | ValueError: 3 | done 4 | -------------------------------------------------------------------------------- /docs/esp8266/img/adafruit_products_pinoutstop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/esp8266/img/adafruit_products_pinoutstop.jpg -------------------------------------------------------------------------------- /extmod/libmetal/metal/system/micropython/sys.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct metal_state { 4 | struct metal_common_state common; 5 | }; 6 | -------------------------------------------------------------------------------- /ports/esp32/boards/OLIMEX_ESP32_EVB/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for Olimex ESP32 boards with Ethernet. 2 | They match the boards ESP32 EVB. 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/SOLDERED_NULA_MINI/pins.csv: -------------------------------------------------------------------------------- 1 | IO2,GPIO2 2 | IO3,GPIO3 3 | IO4,GPIO4 4 | IO5,GPIO5 5 | IO18,GPIO18 6 | IO19,GPIO19 7 | USER_BUTTON,GPIO9 8 | -------------------------------------------------------------------------------- /ports/samd/boards/SAMD_GENERIC_D51X19/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Generic SAMD51P19" 2 | #define MICROPY_HW_MCU_NAME "SAMD51P19A" 3 | -------------------------------------------------------------------------------- /ports/samd/boards/SAMD_GENERIC_D51X20/mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "Generic SAMD51P20" 2 | #define MICROPY_HW_MCU_NAME "SAMD51P20A" 3 | -------------------------------------------------------------------------------- /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/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/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/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/feature_check/int_big.py: -------------------------------------------------------------------------------- 1 | # Check whether arbitrary-precision integers (MPZ) are supported 2 | print(1000000000000000000000000000000000000000000000) 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/inlineasm/rv32/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/inlineasm/thumb/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/micropython/heapalloc_traceback.py.exp: -------------------------------------------------------------------------------- 1 | StopIteration 2 | Traceback (most recent call last): 3 | File , line 24, in test 4 | StopIteration: 5 | 6 | -------------------------------------------------------------------------------- /tests/micropython/native_gen.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 5 4 | [0, 1, 2] 5 | 1 6 | caught ValueError(42,) 7 | 3 8 | 1 9 | raising GeneratorExit 10 | None 11 | -------------------------------------------------------------------------------- /tests/micropython/opt_level_lineno.py.exp: -------------------------------------------------------------------------------- 1 | Traceback (most recent call last): 2 | File "", line 1, in f 3 | NameError: name 'xyz' isn't defined 4 | -------------------------------------------------------------------------------- /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/ports/webassembly/run_python_async_no_await.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 2 Promise { } 3 | py 1 4 | setTimeout resolved 5 | resolved value: 123 6 | py 2 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/ESPRUINO_PICO/deploy.md: -------------------------------------------------------------------------------- 1 | For programming an Espruino Pico see the "Advanced Reflashing" section of [this page](http://www.espruino.com/Pico). 2 | -------------------------------------------------------------------------------- /ports/stm32/boards/NUCLEO_H743ZI2/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | FROZEN_MANIFEST ?= boards/NUCLEO_H743ZI/manifest.py 2 | 3 | include boards/NUCLEO_H743ZI/mpconfigboard.mk 4 | -------------------------------------------------------------------------------- /ports/zephyr/boards/mimxrt1020_evk.overlay: -------------------------------------------------------------------------------- 1 | / { 2 | aliases { 3 | watchdog0 = &wdog0; 4 | }; 5 | }; 6 | 7 | &wdog0 { 8 | status = "okay"; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/basics/bytes_escape_unicode.py: -------------------------------------------------------------------------------- 1 | # Coverage test for unicode escape in a bytes literal. 2 | # CPython issues a SyntaxWarning for this. 3 | print(b"\u1234") 4 | -------------------------------------------------------------------------------- /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/fun_code_full.py.exp: -------------------------------------------------------------------------------- 1 | 2 | (None,) 3 | fun_code_full.py 4 | 5 | f 6 | True 7 | 0 8 | 0 9 | non-contiguous 10 | -------------------------------------------------------------------------------- /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_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/cmdline/repl_micropyinspect.py: -------------------------------------------------------------------------------- 1 | # cmdline: cmdline/repl_micropyinspect 2 | # setting MICROPYINSPECT environment variable before program exit triggers REPL 3 | -------------------------------------------------------------------------------- /tests/extmod/ssl_keycert.py.exp: -------------------------------------------------------------------------------- 1 | ValueError('invalid key',) 2 | TypeError("can't convert 'NoneType' object to str implicitly",) 3 | ValueError('invalid cert',) 4 | -------------------------------------------------------------------------------- /tests/extmod/vfs_posix_readonly.py.exp: -------------------------------------------------------------------------------- 1 | file: content 2 | file 2: content 3 | OSError(30,) 4 | OSError(30,) 5 | OSError(30,) 6 | OSError(30,) 7 | OSError(30,) 8 | -------------------------------------------------------------------------------- /tests/import/ext/micropython.py: -------------------------------------------------------------------------------- 1 | # micropython is always builtin and cannot be overridden by the filesystem. 2 | print("ERROR: micropython from filesystem") 3 | -------------------------------------------------------------------------------- /tests/import/ext/usys.py: -------------------------------------------------------------------------------- 1 | # usys (and any u-prefix) is always builtin and cannot be overridden by the 2 | # filesystem. 3 | print("ERROR: usys from filesystem") 4 | -------------------------------------------------------------------------------- /tests/inlineasm/thumb/asmerrors.py: -------------------------------------------------------------------------------- 1 | try: 2 | exec("@micropython.asm_thumb\ndef l():\n a = di(a2, a2, -1)") 3 | except SyntaxError as e: 4 | print(e) 5 | -------------------------------------------------------------------------------- /tests/micropython/test_normalize_newlines.py.exp: -------------------------------------------------------------------------------- 1 | Testing newline handling 2 | Line 1 3 | Line 2 4 | Line 3 5 | Line 4 6 | Line 5 7 | Line 6 8 | 'test\rstring' 9 | -------------------------------------------------------------------------------- /tests/micropython/viper_misc3.py.exp: -------------------------------------------------------------------------------- 1 | 49994955 2 | 1 1 3 | 1 3 4 | (0, 1, False, True) 5 | (1, 3) 6 | [1, 3] 7 | [1, 3] 8 | OSError(1,) 9 | 1 10 | 1 11 | -------------------------------------------------------------------------------- /tests/ports/cc3200/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/stress/qstr_limit_str_modulo.py.exp: -------------------------------------------------------------------------------- 1 | 254 2 | 255 3 | RuntimeError name too long 256 4 | RuntimeError name too long 257 5 | RuntimeError name too long 258 6 | -------------------------------------------------------------------------------- /ports/esp32/boards/M5STACK_NANOC6/pins.csv: -------------------------------------------------------------------------------- 1 | G1,GPIO1 2 | G2,GPIO2 3 | IR_LED,GPIO3 4 | LED_BLUE,GPIO7 5 | BUTTON,GPIO9 6 | NEOPIXEL_POWER,GPIO19 7 | NEOPIXEL,GPIO20 8 | -------------------------------------------------------------------------------- /ports/esp32/boards/OLIMEX_ESP32_EVB/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ETH_PHY_INTERFACE_RMII=y 2 | CONFIG_ETH_RMII_CLK_OUT_GPIO=0 3 | CONFIG_LWIP_LOCAL_HOSTNAME="ESP32_EVB" 4 | -------------------------------------------------------------------------------- /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/rp2/boards/MACHDYNE_WERKZEUG/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Machdyne Werkzeug 2 | set(PICO_BOARD "machdyne_werkzeug") 3 | set(PICO_PLATFORM "rp2040") 4 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO2_W/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | 5 | # Bluetooth 6 | require("aioble") 7 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO_W/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | 5 | # Bluetooth 6 | require("aioble") 7 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzmpy/frzmpy_pkg2/mod.py: -------------------------------------------------------------------------------- 1 | # test frozen package without __init__.py 2 | print("frzmpy_pkg2.mod") 3 | 4 | 5 | class Foo: 6 | x = 1 7 | -------------------------------------------------------------------------------- /ports/unix/variants/coverage/frzstr/frzstr_pkg2/mod.py: -------------------------------------------------------------------------------- 1 | # test frozen package without __init__.py 2 | print("frzstr_pkg2.mod") 3 | 4 | 5 | class Foo: 6 | x = 1 7 | -------------------------------------------------------------------------------- /ports/unix/variants/standard/mpconfigvariant.mk: -------------------------------------------------------------------------------- 1 | # This is the default variant when you `make` the Unix port. 2 | 3 | FROZEN_MANIFEST ?= $(VARIANT_DIR)/manifest.py 4 | -------------------------------------------------------------------------------- /ports/zephyr/boards/mimxrt1020_evk/mpconfigport.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES) 2 | 3 | #include "../mpconfigport.h" 4 | -------------------------------------------------------------------------------- /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/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/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/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/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/stress/bytecode_limit.py.exp: -------------------------------------------------------------------------------- 1 | cond false 2 | cond false 3 | ["RuntimeError('bytecode overflow',)", "RuntimeError('bytecode overflow',)", 'ok', 'ok'] 4 | [123] 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_RGBTOUCH_MINI/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | # freeze("modules") - to re-enable at a later stage when there are modules 3 | -------------------------------------------------------------------------------- /ports/mimxrt/boards/manifest.py: -------------------------------------------------------------------------------- 1 | freeze("$(PORT_DIR)/modules") 2 | include("$(MPY_DIR)/extmod/asyncio") 3 | require("onewire") 4 | require("ds18x20") 5 | require("dht") 6 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_QTPY_SAMD21/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/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/SAMD_GENERIC_D21X18/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD21 2 | CMSIS_MCU = SAMD21J18A 3 | LD_FILES = boards/samd21x18a.ld sections.ld 4 | TEXT0 = 0x2000 5 | -------------------------------------------------------------------------------- /ports/samd/boards/SEEED_XIAO_SAMD21/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD21 2 | CMSIS_MCU = SAMD21G18A 3 | LD_FILES = boards/samd21x18a.ld sections.ld 4 | TEXT0 = 0x2000 5 | -------------------------------------------------------------------------------- /ports/stm32/boards/PYBD_SF2/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | include("$(PORT_DIR)/boards/manifest_pyboard.py") 3 | require("bundle-networking") 4 | -------------------------------------------------------------------------------- /tests/extmod/machine_i2s_rate.py.exp: -------------------------------------------------------------------------------- 1 | TX 16 1 True 2 | TX 16 2 True 3 | TX 32 1 True 4 | TX 32 2 True 5 | RX 16 1 True 6 | RX 16 2 True 7 | RX 32 1 True 8 | RX 32 2 True 9 | -------------------------------------------------------------------------------- /tests/import/import_file.py: -------------------------------------------------------------------------------- 1 | if "__file__" not in globals(): 2 | print("SKIP") 3 | raise SystemExit 4 | 5 | import import1b 6 | 7 | print(import1b.__file__) 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/ports/rp2/rp2_uart.py.exp: -------------------------------------------------------------------------------- 1 | UART(0, baudrate=115200, bits=8, parity=None, stop=1, tx=0, rx=1, txbuf=256, rxbuf=256, timeout=0, timeout_char=1, invert=None, irq=0) 2 | -------------------------------------------------------------------------------- /tests/unicode/file_invalid.py: -------------------------------------------------------------------------------- 1 | try: 2 | f = open("data/utf-8_invalid.txt", encoding="utf-8") 3 | f.read() 4 | except UnicodeError: 5 | print("UnicodeError") 6 | -------------------------------------------------------------------------------- /ports/qemu/test-frzmpy/frozen_viper.py: -------------------------------------------------------------------------------- 1 | # Test freezing viper code. 2 | 3 | import micropython 4 | 5 | 6 | @micropython.viper 7 | def viper_add(x, y): 8 | print(x + y) 9 | -------------------------------------------------------------------------------- /ports/samd/boards/ADAFRUIT_NEOKEY_TRINKEY/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD21 2 | CMSIS_MCU = SAMD21E18A 3 | LD_FILES = boards/samd21x18a.ld sections.ld 4 | TEXT0 = 0x2000 5 | -------------------------------------------------------------------------------- /ports/zephyr/boards/mimxrt1020_evk/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(MPY_DIR)/extmod/asyncio") 2 | 3 | freeze("$(PORT_DIR)/modules") 4 | 5 | require("upysh") 6 | require("aiorepl") 7 | -------------------------------------------------------------------------------- /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/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/feature_check/native_check.py: -------------------------------------------------------------------------------- 1 | # this test for the availability of native emitter 2 | @micropython.native 3 | def f(): 4 | pass 5 | 6 | 7 | f() 8 | print("native") 9 | -------------------------------------------------------------------------------- /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/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/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_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/misc/cexample_class.py.exp: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | AdvancedTimer() 5 | AdvancedTimer() # created 0 seconds ago 6 | 0 7 | 123 8 | True 9 | TypeError 10 | -------------------------------------------------------------------------------- /tests/ports/qemu/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/ports/webassembly/py_proxy_to_js.mjs.exp: -------------------------------------------------------------------------------- 1 | false 1 2 | true [ 1, 2, 3 ] 3 | true [ null, true, 1.2 ] 4 | true { tuple: [ 1, 2, 3 ], one: 1, list: [ null, true, 1.2 ] } 5 | -------------------------------------------------------------------------------- /docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-hh/micropython/HEAD/docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | set(IDF_TARGET esp32p4) 2 | 3 | set(SDKCONFIG_DEFAULTS 4 | boards/sdkconfig.base 5 | boards/sdkconfig.p4 6 | ) 7 | -------------------------------------------------------------------------------- /ports/esp32/boards/LILYGO_TTGO_LORA32/board.md: -------------------------------------------------------------------------------- 1 | The following files are daily firmware for the LILYGO TTGO LoRa32. 2 | 3 | Support for hardware versions v1.0, v1.2, v1.6 and v2.0. 4 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_THINGPLUS_RP2350/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | 5 | # Bluetooth 6 | require("aioble") 7 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_XRP_CONTROLLER/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | 5 | # Bluetooth 6 | require("aioble") 7 | -------------------------------------------------------------------------------- /ports/samd/boards/SPARKFUN_SAMD21_DEV_BREAKOUT/mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = SAMD21 2 | CMSIS_MCU = SAMD21G18A 3 | LD_FILES = boards/samd21x18a.ld sections.ld 4 | TEXT0 = 0x2000 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/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/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/extmod/select_ipoll.py.exp: -------------------------------------------------------------------------------- 1 | [(, 4)] 2 | [(, 4)] 3 | [] 4 | [(, 4), (, 4)] 5 | [(, 4)] 6 | [] 7 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmdivmul.py.exp: -------------------------------------------------------------------------------- 1 | 411 2 | -411 3 | -411 4 | 411 5 | 411 6 | 2 7 | 1 8 | 1 9 | -1 10 | 1 11 | -1 12 | 1 13 | 1 14 | 0 15 | -2 16 | 0 17 | -17 18 | -1 19 | -------------------------------------------------------------------------------- /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/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/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/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/multi_espnow/10_simple_data.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | b'client to server' 3 | b'server to client' 4 | --- instance1 --- 5 | b'client to server' 6 | b'server to client' 7 | -------------------------------------------------------------------------------- /tests/multi_net/sslcontext_check_hostname_error.py.exp: -------------------------------------------------------------------------------- 1 | --- instance0 --- 2 | (-29312, 'MBEDTLS_ERR_SSL_CONN_EOF') 3 | --- instance1 --- 4 | CERT_REQUIRED requires server_hostname 5 | -------------------------------------------------------------------------------- /tests/ports/esp32/esp32_idf_heap_info.py.exp: -------------------------------------------------------------------------------- 1 | HEAP_DATA >=MIN: True 2 | HEAP_DATA [True, True, True, True] 3 | HEAP_EXEC >=MIN: True 4 | HEAP_EXEC [True, True, True, True] 5 | [] 6 | -------------------------------------------------------------------------------- /tests/ports/webassembly/js_proxy_attribute.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 2 | 1 2 3 | undefined 4 | creating attribute c 5 | c 6 | c 7 | creating attribute d 8 | True 9 | d 10 | -------------------------------------------------------------------------------- /tests/ports/webassembly/register_js_module.js.exp: -------------------------------------------------------------------------------- 1 | 2 | 2 3 | ==== 4 | True 5 | 2 6 | 7 | True 8 | ==== 9 | True 10 | 3 11 | 12 | True 13 | -------------------------------------------------------------------------------- /tests/target_wiring/nrf.py: -------------------------------------------------------------------------------- 1 | # Target wiring for general nrf board. 2 | # 3 | # Connect: 4 | # - UART0 TX and RX 5 | 6 | uart_loopback_args = (0,) 7 | uart_loopback_kwargs = {} 8 | -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC_S2/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | set(IDF_TARGET esp32s2) 2 | 3 | set(SDKCONFIG_DEFAULTS 4 | boards/sdkconfig.base 5 | boards/sdkconfig.spiram_sx 6 | ) 7 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYC6/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | CONFIG_ESPTOOLPY_AFTER_NORESET=y 4 | 5 | CONFIG_SPIRAM_MEMTEST= 6 | -------------------------------------------------------------------------------- /ports/esp8266/boards/manifest.py: -------------------------------------------------------------------------------- 1 | freeze("$(PORT_DIR)/modules") 2 | require("bundle-networking") 3 | require("dht") 4 | require("ds18x20") 5 | require("neopixel") 6 | require("onewire") 7 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_XRP_CONTROLLER_BETA/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | 5 | # Bluetooth 6 | require("aioble") 7 | -------------------------------------------------------------------------------- /ports/samd/mcu/samd21/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | include("$(MPY_DIR)/extmod/asyncio") 3 | require("onewire") 4 | require("ds18x20") 5 | require("dht") 6 | -------------------------------------------------------------------------------- /ports/samd/mcu/samd51/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | include("$(MPY_DIR)/extmod/asyncio") 3 | require("onewire") 4 | require("ds18x20") 5 | require("dht") 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 | -------------------------------------------------------------------------------- /tests/basics/bytearray_count.py: -------------------------------------------------------------------------------- 1 | try: 2 | bytearray.count 3 | except AttributeError: 4 | print("SKIP") 5 | raise SystemExit 6 | 7 | print(bytearray(b"aaaa").count(b"a")) 8 | -------------------------------------------------------------------------------- /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/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/module2.py: -------------------------------------------------------------------------------- 1 | # MicroPython 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/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/feature_check/inlineasm_thumb.py: -------------------------------------------------------------------------------- 1 | # check if Thumb inline asm is supported 2 | 3 | 4 | @micropython.asm_thumb 5 | def f(): 6 | nop() 7 | 8 | 9 | print("thumb") 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/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/multi_net/asyncio_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_OMGS3/pins.csv: -------------------------------------------------------------------------------- 1 | I2C_SCL,GPIO9 2 | I2C_SDA,GPIO8 3 | FG_INT,GPIO21 4 | RGB_DATA,GPIO35 5 | RGB_PWR,GPIO34 6 | UART0_TX,GPIO43 7 | UART0_RX,GPIO44 8 | VBUS_SENSE,GPIO33 9 | -------------------------------------------------------------------------------- /ports/esp32/boards/sdkconfig.riscv: -------------------------------------------------------------------------------- 1 | # ESP RISC-V binary sizes are generally larger than Xtensa ones, 2 | # so switch to size optimization by default 3 | CONFIG_COMPILER_OPTIMIZATION_SIZE=y 4 | -------------------------------------------------------------------------------- /ports/rp2/boards/RPI_PICO2/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for Raspberry Pi Pico2 2 | set(PICO_BOARD "pico2") 3 | 4 | # To change the gpio count for QFN-80 5 | # set(PICO_NUM_GPIOS 48) 6 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_PROMICRO_RP2350/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | # cmake file for SparkFun Pro Micro RP2350 2 | 3 | set(PICO_BOARD "sparkfun_promicro_rp2350") 4 | set(PICO_PLATFORM "rp2350") 5 | -------------------------------------------------------------------------------- /ports/rp2/boards/manifest.py: -------------------------------------------------------------------------------- 1 | freeze("$(PORT_DIR)/modules") 2 | include("$(MPY_DIR)/extmod/asyncio") 3 | require("onewire") 4 | require("ds18x20") 5 | require("dht") 6 | require("neopixel") 7 | -------------------------------------------------------------------------------- /ports/stm32/boards/LEGO_HUB_NO7/bluetooth_init_cc2564C_1.5.c: -------------------------------------------------------------------------------- 1 | // LEGO_HUB_NO7 is identical to LEGO_HUB_NO6 in this regard. 2 | 3 | #include "../LEGO_HUB_NO6/bluetooth_init_cc2564C_1.5.c" 4 | -------------------------------------------------------------------------------- /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/zephyr/boards/nrf9151dk_nrf9151.conf: -------------------------------------------------------------------------------- 1 | # Enable external flash 2 | CONFIG_SPI=y 3 | CONFIG_SPI_NOR=y 4 | CONFIG_SPI_NOR_SFDP_DEVICETREE=y 5 | 6 | CONFIG_FLASH=y 7 | CONFIG_FLASH_MAP=y 8 | -------------------------------------------------------------------------------- /shared/README.md: -------------------------------------------------------------------------------- 1 | This directory contains libraries, utilities and helper code developed 2 | specifically for this project. The code is intended to be portable and 3 | usable by any port. 4 | -------------------------------------------------------------------------------- /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/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/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/feature_check/inlineasm_xtensa.py: -------------------------------------------------------------------------------- 1 | # check if Xtensa inline asm is supported 2 | 3 | 4 | @micropython.asm_xtensa 5 | def f(): 6 | ret_n() 7 | 8 | 9 | print("xtensa") 10 | -------------------------------------------------------------------------------- /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/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/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/ports/webassembly/jsffi_to_js.mjs.exp: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | 4 | false 5 | 1 6 | true 7 | [ 2 ] 8 | [ '0', 'length' ] 9 | false 10 | { three: 3 } 11 | [ 'three' ] 12 | -------------------------------------------------------------------------------- /tests/ports/webassembly/py_proxy_dict_undefined.mjs.exp: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | null 4 | OK 5 | [Function: value] 6 | ==== 7 | OK 8 | OK 9 | null 10 | OK 11 | [Function: obj] { _ref: 7 } 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ports/alif/modules/he/_boot.py: -------------------------------------------------------------------------------- 1 | # Change working directory to ROMFS, so boot.py and main.py can run from there. 2 | try: 3 | import os 4 | 5 | os.chdir("/rom") 6 | except: 7 | pass 8 | -------------------------------------------------------------------------------- /ports/cc3200/boards/WIPY/deploy.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for the WiPy. The zip file contains mcuimg.bin 2 | which should be copied via ftp to the /flash/sys directory on the WiPy. 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/ESP32_GENERIC_C3/sdkconfig.c3usb: -------------------------------------------------------------------------------- 1 | CONFIG_ESP32C3_REV_MIN_3=y 2 | 3 | # Workaround for https://github.com/espressif/esp-idf/issues/14456 4 | CONFIG_ESP_SYSTEM_HW_STACK_GUARD=n 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/LOLIN_C3_MINI/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESP32C3_REV_MIN_3=y 2 | 3 | # Workaround for https://github.com/espressif/esp-idf/issues/14456 4 | CONFIG_ESP_SYSTEM_HW_STACK_GUARD=n 5 | -------------------------------------------------------------------------------- /ports/esp32/boards/LOLIN_S2_MINI/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | # LWIP 4 | CONFIG_LWIP_LOCAL_HOSTNAME="LOLIN_S2_MINI" 5 | # end of LWIP 6 | -------------------------------------------------------------------------------- /ports/esp32/boards/LOLIN_S2_PICO/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | # LWIP 4 | CONFIG_LWIP_LOCAL_HOSTNAME="LOLIN_S2_PICO" 5 | # end of LWIP 6 | -------------------------------------------------------------------------------- /ports/esp32/boards/OLIMEX_ESP32_EVB/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | set(SDKCONFIG_DEFAULTS 2 | boards/sdkconfig.base 3 | boards/sdkconfig.ble 4 | boards/OLIMEX_ESP32_EVB/sdkconfig.board 5 | ) 6 | -------------------------------------------------------------------------------- /ports/esp32/boards/OLIMEX_ESP32_POE/board.md: -------------------------------------------------------------------------------- 1 | The following files are firmware for Olimex ESP32 boards with Ethernet. 2 | They match the boards ESP32 ETH-PoE, ESP32 ETH-PoE-ISO and ESP32 Gateway. 3 | -------------------------------------------------------------------------------- /ports/esp32/boards/OLIMEX_ESP32_POE/mpconfigboard.cmake: -------------------------------------------------------------------------------- 1 | set(SDKCONFIG_DEFAULTS 2 | boards/sdkconfig.base 3 | boards/sdkconfig.ble 4 | boards/OLIMEX_ESP32_POE/sdkconfig.board 5 | ) 6 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_FEATHERS2/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | module("dotstar.py", base_path="$(PORT_DIR)/boards/UM_TINYPICO/modules", opt=3) 3 | freeze("modules") 4 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_NANOS3/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | 4 | CONFIG_SPIRAM_MEMTEST= 5 | 6 | CONFIG_LWIP_LOCAL_HOSTNAME="UMNanoS3" 7 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_PROS3/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | 4 | CONFIG_SPIRAM_MEMTEST= 5 | 6 | CONFIG_LWIP_LOCAL_HOSTNAME="UMProS3" 7 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYS2/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | 4 | # LWIP 5 | CONFIG_LWIP_LOCAL_HOSTNAME="UMTinyS2" 6 | # end of LWIP 7 | -------------------------------------------------------------------------------- /ports/esp32/boards/UM_TINYS3/sdkconfig.board: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 2 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 3 | 4 | CONFIG_SPIRAM_MEMTEST= 5 | 6 | CONFIG_LWIP_LOCAL_HOSTNAME="UMTinyS3" 7 | -------------------------------------------------------------------------------- /ports/rp2/boards/SPARKFUN_IOTREDBOARD_RP2350/manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | 3 | require("bundle-networking") 4 | 5 | require("aioble") 6 | 7 | require("sdcard") 8 | -------------------------------------------------------------------------------- /ports/stm32/boards/LEGO_HUB_NO6/hub_display.h: -------------------------------------------------------------------------------- 1 | void hub_display_on(void); 2 | void hub_display_off(void); 3 | void hub_display_update(void); 4 | void hub_display_set(uint8_t led, uint16_t value); 5 | -------------------------------------------------------------------------------- /ports/stm32/boards/LEGO_HUB_NO7/hub_display.h: -------------------------------------------------------------------------------- 1 | void hub_display_on(void); 2 | void hub_display_off(void); 3 | void hub_display_update(void); 4 | void hub_display_set(uint8_t led, uint16_t value); 5 | -------------------------------------------------------------------------------- /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/special_methods_intbig.py: -------------------------------------------------------------------------------- 1 | # Test class special methods, that use a bigint. 2 | 3 | class A: 4 | def __int__(self): 5 | return 1 << 100 6 | 7 | 8 | print(int(A())) 9 | -------------------------------------------------------------------------------- /tests/extmod/ssl_basic.py.exp: -------------------------------------------------------------------------------- 1 | OSError: client 2 | 3 | TestSocket.setblocking(False) 4 | TestSocket.setblocking(True) 5 | TestSocket.ioctl 4 0 6 | OSError: read 7 | OSError: write 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/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/feature_check/inlineasm_rv32.py: -------------------------------------------------------------------------------- 1 | # check if RISC-V 32 inline asm is supported 2 | 3 | 4 | @micropython.asm_rv32 5 | def f(): 6 | add(a0, a0, a0) 7 | 8 | 9 | print("rv32") 10 | -------------------------------------------------------------------------------- /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/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/inlineasm/rv32/asmdata.py.exp: -------------------------------------------------------------------------------- 1 | 0x12345678 2 | 0x20000000 3 | 0x40000000 4 | 0x80000000 5 | 0xfffffffe 6 | 0x12345678 7 | 0x20000000 8 | 0x40000000 9 | 0x80000000 10 | 0xfffffffe 11 | -------------------------------------------------------------------------------- /tests/inlineasm/rv32/asmshift.py.exp: -------------------------------------------------------------------------------- 1 | 0x246 2 | 0x800000 3 | 0x91 4 | 0x1 5 | 0x91 6 | -0x1 7 | 0x246 8 | 0x800000 9 | 0x91 10 | 0x1 11 | 0x91 12 | -0x1 13 | 0x246 14 | 0x91 15 | 0x91 16 | -------------------------------------------------------------------------------- /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/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 | --------------------------------------------------------------------------------