├── scripts ├── Kconfig ├── dtc │ ├── tests │ │ ├── include5.dts │ │ ├── deps_inc2.dtsi │ │ ├── include6.dts │ │ ├── include8.dts │ │ ├── include3.dts │ │ ├── deps_inc1.dtsi │ │ ├── empty.dts │ │ ├── include0.dts │ │ ├── include4.dts │ │ ├── include5a.dts │ │ ├── base01.cmd │ │ ├── search_dir │ │ │ ├── search_test2.dtsi │ │ │ └── search_test.dtsi │ │ ├── search_dir_b │ │ │ ├── search_test_c.dtsi │ │ │ ├── search_test_b.dtsi │ │ │ ├── search_test_b2.dtsi │ │ │ └── search_paths_subdir.dts │ │ ├── include2.dts │ │ ├── incbin.bin │ │ ├── test_tree1.dts │ │ ├── dup-propname.dts │ │ ├── dependencies.cmp │ │ ├── dependencies.dts │ │ ├── dup-nodename.dts │ │ ├── reuse-label4.dts │ │ ├── search_paths.dts │ │ ├── search_paths_b.dts │ │ ├── default-addr-size.dts │ │ ├── zero-phandle.dts │ │ ├── bad-name-property.dts │ │ ├── char_literal.dts │ │ ├── reuse-label5.dts │ │ ├── reuse-label6.dts │ │ ├── minusone-phandle.dts │ │ ├── propname_escapes.dts │ │ ├── reuse-label2.dts │ │ ├── prop-after-subnode.dts │ │ ├── data.S │ │ ├── nonexist-label-ref.dts │ │ ├── incbin.dts │ │ ├── bad-string-props.dts │ │ ├── nonexist-node-ref.dts │ │ ├── bad-ncells.dts │ │ ├── delete_reinstate_multilabel_ref.dts │ │ ├── open_pack.supp │ │ ├── reuse-label3.dts │ │ ├── dup-phandle.dts │ │ ├── reuse-label1.dts │ │ ├── mangle-layout.supp │ │ ├── reg-ranges-root.dts │ │ ├── escapes.dts │ │ ├── nonexist-node-ref2.dts │ │ ├── label_repeated.dts │ │ ├── bad-empty-ranges.dts │ │ ├── comments-cmp.dts │ │ ├── bad-reg-ranges.dts │ │ ├── include7.dts │ │ ├── test01.stderr │ │ ├── reuse-label.dts │ │ ├── appendprop.dts │ │ ├── obsolete-chosen-interrupt-controller.dts │ │ ├── value-labels.dts │ │ ├── base01.stderr │ │ ├── boot-cpuid.dts │ │ ├── path-references.dts │ │ ├── dtc-fatal.sh │ │ ├── extra-terminating-null.dts │ │ └── aliases.dts │ ├── libfdt │ │ └── TODO │ ├── .gitignore │ ├── TODO │ └── Makefile.convert-dtsv0 ├── mkimage │ ├── crc32.h │ ├── fit_timestamp.c │ └── Makefile ├── kconfig-win32 │ ├── libintl3.dll │ ├── regex2.dll │ ├── libiconv2.dll │ └── kconfig-mconf.exe └── kconfig-linux64 │ ├── kconfig-conf │ └── kconfig-mconf ├── doc ├── datastructures.tex ├── api.tex ├── Makefile └── subsystems │ └── handlemanager.tex ├── .dbuild ├── defines.mk ├── .gitignore ├── relpath.py ├── scripts │ └── mkconfig │ │ └── mkconfig.exe ├── pretty │ ├── rl.py │ ├── test.py │ ├── prettydefault.py │ ├── prettychmod.py │ └── prettymd.py ├── module.mk └── makedeps.sh ├── arch └── arm │ ├── mach │ ├── bcm2835 │ │ └── .config.mk │ ├── stm32 │ │ ├── timer.c │ │ ├── timer.h │ │ └── .config.mk │ ├── zynq │ │ ├── tools │ │ │ └── .gitignore │ │ ├── timer.h │ │ └── .config.mk │ └── raspberrypi │ │ └── raspberrypi.c │ ├── common │ ├── Kconfig │ └── gt.h │ └── include │ ├── bt_arch_config.h │ ├── mach │ └── bt_machine_types.h │ └── arch │ └── syscall.h ├── os ├── src │ ├── shell │ │ ├── jimtcl │ │ │ ├── tests │ │ │ │ ├── break.tcl │ │ │ │ ├── testio.in │ │ │ │ ├── return-break.tcl │ │ │ │ ├── exitpackage.tcl │ │ │ │ ├── dummy.tcl │ │ │ │ └── Makefile │ │ │ ├── BUGS │ │ │ ├── configure.ac │ │ │ ├── jim-config.h.in │ │ │ ├── autosetup │ │ │ │ └── README.autosetup │ │ │ ├── configure │ │ │ ├── bootstrap.tcl │ │ │ ├── jim-config.h │ │ │ ├── examples.ext │ │ │ │ └── README │ │ │ ├── examples.api │ │ │ │ ├── print.tcl │ │ │ │ └── Makefile │ │ │ ├── examples │ │ │ │ ├── tcp.client │ │ │ │ └── pipe.tcl │ │ │ ├── .project │ │ │ ├── .gitignore │ │ │ └── sqlite3 │ │ │ │ └── build-ext │ │ └── micropython │ │ │ ├── tests │ │ │ ├── io │ │ │ │ ├── data │ │ │ │ │ ├── file2 │ │ │ │ │ └── file1 │ │ │ │ ├── argv.py │ │ │ │ ├── file_iter.py │ │ │ │ ├── file_long_read.py │ │ │ │ ├── file_stdio.py │ │ │ │ ├── file1.py │ │ │ │ └── file_readinto.py │ │ │ ├── import │ │ │ │ ├── pkg │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── mod.py │ │ │ │ ├── pkg2 │ │ │ │ │ ├── mod2.py │ │ │ │ │ ├── mod1.py │ │ │ │ │ └── __init__.py │ │ │ │ ├── gen_context2.py │ │ │ │ ├── import1a.py │ │ │ │ ├── import2a.py │ │ │ │ ├── import3a.py │ │ │ │ ├── pkg3 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── subpkg1 │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── mod1.py │ │ │ │ │ ├── mod1.py │ │ │ │ │ └── mod2.py │ │ │ │ ├── import_file.py │ │ │ │ ├── import1b.py │ │ │ │ ├── import_pkg3.py │ │ │ │ ├── import_pkg4.py │ │ │ │ ├── import_pkg5.py │ │ │ │ ├── gen_context.py │ │ │ │ ├── import_pkg1.py │ │ │ │ └── try_module.py │ │ │ ├── pyb │ │ │ │ ├── dac.py.exp │ │ │ │ ├── switch.py.exp │ │ │ │ ├── accel.py.exp │ │ │ │ ├── extint.py.exp │ │ │ │ ├── adc.py.exp │ │ │ │ ├── irq.py.exp │ │ │ │ ├── i2c.py.exp │ │ │ │ ├── led.py.exp │ │ │ │ ├── timer.py.exp │ │ │ │ ├── can.py.exp │ │ │ │ ├── servo.py.exp │ │ │ │ ├── pyb1.py.exp │ │ │ │ ├── switch.py │ │ │ │ ├── uart.py.exp │ │ │ │ ├── accel.py │ │ │ │ ├── spi.py.exp │ │ │ │ ├── adc.py │ │ │ │ ├── can.py │ │ │ │ ├── extint.py │ │ │ │ ├── dac.py │ │ │ │ ├── pin.py.exp │ │ │ │ ├── uart.py │ │ │ │ └── servo.py │ │ │ ├── micropython │ │ │ │ ├── native_check.py.exp │ │ │ │ ├── const.py.exp │ │ │ │ ├── native_misc.py.exp │ │ │ │ ├── viper_cond.py.exp │ │ │ │ ├── viper_ptr16_load.py.exp │ │ │ │ ├── viper_ptr8_load.py.exp │ │ │ │ ├── viper_ptr16_store.py.exp │ │ │ │ ├── native_check.py │ │ │ │ ├── viper_binop_multi_comp.py.exp │ │ │ │ ├── viper_ptr8_store.py.exp │ │ │ │ ├── viper_misc.py.exp │ │ │ │ ├── const.py │ │ │ │ ├── viper_binop_comp.py.exp │ │ │ │ ├── native_misc.py │ │ │ │ ├── viper_cond.py │ │ │ │ └── viper_binop_arith.py.exp │ │ │ ├── pyboard.py │ │ │ ├── extmod │ │ │ │ ├── uctypes_sizeof_native.py.exp │ │ │ │ ├── uctypes_ptr_le.py.exp │ │ │ │ ├── uctypes_ptr_native_le.py.exp │ │ │ │ ├── uctypes_le.py.exp │ │ │ │ └── uctypes_native_le.py.exp │ │ │ ├── unicode │ │ │ │ ├── data │ │ │ │ │ ├── utf-8_1.txt │ │ │ │ │ └── utf-8_2.txt │ │ │ │ ├── unicode_iter.py │ │ │ │ ├── file1.py │ │ │ │ ├── unicode_index.py │ │ │ │ ├── unicode_pos.py │ │ │ │ └── file2.py │ │ │ ├── bytecode │ │ │ │ ├── mp-tests │ │ │ │ │ ├── call1.py │ │ │ │ │ ├── ifexpr1.py │ │ │ │ │ ├── import2.py │ │ │ │ │ ├── lambda2.py │ │ │ │ │ ├── listcomp2.py │ │ │ │ │ ├── assert1.py │ │ │ │ │ ├── class1.py │ │ │ │ │ ├── fun1.py │ │ │ │ │ ├── closure1.py │ │ │ │ │ ├── slice2.py │ │ │ │ │ ├── lambda1.py │ │ │ │ │ ├── dict1.py │ │ │ │ │ ├── class2.py │ │ │ │ │ ├── setcomp1.py │ │ │ │ │ ├── dictcomp1.py │ │ │ │ │ ├── docstring2.py │ │ │ │ │ ├── import4.py │ │ │ │ │ ├── import1.py │ │ │ │ │ ├── tuple3.py │ │ │ │ │ ├── augassign1.py │ │ │ │ │ ├── try2.py │ │ │ │ │ ├── listcomp1.py │ │ │ │ │ ├── listcomp3.py │ │ │ │ │ ├── fun3.py │ │ │ │ │ ├── if3.py │ │ │ │ │ ├── scope1.py │ │ │ │ │ ├── set1.py │ │ │ │ │ ├── scope0.py │ │ │ │ │ ├── try5.py │ │ │ │ │ ├── docstring1.py │ │ │ │ │ ├── class6.py │ │ │ │ │ ├── if4.py │ │ │ │ │ ├── import5.py │ │ │ │ │ ├── list2.py │ │ │ │ │ ├── listcomp4.py │ │ │ │ │ ├── class5.py │ │ │ │ │ ├── compare1.py │ │ │ │ │ ├── with1.py │ │ │ │ │ ├── class7.py │ │ │ │ │ ├── scope6.py │ │ │ │ │ ├── yield2.py │ │ │ │ │ ├── closure2.py │ │ │ │ │ ├── const1.py │ │ │ │ │ ├── list1.py │ │ │ │ │ ├── import3.py │ │ │ │ │ ├── del2.py │ │ │ │ │ ├── string1.py │ │ │ │ │ ├── raise1.py │ │ │ │ │ ├── try6.py │ │ │ │ │ ├── assign1.py │ │ │ │ │ ├── class3.py │ │ │ │ │ ├── class4.py │ │ │ │ │ ├── scope4.py │ │ │ │ │ ├── fun4.py │ │ │ │ │ ├── scope3.py │ │ │ │ │ ├── scope5.py │ │ │ │ │ ├── try3.py │ │ │ │ │ ├── string2.py │ │ │ │ │ ├── decorate1.py │ │ │ │ │ ├── slice1.py │ │ │ │ │ ├── try1.py │ │ │ │ │ ├── closure3.py │ │ │ │ │ ├── tuple2.py │ │ │ │ │ ├── super1.py │ │ │ │ │ ├── tuple1.py │ │ │ │ │ ├── try4.py │ │ │ │ │ ├── closure4.py │ │ │ │ │ ├── del1.py │ │ │ │ │ ├── if1.py │ │ │ │ │ ├── scope2.py │ │ │ │ │ ├── yield1.py │ │ │ │ │ ├── scope7.py │ │ │ │ │ ├── assign2.py │ │ │ │ │ └── listcomp5.py │ │ │ │ ├── .gitignore │ │ │ │ └── pylib-tests │ │ │ │ │ └── struct.py │ │ │ ├── unix │ │ │ │ └── ffi_float.py.exp │ │ │ ├── basics │ │ │ │ ├── class_emptybases.py │ │ │ │ ├── set_union.py │ │ │ │ ├── memoryerror.py.exp │ │ │ │ ├── zip.py │ │ │ │ ├── fun1.py │ │ │ │ ├── set_add.py │ │ │ │ ├── set_clear.py │ │ │ │ ├── set_discard.py │ │ │ │ ├── lambda1.py │ │ │ │ ├── set_iter.py │ │ │ │ ├── generator2.py │ │ │ │ ├── list_clear.py │ │ │ │ ├── dict_get.py │ │ │ │ ├── list_sum.py │ │ │ │ ├── 0prelim.py │ │ │ │ ├── compare_multi.py │ │ │ │ ├── int_divzero.py │ │ │ │ ├── list_reverse.py │ │ │ │ ├── set1.py │ │ │ │ ├── dict_clear.py │ │ │ │ ├── filter.py │ │ │ │ ├── fun_annotations.py │ │ │ │ ├── sorted.py │ │ │ │ ├── class_subclass_builtin.py │ │ │ │ ├── dict_iterator.py │ │ │ │ ├── set_copy.py │ │ │ │ ├── tuple_count.py │ │ │ │ ├── dict_copy.py │ │ │ │ ├── list_copy.py │ │ │ │ ├── builtin_callable.py │ │ │ │ ├── exec1.py │ │ │ │ ├── for_return.py │ │ │ │ ├── list_count.py │ │ │ │ ├── set_update.py │ │ │ │ ├── bytes_gen.py │ │ │ │ ├── string_upperlow.py │ │ │ │ ├── andor.py │ │ │ │ ├── dict_views.py │ │ │ │ ├── builtin_eval_error.py │ │ │ │ ├── memoryerror.py │ │ │ │ ├── gen_yield_from_iter.py │ │ │ │ ├── fun2.py │ │ │ │ ├── fun3.py │ │ │ │ ├── list_insert.py │ │ │ │ ├── set_isfooset.py │ │ │ │ ├── set_pop.py │ │ │ │ ├── try1.py │ │ │ │ ├── list_slice_3arg.py │ │ │ │ ├── set_isdisjoint.py │ │ │ │ ├── for2.py │ │ │ │ ├── map.py │ │ │ │ ├── del_subscr.py │ │ │ │ ├── generator_return.py │ │ │ │ ├── set_intersection.py │ │ │ │ ├── subclass_native4.py │ │ │ │ ├── bytes_compare2.py │ │ │ │ ├── dict_fromkeys.py │ │ │ │ ├── string_repr.py │ │ │ │ ├── set_symmetric_difference.py │ │ │ │ ├── int_big_div.py │ │ │ │ ├── iter_of_iter.py │ │ │ │ ├── closure_defargs.py │ │ │ │ ├── string_escape.py │ │ │ │ ├── builtin_eval.py │ │ │ │ ├── builtin_len1.py │ │ │ │ ├── list_remove.py │ │ │ │ ├── subclass_classmethod.py │ │ │ │ ├── subclass_native_cmp.py │ │ │ │ ├── getattr.py │ │ │ │ ├── try_as_var.py │ │ │ │ ├── break.py │ │ │ │ ├── subclass_native5.py │ │ │ │ ├── unary_op.py │ │ │ │ ├── while1.py │ │ │ │ ├── frozenset_copy.py │ │ │ │ ├── frozenset_add.py │ │ │ │ ├── int_big_mul.py │ │ │ │ ├── list_pop.py │ │ │ │ ├── builtin_bin.py │ │ │ │ ├── builtin_hex.py │ │ │ │ ├── builtin_oct.py │ │ │ │ ├── dict1.py │ │ │ │ ├── dict_setdefault.py │ │ │ │ ├── array1.py │ │ │ │ ├── class_store.py │ │ │ │ ├── while_nest_exc.py │ │ │ │ ├── builtin_id.py │ │ │ │ ├── dict_construct.py │ │ │ │ ├── types2.py │ │ │ │ ├── frozenset1.py │ │ │ │ ├── gen_yield_from_exc.py │ │ │ │ ├── is_isnot.py │ │ │ │ ├── closure1.py │ │ │ │ ├── dict_pop.py │ │ │ │ ├── gen_yield_from_send.py │ │ │ │ ├── while_cond.py │ │ │ │ ├── int_bytes.py │ │ │ │ ├── with_return.py │ │ │ │ ├── class2.py │ │ │ │ ├── string_mult.py │ │ │ │ ├── try3.py │ │ │ │ ├── bytes_mult.py │ │ │ │ ├── fun_kwvarargs.py │ │ │ │ ├── list_mult.py │ │ │ │ ├── tuple_mult.py │ │ │ │ ├── class_super.py │ │ │ │ ├── dict_update.py │ │ │ │ ├── del_name.py │ │ │ │ ├── closure2.py │ │ │ │ ├── with_break.py │ │ │ │ ├── class_call.py │ │ │ │ ├── continue.py │ │ │ │ ├── dict2.py │ │ │ │ ├── with_continue.py │ │ │ │ ├── dict_from_iter.py │ │ │ │ ├── dict_popitem.py │ │ │ │ ├── unboundlocal.py │ │ │ │ ├── class_number.py │ │ │ │ ├── exception1.py │ │ │ │ ├── fun_defargs2.py │ │ │ │ ├── tuple1.py │ │ │ │ ├── class_super_object.py │ │ │ │ ├── dict_intern.py │ │ │ │ ├── fun_defargs.py │ │ │ │ ├── slots_bool_len.py │ │ │ │ ├── list1.py │ │ │ │ ├── print.py │ │ │ │ ├── try_reraise.py │ │ │ │ ├── subclass_native_specmeth.py │ │ │ │ └── list_slice.py │ │ │ ├── pybnative │ │ │ │ ├── while.py.exp │ │ │ │ ├── for.py.exp │ │ │ │ ├── for.py │ │ │ │ └── while.py │ │ │ ├── float │ │ │ │ ├── int_divzero.py │ │ │ │ ├── list_index.py │ │ │ │ ├── true_value.py │ │ │ │ ├── float1.py │ │ │ │ └── types.py │ │ │ ├── inlineasm │ │ │ │ └── asmsum.py.exp │ │ │ ├── misc │ │ │ │ ├── recursion.py │ │ │ │ └── recursive_data.py_ │ │ │ └── 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 │ │ │ │ ├── func_builtin-1-enum_pos.py │ │ │ │ ├── loop_count-5.1-while_down_ne_localvar.py │ │ │ │ ├── var-4-arg.py │ │ │ │ ├── bench.py │ │ │ │ ├── var-2-global.py │ │ │ │ ├── func_builtin-2-enum_kw.py │ │ │ │ ├── var-3-local.py │ │ │ │ ├── from_iter-1-list_bound.py │ │ │ │ ├── from_iter-3-tuple_bound.py │ │ │ │ ├── from_iter-5-bytes_bound.py │ │ │ │ ├── func_args-1.1-pos_1.py │ │ │ │ ├── func_args-3.1-kw_1.py │ │ │ │ ├── from_iter-7-bytearray_bound.py │ │ │ │ ├── func_args-1.2-pos_3.py │ │ │ │ ├── var-5-class-attr.py │ │ │ │ ├── from_iter-2-list_unbound.py │ │ │ │ ├── func_args-3.2-kw_3.py │ │ │ │ ├── from_iter-4-tuple_unbound.py │ │ │ │ ├── from_iter-6-bytes_unbound.py │ │ │ │ ├── func_args-2-pos_default_2_of_3.py │ │ │ │ ├── from_iter-8-bytearray_unbound.py │ │ │ │ ├── funcall-1-inline.py │ │ │ │ ├── var-6-instance-attr.py │ │ │ │ ├── var-8-namedtuple-1st.py │ │ │ │ ├── funcall-2-funcall.py │ │ │ │ ├── var-8.1-namedtuple-5th.py │ │ │ │ ├── bytebuf-3-bytarray_map.py │ │ │ │ ├── bytebuf-1-inplace.py │ │ │ │ ├── var-7-instance-meth.py │ │ │ │ ├── var-6.1-instance-attr-5.py │ │ │ │ └── arrayop-1-list_inplace.py │ │ │ ├── unix-cpy │ │ │ └── .gitignore │ │ │ ├── unix │ │ │ ├── input.h │ │ │ └── .gitignore │ │ │ ├── bare-arm │ │ │ └── qstrdefsport.h │ │ │ ├── qemu-arm │ │ │ └── qstrdefsport.h │ │ │ ├── py │ │ │ └── unicode.h │ │ │ ├── teensy │ │ │ ├── lexermemzip.h │ │ │ ├── core │ │ │ │ └── Arduino.h │ │ │ ├── servo.h │ │ │ ├── memzip_files │ │ │ │ ├── main.py │ │ │ │ └── boot.py │ │ │ ├── led.h │ │ │ ├── reg.h │ │ │ ├── teensy_hal.c │ │ │ ├── lexerfatfs.c │ │ │ └── lcd.c │ │ │ ├── logo │ │ │ ├── logo.jpg │ │ │ ├── trans-logo.png │ │ │ ├── vector-logo-2.png │ │ │ ├── vector-logo-3.png │ │ │ ├── upython-with-micro.jpg │ │ │ ├── upython-with-micro.png │ │ │ └── micropythonpowered-art.png │ │ │ ├── stmhal │ │ │ ├── .gitignore │ │ │ ├── fatfs │ │ │ │ ├── doc │ │ │ │ │ ├── css_j.css │ │ │ │ │ ├── img │ │ │ │ │ │ ├── f1.png │ │ │ │ │ │ ├── f2.png │ │ │ │ │ │ ├── f3.png │ │ │ │ │ │ ├── f4.png │ │ │ │ │ │ ├── f5.png │ │ │ │ │ │ ├── f6.png │ │ │ │ │ │ ├── f7.png │ │ │ │ │ │ ├── layers.png │ │ │ │ │ │ ├── rwtest.png │ │ │ │ │ │ ├── layers3.png │ │ │ │ │ │ ├── modules.png │ │ │ │ │ │ ├── rwtest2.png │ │ │ │ │ │ └── rwtest3.png │ │ │ │ │ ├── ja │ │ │ │ │ │ ├── eof.html │ │ │ │ │ │ ├── gets.html │ │ │ │ │ │ ├── mkfs.html │ │ │ │ │ │ ├── open.html │ │ │ │ │ │ ├── putc.html │ │ │ │ │ │ ├── puts.html │ │ │ │ │ │ ├── read.html │ │ │ │ │ │ ├── sdir.html │ │ │ │ │ │ ├── size.html │ │ │ │ │ │ ├── stat.html │ │ │ │ │ │ ├── sync.html │ │ │ │ │ │ ├── tell.html │ │ │ │ │ │ ├── chdir.html │ │ │ │ │ │ ├── chmod.html │ │ │ │ │ │ ├── close.html │ │ │ │ │ │ ├── dinit.html │ │ │ │ │ │ ├── dioctl.html │ │ │ │ │ │ ├── dread.html │ │ │ │ │ │ ├── dstat.html │ │ │ │ │ │ ├── dwrite.html │ │ │ │ │ │ ├── error.html │ │ │ │ │ │ ├── fdisk.html │ │ │ │ │ │ ├── getcwd.html │ │ │ │ │ │ ├── lseek.html │ │ │ │ │ │ ├── mkdir.html │ │ │ │ │ │ ├── mount.html │ │ │ │ │ │ ├── printf.html │ │ │ │ │ │ ├── rename.html │ │ │ │ │ │ ├── sfatfs.html │ │ │ │ │ │ ├── sfile.html │ │ │ │ │ │ ├── unlink.html │ │ │ │ │ │ ├── utime.html │ │ │ │ │ │ ├── write.html │ │ │ │ │ │ ├── chdrive.html │ │ │ │ │ │ ├── closedir.html │ │ │ │ │ │ ├── fattime.html │ │ │ │ │ │ ├── forward.html │ │ │ │ │ │ ├── getfree.html │ │ │ │ │ │ ├── getlabel.html │ │ │ │ │ │ ├── opendir.html │ │ │ │ │ │ ├── readdir.html │ │ │ │ │ │ ├── setlabel.html │ │ │ │ │ │ ├── sfileinfo.html │ │ │ │ │ │ └── truncate.html │ │ │ │ │ └── 00index_j.html │ │ │ │ └── src │ │ │ │ │ └── option │ │ │ │ │ └── unicode.c │ │ │ ├── cmsis │ │ │ │ └── devinc │ │ │ │ │ ├── stm32f4xx.h │ │ │ │ │ ├── stm32f401xc.h │ │ │ │ │ ├── stm32f401xe.h │ │ │ │ │ ├── stm32f407xx.h │ │ │ │ │ ├── stm32f411xe.h │ │ │ │ │ ├── stm32f415xx.h │ │ │ │ │ ├── stm32f417xx.h │ │ │ │ │ ├── stm32f427xx.h │ │ │ │ │ ├── stm32f429xx.h │ │ │ │ │ ├── stm32f437xx.h │ │ │ │ │ └── stm32f439xx.h │ │ │ ├── hal │ │ │ │ ├── inc │ │ │ │ │ └── stm32f4xx_hal_def.h │ │ │ │ └── src │ │ │ │ │ ├── stm32f4xx_hal_wwdg.c │ │ │ │ │ └── stm32f4xx_hal_rcc_ex.c │ │ │ ├── mpconfigport.mk │ │ │ ├── pybioctl.h │ │ │ └── boards │ │ │ │ └── NETDUINO_PLUS_2 │ │ │ │ └── pins.csv │ │ │ ├── windows │ │ │ └── .gitignore │ │ │ ├── examples │ │ │ ├── SDdatalogger │ │ │ │ └── cardreader.py │ │ │ └── micropython.py │ │ │ ├── drivers │ │ │ ├── README.md │ │ │ ├── cc3000 │ │ │ │ └── inc │ │ │ │ │ ├── inet_pton.h │ │ │ │ │ ├── inet_ntop.h │ │ │ │ │ └── patch_prog.h │ │ │ └── wiznet5k │ │ │ │ └── README.md │ │ │ ├── lib │ │ │ └── README.md │ │ │ ├── tools │ │ │ └── .gitignore │ │ │ └── extmod │ │ │ └── re1.5 │ │ │ └── charclass.c │ ├── rtc │ │ ├── Kconfig │ │ └── objects.mk │ ├── time │ │ ├── objects.mk │ │ └── Kconfig │ ├── net │ │ └── lwip │ │ │ ├── src │ │ │ └── core │ │ │ │ └── ipv6 │ │ │ │ └── README │ │ │ ├── CHANGELOG │ │ │ ├── FILES │ │ │ └── test │ │ │ └── unit │ │ │ ├── core │ │ │ └── test_mem.h │ │ │ ├── tcp │ │ │ ├── test_tcp.h │ │ │ └── test_tcp_oos.h │ │ │ ├── udp │ │ │ └── test_udp.h │ │ │ └── etharp │ │ │ └── test_etharp.h │ ├── helpers │ │ └── objects.mk │ ├── syscall │ │ ├── calls │ │ │ ├── getpid.c │ │ │ ├── yield.c │ │ │ ├── sleep.c │ │ │ ├── gpio.c │ │ │ ├── klog.c │ │ │ ├── time.c │ │ │ └── close.c │ │ ├── Kconfig │ │ └── getpid │ │ │ └── getpid.S │ ├── loader │ │ ├── objects.mk │ │ └── Kconfig │ ├── volumes │ │ └── objects.mk │ ├── fs │ │ ├── fullfat │ │ │ └── include │ │ │ │ └── FreeRTOSFATConfig.h │ │ ├── bt_inode.c │ │ └── bt_dir.c │ ├── gpio │ │ └── Kconfig │ └── lib │ │ ├── bcd.c │ │ └── Kconfig ├── include │ ├── bt_export.h │ ├── loader │ │ └── bt_elf.h │ ├── lib │ │ ├── bcd.h │ │ └── multiplexer.h │ ├── devman │ │ └── bt_integrated_driver.h │ ├── interfaces │ │ ├── bt_dev_if_sdio.h │ │ ├── bt_if_inode.h │ │ ├── bt_dev_if_gtimer.h │ │ └── bt_if_dir.h │ ├── bt_time.h │ └── fs │ │ └── bt_inode.h └── .config.mk ├── include ├── sys │ └── socket.h └── netdb.h ├── drivers ├── net │ ├── objects.mk │ ├── Kconfig │ └── phy │ │ ├── Kconfig │ │ └── objects.mk ├── mtd │ ├── objects.mk │ └── Kconfig ├── rtc │ ├── objects.mk │ └── Kconfig ├── dac │ ├── objects.mk │ └── Kconfig ├── gpio │ ├── objects.mk │ └── Kconfig ├── block │ ├── Kconfig │ └── objects.mk ├── mmc │ ├── host.h │ └── objects.mk ├── adc │ ├── objects.mk │ └── Kconfig └── Kconfig ├── kernel └── FreeRTOS │ └── Kconfig ├── lib ├── src │ ├── hash │ │ └── objects.mk │ └── mm │ │ └── bt_mm.c └── include │ ├── mm │ └── bt_mm.h │ ├── interfaces │ └── bt_if_module.h │ └── compilers │ └── bt_gcc.h └── .gitattributes /scripts/Kconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/datastructures.tex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.dbuild/defines.mk: -------------------------------------------------------------------------------- 1 | DB_QUOTES := " 2 | -------------------------------------------------------------------------------- /arch/arm/mach/bcm2835/.config.mk: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include5.dts: -------------------------------------------------------------------------------- 1 | prop-int 2 | -------------------------------------------------------------------------------- /.dbuild/.gitignore: -------------------------------------------------------------------------------- 1 | pretty/prettyformat.pyc 2 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/tests/break.tcl: -------------------------------------------------------------------------------- 1 | break 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/data/file2: -------------------------------------------------------------------------------- 1 | 1234 -------------------------------------------------------------------------------- /scripts/dtc/tests/deps_inc2.dtsi: -------------------------------------------------------------------------------- 1 | /* Empty */ 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include6.dts: -------------------------------------------------------------------------------- 1 | "hello world" 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include8.dts: -------------------------------------------------------------------------------- 1 | subsubnode@0 { -------------------------------------------------------------------------------- /include/sys/socket.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include3.dts: -------------------------------------------------------------------------------- 1 | 123456789 010000 2 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/tests/testio.in: -------------------------------------------------------------------------------- 1 | One line here 2 | ^ -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/dac.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/switch.py.exp: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/native_check.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/accel.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyboard.py: -------------------------------------------------------------------------------- 1 | ../tools/pyboard.py -------------------------------------------------------------------------------- /os/src/shell/micropython/unix-cpy/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | cpy 3 | -------------------------------------------------------------------------------- /scripts/dtc/tests/deps_inc1.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "deps_inc2.dtsi" 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/empty.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | }; 5 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include0.dts: -------------------------------------------------------------------------------- 1 | /include/ "include1.dts" 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include4.dts: -------------------------------------------------------------------------------- 1 | compatible = "test_tree1"; 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include5a.dts: -------------------------------------------------------------------------------- 1 | = /bits/ 64 <0xdeadbeef01abcdef> -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/extmod/uctypes_sizeof_native.py.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/extint.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | line: 0 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unicode/data/utf-8_1.txt: -------------------------------------------------------------------------------- 1 | Привет 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unicode/data/utf-8_2.txt: -------------------------------------------------------------------------------- 1 | aαbβcγdδ 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/base01.cmd: -------------------------------------------------------------------------------- 1 | dtc -f -b 0 -V 16 -I dts -O asm 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_dir/search_test2.dtsi: -------------------------------------------------------------------------------- 1 | 2 | / { 3 | }; 4 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_dir_b/search_test_c.dtsi: -------------------------------------------------------------------------------- 1 | / { 2 | }; 3 | -------------------------------------------------------------------------------- /drivers/net/objects.mk: -------------------------------------------------------------------------------- 1 | include $(BASE)/drivers/net/phy/objects.mk 2 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/BUGS: -------------------------------------------------------------------------------- 1 | Known bugs 2 | ========== 3 | 4 | None! 5 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/tests/return-break.tcl: -------------------------------------------------------------------------------- 1 | return -code break result 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/call1.py: -------------------------------------------------------------------------------- 1 | f(a, b=c) 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg2/mod2.py: -------------------------------------------------------------------------------- 1 | print("in mod2") 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/adc.py.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/irq.py.exp: -------------------------------------------------------------------------------- 1 | True 2 | True False 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/unix/input.h: -------------------------------------------------------------------------------- 1 | char *prompt(char *p); 2 | 3 | -------------------------------------------------------------------------------- /os/src/rtc/Kconfig: -------------------------------------------------------------------------------- 1 | config RTC 2 | bool "RTC subsystem" 3 | default n 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg2/mod1.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod2 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/argv.py: -------------------------------------------------------------------------------- 1 | import sys 2 | print(sys.argv) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unix/ffi_float.py.exp: -------------------------------------------------------------------------------- 1 | 1.230000 2 | 1.230000 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/unix/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | micropython 3 | *.py 4 | -------------------------------------------------------------------------------- /os/src/time/objects.mk: -------------------------------------------------------------------------------- 1 | BT_OS_OBJECTS += $(BUILD_DIR)/os/src/time/time.o 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include2.dts: -------------------------------------------------------------------------------- 1 | /memreserve/ 0xdeadbeef00000000 0x100000; 2 | -------------------------------------------------------------------------------- /arch/arm/common/Kconfig: -------------------------------------------------------------------------------- 1 | config ARCH_ARM_USE_GIC 2 | bool 3 | default n 4 | -------------------------------------------------------------------------------- /os/src/net/lwip/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/configure.ac: -------------------------------------------------------------------------------- 1 | # Dummy configure.ac to make automake happy 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/bare-arm/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/qemu-arm/qstrdefsport.h: -------------------------------------------------------------------------------- 1 | // qstrs specific to this port 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/ifexpr1.py: -------------------------------------------------------------------------------- 1 | x = 1 if a else 2 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/import2.py: -------------------------------------------------------------------------------- 1 | from a import b 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg/mod.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | return 42 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg2/__init__.py: -------------------------------------------------------------------------------- 1 | from pkg2 import mod1 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/data/file1: -------------------------------------------------------------------------------- 1 | longer line1 2 | line2 3 | line3 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/const.py.exp: -------------------------------------------------------------------------------- 1 | 123 580 2 | 123 580 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/native_misc.py.exp: -------------------------------------------------------------------------------- 1 | 1 [] 2 2 | 1 [] 3 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_cond.py.exp: -------------------------------------------------------------------------------- 1 | x True 2 | y 1 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/i2c.py.exp: -------------------------------------------------------------------------------- 1 | [] 2 | [76] 3 | True 4 | b'\x01' 5 | -------------------------------------------------------------------------------- /scripts/dtc/tests/incbin.bin: -------------------------------------------------------------------------------- 1 | abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -------------------------------------------------------------------------------- /scripts/mkimage/crc32.h: -------------------------------------------------------------------------------- 1 | uint32_t crc32(const uint8_t *data, uint32_t length); 2 | -------------------------------------------------------------------------------- /include/netdb.h: -------------------------------------------------------------------------------- 1 | #include 2 | #define gethostbyname lwip_gethostbyname 3 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/tests/exitpackage.tcl: -------------------------------------------------------------------------------- 1 | # This package just exits 2 | 3 | exit 1 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class_emptybases.py: -------------------------------------------------------------------------------- 1 | class A(): 2 | pass 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_union.py: -------------------------------------------------------------------------------- 1 | print(sorted({1}.union({2}))) 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/lambda2.py: -------------------------------------------------------------------------------- 1 | f = lambda *args: args 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/listcomp2.py: -------------------------------------------------------------------------------- 1 | [x.y for x in k.l] 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/gen_context2.py: -------------------------------------------------------------------------------- 1 | def call(g): 2 | next(g) 3 | -------------------------------------------------------------------------------- /scripts/dtc/tests/test_tree1.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | /include/ "test_tree1_body.dtsi" 4 | -------------------------------------------------------------------------------- /os/src/rtc/objects.mk: -------------------------------------------------------------------------------- 1 | BT_OS_OBJECTS-$(BT_CONFIG_RTC) += $(BUILD_DIR)/os/src/rtc/bt_rtc.o 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/memoryerror.py.exp: -------------------------------------------------------------------------------- 1 | MemoryError 2 | 10000 0 9999 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/assert1.py: -------------------------------------------------------------------------------- 1 | assert x 2 | assert x, 'test' 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/class1.py: -------------------------------------------------------------------------------- 1 | class C: 2 | pass 3 | C() 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/fun1.py: -------------------------------------------------------------------------------- 1 | def f(*args): 2 | g(*args) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import1a.py: -------------------------------------------------------------------------------- 1 | import import1b 2 | print(import1b.var) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import2a.py: -------------------------------------------------------------------------------- 1 | from import1b import var 2 | print(var) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import3a.py: -------------------------------------------------------------------------------- 1 | from import1b import * 2 | print(var) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg3/__init__.py: -------------------------------------------------------------------------------- 1 | print("pkg __name__:", __name__) 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/led.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/timer.py.exp: -------------------------------------------------------------------------------- 1 | 100 2 | 200 3 | 300 4 | 400 5 | 1 6 | 2 3 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pybnative/while.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 1 5 | 2 6 | 3 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/dup-propname.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | prop; 5 | prop; 6 | }; 7 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/jim-config.h.in: -------------------------------------------------------------------------------- 1 | /* Public autoconf settings */ 2 | @DEFINE_HAVE_LONG_LONG@ 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/closure1.py: -------------------------------------------------------------------------------- 1 | # basic closure 2 | # to write! 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/slice2.py: -------------------------------------------------------------------------------- 1 | x = x[a, b] 2 | 3 | x[a, b] = x 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/py/unicode.h: -------------------------------------------------------------------------------- 1 | mp_uint_t utf8_ptr_to_index(const byte *s, const byte *ptr); 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/zip.py: -------------------------------------------------------------------------------- 1 | print(list(zip())) 2 | print(list(zip([1], {2,3}))) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/lambda1.py: -------------------------------------------------------------------------------- 1 | f = lambda: 0 2 | f = lambda x: 1 + x 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import_file.py: -------------------------------------------------------------------------------- 1 | import import1b 2 | print(import1b.__file__) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg3/subpkg1/__init__.py: -------------------------------------------------------------------------------- 1 | print("subpkg1 __name__:", __name__) 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/can.py.exp: -------------------------------------------------------------------------------- 1 | CAN(1) 2 | False 3 | True 4 | (123, 0, 0, b'abcd') 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pybnative/for.py.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 0 6 | 1 7 | 2 8 | 3 9 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_dir/search_test.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "search_test2.dtsi" 2 | 3 | / { 4 | }; 5 | -------------------------------------------------------------------------------- /.dbuild/relpath.py: -------------------------------------------------------------------------------- 1 | import os.path 2 | import sys 3 | print(os.path.relpath(sys.argv[1], sys.argv[2])) 4 | -------------------------------------------------------------------------------- /os/src/helpers/objects.mk: -------------------------------------------------------------------------------- 1 | BT_OS_OBJECTS-$(BT_CONFIG_OS) += $(BUILD_DIR)/os/src/helpers/bt_clkdiv.o 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/dict1.py: -------------------------------------------------------------------------------- 1 | x = {} 2 | x = {'a':1} 3 | x = {'a':1, 'b':2} 4 | -------------------------------------------------------------------------------- /scripts/dtc/tests/dependencies.cmp: -------------------------------------------------------------------------------- 1 | dependencies.test.dtb: dependencies.dts deps_inc1.dtsi deps_inc2.dtsi 2 | -------------------------------------------------------------------------------- /scripts/dtc/tests/dependencies.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | /include/ "deps_inc1.dtsi" 4 | 5 | / { 6 | }; 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/dup-nodename.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | node { 5 | }; 6 | node { 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reuse-label4.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | property = label: "foo" label:; 5 | }; 6 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_dir_b/search_test_b.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "search_test_b2.dtsi" 2 | 3 | / { 4 | }; 5 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_dir_b/search_test_b2.dtsi: -------------------------------------------------------------------------------- 1 | 2 | /include/ "search_test.dtsi" 3 | 4 | / { 5 | }; 6 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_paths.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | /include/ "search_test.dtsi" 4 | 5 | / { 6 | }; 7 | -------------------------------------------------------------------------------- /doc/api.tex: -------------------------------------------------------------------------------- 1 | \section{Core Operating System Services} 2 | \subsection{Processes} 3 | 4 | \subsection{Threads} 5 | -------------------------------------------------------------------------------- /os/src/net/lwip/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/net/lwip/CHANGELOG -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/fun1.py: -------------------------------------------------------------------------------- 1 | # calling a function 2 | 3 | def f(): 4 | print(1) 5 | f() 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_add.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(s.add(5)) 3 | print(sorted(s)) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_clear.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(s.clear()) 3 | print(list(s)) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_discard.py: -------------------------------------------------------------------------------- 1 | s = {1, 2} 2 | print(s.discard(1)) 3 | print(list(s)) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/class2.py: -------------------------------------------------------------------------------- 1 | class A: 2 | x = 1 3 | y = x + z 4 | A() 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import1b.py: -------------------------------------------------------------------------------- 1 | var = 123 2 | 3 | def throw(): 4 | raise ValueError 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg3/mod1.py: -------------------------------------------------------------------------------- 1 | print("mod1 __name__:", __name__) 2 | from . import mod2 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/file_iter.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/file1") 2 | for l in f: 3 | print(l) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_ptr16_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 12849 3 | 26212 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_ptr8_load.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'1234') 2 | 49 3 | 202 4 | 202 5 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_paths_b.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | /include/ "search_test_b.dtsi" 4 | 5 | / { 6 | }; 7 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/autosetup/README.autosetup: -------------------------------------------------------------------------------- 1 | This is autosetup v0.6.5. See http://msteveb.github.com/autosetup/ 2 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/lambda1.py: -------------------------------------------------------------------------------- 1 | # lambda 2 | 3 | f = lambda x, y: x + 3 * y 4 | print(f(3, 5)) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_iter.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | l = list(s) 3 | l.sort() 4 | print(l) 5 | 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | mp-tests/__pycache__ 3 | pylib-tests/__pycache__ 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/setcomp1.py: -------------------------------------------------------------------------------- 1 | x = {a for a in l} 2 | x = {a + b for a, b in l if b} 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/extmod/uctypes_ptr_le.py.exp: -------------------------------------------------------------------------------- 1 | 48 2 | 49 3 | 0x3130 4 | 48 49 5 | 48 49 6 | 0x3130 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/servo.py.exp: -------------------------------------------------------------------------------- 1 | 2 | 1500 3 | (630, 2410, 1490, 2460, 2190) 4 | -------------------------------------------------------------------------------- /scripts/dtc/tests/default-addr-size.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | node { 5 | reg = <0 0 0>; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/zero-phandle.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | node { 5 | linux,phandle = <0>; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/lexermemzip.h: -------------------------------------------------------------------------------- 1 | mp_lexer_t *mp_lexer_new_from_memzip_file(const char *filename); 2 | 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/generator2.py: -------------------------------------------------------------------------------- 1 | gen = (i for i in range(10)) 2 | for i in gen: 3 | print(i) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_clear.py: -------------------------------------------------------------------------------- 1 | # tests list.clear 2 | x = [1, 2, 3, 4] 3 | x.clear() 4 | print(x) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/dictcomp1.py: -------------------------------------------------------------------------------- 1 | x = {a:None for a in l} 2 | x = {b:c for c, b in l if c} 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/docstring2.py: -------------------------------------------------------------------------------- 1 | # comment before doc string 2 | 3 | """Doc string""" 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/import4.py: -------------------------------------------------------------------------------- 1 | import a as y 2 | import a.b as y 3 | import a.b.c as y 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/extmod/uctypes_ptr_native_le.py.exp: -------------------------------------------------------------------------------- 1 | 48 2 | 49 3 | 0x3130 4 | 48 49 5 | 48 49 6 | 0x3130 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/file_long_read.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/file1") 2 | b = f.read(100) 3 | print(len(b)) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/pyb1.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | (168000000, 168000000, 42000000, 84000000) 4 | True 5 | 12 6 | -------------------------------------------------------------------------------- /scripts/dtc/libfdt/TODO: -------------------------------------------------------------------------------- 1 | - Tree traversal functions 2 | - Graft function 3 | - Complete libfdt.h documenting comments 4 | -------------------------------------------------------------------------------- /scripts/dtc/tests/bad-name-property.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | node@0 { 5 | name = "badthing"; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/char_literal.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | char-literal-cells = <'\r' 'b' '\0' '\'' '\xff'>; 5 | }; 6 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reuse-label5.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | prop1 = label: "foo"; 5 | prop2 = "bar" label:; 6 | }; 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reuse-label6.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | label: prop1 = "foo"; 5 | prop2 = "bar" label:; 6 | }; 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_get.py: -------------------------------------------------------------------------------- 1 | for d in {}, {42:2}: 2 | print(d.get(42)) 3 | print(d.get(42,2)) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_sum.py: -------------------------------------------------------------------------------- 1 | # list addition 2 | a = [1,2,3] 3 | b = [4,5,6] 4 | c = a + b 5 | print(c) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/import1.py: -------------------------------------------------------------------------------- 1 | a = 1 2 | def f(): 3 | global a 4 | import a 5 | import b, c 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/tuple3.py: -------------------------------------------------------------------------------- 1 | def f(x): 2 | return x, x + 1 3 | for a in b, c: 4 | f(a) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/file_stdio.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.stdin.fileno()) 4 | print(sys.stdout.fileno()) 5 | -------------------------------------------------------------------------------- /os/src/syscall/calls/getpid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long bt_sys_getpid(void) { 4 | return curtask->pid; 5 | } 6 | -------------------------------------------------------------------------------- /scripts/dtc/tests/minusone-phandle.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | node { 5 | linux,phandle = <0xffffffff>; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/propname_escapes.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <1>; 5 | \#gpio-cells = <2>; 6 | }; 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/search_dir_b/search_paths_subdir.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | /include/ "search_test_c.dtsi" 4 | 5 | / { 6 | }; 7 | -------------------------------------------------------------------------------- /scripts/kconfig-win32/libintl3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/scripts/kconfig-win32/libintl3.dll -------------------------------------------------------------------------------- /scripts/kconfig-win32/regex2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/scripts/kconfig-win32/regex2.dll -------------------------------------------------------------------------------- /arch/arm/mach/stm32/timer.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the Xilinx system timer for BitThunder. 3 | **/ 4 | 5 | #include 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/core/Arduino.h: -------------------------------------------------------------------------------- 1 | //#include "WProgram.h" 2 | #include "core_pins.h" 3 | #include "pins_arduino.h" 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/augassign1.py: -------------------------------------------------------------------------------- 1 | [] = () 2 | x += 1 3 | x.y += 1 4 | x.f().y += 1 5 | x[1] += 2 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/try2.py: -------------------------------------------------------------------------------- 1 | def f(): 2 | try: 3 | f() 4 | finally: 5 | g() 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg3/subpkg1/mod1.py: -------------------------------------------------------------------------------- 1 | print("subpkg1.mod1 __name__:", __name__) 2 | from ..mod2 import foo 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unicode/unicode_iter.py: -------------------------------------------------------------------------------- 1 | for c in "Hello": 2 | print(c) 3 | for c in "Привет": 4 | print(c) 5 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reuse-label2.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | label: property1 = "foo"; 5 | label: property2 = "bar"; 6 | }; 7 | -------------------------------------------------------------------------------- /scripts/kconfig-linux64/kconfig-conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/scripts/kconfig-linux64/kconfig-conf -------------------------------------------------------------------------------- /scripts/kconfig-win32/libiconv2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/scripts/kconfig-win32/libiconv2.dll -------------------------------------------------------------------------------- /.dbuild/scripts/mkconfig/mkconfig.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/.dbuild/scripts/mkconfig/mkconfig.exe -------------------------------------------------------------------------------- /os/include/bt_export.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_EXPORT_H_ 2 | #define _BT_EXPORT_H_ 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/tests/dummy.tcl: -------------------------------------------------------------------------------- 1 | # generates an error 2 | proc dummyproc {} { 3 | error "from dummyproc" 4 | } 5 | 6 | dummyproc 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/logo/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/logo/logo.jpg -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/listcomp1.py: -------------------------------------------------------------------------------- 1 | x = (a for a in l) 2 | 3 | f(a for a in l) 4 | f(a + b for a, b in f()) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/listcomp3.py: -------------------------------------------------------------------------------- 1 | x = (a + 1 for a in l if a.f()) 2 | 3 | x = [a + 1 for a in l if a.f()] 4 | -------------------------------------------------------------------------------- /os/src/syscall/calls/yield.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long bt_sys_yield(void) { 4 | BT_ThreadYield(); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/prop-after-subnode.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | node1 { 5 | }; 6 | prop; 7 | node2 { 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /scripts/kconfig-linux64/kconfig-mconf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/scripts/kconfig-linux64/kconfig-mconf -------------------------------------------------------------------------------- /scripts/kconfig-win32/kconfig-mconf.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/scripts/kconfig-win32/kconfig-mconf.exe -------------------------------------------------------------------------------- /kernel/FreeRTOS/Kconfig: -------------------------------------------------------------------------------- 1 | config KERNEL_FREERTOS_NEWLIB_REENTRANCY_SUPPORT 2 | bool "Support NEWLIB reentrancy model" 3 | default n 4 | -------------------------------------------------------------------------------- /lib/src/hash/objects.mk: -------------------------------------------------------------------------------- 1 | BT_LIB_OBJECTS += $(BUILD_DIR)/lib/src/hash/bt_crc32.o 2 | BT_LIB_OBJECTS += $(BUILD_DIR)/lib/src/hash/bt_md5.o 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/0prelim.py: -------------------------------------------------------------------------------- 1 | # all tests need print to work! make sure it does work 2 | 3 | print(1) 4 | print('abc') 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/compare_multi.py: -------------------------------------------------------------------------------- 1 | print(1 < 2 < 3) 2 | print(1 < 2 < 3 < 4) 3 | print(1 > 2 < 3) 4 | print(1 < 2 > 3) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/int_divzero.py: -------------------------------------------------------------------------------- 1 | try: 2 | 1 // 0 3 | except ZeroDivisionError: 4 | print("ZeroDivisionError") 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_reverse.py: -------------------------------------------------------------------------------- 1 | a = [] 2 | for i in range(100): 3 | a.append(i) 4 | a.reverse() 5 | print(a) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set1.py: -------------------------------------------------------------------------------- 1 | # basic sets 2 | 3 | s = {1} 4 | print(s) 5 | 6 | s = {3, 4, 3, 1} 7 | print(sorted(s)) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/float/int_divzero.py: -------------------------------------------------------------------------------- 1 | try: 2 | 1 / 0 3 | except ZeroDivisionError: 4 | print("ZeroDivisionError") 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unicode/file1.py: -------------------------------------------------------------------------------- 1 | f = open("unicode/data/utf-8_1.txt") 2 | l = f.readline() 3 | print(l) 4 | print(len(l)) 5 | -------------------------------------------------------------------------------- /os/src/syscall/Kconfig: -------------------------------------------------------------------------------- 1 | menu "System Calls" 2 | 3 | config SYSCALL 4 | bool "System Call Mechanism" 5 | default n 6 | 7 | 8 | endmenu 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/logo/trans-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/logo/trans-logo.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/.gitignore: -------------------------------------------------------------------------------- 1 | build-PYBV3/ 2 | build-PYBV4/ 3 | build-PYBV10/ 4 | build-STM32F4DISC/ 5 | build-NETDUINO_PLUS_2/ 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_clear.py: -------------------------------------------------------------------------------- 1 | d = {1: 2, 3: 4} 2 | print(len(d)) 3 | d.clear() 4 | print(d) 5 | d[2] = 42 6 | print(d) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/filter.py: -------------------------------------------------------------------------------- 1 | print(list(filter(lambda x: x & 1, range(-3, 4)))) 2 | print(list(filter(None, range(-3, 4)))) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/fun_annotations.py: -------------------------------------------------------------------------------- 1 | def foo(x: int, y: list) -> dict: 2 | return {x: y} 3 | 4 | print(foo(1, [2, 3])) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/sorted.py: -------------------------------------------------------------------------------- 1 | print(sorted(set(range(100)))) 2 | print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2))) 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/fun3.py: -------------------------------------------------------------------------------- 1 | def f(a, b): 2 | def g(c, d=None, *, e=True): 3 | return a + b + c + d + e 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/if3.py: -------------------------------------------------------------------------------- 1 | if a and b: 2 | f() 3 | if a or b: 4 | f() 5 | if a and (b or c): 6 | f() 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope1.py: -------------------------------------------------------------------------------- 1 | x = 1 2 | print(x) 3 | def f1(): 4 | print(x) 5 | def f2(x): 6 | print(x) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/set1.py: -------------------------------------------------------------------------------- 1 | x = set() 2 | x = {1} 3 | x = {1,} 4 | x = {1, 2} 5 | x = {1, 2,} 6 | x = {1, 2, 3} 7 | -------------------------------------------------------------------------------- /os/src/syscall/calls/sleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long bt_sys_sleep(BT_u32 ticks) { 4 | BT_ThreadSleep(ticks); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/data.S: -------------------------------------------------------------------------------- 1 | /* Used in combination with dtc -Oasm output to embed 2 | * a device tree in the data section of a .o */ 3 | .data 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import_pkg3.py: -------------------------------------------------------------------------------- 1 | from pkg import mod 2 | 3 | print(mod.foo()) 4 | 5 | import pkg.mod 6 | print(mod is pkg.mod) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import_pkg4.py: -------------------------------------------------------------------------------- 1 | # Testing that "recursive" imports (pkg2/__init__.py imports from pkg2) work 2 | import pkg2 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/inlineasm/asmsum.py.exp: -------------------------------------------------------------------------------- 1 | array('l', [100, 200, 300, 400]) 1000 2 | array('b', [10, 20, 30, 40, 50, 60, 70, 80]) 360 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/windows/.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.*sdf 3 | *.suo 4 | *.sln 5 | *.exe 6 | *.pdb 7 | *.ilk 8 | *.filters 9 | /build/* 10 | -------------------------------------------------------------------------------- /os/src/syscall/getpid/getpid.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | BT_SYSCALL0(getpid) 5 | BT_SYSCALL0(getpid2) 6 | -------------------------------------------------------------------------------- /scripts/dtc/tests/nonexist-label-ref.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | ref = <&label>; 5 | badref = <&nosuchlabel>; 6 | label: node { 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/examples/SDdatalogger/cardreader.py: -------------------------------------------------------------------------------- 1 | # cardread.py 2 | # This is called when the user enters cardreader mode. It does nothing. 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/logo/vector-logo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/logo/vector-logo-2.png -------------------------------------------------------------------------------- /os/src/shell/micropython/logo/vector-logo-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/logo/vector-logo-3.png -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class_subclass_builtin.py: -------------------------------------------------------------------------------- 1 | #class mylist(list): 2 | # pass 3 | 4 | #l = mylist() 5 | #l.append(1) 6 | #print(l) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_iterator.py: -------------------------------------------------------------------------------- 1 | d = {1: 2, 3: 4} 2 | els = [] 3 | for i in d: 4 | els.append((i, d[i])) 5 | print(sorted(els)) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/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 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/pkg3/mod2.py: -------------------------------------------------------------------------------- 1 | print("mod2 __name__:", __name__) 2 | print("in mod2") 3 | 4 | def foo(): 5 | print("mod2.foo()") 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_ptr16_store.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x00\x00\x00\x00') 2 | bytearray(b'BB\x00\x00') 3 | bytearray(b'CCCC') 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/switch.py: -------------------------------------------------------------------------------- 1 | from pyb import Switch 2 | 3 | sw = Switch() 4 | print(sw()) 5 | sw.callback(print) 6 | sw.callback(None) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/uart.py.exp: -------------------------------------------------------------------------------- 1 | UART(1, baudrate=9600, bits=8, stop=1, parity=None) 2 | UART(1, baudrate=1200, bits=8, stop=1, parity=None) 3 | -------------------------------------------------------------------------------- /scripts/dtc/tests/incbin.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | incbin = /incbin/("incbin.bin"); 5 | incbin-partial = /incbin/("incbin.bin", 13, 17); 6 | }; 7 | -------------------------------------------------------------------------------- /.dbuild/pretty/rl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import prettyformat 4 | import sys 5 | 6 | for line in prettyformat.readline(sys.stdin): 7 | print line 8 | -------------------------------------------------------------------------------- /arch/arm/mach/zynq/tools/.gitignore: -------------------------------------------------------------------------------- 1 | BOOT.BIN 2 | bootgen 3 | bootgen_line.pyc 4 | bootthunder.elf.bin 5 | *.init 6 | *.S 7 | *.bin 8 | *.o 9 | *.bif 10 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | dir="`dirname "$0"`/autosetup" 3 | WRAPPER="$0"; export WRAPPER; exec "`$dir/find-tclsh`" "$dir/autosetup" "$@" 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/drivers/README.md: -------------------------------------------------------------------------------- 1 | This directory contains drivers for specific hardware. The drivers are 2 | intended to work across multiple ports. 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/css_j.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/css_j.css -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/tuple_count.py: -------------------------------------------------------------------------------- 1 | a = (1, 2, 3) 2 | a = a + a + a 3 | b = (0, 0, a, 0, a, 0) 4 | print(a.count(2)) 5 | print(b.count(a)) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope0.py: -------------------------------------------------------------------------------- 1 | x = 1 2 | print(x) 3 | 4 | # local store after load 5 | def f(): 6 | print(x) 7 | x = 1 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/try5.py: -------------------------------------------------------------------------------- 1 | try: 2 | f() 3 | except A: 4 | g() 5 | except B as b: 6 | h() 7 | finally: 8 | i() 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/native_check.py: -------------------------------------------------------------------------------- 1 | # this test for the availability of native emitter 2 | @micropython.native 3 | def f(): 4 | pass 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/misc/recursion.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | foo() 3 | 4 | try: 5 | foo() 6 | except RuntimeError: 7 | print("RuntimeError") 8 | -------------------------------------------------------------------------------- /os/src/time/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Time" 2 | 3 | config TIME_CLOCK_SOURCE 4 | string "Real Time Clock Source device" 5 | default "/dev/rtc0" 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/bad-string-props.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | device_type = <0xdeadbeef>; 5 | model = <0xdeadbeef>; 6 | status = <0xdeadbeef>; 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/nonexist-node-ref.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | ref = < &{/node} >; 5 | badref = < &{/nosuchnode} >; 6 | label: node { 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /lib/include/mm/bt_mm.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_MEMM_H_ 2 | #define _BT_MEMM_H_ 3 | 4 | 5 | void *BT_Calloc(BT_u32 ulSize); 6 | 7 | 8 | 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/bootstrap.tcl: -------------------------------------------------------------------------------- 1 | # No need for package support in the bootstrap jimsh, but 2 | # Tcl extensions call package require 3 | proc package {args} {} 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/logo/upython-with-micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/logo/upython-with-micro.jpg -------------------------------------------------------------------------------- /os/src/shell/micropython/logo/upython-with-micro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/logo/upython-with-micro.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/f1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/f1.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/f2.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/f3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/f3.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/f4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/f4.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/f5.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/f6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/f6.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/f7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/f7.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/eof.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/eof.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/gets.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/gets.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/mkfs.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/mkfs.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/open.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/open.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/putc.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/putc.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/puts.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/puts.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/read.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/read.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/sdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/sdir.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/size.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/size.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/stat.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/stat.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/sync.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/sync.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/tell.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/tell.html -------------------------------------------------------------------------------- /os/src/syscall/calls/gpio.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long bt_sys_gpioset(BT_u32 flag, BT_BOOL state) { 4 | BT_GpioSet(flag, state); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/bad-ncells.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = "badthing"; 5 | #size-cells = "badthing"; 6 | #interrupt-cells = "badthing"; 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/delete_reinstate_multilabel_ref.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | prop = "value"; 5 | 6 | node { 7 | prop = "value"; 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /scripts/dtc/tests/open_pack.supp: -------------------------------------------------------------------------------- 1 | { 2 | opened blob dumps uninitialized data 3 | Memcheck:Param 4 | write(buf) 5 | obj:/lib/ld-*.so 6 | fun:main 7 | } 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reuse-label3.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | label: property = "foo"; 5 | 6 | label: node { 7 | property = "foo"; 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /drivers/net/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Network Controllers" 2 | 3 | config DRIVERS_NET 4 | bool 5 | default n 6 | 7 | source drivers/net/phy/Kconfig 8 | 9 | endmenu 10 | -------------------------------------------------------------------------------- /drivers/net/phy/Kconfig: -------------------------------------------------------------------------------- 1 | menu "PHYs" 2 | 3 | config DRIVERS_NET_PHY_MARVELL 4 | bool "Marvell Phys" 5 | select DRIVERS_NET 6 | default n 7 | 8 | endmenu 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/logo/micropythonpowered-art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/logo/micropythonpowered-art.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f4xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/00index_j.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/00index_j.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/layers.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/rwtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/rwtest.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/chdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/chdir.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/chmod.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/chmod.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/close.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/close.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/dinit.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/dinit.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/dioctl.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/dioctl.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/dread.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/dread.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/dstat.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/dstat.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/dwrite.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/dwrite.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/error.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/error.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/fdisk.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/fdisk.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/getcwd.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/getcwd.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/lseek.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/lseek.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/mkdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/mkdir.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/mount.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/mount.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/printf.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/printf.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/rename.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/rename.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/sfatfs.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/sfatfs.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/sfile.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/sfile.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/unlink.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/unlink.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/utime.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/utime.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/write.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/write.html -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_copy.py: -------------------------------------------------------------------------------- 1 | a = {i: 2*i for i in range(1000)} 2 | b = a.copy() 3 | for i in range(1000): 4 | print(i, b[i]) 5 | print(len(b)) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_copy.py: -------------------------------------------------------------------------------- 1 | # list copy tests 2 | a = [1, 2, []] 3 | b = a.copy() 4 | a[-1].append(1) 5 | a.append(4) 6 | print(a) 7 | print(b) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/loop_count-1-range.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in range(num): 5 | pass 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/docstring1.py: -------------------------------------------------------------------------------- 1 | """Module""" 2 | 3 | class A: 4 | """Class""" 5 | pass 6 | 7 | class B: 8 | """Class B""" 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/float/list_index.py: -------------------------------------------------------------------------------- 1 | x = [1, 2] 2 | 3 | print(x[1]) 4 | 5 | try: 6 | print(x[1.0]) 7 | except TypeError: 8 | print("TypeError") 9 | -------------------------------------------------------------------------------- /arch/arm/mach/zynq/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMER_H_ 2 | #define _TIMER_H_ 3 | 4 | 5 | 6 | extern const BT_IF_DEVICE BT_ZYNQ_TIMER_oDeviceInterface; 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/jim-config.h: -------------------------------------------------------------------------------- 1 | #ifndef _JIM_CONFIG_H 2 | #define _JIM_CONFIG_H 3 | #define HAVE_LONG_LONG 1 4 | /* #undef JIM_UTF8 */ 5 | #define JIM_VERSION 75 6 | #endif 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f401xc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f401xc.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f401xe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f401xe.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f407xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f407xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f411xe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f411xe.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f415xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f415xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f417xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f417xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f427xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f427xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f429xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f429xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f437xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f437xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/cmsis/devinc/stm32f439xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/cmsis/devinc/stm32f439xx.h -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/layers3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/layers3.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/modules.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/rwtest2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/rwtest2.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/img/rwtest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/img/rwtest3.png -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/chdrive.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/chdrive.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/closedir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/closedir.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/fattime.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/fattime.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/forward.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/forward.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/getfree.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/getfree.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/getlabel.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/getlabel.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/opendir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/opendir.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/readdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/readdir.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/setlabel.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/setlabel.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/sfileinfo.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/sfileinfo.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/doc/ja/truncate.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/fatfs/doc/ja/truncate.html -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/hal/inc/stm32f4xx_hal_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/hal/inc/stm32f4xx_hal_def.h -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_callable.py: -------------------------------------------------------------------------------- 1 | import sys 2 | print(callable(1)) 3 | print(callable("dfsd")) 4 | print(callable(callable)) 5 | print(callable(sys)) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/exec1.py: -------------------------------------------------------------------------------- 1 | print(exec("def foo(): return 42")) 2 | print(foo()) 3 | 4 | d = {} 5 | exec("def bar(): return 84", d) 6 | print(d["bar"]()) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/loop_count-4-while_down_gt.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | while num > 0: 5 | num -= 1 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/loop_count-5-while_down_ne.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | while num != 0: 5 | num -= 1 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/class6.py: -------------------------------------------------------------------------------- 1 | class A: 2 | def f(self): 3 | pass 4 | 5 | class B(A): 6 | def f(self): 7 | super().f() 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/if4.py: -------------------------------------------------------------------------------- 1 | if not a: 2 | f() 3 | if not a and b: 4 | f() 5 | if not a and not b: 6 | f() 7 | while not a: 8 | f() 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/import5.py: -------------------------------------------------------------------------------- 1 | from a import b as c 2 | from a.b import c as d 3 | from a.b.c import d as e 4 | from a.b.c import d as e, f as h 5 | -------------------------------------------------------------------------------- /os/src/syscall/calls/klog.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long bt_sys_klog(const BT_i8 *path) { 4 | BT_kPrint("PID %d says: %s", curtask->pid, path); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /scripts/dtc/tests/dup-phandle.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | node1 { 5 | linux,phandle = <1>; 6 | }; 7 | node2 { 8 | linux,phandle = <1>; 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reuse-label1.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | label: node1 { 5 | prop = "foo"; 6 | }; 7 | label: node2 { 8 | prop = "bar"; 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /.dbuild/pretty/test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import time 4 | 5 | print "This is the first line" 6 | 7 | time.sleep(1) 8 | 9 | print "This is the second line" 10 | -------------------------------------------------------------------------------- /arch/arm/mach/stm32/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMER_H_ 2 | #define _TIMER_H_ 3 | 4 | 5 | 6 | extern const BT_IF_DEVICE BT_ZYNQ_TIMER_oDeviceInterface; 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /os/include/loader/bt_elf.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_ELF_H_ 2 | #define _BT_ELF_H_ 3 | 4 | typedef void (*bt_elf_cb_section) (void *data, void *addr, BT_u32 flags, BT_u32 len); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /os/src/net/lwip/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /os/src/net/lwip/test/unit/core/test_mem.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_MEM_H__ 2 | #define __TEST_MEM_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *mem_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /os/src/net/lwip/test/unit/tcp/test_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_H__ 2 | #define __TEST_TCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /os/src/net/lwip/test/unit/udp/test_udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_UDP_H__ 2 | #define __TEST_UDP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* udp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/lib/README.md: -------------------------------------------------------------------------------- 1 | This directory contains standard, low-level C libraries with emphasis on 2 | being independent and efficient. They can be used by any port. 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/hal/src/stm32f4xx_hal_wwdg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/hal/src/stm32f4xx_hal_wwdg.c -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/for_return.py: -------------------------------------------------------------------------------- 1 | # test returning from within a for loop 2 | 3 | def f(): 4 | for i in [1, 2, 3]: 5 | return i 6 | 7 | print(f()) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_count.py: -------------------------------------------------------------------------------- 1 | # list count tests 2 | a = [1, 2, 3] 3 | a = a + a + a 4 | b = [0, 0, a, 0, a, 0] 5 | print(a.count(2)) 6 | print(b.count(a)) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/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 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/loop_count-2-range_iter.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num)): 5 | pass 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/loop_count-3-while_up.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | i = 0 5 | while i < num: 6 | i += 1 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-1-constant.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | i = 0 5 | while i < 20000000: 6 | i += 1 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/list2.py: -------------------------------------------------------------------------------- 1 | x = [()] 2 | x = [(a)] 3 | x = [(a,)] 4 | x = [(a)] 5 | x = [(a,)] 6 | x = [a, b] 7 | x = [(a, b)] 8 | x = [(a, b, c)] 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/listcomp4.py: -------------------------------------------------------------------------------- 1 | # closing over a local variable in a list comprehension 2 | def f(): 3 | a = 1 4 | x = [a + b for b in l] 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/float/true_value.py: -------------------------------------------------------------------------------- 1 | # Test true-ish value handling 2 | 3 | if not 0.0: 4 | print("float 0") 5 | 6 | if not 0+0j: 7 | print("complex 0") 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_binop_multi_comp.py.exp: -------------------------------------------------------------------------------- 1 | 1 == 1 2 | 2 > 1 3 | 2 >= 1 4 | 2 != 1 5 | 1 < 2 6 | 2 > -1 7 | 2 >= -1 8 | 2 != -1 9 | -2 <= 1 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_ptr8_store.py.exp: -------------------------------------------------------------------------------- 1 | bytearray(b'\x00\x00\x00\x00') 2 | bytearray(b'*\x00\x00\x00') 3 | bytearray(b'++++') 4 | bytearray(b',,,,') 5 | -------------------------------------------------------------------------------- /os/src/loader/objects.mk: -------------------------------------------------------------------------------- 1 | BT_OS_OBJECTS-$(BT_CONFIG_LOADER) += $(BUILD_DIR)/os/src/loader/bt_loader.o 2 | BT_OS_OBJECTS-$(BT_CONFIG_LOADER_ELF) += $(BUILD_DIR)/os/src/loader/bt_elf.o 3 | -------------------------------------------------------------------------------- /os/src/shell/micropython/drivers/cc3000/inc/inet_pton.h: -------------------------------------------------------------------------------- 1 | #ifndef __INET_PTON_H 2 | #define __INET_PTON_H 3 | int inet_pton(int, const char *, void *); 4 | #endif /* __INET_PTON_H */ 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/hal/src/stm32f4xx_hal_rcc_ex.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswalmsley/bitthunder/HEAD/os/src/shell/micropython/stmhal/hal/src/stm32f4xx_hal_rcc_ex.c -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/bytes_gen.py: -------------------------------------------------------------------------------- 1 | # construct a bytes object from a generator 2 | def gen(): 3 | for i in range(4): 4 | yield i 5 | print(bytes(gen())) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/string_upperlow.py: -------------------------------------------------------------------------------- 1 | print("".lower()) 2 | print(" t\tn\nr\rv\vf\f".upper()) 3 | print(" T E S T".lower()) 4 | print("*@a1b2cabc_[]/\\".upper()) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/class5.py: -------------------------------------------------------------------------------- 1 | class A(B): 2 | pass 3 | class A(object): 4 | pass 5 | class A(x.y()): 6 | pass 7 | class A(B, C): 8 | pass 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/compare1.py: -------------------------------------------------------------------------------- 1 | if 1 <= x <= 5: 2 | f() 3 | 4 | if 1 <= x <= y <= 7: 5 | f() 6 | 7 | if a < b > c in l != c is not d: 8 | f() 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/with1.py: -------------------------------------------------------------------------------- 1 | with x: 2 | f() 3 | with x(): 4 | f() 5 | with f() as x: 6 | f(x) 7 | with f() as x, g() as y: 8 | f(x, y) 9 | -------------------------------------------------------------------------------- /scripts/dtc/tests/mangle-layout.supp: -------------------------------------------------------------------------------- 1 | { 2 | uninitialized alignment gaps can be dumped to output 3 | Memcheck:Param 4 | write(buf) 5 | obj:/lib/ld-*.so 6 | fun:main 7 | } 8 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reg-ranges-root.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <1>; 5 | #size-cells = <1>; 6 | reg = <0x1000 0x10>; 7 | ranges = <0x1000 0x2000 0x1000>; 8 | }; 9 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/examples.ext/README: -------------------------------------------------------------------------------- 1 | This directory contains examples of C extensions for Jim. 2 | 3 | In general, do: 4 | 5 | build-jim-ext extsource.c 6 | 7 | See the Makefile 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/andor.py: -------------------------------------------------------------------------------- 1 | # test short circuit expressions outside if conditionals 2 | print(() or 1) 3 | print((1,) or 1) 4 | print(() and 1) 5 | print((1,) and 1) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_views.py: -------------------------------------------------------------------------------- 1 | d = {1: 2} 2 | for m in d.items, d.values, d.keys: 3 | print(m()) 4 | print(list(m())) 5 | 6 | # set operations still to come 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/class7.py: -------------------------------------------------------------------------------- 1 | # accessing super, but not as a function call 2 | 3 | class A: 4 | def f(): 5 | #x = super 6 | print(super) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope6.py: -------------------------------------------------------------------------------- 1 | # closed over variable 2 deep 2 | 3 | def f(): 4 | x = 1 5 | def g(): 6 | def h(): 7 | return 1 + x 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/yield2.py: -------------------------------------------------------------------------------- 1 | def f(): 2 | yield from a 3 | yield from (a, b) 4 | yield from f(a) 5 | 6 | lambda:(yield) 7 | lambda:(yield 1) + 2 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/file1.py: -------------------------------------------------------------------------------- 1 | f = open("io/data/file1") 2 | print(f.read(5)) 3 | print(f.readline()) 4 | print(f.read()) 5 | f = open("io/data/file1") 6 | print(f.readlines()) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_misc.py.exp: -------------------------------------------------------------------------------- 1 | 6 2 | 3 3 | 7 4 | 20 5 | 49994955 6 | 1 1 7 | 1 3 8 | (1, 3) 9 | [1, 3] 10 | [1, 3] 11 | SystemError(1,) 12 | 1 13 | 1 14 | -------------------------------------------------------------------------------- /os/src/volumes/objects.mk: -------------------------------------------------------------------------------- 1 | BT_OS_OBJECTS-$(BT_CONFIG_VOLUME) += $(BUILD_DIR)/os/src/volumes/bt_volume.o 2 | BT_OS_OBJECTS-$(BT_CONFIG_VOLUME) += $(BUILD_DIR)/os/src/volumes/bt_partition.o 3 | -------------------------------------------------------------------------------- /lib/include/interfaces/bt_if_module.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_IF_MODULE_H_ 2 | #define _BT_IF_MODULE_H_ 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /os/include/lib/bcd.h: -------------------------------------------------------------------------------- 1 | #ifndef _BCD_H 2 | #define _BCD_H 3 | 4 | #include 5 | 6 | BT_u8 bcd2bin(BT_u8 val); 7 | BT_u8 bin2bcd(BT_u8 val); 8 | 9 | #endif /* _BCD_H */ 10 | -------------------------------------------------------------------------------- /os/src/net/lwip/test/unit/etharp/test_etharp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_ETHARP_H__ 2 | #define __TEST_ETHARP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* etharp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /os/src/net/lwip/test/unit/tcp/test_tcp_oos.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_OOS_H__ 2 | #define __TEST_TCP_OOS_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_oos_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_eval_error.py: -------------------------------------------------------------------------------- 1 | # test if eval raises SyntaxError 2 | 3 | try: 4 | print(eval("[1, *a]")) 5 | except SyntaxError: 6 | print("SyntaxError") 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/memoryerror.py: -------------------------------------------------------------------------------- 1 | l = list(range(10000)) 2 | try: 3 | 100000000 * l 4 | except MemoryError: 5 | print('MemoryError') 6 | print(len(l), l[0], l[-1]) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/closure2.py: -------------------------------------------------------------------------------- 1 | # test closing over an argument 2 | 3 | def f(x): 4 | y = 2 * x 5 | def g(z): 6 | return x + y + z 7 | return g 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/const1.py: -------------------------------------------------------------------------------- 1 | x = 1 2 | #x = 1.2 3 | #x = 1.2e5 4 | #x = 1.2e+5 5 | #x = 1.2e-5 6 | x = () 7 | x = (1,) 8 | x = (1,2) 9 | x = ('a',None,3) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/accel.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | accel = pyb.Accel() 4 | print(accel) 5 | accel.x() 6 | accel.y() 7 | accel.z() 8 | accel.tilt() 9 | accel.filtered_xyz() 10 | -------------------------------------------------------------------------------- /scripts/dtc/tests/escapes.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | compatible = "test_string_escapes"; 5 | escape-str = "nastystring: \a\b\t\n\v\f\r\\\""; 6 | escape-str-2 = "\xde\xad\xbe\xef"; 7 | }; 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/gen_yield_from_iter.py: -------------------------------------------------------------------------------- 1 | def gen(): 2 | yield from (1, 2, 3) 3 | 4 | def gen2(): 5 | yield from gen() 6 | 7 | print(list(gen())) 8 | print(list(gen2())) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/func_builtin-1-enum_pos.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//20)): 5 | enumerate([1, 2], 1) 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import_pkg5.py: -------------------------------------------------------------------------------- 1 | # This tests relative imports as used in pkg3 2 | import pkg3 3 | import pkg3.mod1 4 | import pkg3.subpkg1.mod1 5 | 6 | pkg3.subpkg1.mod1.foo() 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/spi.py.exp: -------------------------------------------------------------------------------- 1 | SPI(1) 2 | SPI(1, SPI.MASTER, baudrate=328125, polarity=1, phase=1, bits=8) 3 | SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) 4 | b'\xff' 5 | b'\xff' 6 | -------------------------------------------------------------------------------- /scripts/dtc/tests/nonexist-node-ref2.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | label: node { 5 | }; 6 | }; 7 | 8 | /* Try to redefine a node using a non-existent label */ 9 | &nosuchnode { 10 | }; 11 | -------------------------------------------------------------------------------- /.dbuild/module.mk: -------------------------------------------------------------------------------- 1 | include $(DBUILD_ROOT).dbuild/c-objects.mk 2 | include $(DBUILD_ROOT).dbuild/cpp-objects.mk 3 | include $(DBUILD_ROOT).dbuild/module-link.mk 4 | include $(DBUILD_ROOT).dbuild/clean.mk 5 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | all: bitthunder.pdf 2 | 3 | 4 | bitthunder.pdf: *.tex 5 | @pdflatex bitthunder.tex > /dev/null 6 | @echo "[TEX] panorama.tex" 7 | 8 | clean: 9 | rm -rf *.log *.aux *.toc *.pdf 10 | -------------------------------------------------------------------------------- /os/src/fs/fullfat/include/FreeRTOSFATConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_FF_CONFIG_H_ 2 | #define _BT_FF_CONFIG_H_ 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/fun2.py: -------------------------------------------------------------------------------- 1 | # calling a function from a function 2 | 3 | def f(x): 4 | print(x + 1) 5 | 6 | def g(x): 7 | f(2 * x) 8 | f(4 * x) 9 | 10 | g(3) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/loop_count-5.1-while_down_ne_localvar.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | zero = 0 5 | while num != zero: 6 | num -= 1 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-4-arg.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | i = 0 6 | while i < num: 7 | i += 1 8 | 9 | bench.run(lambda n:test(20000000)) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/list1.py: -------------------------------------------------------------------------------- 1 | x = [] 2 | x = [1] 3 | x = [1,] # not implemented 4 | x = [1, 2] 5 | x = [1, 2,] 6 | x = [1, 2, 3] 7 | x = [1, 2, 3, 4] 8 | x = [1, 2, 3, 4, 5] 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/gen_context.py: -------------------------------------------------------------------------------- 1 | import gen_context2 2 | 3 | GLOBAL = "GLOBAL" 4 | 5 | def gen(): 6 | print(GLOBAL) 7 | yield 1 8 | 9 | gen_context2.call(gen()) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/drivers/cc3000/inc/inet_ntop.h: -------------------------------------------------------------------------------- 1 | #ifndef __INET_NTOP_H 2 | #define __INET_NTOP_H 3 | char *inet_ntop(int af, const void *addr, char *buf, size_t size); 4 | #endif /* __INET_NTOP_H */ 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/fun3.py: -------------------------------------------------------------------------------- 1 | # function with large number of arguments 2 | 3 | def fun(a, b, c, d, e, f, g): 4 | return a + b + c * d + e * f * g 5 | 6 | print(fun(1, 2, 3, 4, 5, 6, 7)) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/bench.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | 4 | ITERS = 20000000 5 | 6 | def run(f): 7 | t = time.time() 8 | f(ITERS) 9 | t = time.time() - t 10 | print(t) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-2-global.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | ITERS = 20000000 4 | 5 | def test(num): 6 | i = 0 7 | while i < ITERS: 8 | i += 1 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/import3.py: -------------------------------------------------------------------------------- 1 | import a.b 2 | import a.b.c 3 | from a.b import d 4 | from a.b.c import d 5 | 6 | from a import * 7 | from a import d, e 8 | from a import (d, e) 9 | -------------------------------------------------------------------------------- /scripts/dtc/tests/label_repeated.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | l0: prop = "foo"; 5 | 6 | l1: node { 7 | }; 8 | }; 9 | 10 | / { 11 | l0: prop = "foo"; 12 | 13 | l1: node { 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_insert.py: -------------------------------------------------------------------------------- 1 | a = [1, 2, 3] 2 | a.insert(1, 42) 3 | print(a) 4 | a.insert(-1, -1) 5 | print(a) 6 | a.insert(99, 99) 7 | print(a) 8 | a.insert(-99, -99) 9 | print(a) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/func_builtin-2-enum_kw.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//20)): 5 | enumerate(iterable=[1, 2], start=1) 6 | 7 | bench.run(test) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-3-local.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | 4 | def test(num): 5 | ITERS = 20000000 6 | i = 0 7 | while i < ITERS: 8 | i += 1 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /os/src/gpio/Kconfig: -------------------------------------------------------------------------------- 1 | menu "GPIOs" 2 | config MAX_GPIO_CONTROLLERS 3 | int "Maximum registerable GPIO controllers." 4 | default 1 5 | ---help--- 6 | This will require extra SRAM bytes if more are allowed. 7 | endmenu 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/examples/micropython.py: -------------------------------------------------------------------------------- 1 | # micropython module placeholder for CPython 2 | 3 | # Dummy function decorators 4 | 5 | def nodecor(x): 6 | return x 7 | 8 | bytecode = native = viper = nodecor 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_isfooset.py: -------------------------------------------------------------------------------- 1 | sets = [set(), {1}, {1, 2, 3}, {3, 4, 5}, {5, 6, 7}] 2 | for i in sets: 3 | for j in sets: 4 | print(i.issubset(j)) 5 | print(i.issuperset(j)) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_pop.py: -------------------------------------------------------------------------------- 1 | s = {1} 2 | print(s.pop()) 3 | try: 4 | print(s.pop(), "!!!") 5 | except KeyError: 6 | pass 7 | else: 8 | print("Failed to raise KeyError") 9 | 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-1-list_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = list(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/io/file_readinto.py: -------------------------------------------------------------------------------- 1 | b = bytearray(30) 2 | f = open("io/data/file1", "rb") 3 | print(f.readinto(b)) 4 | print(b) 5 | f = open("io/data/file2", "rb") 6 | print(f.readinto(b)) 7 | print(b) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/const.py: -------------------------------------------------------------------------------- 1 | # test constant optimisation 2 | 3 | X = const(123) 4 | Y = const(X + 456) 5 | 6 | print(X, Y + 1) 7 | 8 | def f(): 9 | print(X, Y + 1) 10 | 11 | f() 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/adc.py: -------------------------------------------------------------------------------- 1 | from pyb import ADC 2 | from pyb import Pin 3 | 4 | adc = ADC('X22') 5 | print(adc) 6 | 7 | adc.read() 8 | 9 | buf = bytearray(100) 10 | adc.read_timed(buf, 500) 11 | -------------------------------------------------------------------------------- /scripts/dtc/tests/bad-empty-ranges.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <2>; 5 | #size-cells = <2>; 6 | node { 7 | #address-cells = <1>; 8 | #size-cells = <1>; 9 | ranges; 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/mpconfigport.mk: -------------------------------------------------------------------------------- 1 | # Enable/disable extra modules 2 | 3 | # wiznet5k module for ethernet support 4 | MICROPY_PY_WIZNET5K ?= 0 5 | 6 | # cc3k module for wifi support 7 | MICROPY_PY_CC3K ?= 0 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/servo.h: -------------------------------------------------------------------------------- 1 | void servo_init(void); 2 | 3 | extern const mp_obj_type_t pyb_servo_type; 4 | 5 | MP_DECLARE_CONST_FUN_OBJ(pyb_servo_set_obj); 6 | MP_DECLARE_CONST_FUN_OBJ(pyb_pwm_set_obj); 7 | 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/try1.py: -------------------------------------------------------------------------------- 1 | # basic exceptions 2 | x = 1 3 | try: 4 | x.a() 5 | except: 6 | print(x) 7 | 8 | try: 9 | raise IndexError 10 | except IndexError: 11 | print("caught") 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-3-tuple_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = tuple(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-5-bytes_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytes(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/func_args-1.1-pos_1.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/func_args-3.1-kw_1.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(a=i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/del2.py: -------------------------------------------------------------------------------- 1 | del x 2 | del x, 3 | del x, y 4 | del x, y, 5 | del x, y, z 6 | del (x) 7 | del (x,) 8 | del (x, y) 9 | del (x, y,) 10 | del (x, y, z) 11 | del a, (b, c) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/string1.py: -------------------------------------------------------------------------------- 1 | x = 'abc' 2 | x = "abc" 3 | x = r'abc' 4 | x = 'abc' \ 5 | 'def' 6 | x = ('abc' 7 | 'def') 8 | 9 | x = 'ab"c' 10 | x = "ab'c" 11 | x = '''ab'c''' 12 | -------------------------------------------------------------------------------- /scripts/dtc/tests/comments-cmp.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | prop1; 5 | prop2; 6 | prop3; 7 | prop4; 8 | prop5; 9 | prop6; 10 | prop7; 11 | prop8; 12 | prop9; 13 | prop10; 14 | child { 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/examples.api/print.tcl: -------------------------------------------------------------------------------- 1 | puts "-- List present in an array constructed from C program --" 2 | foreach {str} $MYLIST { 3 | puts $str 4 | } 5 | puts "---------------------------------------------------------" 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_slice_3arg.py: -------------------------------------------------------------------------------- 1 | x = list(range(10)) 2 | print(x[::-1]) 3 | print(x[::2]) 4 | print(x[::-2]) 5 | 6 | x = list(range(9)) 7 | print(x[::-1]) 8 | print(x[::2]) 9 | print(x[::-2]) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_isdisjoint.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(s.isdisjoint({1})) 3 | print(s.isdisjoint([2])) 4 | print(s.isdisjoint([])) 5 | print(s.isdisjoint({7,8,9,10})) 6 | print(s.isdisjoint([7,8,9,1])) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-7-bytearray_bound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytearray(l) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/extmod/uctypes_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x3130 2 | 48 49 3 | TypeError 4 | arr: 48 49 5 | arr of struct: 48 49 6 | IndexError 7 | bf: 48 49 8 | bf 4bit: 3 1 3 0 9 | bytearray(b'21') 10 | bytearray(b'2Q') 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/can.py: -------------------------------------------------------------------------------- 1 | from pyb import CAN 2 | 3 | can = CAN(1) 4 | print(can) 5 | can.init(CAN.LOOPBACK) 6 | print(can.any(0)) 7 | can.send('abcd', 123) 8 | print(can.any(0)) 9 | print(can.recv(0)) 10 | -------------------------------------------------------------------------------- /drivers/mtd/objects.mk: -------------------------------------------------------------------------------- 1 | MTD_OBJECTS-$(BT_CONFIG_DRIVERS_MTD_M25P80) += $(BUILD_DIR)/drivers/mtd/m25p80.o 2 | 3 | 4 | MTD_OBJECTS += $(MTD_OBJECTS-y) 5 | 6 | $(MTD_OBJECTS): MODULE_NAME="drivers-MTD" 7 | OBJECTS += $(MTD_OBJECTS) 8 | -------------------------------------------------------------------------------- /drivers/rtc/objects.mk: -------------------------------------------------------------------------------- 1 | RTC_OBJECTS-$(BT_CONFIG_DRIVERS_RTC_I2C_DS1338) += $(BUILD_DIR)/drivers/rtc/ds1338.o 2 | 3 | 4 | RTC_OBJECTS += $(RTC_OBJECTS-y) 5 | 6 | $(RTC_OBJECTS): MODULE_NAME="drivers-RTC" 7 | OBJECTS += $(RTC_OBJECTS) 8 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/examples/tcp.client: -------------------------------------------------------------------------------- 1 | # Example of sending via a connected tcp socket 2 | 3 | set s [socket stream 127.0.0.1:20000] 4 | 5 | foreach i [range 1 20] { 6 | $s puts "1 << $i" 7 | 8 | puts [$s gets] 9 | } 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/for2.py: -------------------------------------------------------------------------------- 1 | i = 'init' 2 | for i in range(0): 3 | pass 4 | print(i) # should not have been modified 5 | 6 | for i in range(10): 7 | pass 8 | print(i) # should be last successful value of loop 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/map.py: -------------------------------------------------------------------------------- 1 | print(list(map(lambda x: x & 1, range(-3, 4)))) 2 | print(list(map(abs, range(-3, 4)))) 3 | print(list(map(set, [[i] for i in range(-3, 4)]))) 4 | print(list(map(pow, range(4), range(4)))) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/func_args-1.2-pos_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a, b, c): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(i, i, i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-5-class-attr.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | class Foo: 4 | num = 20000000 5 | 6 | def test(num): 7 | i = 0 8 | while i < Foo.num: 9 | i += 1 10 | 11 | bench.run(test) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/raise1.py: -------------------------------------------------------------------------------- 1 | def f(): 2 | raise 3 | def g(): 4 | raise 1 5 | def h(): 6 | raise 1 from 2 7 | def i(): 8 | try: 9 | f() 10 | except: 11 | raise 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/try6.py: -------------------------------------------------------------------------------- 1 | try: 2 | f() 3 | except: 4 | g() 5 | else: 6 | h() 7 | 8 | try: 9 | f() 10 | except: 11 | g() 12 | else: 13 | h() 14 | finally: 15 | i() 16 | -------------------------------------------------------------------------------- /scripts/dtc/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.d 3 | *.a 4 | *.patch 5 | *.so 6 | *~ 7 | *.tab.[ch] 8 | lex.yy.c 9 | *.lex.c 10 | /dtc 11 | /fdtdump 12 | /convert-dtsv0 13 | /version_gen.h 14 | /fdtget 15 | /fdtput 16 | /patches 17 | /.pc 18 | -------------------------------------------------------------------------------- /drivers/dac/objects.mk: -------------------------------------------------------------------------------- 1 | DAC_OBJECTS-$(BT_CONFIG_DRIVERS_DAC_I2C_MCP4728) += $(BUILD_DIR)/drivers/dac/mcp4728.o 2 | 3 | 4 | DAC_OBJECTS += $(DAC_OBJECTS-y) 5 | 6 | $(DAC_OBJECTS): MODULE_NAME="drivers-DAC" 7 | OBJECTS += $(DAC_OBJECTS) 8 | -------------------------------------------------------------------------------- /drivers/net/phy/objects.mk: -------------------------------------------------------------------------------- 1 | PHY_OBJECTS-$(BT_CONFIG_DRIVERS_NET_PHY_MARVELL) += $(BUILD_DIR)/drivers/net/phy/marvell.o 2 | PHY_OBJECTS += $(PHY_OBJECTS-y) 3 | 4 | $(PHY_OBJECTS): MODULE_NAME="drivers-phy" 5 | 6 | OBJECTS += $(PHY_OBJECTS) 7 | -------------------------------------------------------------------------------- /os/src/lib/bcd.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | BT_u8 bcd2bin(BT_u8 ucVal) 4 | { 5 | return (ucVal & 0x0f) + (ucVal >> 4) * 10; 6 | } 7 | 8 | BT_u8 bin2bcd(BT_u8 ucVal) 9 | { 10 | return ((ucVal / 10) << 4) + ucVal % 10; 11 | } 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/pybioctl.h: -------------------------------------------------------------------------------- 1 | #define MP_IOCTL_POLL (0x100 | 1) 2 | 3 | #define MP_IOCTL_POLL_RD (0x0001) 4 | #define MP_IOCTL_POLL_WR (0x0002) 5 | #define MP_IOCTL_POLL_HUP (0x0004) 6 | #define MP_IOCTL_POLL_ERR (0x0008) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/del_subscr.py: -------------------------------------------------------------------------------- 1 | l = [1, 2, 3] 2 | print(l) 3 | del l[0] 4 | print(l) 5 | del l[-1] 6 | print(l) 7 | 8 | d = {1:2, 3:4, 5:6} 9 | del d[1] 10 | del d[3] 11 | print(d) 12 | del d[5] 13 | print(d) 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/generator_return.py: -------------------------------------------------------------------------------- 1 | def gen(): 2 | yield 1 3 | return 42 4 | 5 | g = gen() 6 | print(next(g)) 7 | try: 8 | print(next(g)) 9 | except StopIteration as e: 10 | print(repr(e)) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-2-list_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = list(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/func_args-3.2-kw_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a, b, c): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(c=i, b=i, a=i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/assign1.py: -------------------------------------------------------------------------------- 1 | [] = () 2 | [] = [] 3 | a = b 4 | (a) = b 5 | a, b = c, d 6 | a, b, c = d, e, f 7 | a, b, c, d = e, f, g, h 8 | #(a, b) = c, d 9 | #a, b = (c, d) 10 | #(a, b) = (c, d) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/extmod/uctypes_native_le.py.exp: -------------------------------------------------------------------------------- 1 | 0x3130 2 | 48 49 3 | TypeError 4 | arr: 48 49 5 | arr of struct: 48 49 6 | IndexError 7 | bf: 48 49 8 | bf 4bit: 3 1 3 0 9 | bytearray(b'21') 10 | bytearray(b'2Q') 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unicode/unicode_index.py: -------------------------------------------------------------------------------- 1 | print("Привет".find("т")) 2 | print("Привет".find("П")) 3 | print("Привет".rfind("т")) 4 | print("Привет".rfind("П")) 5 | print("Привет".index("т")) 6 | print("Привет".index("П")) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unicode/unicode_pos.py: -------------------------------------------------------------------------------- 1 | # str methods with explicit start/end pos 2 | print("Привет".startswith("П")) 3 | print("Привет".startswith("р", 1)) 4 | print("абвба".find("а", 1)) 5 | print("абвба".find("а", 1, -1)) 6 | -------------------------------------------------------------------------------- /os/src/loader/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Loader" 2 | 3 | config LOADER 4 | bool "Enable Dynamic loading" 5 | default n 6 | 7 | config LOADER_ELF 8 | bool "Support ELF file loading" 9 | default n 10 | depends on LOADER 11 | 12 | endmenu 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_intersection.py: -------------------------------------------------------------------------------- 1 | s = {1, 2, 3, 4} 2 | print(sorted(s)) 3 | print(sorted(s.intersection({1, 3}))) 4 | print(sorted(s.intersection([3, 4]))) 5 | 6 | print(s.intersection_update([1])) 7 | print(sorted(s)) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/subclass_native4.py: -------------------------------------------------------------------------------- 1 | # Test calling non-special method inherited from native type 2 | 3 | class mylist(list): 4 | pass 5 | 6 | l = mylist([1, 2, 3]) 7 | print(l) 8 | l.append(10) 9 | print(l) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-4-tuple_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = tuple(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-6-bytes_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytes(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/func_args-2-pos_default_2_of_3.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def func(a, b=1, c=2): 4 | pass 5 | 6 | def test(num): 7 | for i in iter(range(num)): 8 | func(i) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/class3.py: -------------------------------------------------------------------------------- 1 | class A: 2 | def f(x): 3 | return x 4 | def g(y): 5 | def h(z): 6 | return x + y + z 7 | h(y) 8 | A() 9 | A.f(1) 10 | A.g(2)(3) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/class4.py: -------------------------------------------------------------------------------- 1 | class A: 2 | def __init__(self, x): 3 | self.x = x 4 | self.y = 0 5 | 6 | def get(self): 7 | return self.x + self.y 8 | A(1) 9 | A(2).get() 10 | -------------------------------------------------------------------------------- /drivers/gpio/objects.mk: -------------------------------------------------------------------------------- 1 | GPIO_OBJECTS-$(BT_CONFIG_DRIVERS_GPIO_I2C_MAX7312) += $(BUILD_DIR)/drivers/gpio/max7312.o 2 | 3 | 4 | GPIO_OBJECTS += $(GPIO_OBJECTS-y) 5 | 6 | $(GPIO_OBJECTS): MODULE_NAME="drivers-GPIO" 7 | OBJECTS += $(GPIO_OBJECTS) 8 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/tests/Makefile: -------------------------------------------------------------------------------- 1 | jimsh ?= ../jimsh 2 | 3 | test: 4 | @rc=0; for i in *.test; do LD_LIBRARY_PATH=..:$(LD_LIBRARY_PATH) $(jimsh) $$i || rc=$?; done; exit $$rc 5 | 6 | clean: 7 | rm -f gorp.file2 gorp.file sleepx test1 exec.tmp1 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/memzip_files/main.py: -------------------------------------------------------------------------------- 1 | print("Executing main.py") 2 | 3 | led = pyb.LED(1) 4 | 5 | led.on() 6 | pyb.delay(100) 7 | led.off() 8 | pyb.delay(100) 9 | led.on() 10 | pyb.delay(100) 11 | led.off() 12 | 13 | 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/bytes_compare2.py: -------------------------------------------------------------------------------- 1 | import array 2 | 3 | print(b"1" == 1) 4 | print(b"123" == bytearray(b"123")) 5 | print(b"123" == "123") 6 | # CPyhon gives False here 7 | #print(b"\x01\x02\x03" == array.array("B", [1, 2, 3])) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_fromkeys.py: -------------------------------------------------------------------------------- 1 | d = dict.fromkeys([1, 2, 3, 4]) 2 | l = list(d.keys()) 3 | l.sort() 4 | print(l) 5 | 6 | d = dict.fromkeys([1, 2, 3, 4], 42) 7 | l = list(d.values()) 8 | l.sort() 9 | print(l) 10 | 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/string_repr.py: -------------------------------------------------------------------------------- 1 | # anything above 0xa0 is printed as Unicode by CPython 2 | # the abobe is CPython implementation detail, stick to ASCII 3 | for c in range(0x80): 4 | print("0x%02x: %s" % (c, repr(chr(c)))) 5 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/from_iter-8-bytearray_unbound.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | def test(num): 4 | for i in iter(range(num//10000)): 5 | l = [0] * 1000 6 | l2 = bytearray(map(lambda x: x, l)) 7 | 8 | bench.run(test) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope4.py: -------------------------------------------------------------------------------- 1 | # test scope 2 | 3 | def f(x): 4 | global x42 5 | print(x, x42) 6 | x42 = x 7 | 8 | x42 = 123 9 | f(1) 10 | print(x42) 11 | 12 | x42 = 456 13 | f(2) 14 | print(x42) 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_binop_comp.py.exp: -------------------------------------------------------------------------------- 1 | 1 == 1 2 | 1 <= 1 3 | 1 >= 1 4 | 2 > 1 5 | 2 >= 1 6 | 2 != 1 7 | 1 < 2 8 | 1 <= 2 9 | 1 != 2 10 | 2 > -1 11 | 2 >= -1 12 | 2 != -1 13 | -2 < 1 14 | -2 <= 1 15 | -2 != 1 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/extint.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l)) 4 | ext.disable() 5 | ext.enable() 6 | print(ext.line()) 7 | ext.swint() 8 | ext.disable() 9 | -------------------------------------------------------------------------------- /scripts/dtc/tests/bad-reg-ranges.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <2>; 5 | #size-cells = <2>; 6 | node { 7 | reg = <0 0>; 8 | #address-cells = <1>; 9 | #size-cells = <1>; 10 | ranges = <0 0 0>; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /drivers/block/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Block Devices" 2 | 3 | config DRIVERS_BLOCK 4 | bool 5 | default n 6 | select BLOCK 7 | 8 | config DRIVERS_BLOCK_RAMDISK 9 | bool "Ramdisk" 10 | select DRIVERS_BLOCK 11 | default n 12 | 13 | endmenu 14 | -------------------------------------------------------------------------------- /drivers/block/objects.mk: -------------------------------------------------------------------------------- 1 | BLOCK_OBJECTS-$(BT_CONFIG_DRIVERS_BLOCK_RAMDISK) += $(BUILD_DIR)/drivers/block/ramdisk.o 2 | 3 | 4 | BLOCK_OBJECTS += $(BLOCK_OBJECTS-y) 5 | 6 | $(BLOCK_OBJECTS): MODULE_NAME="drivers-BLOCK" 7 | OBJECTS += $(BLOCK_OBJECTS) 8 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/set_symmetric_difference.py: -------------------------------------------------------------------------------- 1 | print(sorted({1,2}.symmetric_difference({2,3}))) 2 | print(sorted({1,2}.symmetric_difference([2,3]))) 3 | s = {1,2} 4 | print(s.symmetric_difference_update({2,3})) 5 | print(sorted(s)) 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/fun4.py: -------------------------------------------------------------------------------- 1 | def f(a, b=1, *c, d): 2 | pass 3 | #print(a,b,c,d) # bug in uPy! 4 | f = lambda a, b, *c, d: None # default arg 5 | #f = lambda a, b=1, *c, d: None # default arg for lambda not implemented 6 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tools/.gitignore: -------------------------------------------------------------------------------- 1 | tinytest/.gitignore 2 | tinytest/.travis.yml 3 | tinytest/Makefile 4 | tinytest/Makefile.arm-cortex-m3-qemu 5 | tinytest/Makefile.avr 6 | tinytest/TODO 7 | tinytest/portable_demo.c 8 | tinytest/tinytest_demo.c 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/int_big_div.py: -------------------------------------------------------------------------------- 1 | for lhs in (1000000000000000000000000, 10000000000100000000000000, 10012003400000000000000007, 12349083434598210349871029923874109871234789): 2 | for rhs in range(1, 555): 3 | print(lhs // rhs) 4 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/iter_of_iter.py: -------------------------------------------------------------------------------- 1 | i = iter(iter((1, 2, 3))) 2 | print(list(i)) 3 | i = iter(iter([1, 2, 3])) 4 | print(list(i)) 5 | i = iter(iter({1:2, 3:4, 5:6})) 6 | print(sorted(i)) 7 | i = iter(iter({1, 2, 3})) 8 | print(sorted(i)) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/dac.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | dac = pyb.DAC(1) 4 | print(dac) 5 | dac.noise(100) 6 | dac.triangle(100) 7 | dac.write(0) 8 | dac.write_timed(bytearray(10), 100, mode=pyb.DAC.NORMAL) 9 | pyb.delay(20) 10 | dac.write(0) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/closure_defargs.py: -------------------------------------------------------------------------------- 1 | # test closure with default args 2 | 3 | def f(): 4 | a = 1 5 | def bar(b = 10, c = 20): 6 | print(a + b + c) 7 | bar() 8 | bar(2) 9 | bar(2, 3) 10 | 11 | print(f()) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/string_escape.py: -------------------------------------------------------------------------------- 1 | a = "a\1b" 2 | print(len(a)) 3 | print(ord(a[1])) 4 | print(len("a\123b")) 5 | a = "a\12345b" 6 | print(len(a)) 7 | print(ord(a[1])) 8 | 9 | a = "a\xffb" 10 | print(len(a)) 11 | print(ord(a[1])) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope3.py: -------------------------------------------------------------------------------- 1 | # test nested functions and scope 2 | 3 | def f(x): 4 | def f2(y): 5 | return y + x 6 | print(f2(x)) 7 | return f2 8 | x=f(2) 9 | print(x, x(5)) 10 | f=123 11 | print(f(f)) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/pin.py.exp: -------------------------------------------------------------------------------- 1 | Pin(Pin.cpu.A0, mode=Pin.IN) 2 | A0 3 | 0 4 | 0 5 | Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_UP) 6 | 1 7 | Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_DOWN) 8 | 0 9 | 0 10 | 1 11 | 0 12 | 1 13 | 0 14 | 1 15 | -------------------------------------------------------------------------------- /scripts/dtc/tests/include7.dts: -------------------------------------------------------------------------------- 1 | subnode@1 { 2 | compatible = "subnode1"; 3 | prop-int = [deadbeef]; 4 | 5 | subsubnode { 6 | compatible = "subsubnode1", "subsubnode"; 7 | prop-int = <0xdeadbeef>; 8 | }; 9 | 10 | ss1 { 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /scripts/dtc/tests/test01.stderr: -------------------------------------------------------------------------------- 1 | DTC: dts->asm on file "test.dts" 2 | Warning: "linux,boot-cpu" property is deprecated in blob version 2 or higher 3 | Warning: /chosen has no "linux,stdout-path" property 4 | Warning: /chosen has no "interrupt-controller" property 5 | -------------------------------------------------------------------------------- /os/include/devman/bt_integrated_driver.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_INTEGRATED_DRIVER_H_ 2 | #define _BT_INTEGRATED_DRIVER_H_ 3 | 4 | #include "bt_driver.h" 5 | 6 | #define BT_INTEGRATED_DRIVER BT_DRIVER 7 | #define BT_INTEGRATED_DRIVER_DEF BT_DRIVER_DEF 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/drivers/wiznet5k/README.md: -------------------------------------------------------------------------------- 1 | This is the driver for the WIZnet5x00 series of Ethernet controllers. 2 | 3 | Adapted for Micro Python. 4 | 5 | Original source: https://github.com/Wiznet/W5500_EVB/tree/master/ioLibrary 6 | Taken on: 30 August 2014 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_eval.py: -------------------------------------------------------------------------------- 1 | # builtin eval 2 | 3 | eval('1 + 2') 4 | eval('1 + 2\n') 5 | eval('1 + 2\n\n#comment\n') 6 | 7 | x = 4 8 | eval('x') 9 | 10 | eval('lambda x: x + 10')(-5) 11 | 12 | y = 6 13 | eval('lambda: y * 2')() 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_len1.py: -------------------------------------------------------------------------------- 1 | # builtin len 2 | 3 | print(len(())) 4 | print(len((1,))) 5 | print(len((1, 2))) 6 | 7 | print(len([])) 8 | x = [1, 2, 3] 9 | print(len(x)) 10 | 11 | f = len 12 | print(f({})) 13 | print(f({1:2, 3:4})) 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_remove.py: -------------------------------------------------------------------------------- 1 | a = [1, 2, 3] 2 | print(a.remove(2)) 3 | print(a) 4 | try: 5 | a.remove(2) 6 | except ValueError: 7 | print("Raised ValueError") 8 | else: 9 | raise AssertionError("Did not raise ValueError") 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/subclass_classmethod.py: -------------------------------------------------------------------------------- 1 | # Calling an inherited classmethod 2 | class Base: 3 | 4 | @classmethod 5 | def foo(cls): 6 | print(cls.__name__) 7 | 8 | class Sub(Base): 9 | pass 10 | 11 | 12 | Sub.foo() 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope5.py: -------------------------------------------------------------------------------- 1 | # test scope 2 | 3 | def f(x): 4 | def f2(y): 5 | print(y, x42, y42) 6 | x42 = x = y42 = 123 7 | myf2 = f2 8 | x42 = 456 9 | return myf2 10 | 11 | myf = f(1) 12 | myf(1) 13 | -------------------------------------------------------------------------------- /scripts/dtc/tests/reuse-label.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | label: property1 = "foo"; 5 | label: property2 = "bar"; 6 | 7 | test1 = &label; 8 | 9 | label: node1 { 10 | prop = "foo"; 11 | }; 12 | label: node2 { 13 | prop = "bar"; 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /arch/arm/include/bt_arch_config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_ARCH_CONFIG_H_ 2 | #define _BT_ARCH_CONFIG_H_ 3 | 4 | #include "compilers/bt_gcc.h" 5 | 6 | //#define BT_CONFIG_ARCH_LITTLE_ENDIAN 7 | #define BT_CONFIG_ARCH_BIG_ENDIAN 8 | 9 | 10 | 11 | 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /drivers/dac/Kconfig: -------------------------------------------------------------------------------- 1 | menu "DAC Devices" 2 | 3 | config DRIVERS_DAC 4 | bool 5 | default n 6 | 7 | menu "I2C DAC's" 8 | 9 | config DRIVERS_DAC_I2C_MCP4728 10 | bool "MCP4728" 11 | select DRIVERS_DAC 12 | default n 13 | endmenu 14 | 15 | 16 | endmenu 17 | -------------------------------------------------------------------------------- /lib/src/mm/bt_mm.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Memory Manager for BitThunder. 3 | * 4 | * 5 | **/ 6 | 7 | #include 8 | #include 9 | 10 | 11 | void *BT_Calloc(BT_u32 ulSize) { 12 | return calloc(1, ulSize); 13 | } 14 | BT_EXPORT_SYMBOL(BT_Calloc); 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/led.h: -------------------------------------------------------------------------------- 1 | typedef enum { 2 | PYB_LED_BUILTIN = 1, 3 | } pyb_led_t; 4 | 5 | void led_init(void); 6 | void led_state(pyb_led_t led, int state); 7 | void led_toggle(pyb_led_t led); 8 | 9 | extern const mp_obj_type_t pyb_led_type; 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/subclass_native_cmp.py: -------------------------------------------------------------------------------- 1 | # Test calling non-special method inherited from native type 2 | 3 | class mytuple(tuple): 4 | pass 5 | 6 | t = mytuple((1, 2, 3)) 7 | print(t) 8 | print(t == (1, 2, 3)) 9 | print((1, 2, 3) == t) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/native_misc.py: -------------------------------------------------------------------------------- 1 | @micropython.native 2 | def native_test(x): 3 | print(1, [], x) 4 | 5 | native_test(2) 6 | 7 | # check that GC doesn't collect the native function 8 | import gc 9 | gc.collect() 10 | native_test(3) 11 | -------------------------------------------------------------------------------- /drivers/rtc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "RTC Devices" 2 | 3 | config DRIVERS_RTC 4 | bool 5 | default n 6 | 7 | menu "I2C RTC devices" 8 | 9 | config DRIVERS_RTC_I2C_DS1338 10 | bool "DS1338" 11 | select DRIVERS_RTC 12 | default n 13 | endmenu 14 | 15 | 16 | endmenu 17 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | jim 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/getattr.py: -------------------------------------------------------------------------------- 1 | # test __getattr__ 2 | 3 | class A: 4 | def __init__(self, d): 5 | self.d = d 6 | 7 | def __getattr__(self, attr): 8 | return self.d[attr] 9 | 10 | a = A({'a':1, 'b':2}) 11 | print(a.a, a.b) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/try_as_var.py: -------------------------------------------------------------------------------- 1 | try: 2 | raise ValueError(534) 3 | except ValueError as e: 4 | print(repr(e)) 5 | 6 | # Var bound in except block is automatically deleted 7 | try: 8 | e 9 | except NameError: 10 | print("NameError") 11 | -------------------------------------------------------------------------------- /scripts/dtc/tests/appendprop.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | prop-str = "hello world", "nastystring: \a\b\t\n\v\f\r\\\""; 5 | prop-int64 = /bits/ 64 <0xdeadbeef01abcdef 0xdeadbeef01abcdef>; 6 | prop-int = <0xdeadbeef 123456789>; 7 | prop-bytes = [00010203040001020304]; 8 | }; 9 | -------------------------------------------------------------------------------- /os/.config.mk: -------------------------------------------------------------------------------- 1 | CFLAGS += -I $(BASE)/os/include/ 2 | CFLAGS += -I $(BASE)/arch/$(ARCH)/include/ 3 | CFLAGS += -I $(BASE)/drivers/ 4 | CFLAGS += -I $(BASE)/arch/$(ARCH)/include/arch/common/ 5 | ifneq ($(PROJECT_CONFIG),y) 6 | CFLAGS += -I $(BASE) 7 | endif 8 | CFLAGS += -DBT_CONFIG_OS 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/break.py: -------------------------------------------------------------------------------- 1 | while True: 2 | break 3 | 4 | for i in range(4): 5 | print('one', i) 6 | if i > 2: 7 | break 8 | print('two', i) 9 | 10 | for i in [1, 2, 3, 4]: 11 | if i == 3: 12 | break 13 | print(i) 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/subclass_native5.py: -------------------------------------------------------------------------------- 1 | # Subclass from 2 bases explicitly subclasses from object 2 | 3 | class Base1(object): 4 | pass 5 | 6 | class Base2(object): 7 | pass 8 | 9 | class Sub(Base1, Base2): 10 | pass 11 | 12 | o = Sub() 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/try3.py: -------------------------------------------------------------------------------- 1 | def f(): 2 | try: 3 | f() 4 | except: 5 | g() 6 | finally: 7 | f() 8 | 9 | try: 10 | f() 11 | except Exception: 12 | g() 13 | finally: 14 | f() 15 | -------------------------------------------------------------------------------- /drivers/gpio/Kconfig: -------------------------------------------------------------------------------- 1 | menu "GPIO Devices" 2 | 3 | config DRIVERS_GPIO 4 | bool 5 | default n 6 | 7 | menu "I2C GPIO Expanders" 8 | 9 | config DRIVERS_GPIO_I2C_MAX7312 10 | bool "MAX7312" 11 | select DRIVERS_GPIO 12 | default n 13 | endmenu 14 | 15 | 16 | endmenu 17 | -------------------------------------------------------------------------------- /os/include/interfaces/bt_dev_if_sdio.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_DEV_IF_SDIO_H_ 2 | #define _BT_DEV_IF_SDIO_H_ 3 | 4 | 5 | typedef struct _BT_DEV_IF_SDIO { 6 | BT_ERROR (*pfnSendCommand) (BT_u8 ucCommand, BT_u32 ulArgument, BT_u32 *pResponse); 7 | 8 | } BT_DEV_IF_SDIO; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/unary_op.py: -------------------------------------------------------------------------------- 1 | print(not None) 2 | print(not False) 3 | print(not True) 4 | print(not 0) 5 | print(not 1) 6 | print(not -1) 7 | print(not ()) 8 | print(not (1,)) 9 | print(not []) 10 | print(not [1,]) 11 | print(not {}) 12 | print(not {1:1}) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/while1.py: -------------------------------------------------------------------------------- 1 | # basic while loop 2 | 3 | x = 0 4 | while x < 2: 5 | y = 0 6 | while y < 2: 7 | z = 0 8 | while z < 2: 9 | z = z + 1 10 | print(x, y, z) 11 | y = y + 1 12 | x = x + 1 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/funcall-1-inline.py: -------------------------------------------------------------------------------- 1 | # Function call overhead test 2 | # Establish a baseline for performing a trivial operation inline 3 | import bench 4 | 5 | def test(num): 6 | for i in iter(range(num)): 7 | a = i + 1 8 | 9 | bench.run(test) 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/string2.py: -------------------------------------------------------------------------------- 1 | 'abc' 2 | class f: 3 | u"123" 4 | pass 5 | x = 'abc' 6 | x = u"abc" 7 | x = u"ab\\c" 8 | x = r"ab\\c" 9 | x = b"abc" 10 | x = rb"abc" 11 | x = b"ab\\c" 12 | x = rb"ab\\c" 13 | x = """abc""" 14 | x = b"""abc""" 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/uart.py: -------------------------------------------------------------------------------- 1 | from pyb import UART 2 | 3 | uart = UART(1) 4 | uart = UART(1, 9600) 5 | uart = UART(1, 9600, bits=8, stop=1, parity=None) 6 | print(uart) 7 | 8 | uart.init(1200) 9 | print(uart) 10 | 11 | uart.any() 12 | uart.send(1, timeout=500) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pybnative/for.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | @micropython.native 4 | def f1(n): 5 | for i in range(n): 6 | print(i) 7 | 8 | f1(4) 9 | 10 | @micropython.native 11 | def f2(r): 12 | for i in r: 13 | print(i) 14 | 15 | f2(range(4)) 16 | -------------------------------------------------------------------------------- /.dbuild/pretty/prettydefault.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import prettyformat 5 | import fileinput 6 | 7 | module = sys.argv[1] 8 | 9 | line = sys.stdin.readline() 10 | while(line): 11 | print module + ": " + line.strip() 12 | line = sys.stdin.readline() 13 | 14 | -------------------------------------------------------------------------------- /drivers/mtd/Kconfig: -------------------------------------------------------------------------------- 1 | menu "MTD Devices" 2 | 3 | config DRIVERS_MTD 4 | bool 5 | default n 6 | select MTD 7 | 8 | 9 | menu "SPI Flash devices" 10 | 11 | config DRIVERS_MTD_M25P80 12 | bool "m25p80" 13 | select DRIVERS_MTD 14 | default n 15 | endmenu 16 | 17 | endmenu 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/reg.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | const char *name; 3 | mp_uint_t offset; 4 | } reg_t; 5 | 6 | #define REG_ENTRY(st, name) { #name, offsetof(st, name) } 7 | 8 | mp_obj_t reg_cmd(void *base, reg_t *reg, mp_uint_t num_reg, uint n_args, const mp_obj_t *args); 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/frozenset_copy.py: -------------------------------------------------------------------------------- 1 | try: 2 | frozenset 3 | except NameError: 4 | print("SKIP") 5 | import sys 6 | sys.exit() 7 | 8 | s = frozenset({1, 2, 3, 4}) 9 | t = s.copy() 10 | print(type(t)) 11 | for i in s, t: 12 | print(sorted(i)) 13 | -------------------------------------------------------------------------------- /scripts/dtc/tests/obsolete-chosen-interrupt-controller.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <1>; 5 | #size-cells = <1>; 6 | PIC: pic@0 { 7 | reg = <0x0 0x10>; 8 | interrupt-controller; 9 | }; 10 | chosen { 11 | interrupt-controller = <&PIC>; 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /arch/arm/common/gt.h: -------------------------------------------------------------------------------- 1 | #ifndef _GT_H_ 2 | #define _GT_H_ 3 | 4 | typedef struct _GT_REGS { 5 | BT_u32 count_0; 6 | BT_u32 count_1; 7 | BT_u32 control; 8 | BT_u32 isr; 9 | BT_u32 comp_0; 10 | BT_u32 comp_1; 11 | BT_u32 autoinc; 12 | } GT_REGS; 13 | 14 | 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /drivers/mmc/host.h: -------------------------------------------------------------------------------- 1 | #ifndef _HOST_H_ 2 | #define _HOST_H_ 3 | 4 | 5 | typedef struct _BT_MMC_HOST_OPS { 6 | BT_u32 (*pfnGetInputClock)(const BT_INTEGRATED_DEVICE *pDevice, BT_ERROR *pError); 7 | } BT_MMC_HOST_OPS; 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-6-instance-attr.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | class Foo: 4 | 5 | def __init__(self): 6 | self.num = 20000000 7 | 8 | def test(num): 9 | o = Foo() 10 | i = 0 11 | while i < o.num: 12 | i += 1 13 | 14 | bench.run(test) 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/decorate1.py: -------------------------------------------------------------------------------- 1 | @d 2 | def f(): 3 | pass 4 | 5 | @d 6 | @e 7 | def g(): 8 | pass 9 | 10 | @d.e.f 11 | def h(): 12 | pass 13 | 14 | @d(a + 1) 15 | def i(): 16 | pass 17 | 18 | @d(a + 1, b + 2) 19 | def i(): 20 | pass 21 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/slice1.py: -------------------------------------------------------------------------------- 1 | x = x[:] 2 | x = x[::] 3 | x = x[::c] 4 | x = x[:b] 5 | x = x[:b:] 6 | x = x[:b:c] 7 | x = x[a] 8 | x = x[a:] 9 | x = x[a::] 10 | x = x[a::c] 11 | x = x[a:b] 12 | x = x[a:b:] 13 | x = x[a:b:c] 14 | 15 | x[0] = 1 16 | x[x] = x 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/try1.py: -------------------------------------------------------------------------------- 1 | def f(x): 2 | try: 3 | f(x) 4 | except: 5 | f(x) 6 | try: 7 | f(x) 8 | except Exception: 9 | f(x) 10 | try: 11 | f(x) 12 | except Exception as e: 13 | f(x, e) 14 | -------------------------------------------------------------------------------- /scripts/dtc/tests/value-labels.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | prop1: prop1 = start1: "a", mid1: "b" end1:; 5 | prop2: prop2 = start2: < innerstart2: 0xdeadbeef innermid2: 0xabcd1234 innerend2: > end2:; 6 | prop3: prop3 = start3: [ innerstart3: ab innermid3: cd innerend3: ] end3:; 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /.dbuild/makedeps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | depsdir() { 4 | echo -n "$1.stamp: "; shift 5 | for d; do 6 | ( cd "$d"; git ls-files | grep -v '[\"#]' | sed "s,^,$d/,"; ) 7 | done | sort | sed 'x; s/ /\\ /g; /./ { s,$, ,; }; s,$,\\,; $ { p; x; }' 8 | echo 9 | } 10 | 11 | echo 12 | depsdir $@ 13 | -------------------------------------------------------------------------------- /os/include/lib/multiplexer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_MULTIPLEXER_H_ 2 | #define _BT_MULTIPLEXER_H_ 3 | 4 | BT_HANDLE BT_CreateMux(BT_u32 ulFlags, BT_ERROR *pError); 5 | BT_ERROR BT_MuxOpen(BT_HANDLE hMux, const BT_i8 *path); 6 | BT_ERROR BT_MuxAttach(BT_HANDLE hMux, BT_HANDLE h); 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/frozenset_add.py: -------------------------------------------------------------------------------- 1 | try: 2 | frozenset 3 | except NameError: 4 | print("SKIP") 5 | import sys 6 | sys.exit() 7 | 8 | s = frozenset({1, 2, 3, 4}) 9 | try: 10 | print(s.add(5)) 11 | except AttributeError: 12 | print("AttributeError") 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/int_big_mul.py: -------------------------------------------------------------------------------- 1 | # tests transition from small to large int representation by multiplication 2 | for rhs in range(2, 11): 3 | lhs = 1 4 | for k in range(100): 5 | res = lhs * rhs 6 | print(lhs, '*', rhs, '=', res) 7 | lhs = res 8 | 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_pop.py: -------------------------------------------------------------------------------- 1 | # list poppin' 2 | a = [1, 2, 3] 3 | print(a.pop()) 4 | print(a.pop()) 5 | print(a.pop()) 6 | try: 7 | print(a.pop()) 8 | except IndexError: 9 | print("IndexError raised") 10 | else: 11 | raise AssertionError("No IndexError raised") 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-8-namedtuple-1st.py: -------------------------------------------------------------------------------- 1 | import bench 2 | from _collections import namedtuple 3 | 4 | T = namedtuple("Tup", "num bar") 5 | 6 | def test(num): 7 | t = T(20000000, 0) 8 | i = 0 9 | while i < t.num: 10 | i += 1 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /scripts/dtc/TODO: -------------------------------------------------------------------------------- 1 | - Bugfixes: 2 | * Proper handling of boot cpu information 3 | - Generate mem reserve map 4 | * linux,reserve-map property 5 | * generating reserve entry for device tree itself 6 | * generating reserve entries from tce, rtas etc. properties 7 | - Expression support 8 | - Macro system 9 | -------------------------------------------------------------------------------- /scripts/dtc/tests/base01.stderr: -------------------------------------------------------------------------------- 1 | DTC: dts->asm on file "tests/base01.dts" 2 | Line 26: Invalid cell value '123456789012345'; -1 assumed 3 | Line 27: Invalid cell value '891'; 0 assumed 4 | Line 28: Invalid cell value '123456123456'; -1 assumed 5 | ERROR: Missing /chosen node 6 | Input tree has errors 7 | -------------------------------------------------------------------------------- /arch/arm/include/mach/bt_machine_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_MACHINE_TYPES_H_ 2 | #define _BT_MACHINE_TYPES_H_ 3 | 4 | typedef enum _BT_MACH_TYPE { 5 | BT_MACH_NONE=0, 6 | BT_MACH_CORTEX_M0=1, 7 | BT_MACH_CORTEX_M3=2, 8 | BT_MACH_ZYNQ=3, 9 | BT_MACH_BCM2835=4, 10 | } BT_MACH_TYPE; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /os/src/fs/bt_inode.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct _BT_OPAQUE_HANDLE { 4 | BT_HANDLE_HEADER h; 5 | }; 6 | 7 | BT_ERROR BT_ReadInode(BT_HANDLE hInode, BT_INODE *pInode) { 8 | return hInode->h.pIf->oIfs.pInodeIF->pfnReadInode(hInode, pInode); 9 | } 10 | BT_EXPORT_SYMBOL(BT_ReadInode); 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_bin.py: -------------------------------------------------------------------------------- 1 | # test builtin bin function 2 | 3 | print(bin(1)) 4 | print(bin(-1)) 5 | print(bin(15)) 6 | print(bin(-15)) 7 | 8 | print(bin(12345)) 9 | print(bin(0b10101)) 10 | 11 | print(bin(12345678901234567890)) 12 | print(bin(0b10101010101010101010)) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_hex.py: -------------------------------------------------------------------------------- 1 | # test builtin hex function 2 | 3 | print(hex(1)) 4 | print(hex(-1)) 5 | print(hex(15)) 6 | print(hex(-15)) 7 | 8 | print(hex(12345)) 9 | print(hex(0x12345)) 10 | 11 | print(hex(12345678901234567890)) 12 | print(hex(0x12345678901234567890)) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_oct.py: -------------------------------------------------------------------------------- 1 | # test builtin oct function 2 | 3 | print(oct(1)) 4 | print(oct(-1)) 5 | print(oct(15)) 6 | print(oct(-15)) 7 | 8 | print(oct(12345)) 9 | print(oct(0o12345)) 10 | 11 | print(oct(12345678901234567890)) 12 | print(oct(0o12345670123456701234)) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict1.py: -------------------------------------------------------------------------------- 1 | # basic dictionary 2 | 3 | d = {} 4 | print(d) 5 | d[2] = 123 6 | print(d) 7 | d = {1:2} 8 | d[3] = 3 9 | print(d) 10 | d[1] = 0 11 | print(d) 12 | print(d[1]) 13 | 14 | x = 1 15 | while x < 1000: 16 | d[x] = x 17 | x += 1 18 | print(d[500]) 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_setdefault.py: -------------------------------------------------------------------------------- 1 | d = {} 2 | print(d.setdefault(1)) 3 | print(d.setdefault(1)) 4 | print(d.setdefault(5, 42)) 5 | print(d.setdefault(5, 1)) 6 | print(d[1]) 7 | print(d[5]) 8 | d.pop(5) 9 | print(d.setdefault(5, 1)) 10 | print(d[1]) 11 | print(d[5]) 12 | 13 | 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/closure3.py: -------------------------------------------------------------------------------- 1 | # test when different variables are closed over by different functions 2 | 3 | def f(): 4 | l1 = 1 5 | l2 = 2 6 | l3 = 3 7 | 8 | def g(): 9 | return l1 + l2 10 | 11 | def h(): 12 | return l2 + l3 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/tuple2.py: -------------------------------------------------------------------------------- 1 | x = t 2 | x, = t 3 | x, y = t 4 | x, y, = t 5 | x, y, z = t 6 | x, y, z, = t 7 | x, y, z, z = a, b, c, d 8 | 9 | (x) = t 10 | (x,) = t 11 | (x, y) = t 12 | (x, y,) = t 13 | (x, y, z) = t 14 | (x, y, z,) = t 15 | (x, y, z, z) = a, b, c, d 16 | -------------------------------------------------------------------------------- /scripts/dtc/tests/boot-cpuid.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | cpus { 5 | cpu@10 { 6 | device_type = "cpu"; 7 | compatible = "fake-cpu"; 8 | reg = <0x10>; 9 | }; 10 | cpu@11 { 11 | device_type = "cpu"; 12 | compatible = "fake-cpu"; 13 | reg = <0x11>; 14 | }; 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/examples.api/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS+= -Wall -g 2 | CFLAGS+= -I.. 3 | LDLIBS += -L.. -ljim 4 | 5 | EXAMPLES= \ 6 | jim_command \ 7 | jim_hello \ 8 | jim_list \ 9 | jim_obj \ 10 | jim_return 11 | 12 | all: $(EXAMPLES) 13 | 14 | clean: 15 | rm -rf $(EXAMPLES) 16 | rm -rf *.core 17 | -------------------------------------------------------------------------------- /os/src/syscall/calls/time.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long bt_sys_gettimeofday(struct bt_timeval *tv, struct bt_timezone *tz) { 4 | return bt_gettimeofday(tv, tz); 5 | } 6 | 7 | long bt_sys_settimeofday(struct bt_timeval *tv, struct bt_timezone *tz) { 8 | return bt_settimeofday(tv, tz); 9 | } 10 | -------------------------------------------------------------------------------- /.dbuild/pretty/prettychmod.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import prettyformat 5 | import fileinput 6 | 7 | action = "CHMOD" 8 | module = sys.argv[1] 9 | 10 | for line in sys.stdin: 11 | description = line.split("\n")[0] 12 | prettyformat.pretty(action, module, description) 13 | 14 | -------------------------------------------------------------------------------- /.dbuild/pretty/prettymd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import prettyformat 5 | import fileinput 6 | 7 | action = "MKDIR" 8 | module = sys.argv[1] 9 | 10 | for line in sys.stdin: 11 | description = line.split("\n")[0] 12 | prettyformat.pretty(action, module, description, False) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/array1.py: -------------------------------------------------------------------------------- 1 | import array 2 | 3 | a = array.array('B', [1, 2, 3]) 4 | print(a, len(a)) 5 | i = array.array('I', [1, 2, 3]) 6 | print(i, len(i)) 7 | print(a[0]) 8 | print(i[-1]) 9 | 10 | # Empty arrays 11 | print(len(array.array('h'))) 12 | print(array.array('i')) 13 | 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class_store.py: -------------------------------------------------------------------------------- 1 | # store to class vs instance 2 | 3 | class C: 4 | pass 5 | 6 | c = C() 7 | c.x = 1 8 | print(c.x) 9 | C.x = 2 10 | C.y = 3 11 | print(c.x, c.y) 12 | print(C.x, C.y) 13 | print(C().x, C().y) 14 | c = C() 15 | print(c.x) 16 | c.x = 4 17 | print(c.x) 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/while_nest_exc.py: -------------------------------------------------------------------------------- 1 | # test nested whiles within a try-except 2 | 3 | while 1: 4 | print(1) 5 | try: 6 | print(2) 7 | while 1: 8 | print(3) 9 | break 10 | except: 11 | print(4) 12 | print(5) 13 | break 14 | -------------------------------------------------------------------------------- /os/src/syscall/calls/close.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long bt_sys_close(int fd) { 4 | BT_ERROR Error = BT_ERR_NONE; 5 | BT_HANDLE hFile = BT_GetFileDescriptor(fd, &Error); 6 | BT_SetFileDescriptor(fd, NULL); 7 | BT_CloseHandle(hFile); 8 | BT_FreeFileDescriptor(fd); 9 | 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /scripts/mkimage/fit_timestamp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int fit_set_timestamp(void *fit, int noffset, time_t timestamp) { 6 | uint32_t t; 7 | t = cpu_to_fdt32(timestamp); 8 | fdt_setprop(fit, noffset, "timestamp", &t, sizeof(t)); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/builtin_id.py: -------------------------------------------------------------------------------- 1 | print(id(1) == id(2)) 2 | print(id(None) == id(None)) 3 | # This can't be true per Python semantics, just CPython implementation detail 4 | #print(id([]) == id([])) 5 | 6 | l = [1, 2] 7 | print(id(l) == id(l)) 8 | 9 | f = lambda:None 10 | print(id(f) == id(f)) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_construct.py: -------------------------------------------------------------------------------- 1 | # dict constructor 2 | 3 | d = dict() 4 | print(d) 5 | 6 | d = dict({1:2}) 7 | print(d) 8 | 9 | d = dict(a=1) 10 | print(d) 11 | 12 | d = dict({1:2}, a=3) 13 | print(d[1], d['a']) 14 | 15 | d = dict([(1, 2)], a=3, b=4) 16 | print(d[1], d['a'], d['b']) 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/super1.py: -------------------------------------------------------------------------------- 1 | class A(B): 2 | def f(): 3 | super.a() 4 | 5 | class B(C): 6 | def g(): 7 | def h(): 8 | super.a() 9 | 10 | super.a() 11 | 12 | def i(): 13 | super.a() 14 | 15 | def j(): 16 | def k(): 17 | super.a() 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/tuple1.py: -------------------------------------------------------------------------------- 1 | x = () 2 | x = a 3 | x = a, 4 | x = a, 2 5 | x = a, 2, 6 | x = a, 2, 3 7 | x = a, 2, 3, 4 8 | x = a, 2, 3, 4, 5 9 | 10 | x = () 11 | x = (a) 12 | x = (a,) 13 | x = (a, 2) 14 | x = (a, 2,) 15 | x = (a, 2, 3) 16 | x = (a, 2, 3, 4) 17 | x = (a, 2, 3, 4, 5) 18 | -------------------------------------------------------------------------------- /drivers/adc/objects.mk: -------------------------------------------------------------------------------- 1 | ADC_OBJECTS-$(BT_CONFIG_DRIVERS_ADC_SPI_MAX1231) += $(BUILD_DIR)/drivers/adc/max1231.o 2 | ADC_OBJECTS-$(BT_CONFIG_DRIVERS_ADC_I2C_MAX1363) += $(BUILD_DIR)/drivers/adc/max1363.o 3 | 4 | 5 | ADC_OBJECTS += $(ADC_OBJECTS-y) 6 | 7 | $(ADC_OBJECTS): MODULE_NAME="drivers-ADC" 8 | OBJECTS += $(ADC_OBJECTS) 9 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/types2.py: -------------------------------------------------------------------------------- 1 | # Types are hashable 2 | print(hash(type) != 0) 3 | print(hash(int) != 0) 4 | print(hash(list) != 0) 5 | class Foo: pass 6 | print(hash(Foo) != 0) 7 | 8 | print(int == int) 9 | print(int != list) 10 | 11 | d = {} 12 | d[int] = list 13 | d[list] = int 14 | print(len(d)) 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/funcall-2-funcall.py: -------------------------------------------------------------------------------- 1 | # Function call overhead test 2 | # Perform the same trivial operation as global function call 3 | import bench 4 | 5 | def f(x): 6 | return x + 1 7 | 8 | def test(num): 9 | for i in iter(range(num)): 10 | a = f(i) 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-8.1-namedtuple-5th.py: -------------------------------------------------------------------------------- 1 | import bench 2 | from _collections import namedtuple 3 | 4 | T = namedtuple("Tup", "foo1 foo2 foo3 foo4 num") 5 | 6 | def test(num): 7 | t = T(0, 0, 0, 0, 20000000) 8 | i = 0 9 | while i < t.num: 10 | i += 1 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/unicode/file2.py: -------------------------------------------------------------------------------- 1 | # test reading a given number of characters 2 | 3 | def do(mode): 4 | f = open('unicode/data/utf-8_2.txt', mode) 5 | print(f.read(1)) 6 | print(f.read(1)) 7 | print(f.read(2)) 8 | print(f.read(4)) 9 | f.close() 10 | 11 | do('rb') 12 | do('rt') 13 | -------------------------------------------------------------------------------- /scripts/mkimage/Makefile: -------------------------------------------------------------------------------- 1 | BASE=$(shell pwd)/../../ 2 | BUILD_BASE=$(shell pwd)/ 3 | BUILD_DIR=$(shell pwd)/build/ 4 | 5 | MODULE_NAME=mkimage 6 | 7 | CFLAGS += -I $(BASE)/scripts/dtc/libfdt/ 8 | 9 | include $(BASE)/.dbuild/dbuild.mk 10 | 11 | all: mkimage 12 | mkimage: $(OBJECTS) 13 | $(CC) -o $@ $(OBJECTS) 14 | 15 | -------------------------------------------------------------------------------- /arch/arm/include/arch/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARM_SYSCALL_H_ 2 | #define _ARM_SYSCALL_H_ 3 | 4 | #include 5 | 6 | #define BT_SYSCALL0(name) \ 7 | .global name; .align; \ 8 | name##: swi #BT_SYS_##name; \ 9 | mov pc, lr 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/teensy_hal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "mpconfig.h" 5 | 6 | #include "Arduino.h" 7 | 8 | #include MICROPY_HAL_H 9 | 10 | uint32_t HAL_GetTick(void) { 11 | return millis(); 12 | } 13 | 14 | void HAL_Delay(uint32_t Delay) { 15 | delay(Delay); 16 | } 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/frozenset1.py: -------------------------------------------------------------------------------- 1 | # basic sets 2 | 3 | try: 4 | frozenset 5 | except NameError: 6 | print("SKIP") 7 | import sys 8 | sys.exit() 9 | 10 | s = frozenset() 11 | print(s) 12 | 13 | s = frozenset({1}) 14 | print(s) 15 | 16 | s = frozenset({3, 4, 3, 1}) 17 | print(sorted(s)) 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/gen_yield_from_exc.py: -------------------------------------------------------------------------------- 1 | def gen(): 2 | yield 1 3 | yield 2 4 | raise ValueError 5 | 6 | def gen2(): 7 | try: 8 | print((yield from gen())) 9 | except ValueError: 10 | print("caught ValueError from downstream") 11 | 12 | g = gen2() 13 | print(list(g)) 14 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/.gitignore: -------------------------------------------------------------------------------- 1 | config.log 2 | tags 3 | /Makefile 4 | Tcl.html 5 | jimautoconf.h 6 | jimautoconfext.h 7 | jim-config.h 8 | _*.c 9 | jim-stdlib.c 10 | jim-tclcompat.c 11 | jim-tree.c 12 | jim-oo.c 13 | jimsh 14 | *.exe 15 | libjim.a 16 | *.so.* 17 | *.dll 18 | *.o 19 | configure.gnu 20 | jimsh0 21 | build-jim-ext 22 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/is_isnot.py: -------------------------------------------------------------------------------- 1 | print(1 is 1) 2 | print(1 is 2) 3 | print(1 is not 1) 4 | print(1 is not 2) 5 | 6 | 7 | print([1, 2] is [1, 2]) 8 | a = [1, 2] 9 | b = a 10 | print(b is a) 11 | 12 | # TODO: strings require special "is" handling, postponed 13 | # until qstr refactor. 14 | #print("a" is "a") 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/try4.py: -------------------------------------------------------------------------------- 1 | try: 2 | f() 3 | except A: 4 | g() 5 | except: 6 | h() 7 | 8 | try: 9 | f() 10 | except A: 11 | g() 12 | except B as c: 13 | h() 14 | 15 | try: 16 | f() 17 | except A: 18 | g() 19 | except B as c: 20 | h() 21 | except: 22 | i() 23 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/import_pkg1.py: -------------------------------------------------------------------------------- 1 | import pkg.mod 2 | 3 | print(pkg.__name__) 4 | print(pkg.mod.__name__) 5 | print(pkg.mod.foo()) 6 | 7 | # Import 2nd time, must be same module objects 8 | pkg_ = __import__("pkg.mod") 9 | print(pkg_ is not pkg.mod) 10 | print(pkg_ is pkg) 11 | print(pkg_.mod is pkg.mod) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/closure1.py: -------------------------------------------------------------------------------- 1 | # closures 2 | 3 | def f(x): 4 | y = 2 * x 5 | def g(z): 6 | return y + z 7 | return g 8 | 9 | print(f(1)(1)) 10 | 11 | x = f(2) 12 | y = f(3) 13 | print(x(1), x(2), x(3)) 14 | print(y(1), y(2), y(3)) 15 | print(x(1), x(2), x(3)) 16 | print(y(1), y(2), y(3)) 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_pop.py: -------------------------------------------------------------------------------- 1 | d = {1: 2, 3: 4} 2 | print(d.pop(3), d) 3 | print(d) 4 | print(d.pop(1, 42), d) 5 | print(d.pop(1, 42), d) 6 | print(d.pop(1, None), d) 7 | try: 8 | print(d.pop(1), "!!!",) 9 | except KeyError: 10 | print("Raised KeyError") 11 | else: 12 | print("Did not rise KeyError!") 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/gen_yield_from_send.py: -------------------------------------------------------------------------------- 1 | def gen(): 2 | print("sent:", (yield 1)) 3 | yield 2 4 | 5 | def gen2(): 6 | print((yield from gen())) 7 | 8 | g = gen2() 9 | next(g) 10 | print("yielded:", g.send("val")) 11 | try: 12 | next(g) 13 | except StopIteration: 14 | print("StopIteration") 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/while_cond.py: -------------------------------------------------------------------------------- 1 | # test while conditions which are optimised by the compiler 2 | 3 | while 0: 4 | print(0) 5 | else: 6 | print(1) 7 | 8 | while 1: 9 | print(2) 10 | break 11 | 12 | while 2: 13 | print(3) 14 | break 15 | 16 | while -1: 17 | print(4) 18 | break 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/float/float1.py: -------------------------------------------------------------------------------- 1 | # basic float 2 | x = 1 / 2 3 | print(x) 4 | 5 | print(1.0 // 2) 6 | print(2.0 // 2) 7 | 8 | try: 9 | 1.0 / 0 10 | except ZeroDivisionError: 11 | print("ZeroDivisionError") 12 | 13 | try: 14 | 1.0 // 0 15 | except ZeroDivisionError: 16 | print("ZeroDivisionError") 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_cond.py: -------------------------------------------------------------------------------- 1 | # using a bool as a conditional 2 | @micropython.viper 3 | def f(): 4 | x = True 5 | if x: 6 | print("x", x) 7 | f() 8 | 9 | # using an int as a conditional 10 | @micropython.viper 11 | def g(): 12 | y = 1 13 | if y: 14 | print("y", y) 15 | g() 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pybnative/while.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | 3 | @micropython.native 4 | def f(led, n, d): 5 | led.off() 6 | i = 0 7 | while i < n: 8 | print(i) 9 | led.toggle() 10 | pyb.delay(d) 11 | i += 1 12 | led.off() 13 | 14 | f(pyb.LED(1), 2, 150) 15 | f(pyb.LED(2), 4, 50) 16 | -------------------------------------------------------------------------------- /scripts/dtc/tests/path-references.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | /* Check multiple references case */ 5 | multiref = &n1 , &n2; 6 | n1: node1 { 7 | ref = &{/node2}; /* reference precedes target */ 8 | lref = &n2; 9 | }; 10 | n2: node2 { 11 | ref = &{/node1}; /* reference after target */ 12 | lref = &n1; 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/examples/pipe.tcl: -------------------------------------------------------------------------------- 1 | lassign [socket pipe] r w 2 | 3 | # Note, once the exec has the fh (via dup), close it 4 | # so that the pipe data is accessible 5 | exec ps aux >@$w & 6 | $w close 7 | 8 | $r readable { 9 | puts [$r gets] 10 | if {[eof $r]} { 11 | $r close 12 | set done 1 13 | } 14 | } 15 | 16 | vwait done 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/int_bytes.py: -------------------------------------------------------------------------------- 1 | print((10).to_bytes(1, "little")) 2 | print((111111).to_bytes(4, "little")) 3 | print((100).to_bytes(10, "little")) 4 | print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little")) 5 | print(int.from_bytes(b"\x01\0\0\0\0\0\0\0", "little")) 6 | print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little")) 7 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/with_return.py: -------------------------------------------------------------------------------- 1 | class CtxMgr: 2 | 3 | def __enter__(self): 4 | print("__enter__") 5 | return self 6 | 7 | def __exit__(self, a, b, c): 8 | print("__exit__", repr(a), repr(b)) 9 | 10 | def foo(): 11 | with CtxMgr(): 12 | return 4 13 | 14 | print(foo()) 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/bytebuf-3-bytarray_map.py: -------------------------------------------------------------------------------- 1 | # Doing some operation on bytearray 2 | # No joins, but still map(). 3 | import bench 4 | 5 | def test(num): 6 | for i in iter(range(num//10000)): 7 | ba = bytearray(b"\0" * 1000) 8 | ba2 = bytearray(map(lambda x: x + 1, ba)) 9 | 10 | bench.run(test) 11 | -------------------------------------------------------------------------------- /scripts/dtc/tests/dtc-fatal.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | . ./tests.sh 4 | 5 | verbose_run $VALGRIND "$DTC" -o/dev/null "$@" 6 | ret="$?" 7 | 8 | if [ "$ret" -gt 127 ]; then 9 | FAIL "dtc killed by signal (ret=$ret)" 10 | elif [ "$ret" != "1" ]; then 11 | FAIL "dtc returned incorrect status $ret instead of 1" 12 | fi 13 | 14 | PASS 15 | -------------------------------------------------------------------------------- /os/include/interfaces/bt_if_inode.h: -------------------------------------------------------------------------------- 1 | /** 2 | * BT Inode interface. 3 | * 4 | **/ 5 | 6 | #ifndef _BT_IF_INODE_H_ 7 | #define _BT_IF_INODE_H_ 8 | 9 | #include 10 | 11 | typedef struct _BT_IF_INODE { 12 | BT_ERROR (*pfnReadInode)(BT_HANDLE hInode, BT_INODE *pInode); 13 | } BT_IF_INODE; 14 | 15 | 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class2.py: -------------------------------------------------------------------------------- 1 | # class with __init__ 2 | 3 | class C1: 4 | def __init__(self): 5 | self.x = 1 6 | 7 | c1 = C1() 8 | print(type(c1) == C1) 9 | print(c1.x) 10 | 11 | class C2: 12 | def __init__(self, x): 13 | self.x = x 14 | 15 | c2 = C2(4) 16 | print(type(c2) == C2) 17 | print(c2.x) 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/string_mult.py: -------------------------------------------------------------------------------- 1 | # basic multiplication 2 | print('0' * 5) 3 | 4 | # check negative, 0, positive; lhs and rhs multiplication 5 | for i in (-4, -2, 0, 2, 4): 6 | print(i * '12') 7 | print('12' * i) 8 | 9 | # check that we don't modify existing object 10 | a = '123' 11 | c = a * 3 12 | print(a, c) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/try3.py: -------------------------------------------------------------------------------- 1 | # nested exceptions 2 | 3 | def f(): 4 | try: 5 | foo() 6 | except: 7 | print("except 1") 8 | try: 9 | baz() 10 | except: 11 | print("except 2") 12 | bar() 13 | 14 | try: 15 | f() 16 | except: 17 | print("f except") 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/closure4.py: -------------------------------------------------------------------------------- 1 | # test when a function has cell and free vars 2 | 3 | def f(): 4 | f_local = 1 5 | f_cell = 2 6 | 7 | def g(): 8 | g_local = 3 9 | g_cell = f_cell + 4 10 | 11 | def h(): 12 | h1_local = 4 13 | h2_local = f_cell + g_cell 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/del1.py: -------------------------------------------------------------------------------- 1 | del x 2 | del x.y 3 | del x().y 4 | del g 5 | del x[a] 6 | def f(): 7 | global g 8 | del x 9 | del g 10 | local = 1 11 | local2 = 2 12 | local3 = 3 13 | del local, local2, local3 14 | def f2(): 15 | nonlocal local3 16 | del local2, local3 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/if1.py: -------------------------------------------------------------------------------- 1 | if x: 2 | x() 3 | if x: 4 | x() 5 | elif y: 6 | y() 7 | if x: 8 | x() 9 | else: 10 | zz() 11 | if x: 12 | x() 13 | elif y: 14 | y() 15 | else: 16 | zz() 17 | if x: 18 | x() 19 | elif y: 20 | y() 21 | elif z: 22 | z() 23 | else: 24 | zz() 25 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope2.py: -------------------------------------------------------------------------------- 1 | # scope 2 | 3 | gl = 1 4 | 5 | def f(x): 6 | global gl 7 | gl += 2 8 | lo1 = 3 9 | lo2 = 4 10 | lo3 = 5 11 | 12 | def f2(x, y): 13 | global gl 14 | nonlocal lo3 15 | lo3 = 5 16 | lo4 = gl + lo2 + lo3 17 | 18 | return f2 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/bytes_mult.py: -------------------------------------------------------------------------------- 1 | # basic multiplication 2 | print(b'0' * 5) 3 | 4 | # check negative, 0, positive; lhs and rhs multiplication 5 | for i in (-4, -2, 0, 2, 4): 6 | print(i * b'12') 7 | print(b'12' * i) 8 | 9 | # check that we don't modify existing object 10 | a = b'123' 11 | c = a * 3 12 | print(a, c) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/fun_kwvarargs.py: -------------------------------------------------------------------------------- 1 | def f1(**kwargs): 2 | print(kwargs) 3 | 4 | f1() 5 | f1(a=1) 6 | 7 | def f2(a, **kwargs): 8 | print(a, kwargs) 9 | 10 | f2(1) 11 | f2(1, b=2) 12 | 13 | def f3(a, *vargs, **kwargs): 14 | print(a, vargs, kwargs) 15 | 16 | f3(1) 17 | f3(1, 2) 18 | f3(1, b=2) 19 | f3(1, 2, b=3) 20 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_mult.py: -------------------------------------------------------------------------------- 1 | # basic multiplication 2 | print([0] * 5) 3 | 4 | # check negative, 0, positive; lhs and rhs multiplication 5 | for i in (-4, -2, 0, 2, 4): 6 | print(i * [1, 2]) 7 | print([1, 2] * i) 8 | 9 | # check that we don't modify existing list 10 | a = [1, 2, 3] 11 | c = a * 3 12 | print(a, c) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/tuple_mult.py: -------------------------------------------------------------------------------- 1 | # basic multiplication 2 | print((0,) * 5) 3 | 4 | # check negative, 0, positive; lhs and rhs multiplication 5 | for i in (-4, -2, 0, 2, 4): 6 | print(i * (1, 2)) 7 | print((1, 2) * i) 8 | 9 | # check that we don't modify existing tuple 10 | a = (1, 2, 3) 11 | c = a * 3 12 | print(a, c) 13 | -------------------------------------------------------------------------------- /scripts/dtc/tests/extra-terminating-null.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | extranull0 = "hello world"; 5 | extranull1,1 = "hello world\0"; 6 | extranull1,2 = "hello world", ""; 7 | extranull2,1 = "hello world\0\0"; 8 | extranull2,2 = "hello world", "", ""; 9 | extranull2,3 = "hello world\0", ""; 10 | extranull2,4 = "hello world", "\0"; 11 | }; 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class_super.py: -------------------------------------------------------------------------------- 1 | class Base: 2 | 3 | def __init__(self): 4 | self.a = 1 5 | 6 | def meth(self): 7 | print("in Base meth", self.a) 8 | 9 | class Sub(Base): 10 | 11 | def meth(self): 12 | print("in Sub meth") 13 | return super().meth() 14 | 15 | a = Sub() 16 | a.meth() 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_update.py: -------------------------------------------------------------------------------- 1 | d = {1:2, 3:4} 2 | print(len(d)) 3 | d.update(["ab"]) 4 | print(d[1]) 5 | print(d[3]) 6 | print(d["a"]) 7 | print(len(d)) 8 | d.update([(1,4)]) 9 | print(d[1]) 10 | print(len(d)) 11 | 12 | # using keywords 13 | d.update(a=5) 14 | print(d['a']) 15 | d.update([(1,5)], b=6) 16 | print(d[1], d['b']) 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/bytebuf-1-inplace.py: -------------------------------------------------------------------------------- 1 | # Doing some operation on bytearray 2 | # Inplace - the most memory efficient way 3 | import bench 4 | 5 | def test(num): 6 | for i in iter(range(num//10000)): 7 | ba = bytearray(b"\0" * 1000) 8 | for i in range(len(ba)): 9 | ba[i] += 1 10 | 11 | bench.run(test) 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-7-instance-meth.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | class Foo: 4 | 5 | def __init__(self): 6 | self._num = 20000000 7 | 8 | def num(self): 9 | return self._num 10 | 11 | def test(num): 12 | o = Foo() 13 | i = 0 14 | while i < o.num(): 15 | i += 1 16 | 17 | bench.run(test) 18 | -------------------------------------------------------------------------------- /os/include/interfaces/bt_dev_if_gtimer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_DEV_IF_GTIMER_H_ 2 | #define _BT_DEV_IF_GTIMER_H_ 3 | 4 | #include "bt_types.h" 5 | 6 | typedef struct _BT_DEV_IF_GTIMER { 7 | BT_u32 (*pfnGetClockRate) (BT_HANDLE hTimer, BT_ERROR *pError); 8 | BT_u64 (*pfnGetValue) (BT_HANDLE hTimer, BT_ERROR *pError); 9 | } BT_DEV_IF_GTIMER; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/del_name.py: -------------------------------------------------------------------------------- 1 | # del global 2 | 3 | x = 1 4 | print(x) 5 | del x 6 | try: 7 | print(x) 8 | except NameError: 9 | print("NameError") 10 | try: 11 | del x 12 | except: # NameError: 13 | # FIXME uPy returns KeyError for this 14 | print("NameError") 15 | 16 | class C: 17 | def f(): 18 | pass 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/pylib-tests/struct.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | # Functions 3 | 'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from', 4 | 5 | # Classes 6 | 'Struct', 7 | 8 | # Exceptions 9 | 'error' 10 | ] 11 | 12 | from _struct import * 13 | from _struct import _clearcache 14 | from _struct import __doc__ 15 | -------------------------------------------------------------------------------- /os/src/lib/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Library Support" 2 | 3 | config LIB_PRINTF 4 | depends on OS 5 | bool "Use simple printf from BT" 6 | default y 7 | 8 | menu "printf features" 9 | depends on LIB_PRINTF 10 | config LIB_PRINTF_SUPPORT_HEX 11 | bool "Support %x format specifier" 12 | default y 13 | depends on LIB_PRINTF 14 | endmenu 15 | 16 | 17 | endmenu 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/closure2.py: -------------------------------------------------------------------------------- 1 | # closures; closing over an argument 2 | 3 | def f(x): 4 | y = 2 * x 5 | def g(z): 6 | return x + y + z 7 | return g 8 | 9 | print(f(1)(1)) 10 | 11 | x = f(2) 12 | y = f(3) 13 | print(x(1), x(2), x(3)) 14 | print(y(1), y(2), y(3)) 15 | print(x(1), x(2), x(3)) 16 | print(y(1), y(2), y(3)) 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/with_break.py: -------------------------------------------------------------------------------- 1 | class CtxMgr: 2 | 3 | def __enter__(self): 4 | print("__enter__") 5 | return self 6 | 7 | def __exit__(self, a, b, c): 8 | print("__exit__", repr(a), repr(b)) 9 | 10 | for i in range(5): 11 | print(i) 12 | with CtxMgr(): 13 | if i == 3: 14 | break 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/micropython/viper_binop_arith.py.exp: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | 45 4 | 45 5 | 1 6 | 1 7 | -45 8 | -45 9 | -1 10 | 1 11 | 39 12 | -39 13 | -3 14 | 3 15 | -39 16 | 39 17 | 1 18 | 8 19 | 1073741824 20 | 43008 21 | -43008 22 | 1 23 | 0 24 | 10 25 | -11 26 | 0 0 27 | 1 1 28 | 48 48 29 | 6 6 30 | 1 1 31 | 3 3 32 | -41 -41 33 | 1 1 34 | 3 3 35 | -45 -45 36 | -------------------------------------------------------------------------------- /drivers/Kconfig: -------------------------------------------------------------------------------- 1 | comment "Configure all required driver sub-systems" 2 | 3 | source drivers/block/Kconfig 4 | 5 | source drivers/gpio/Kconfig 6 | 7 | source drivers/dac/Kconfig 8 | 9 | source drivers/adc/Kconfig 10 | 11 | source drivers/mmc/Kconfig 12 | 13 | source drivers/mtd/Kconfig 14 | 15 | source drivers/net/Kconfig 16 | 17 | source drivers/rtc/Kconfig 18 | -------------------------------------------------------------------------------- /os/include/bt_time.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_TIME_H_ 2 | #define _BT_TIME_H_ 3 | 4 | typedef struct _BT_DATETIME { 5 | BT_u16 year; // e.g. 2013 6 | BT_u8 month; // e.g. 1 = Jan 12 = Dec 7 | BT_u8 day; // Day (1-31). 8 | BT_u8 hour; // Hour (0-23). 9 | BT_u8 min; // Minute (0-59). 10 | BT_u8 second; // Second (0-59). 11 | } BT_DATETIME; 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class_call.py: -------------------------------------------------------------------------------- 1 | class C1: 2 | def __call__(self, val): 3 | print('call', val) 4 | return 'item' 5 | 6 | class C2: 7 | 8 | def __getattr__(self, k): 9 | pass 10 | 11 | c1 = C1() 12 | print(c1(1)) 13 | 14 | c2 = C2() 15 | try: 16 | print(c2(1)) 17 | except TypeError: 18 | print("TypeError") 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/continue.py: -------------------------------------------------------------------------------- 1 | for i in range(4): 2 | print('one', i) 3 | if i > 2: 4 | continue 5 | print('two', i) 6 | 7 | for i in range(4): 8 | print('one', i) 9 | if i < 2: 10 | continue 11 | print('two', i) 12 | 13 | for i in [1, 2, 3, 4]: 14 | if i == 3: 15 | continue 16 | print(i) 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict2.py: -------------------------------------------------------------------------------- 1 | # using strings as keys in dict 2 | 3 | d = {'1': 1, '2': 2} 4 | print(d['1'], d['2']) 5 | 6 | d['3'] = 3 7 | print(d['1'], d['2'], d['3']) 8 | 9 | d['2'] = 222 10 | print(d['1'], d['2'], d['3']) 11 | 12 | d2 = dict(d) 13 | print('2' in d2) 14 | print(id(d) != id(d2), d == d2) 15 | 16 | print(d.__getitem__('2')) 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/with_continue.py: -------------------------------------------------------------------------------- 1 | class CtxMgr: 2 | 3 | def __enter__(self): 4 | print("__enter__") 5 | return self 6 | 7 | def __exit__(self, a, b, c): 8 | print("__exit__", repr(a), repr(b)) 9 | 10 | for i in range(5): 11 | print(i) 12 | with CtxMgr(): 13 | if i == 3: 14 | continue 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/float/types.py: -------------------------------------------------------------------------------- 1 | # float types 2 | 3 | print(float) 4 | print(complex) 5 | 6 | print(type(float()) == float) 7 | print(type(complex()) == complex) 8 | 9 | print(type(0.0) == float) 10 | print(type(1j) == complex) 11 | 12 | # hashing float types 13 | 14 | d = dict() 15 | d[float] = complex 16 | d[complex] = float 17 | print(len(d)) 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/pyb/servo.py: -------------------------------------------------------------------------------- 1 | from pyb import Servo 2 | 3 | servo = Servo(1) 4 | print(servo) 5 | 6 | servo.angle(0) 7 | servo.angle(10, 100) 8 | 9 | servo.speed(-10) 10 | servo.speed(10, 100) 11 | 12 | servo.pulse_width(1500) 13 | print(servo.pulse_width()) 14 | 15 | servo.calibration(630, 2410, 1490, 2460, 2190) 16 | print(servo.calibration()) 17 | -------------------------------------------------------------------------------- /arch/arm/mach/zynq/.config.mk: -------------------------------------------------------------------------------- 1 | BT_CONFIG_ARCH_ARM_CORTEX-A9=y 2 | BT_CONFIG_ARCH_ARM_USE_GIC=y 3 | 4 | 5 | # 6 | # Configure the GIC parameters for this platform. 7 | # 8 | BT_CONFIG_ARCH_ARM_GIC_TOTAL_IRQS=95 9 | 10 | ifeq ($(BT_CONFIG_DRIVERS_SDCARD), y) 11 | BT_CONFIG_DRIVERS_SDCARD_HOST_SDHCI=y 12 | endif 13 | 14 | BT_CONFIG_FREERTOS_PORT_ARCH=BT_CONFIG_FREERTOS_A9 15 | -------------------------------------------------------------------------------- /doc/subsystems/handlemanager.tex: -------------------------------------------------------------------------------- 1 | Provides management of process / kernel level handles. Tracks their resources, and provides a novel cleanup 2 | mechanism. 3 | 4 | The BT_HANDLE type is a fundamental type in BitThunder. Almost all resources have an associated BT_HANDLE in some 5 | way. 6 | 7 | \subsubsection{Data Structures} 8 | \includegraphics{figures/architecture/handles.1} 9 | -------------------------------------------------------------------------------- /os/include/interfaces/bt_if_dir.h: -------------------------------------------------------------------------------- 1 | /** 2 | * BitThunder Directory Handling Interface. 3 | **/ 4 | 5 | #ifndef _BT_IF_DIR_H_ 6 | #define _BT_IF_DIR_H_ 7 | 8 | #include 9 | 10 | typedef struct _BT_IF_DIR { 11 | BT_ERROR (*pfnReadDir)(BT_HANDLE hDir, BT_DIRENT *pDirent); 12 | } BT_IF_DIR; 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_from_iter.py: -------------------------------------------------------------------------------- 1 | print(dict([(1, "foo")])) 2 | d = dict([("foo", "foo2"), ("bar", "baz")]) 3 | print(sorted(d.keys())) 4 | print(sorted(d.values())) 5 | 6 | try: 7 | dict(((1,),)) 8 | except ValueError: 9 | print("ValueError") 10 | 11 | try: 12 | dict(((1, 2, 3),)) 13 | except ValueError: 14 | print("ValueError") 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/yield1.py: -------------------------------------------------------------------------------- 1 | # generators and yield 2 | 3 | def main(): 4 | def f(): 5 | print(123) 6 | yield 7 | print(456) 8 | yield 2 9 | print(789) 10 | 11 | a = f() 12 | print(a) 13 | print(a.__next__()) 14 | print(a.__next__()) 15 | #print(a.__next__()) 16 | 17 | main() 18 | -------------------------------------------------------------------------------- /scripts/dtc/Makefile.convert-dtsv0: -------------------------------------------------------------------------------- 1 | # 2 | # This is not a complete Makefile of itself. 3 | # Instead, it is designed to be easily embeddable 4 | # into other systems of Makefiles. 5 | # 6 | 7 | CONVERT_SRCS = \ 8 | srcpos.c \ 9 | util.c 10 | 11 | CONVERT_GEN_SRCS = convert-dtsv0-lexer.lex.c 12 | 13 | CONVERT_OBJS = $(CONVERT_SRCS:%.c=%.o) $(CONVERT_GEN_SRCS:%.c=%.o) 14 | -------------------------------------------------------------------------------- /os/src/shell/jimtcl/sqlite3/build-ext: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This is a small wrapper around build-jim-ext 4 | # which knows it is running in /sqlite3 and 5 | # so can find a host version of jimsh/tclsh 6 | 7 | # Prefer jimsh in .. if it exists 8 | PATH=..:$PATH; export PATH 9 | asdir="`dirname "$0"`/../autosetup" 10 | exec "`$asdir/find-tclsh`" ../build-jim-ext "$@" 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_popitem.py: -------------------------------------------------------------------------------- 1 | els = [] 2 | d = {1:2,3:4} 3 | a = d.popitem() 4 | print(len(d)) 5 | els.append(a) 6 | a = d.popitem() 7 | print(len(d)) 8 | els.append(a) 9 | try: 10 | print(d.popitem(), "!!!",) 11 | except KeyError: 12 | print("Raised KeyError") 13 | else: 14 | print("Did not raise KeyError") 15 | print(sorted(els)) 16 | 17 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/unboundlocal.py: -------------------------------------------------------------------------------- 1 | # locals referenced before assignment 2 | 3 | def f1(): 4 | print(x) 5 | x = 1 6 | 7 | def f2(): 8 | for i in range(0): 9 | print(i) 10 | print(i) 11 | 12 | def check(f): 13 | try: 14 | f() 15 | except NameError: 16 | print("NameError") 17 | 18 | check(f1) 19 | check(f2) 20 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/fatfs/src/option/unicode.c: -------------------------------------------------------------------------------- 1 | #include "../ff.h" 2 | 3 | #if _USE_LFN != 0 4 | 5 | #if _CODE_PAGE == 932 6 | #include "cc932.c" 7 | #elif _CODE_PAGE == 936 8 | #include "cc936.c" 9 | #elif _CODE_PAGE == 949 10 | #include "cc949.c" 11 | #elif _CODE_PAGE == 950 12 | #include "cc950.c" 13 | #else 14 | #include "ccsbcs.c" 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class_number.py: -------------------------------------------------------------------------------- 1 | # test class with __add__ and __sub__ methods 2 | 3 | class C: 4 | def __init__(self, value): 5 | self.value = value 6 | 7 | def __add__(self, rhs): 8 | print(self.value, '+', rhs) 9 | 10 | def __sub__(self, rhs): 11 | print(self.value, '-', rhs) 12 | 13 | c = C(0) 14 | c + 1 15 | c - 2 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/exception1.py: -------------------------------------------------------------------------------- 1 | print(repr(IndexError())) 2 | print(str(IndexError())) 3 | 4 | print(repr(IndexError("foo"))) 5 | print(str(IndexError("foo"))) 6 | 7 | a = IndexError(1, "test", [100, 200]) 8 | print(repr(a)) 9 | print(str(a)) 10 | print(a.args) 11 | 12 | s = StopIteration() 13 | print(s.value) 14 | s = StopIteration(1, 2, 3) 15 | print(s.value) 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/lexerfatfs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "misc.h" 5 | #include "mpconfig.h" 6 | #include "qstr.h" 7 | #include "lexer.h" 8 | typedef int FIL; 9 | #include "../stmhal/lexerfatfs.h" 10 | 11 | mp_lexer_t *mp_lexer_new_from_file(const char *filename) { 12 | printf("import not implemented\n"); 13 | return NULL; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/fun_defargs2.py: -------------------------------------------------------------------------------- 1 | # overriding default arguments 2 | 3 | def foo(a, b=3): 4 | print(a, b) 5 | 6 | # override with positional 7 | foo(1, 333) 8 | 9 | # override with keyword 10 | foo(1, b=333) 11 | 12 | # override with keyword 13 | foo(a=2, b=333) 14 | 15 | def foo2(a=1, b=2): 16 | print(a, b) 17 | 18 | # default and keyword 19 | foo2(b='two') 20 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/tuple1.py: -------------------------------------------------------------------------------- 1 | # basic tuple functionality 2 | x = (1, 2, 3 * 4) 3 | print(x) 4 | try: 5 | x[0] = 4 6 | except TypeError: 7 | print("TypeError") 8 | print(x) 9 | try: 10 | x.append(5) 11 | except AttributeError: 12 | print("AttributeError") 13 | 14 | print(x[1:]) 15 | print(x[:-1]) 16 | print(x[2:3]) 17 | 18 | print(x + (10, 100, 10000)) 19 | -------------------------------------------------------------------------------- /lib/include/compilers/bt_gcc.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_GCC_H_ 2 | #define _BT_GCC_H_ 3 | 4 | #define BT_ATTRIBUTE_SECTION(name) __attribute__ ((section(name), used)) 5 | #define __BT_WEAK __attribute__((weak)) 6 | 7 | 8 | #define BT_CLZ(x) __builtin_clz(x) 9 | 10 | #define BT_DEPRECATED(message) __attribute__ ((deprecated(message))) 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/class_super_object.py: -------------------------------------------------------------------------------- 1 | # Calling object.__init__() via super().__init__ 2 | 3 | class Test(object): 4 | def __init__(self): 5 | super().__init__() 6 | print("Test.__init__") 7 | 8 | t = Test() 9 | 10 | class Test2: 11 | def __init__(self): 12 | super().__init__() 13 | print("Test2.__init__") 14 | 15 | t = Test2() 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/var-6.1-instance-attr-5.py: -------------------------------------------------------------------------------- 1 | import bench 2 | 3 | class Foo: 4 | 5 | def __init__(self): 6 | self.num1 = 0 7 | self.num2 = 0 8 | self.num3 = 0 9 | self.num4 = 0 10 | self.num = 20000000 11 | 12 | def test(num): 13 | o = Foo() 14 | i = 0 15 | while i < o.num: 16 | i += 1 17 | 18 | bench.run(test) 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/scope7.py: -------------------------------------------------------------------------------- 1 | # test order of closed over locals 2 | # not that CPython seems to sort closed over variables (but not fast locals) 3 | 4 | def f(): 5 | l1 = 1 6 | l2 = 4 7 | l3 = 3 8 | l4 = 2 9 | l5 = 5 10 | 11 | def g(): 12 | return l1 + l4 + l3 + l2 + l5 13 | 14 | def h(): 15 | return l1 + l2 + l3 + l4 + l5 16 | -------------------------------------------------------------------------------- /os/src/fs/bt_dir.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct _BT_OPAQUE_HANDLE { 4 | BT_HANDLE_HEADER h; 5 | }; 6 | 7 | BT_ERROR BT_ReadDir(BT_HANDLE hDir, BT_DIRENT *pDirent) { 8 | if(!hDir && BT_HANDLE_TYPE(hDir) != BT_HANDLE_T_DIRECTORY) { 9 | return BT_ERR_INVALID_HANDLE_TYPE; 10 | } 11 | 12 | return hDir->h.pIf->oIfs.pDirIF->pfnReadDir(hDir, pDirent); 13 | } 14 | BT_EXPORT_SYMBOL(BT_ReadDir); 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/assign2.py: -------------------------------------------------------------------------------- 1 | *a, = b 2 | a, *b = c 3 | a, *b, = c 4 | a, *b, c = d 5 | 6 | [*a] = b 7 | [*a,] = b 8 | [a, *b] = c 9 | [a, *b,] = c 10 | [a, *b, c] = d 11 | 12 | (*a,) = x 13 | (*a, b) = x 14 | (a, *b) = x 15 | (*a, b, c) = x 16 | (a, *b, c) = x 17 | (a, b, *c) = x 18 | (*a, b, c, d) = x 19 | (a, *b, c, d) = x 20 | (a, b, *c, d) = x 21 | (a, b, c, *d) = x 22 | -------------------------------------------------------------------------------- /arch/arm/mach/raspberrypi/raspberrypi.c: -------------------------------------------------------------------------------- 1 | /** 2 | * This file describes the raspberrypi machine. 3 | * 4 | * As well as describing the integrated peripherals, available during boot 5 | * it also provides basic routines for configuring and using them. 6 | * 7 | **/ 8 | 9 | #include 10 | 11 | 12 | 13 | BT_MACHINE_START(ARM, 0, "RaspberryPi Embedded Computer") 14 | 15 | 16 | BT_MACHINE_END 17 | -------------------------------------------------------------------------------- /drivers/adc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "ADC Devices" 2 | 3 | config DRIVERS_ADC 4 | bool 5 | default n 6 | 7 | menu "SPI ADC's" 8 | 9 | config DRIVERS_ADC_SPI_MAX1231 10 | bool "MAX1231" 11 | select DRIVERS_ADC 12 | default n 13 | endmenu 14 | 15 | menu "I2C ADC's" 16 | 17 | config DRIVERS_ADC_I2C_MAX1363 18 | bool "MAX1363" 19 | select DRIVERS_ADC 20 | default n 21 | endmenu 22 | 23 | 24 | endmenu 25 | -------------------------------------------------------------------------------- /drivers/mmc/objects.mk: -------------------------------------------------------------------------------- 1 | MMC_OBJECTS-$(BT_CONFIG_DRIVERS_MMC) += $(BUILD_DIR)/drivers/mmc/sdcard.o 2 | MMC_OBJECTS-$(BT_CONFIG_DRIVERS_SDCARD_SDHCI) += $(BUILD_DIR)/drivers/mmc/host/sdhci.o 3 | MMC_OBJECTS-$(BT_CONFIG_DRIVERS_SDCARD_SPI) += $(BUILD_DIR)/drivers/mmc/host/sd_spi.o 4 | 5 | 6 | MMC_OBJECTS += $(MMC_OBJECTS-y) 7 | 8 | $(MMC_OBJECTS): MODULE_NAME="drivers-SDIO" 9 | 10 | OBJECTS += $(MMC_OBJECTS) 11 | -------------------------------------------------------------------------------- /os/src/shell/micropython/extmod/re1.5/charclass.c: -------------------------------------------------------------------------------- 1 | #include "re1.5.h" 2 | 3 | int _re1_5_classmatch(const char *pc, const char *sp) 4 | { 5 | // pc points to "cnt" byte after opcode 6 | int is_positive = (pc[-1] == Class); 7 | int cnt = *pc++; 8 | while (cnt--) { 9 | if (*sp >= *pc && *sp <= pc[1]) return is_positive; 10 | pc += 2; 11 | } 12 | return !is_positive; 13 | } 14 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/dict_intern.py: -------------------------------------------------------------------------------- 1 | # check that interned strings are compared against non-interned strings 2 | 3 | di = {"key1": "value"} 4 | 5 | # lookup interned string 6 | k = "key1" 7 | print(k in di) 8 | 9 | # lookup non-interned string 10 | k2 = "key" + "1" 11 | print(k == k2) 12 | print(k2 in di) 13 | 14 | # lookup non-interned string 15 | print("".join(['k', 'e', 'y', '1']) in di) 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/fun_defargs.py: -------------------------------------------------------------------------------- 1 | def fun1(val=5): 2 | print(val) 3 | 4 | fun1() 5 | fun1(10) 6 | 7 | def fun2(p1, p2=100, p3="foo"): 8 | print(p1, p2, p3) 9 | 10 | fun2(1) 11 | fun2(1, None) 12 | fun2(0, "bar", 200) 13 | try: 14 | fun2() 15 | except TypeError: 16 | print("TypeError") 17 | try: 18 | fun2(1, 2, 3, 4) 19 | except TypeError: 20 | print("TypeError") 21 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/slots_bool_len.py: -------------------------------------------------------------------------------- 1 | class A: 2 | def __bool__(self): 3 | print('__bool__') 4 | return True 5 | def __len__(self): 6 | print('__len__') 7 | return 1 8 | 9 | class B: 10 | def __len__(self): 11 | print('__len__') 12 | return 0 13 | 14 | print(bool(A())) 15 | print(len(A())) 16 | print(bool(B())) 17 | print(len(B())) 18 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/import/try_module.py: -------------------------------------------------------------------------------- 1 | # Regression test for #290 - throwing exception in another module led to 2 | # its namespace stick and namespace of current module not coming back. 3 | import import1b 4 | 5 | def func1(): 6 | print('func1') 7 | 8 | def func2(): 9 | try: 10 | import1b.throw() 11 | except ValueError: 12 | pass 13 | func1() 14 | 15 | func2() 16 | -------------------------------------------------------------------------------- /os/src/shell/micropython/stmhal/boards/NETDUINO_PLUS_2/pins.csv: -------------------------------------------------------------------------------- 1 | D0,PC7 2 | D1,PC6 3 | D2,PA3 4 | D3,PA2 5 | D4,PB12 6 | D5,PB8 7 | D6,PB9 8 | D7,PA1 9 | D8,PA0 10 | D9,PA6 11 | D10,PB10 12 | D11,PB15 13 | D12,PB14 14 | D13,PB13 15 | A0,PC0 16 | A1,PC1 17 | A2,PC2 18 | A3,PC3 19 | A4,PC4 20 | A5,PC5 21 | LED,PA10 22 | SW,PB11 23 | PWR_LED,PC13 24 | PWR_SD,PB1 25 | PWR_HDR,PB2 26 | PWR_ETH,PC15 27 | RST_ETH,PD2 28 | 29 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list1.py: -------------------------------------------------------------------------------- 1 | # basic list functionality 2 | x = [1, 2, 3 * 4] 3 | print(x) 4 | x[0] = 4 5 | print(x) 6 | x[1] += -4 7 | print(x) 8 | x.append(5) 9 | print(x) 10 | f = x.append 11 | f(4) 12 | print(x) 13 | 14 | x.extend([100, 200]) 15 | print(x) 16 | x.extend(range(3)) 17 | print(x) 18 | 19 | x += [2, 1] 20 | print(x) 21 | 22 | print(x[1:]) 23 | print(x[:-1]) 24 | print(x[2:3]) 25 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/print.py: -------------------------------------------------------------------------------- 1 | # test builtin print function 2 | 3 | print() 4 | print(None) 5 | print('') 6 | print(1) 7 | print(1, 2) 8 | 9 | print(sep='') 10 | print(sep='x') 11 | print(end='') 12 | print(end='x\n') 13 | print(1, sep='') 14 | print(1, end='') 15 | print(1, sep='', end='') 16 | print(1, 2, sep='') 17 | print(1, 2, end='') 18 | print(1, 2, sep='', end='') 19 | 20 | print([{1:2}]) 21 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/try_reraise.py: -------------------------------------------------------------------------------- 1 | # Reraising last exception with raise w/o args 2 | 3 | def f(): 4 | try: 5 | raise ValueError("val", 3) 6 | except: 7 | raise 8 | 9 | try: 10 | f() 11 | except ValueError as e: 12 | print(repr(e)) 13 | 14 | 15 | # Can reraise only in except block 16 | try: 17 | raise 18 | except RuntimeError: 19 | print("RuntimeError") 20 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/misc/recursive_data.py_: -------------------------------------------------------------------------------- 1 | # This tests that printing recursive data structure doesn't lead to segfault. 2 | # Unfortunately, print() so far doesn't support "file "kwarg, so variable-len 3 | # output of this test cannot be redirected, and this test cannot be validated. 4 | l = [1, 2, 3, None] 5 | l[-1] = l 6 | try: 7 | print(l) 8 | except RuntimeError: 9 | print("RuntimeError") 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # BitThunder Repository should store all text files with UNIX line endings. 2 | *.c text 3 | *.h text 4 | *.mk text 5 | .config text 6 | *.s text 7 | *.S text 8 | *.ld text 9 | *.asm text 10 | *.sh text 11 | *.dts text 12 | *.its text 13 | *.txt text 14 | *.tex text 15 | Kconfig text 16 | config text 17 | *.config text 18 | .config text 19 | *.lds text 20 | config/* 21 | *.py 22 | linker 23 | Makefile text 24 | -------------------------------------------------------------------------------- /arch/arm/mach/stm32/.config.mk: -------------------------------------------------------------------------------- 1 | BT_CONFIG_ARCH_ARM_CORTEX-M3=y 2 | BT_CONFIG_ARCH_ARM_USE_NVIC=y 3 | 4 | # 5 | # Configure the NVIC parameters for this platform 6 | # 7 | #BT_CONFIG_ARCH_ARM_NVIC_BASE // Use default 8 | BT_CONFIG_ARCH_ARM_NVIC_TOTAL_IRQS=56 9 | 10 | ifeq ($(BT_CONFIG_DRIVERS_SDCARD), y) 11 | BT_CONFIG_DRIVERS_SDCARD_HOST_SDHCI=y 12 | endif 13 | 14 | BT_CONFIG_FREERTOS_PORT_ARCH=BT_CONFIG_FREERTOS_M3 15 | -------------------------------------------------------------------------------- /os/src/shell/micropython/drivers/cc3000/inc/patch_prog.h: -------------------------------------------------------------------------------- 1 | #ifndef __CC3000_PATCH_PROG_H__ 2 | #define __CC3000_PATCH_PROG_H__ 3 | extern unsigned short fw_length; 4 | extern const unsigned char fw_patch[]; 5 | 6 | extern unsigned short drv_length; 7 | extern const unsigned char wlan_drv_patch[]; 8 | extern const unsigned char cRMdefaultParams[128]; 9 | 10 | void patch_prog_start(); 11 | #endif //__CC3000_PATCH_PROG_H__ 12 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/subclass_native_specmeth.py: -------------------------------------------------------------------------------- 1 | # Test calling non-special method inherited from native type 2 | 3 | class mylist(list): 4 | pass 5 | 6 | l = mylist([1, 2, 3]) 7 | print(l) 8 | print([e for e in l]) 9 | 10 | 11 | class mylist2(list): 12 | 13 | def __iter__(self): 14 | return iter([10, 20, 30]) 15 | 16 | l = mylist2([1, 2, 3]) 17 | print(l) 18 | print([e for e in l]) 19 | -------------------------------------------------------------------------------- /scripts/dtc/tests/aliases.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | aliases { 5 | s1 = &sub1; 6 | ss1 = &subsub1; 7 | sss1 = &subsubsub1; 8 | }; 9 | 10 | sub1: subnode@1 { 11 | compatible = "subnode1"; 12 | 13 | subsub1: subsubnode { 14 | compatible = "subsubnode1", "subsubnode"; 15 | 16 | subsubsub1: subsubsubnode { 17 | compatible = "subsubsubnode1", "subsubsubnode"; 18 | }; 19 | }; 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /os/include/fs/bt_inode.h: -------------------------------------------------------------------------------- 1 | #ifndef _BT_INODE_H_ 2 | #define _BT_INODE_H_ 3 | 4 | #include "bt_dir.h" 5 | 6 | typedef struct _BT_INODE { 7 | union { 8 | BT_u64 ullFileSize; 9 | BT_u64 ullFilesize; 10 | }; 11 | BT_u32 attr; 12 | BT_DATETIME ctime; 13 | BT_DATETIME atime; 14 | BT_DATETIME mtime; 15 | } BT_INODE; 16 | 17 | BT_ERROR BT_ReadInode(BT_HANDLE hInode, BT_INODE *pInode); 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/lcd.c: -------------------------------------------------------------------------------- 1 | #include "mpconfig.h" 2 | #include "nlr.h" 3 | #include "misc.h" 4 | #include "qstr.h" 5 | #include "parse.h" 6 | #include "obj.h" 7 | #include "../stmhal/lcd.h" 8 | 9 | void lcd_init(void) { 10 | } 11 | 12 | void lcd_print_str(const char *str) { 13 | (void)str; 14 | } 15 | 16 | void lcd_print_strn(const char *str, unsigned int len) { 17 | (void)str; 18 | (void)len; 19 | } 20 | -------------------------------------------------------------------------------- /os/src/shell/micropython/teensy/memzip_files/boot.py: -------------------------------------------------------------------------------- 1 | import pyb 2 | print("Executing boot.py") 3 | 4 | def pins(): 5 | for pin_name in dir(pyb.Pin.board): 6 | pin = pyb.Pin(pin_name) 7 | print('{:10s} {:s}'.format(pin_name, str(pin))) 8 | 9 | def af(): 10 | for pin_name in dir(pyb.Pin.board): 11 | pin = pyb.Pin(pin_name) 12 | print('{:10s} {:s}'.format(pin_name, str(pin.af_list()))) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/basics/list_slice.py: -------------------------------------------------------------------------------- 1 | # test slices; only 2 argument version supported by Micro Python at the moment 2 | x = list(range(10)) 3 | a = 2 4 | b = 4 5 | c = 3 6 | print(x[:]) 7 | print(x[::]) 8 | #print(x[::c]) 9 | print(x[:b]) 10 | print(x[:b:]) 11 | #print(x[:b:c]) 12 | print(x[a]) 13 | print(x[a:]) 14 | print(x[a::]) 15 | #print(x[a::c]) 16 | print(x[a:b]) 17 | print(x[a:b:]) 18 | #print(x[a:b:c]) 19 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bench/arrayop-1-list_inplace.py: -------------------------------------------------------------------------------- 1 | # Array operation 2 | # Type: list, inplace operation using for. What's good about this 3 | # method is that it doesn't require any extra memory allocation. 4 | import bench 5 | 6 | def test(num): 7 | for i in iter(range(num//10000)): 8 | arr = [0] * 1000 9 | for i in range(len(arr)): 10 | arr[i] += 1 11 | 12 | bench.run(test) 13 | -------------------------------------------------------------------------------- /os/src/shell/micropython/tests/bytecode/mp-tests/listcomp5.py: -------------------------------------------------------------------------------- 1 | # nested ifs 2 | x = [a for a in l if a if a + 1] 3 | x = [a for a in l if a if a + 1 if a + 2] 4 | 5 | # nested for loops 6 | x = [a for a in l for l in ls] 7 | x = [a for ls in lss for l in ls for a in l] 8 | x = [a for a in l for l in ls for ls in lss] 9 | 10 | # nested ifs and for loops 11 | x = [a for a in l if a for l in ls if l if a for ls in lss if ls] 12 | --------------------------------------------------------------------------------