4135|12

1万

帖子

25

TA的资源

版主

楼主
 

MicroPython升级到1.8.2 [复制链接]

 
 今天(2016.7.10)升级到了1.8.2,开始支持线程了。

主要改进有:

v1.8.2          Thread support, ESP8266 memory improvements, btree module, improved docs

    This release brings multi-threading support in the form of the _thread
    module, which closely matches the semantics of the corresponding CPython
    module.  There is support for GIL and non-GIL builds; without the GIL
    enabled one must protect concurrent access to mutable Python state at the
    Python level using Lock objects.  Threading with the GIL is enabled in
    the cc3200 port on the WiPy.  Threading without the GIL is enabled on the
    unix port.  The ESP8266 port has support for frozen bytecode (for scripts
    in the modules/ subdirectory), as well as optimisations for reduced
    memory usage and decreased memory fragmentation.  The ESP8266 RTC also
    resumes correctly after a deepsleep.  An initial "btree" module has been
    implemented for database support (unix port only), and the documentation
    has been further improved, with pre-built PDF versions of the docs now
    available.

    py core:
    - parse: treat constants that start with underscore as private
    - objdict: implemented OrderedDict equality check
    - support to build berkeley db 1.85 and "btree" module
    - mpconfig.h: MP_NOINLINE is universally useful, move from unix port
    - makeqstrdefs.py: remove restriction that source path can't be absolute
    - mkrules.mk: define "lib" outside conditional block
    - rename __QSTR_EXTRACT flag to NO_QSTR
    - objtype: instance: inherit protocol vtable from a base class
    - mphal.h: if virtpin API is used, automagically include its header
    - objtype: inherit protocol vtable from base class only if it exists
    - add MP_STATE_THREAD to hold state specific to a given thread
    - add basic _thread module, with ability to start a new thread
    - modthread: properly cast concrete exception pointer to an object
    - modthread: add stack_size() function
    - modthread: add exit() function
    - modthread: implement lock object, for creating a mutex
    - modthread: add with-context capabilities to lock object
    - gc: make memory manager and garbage collector thread safe
    - modthread: satisfy unused-args warning
    - gc: fix 2 cases of concurrent access to ATB and FTB
    - modthread: be more careful with root pointers when creating a thread
    - modthread: call mp_thread_start/mp_thread_finish around threads
    - gc: fix GC+thread bug where ptr gets lost because it's not computed
    - make interning of qstrs thread safe
    - implement a simple global interpreter lock (GIL)
    - don't use gc or qstr mutex when the GIL is enabled, there is no need
    - modthread: make Lock objects work when GIL is enabled
    - mpthread.h: move GIL macros outside MICROPY_PY_THREAD block
    - modthread: allow to properly set the stack limit of a thread
    - nlrthumb: convert NLR thumb funcs from asm to C with inline-asm
    - nlrsetjmp: update to take into account new location of nlr_top
    - mpthread: include mpstate.h when defining GIL macros
    - gc: be sure to count last allocated block at heap end in stats
    - gc: calculate (and report) maximum contiguous free block size
    - builtinimport: disable "imported as namespace package" warning
    - mpconfig.h: mention MICROPY_PY_BTREE config option
    - objarray: split out header to allow direct access to object
    - rename mp_obj_type_t::stream_p to "protocol"

    extmod:
    - modbtree: initial implementation of "btree" module based on BerkeleyDB
    - modbtree: handle default value and error check
    - modbtree: implement .items() iterator
    - modbtree: actually implement end key support for .items()
    - modbtree: items(): Implement "end key inclusive" flag
    - modbtree: items(): Implement DESC flag
    - modbtree: __getitem__() should raise KeyError for non-existing key
    - modbtree: open(): Support "in-memory" database with filename=None
    - machine_pinbase: implementation of PinBase class
    - machine_pinbase: fix nanbox build
    - modlwip: store a chain of incoming pbufs, instead of only one
    - modbtree: implement keys(), values(), items() iterators
    - modbtree: cleverly implement "for key in btree:" syntax
    - modwebsocket: add readinto() method
    - modwebrepl: add readinto() method
    - modbtree: fix unused argument warning
    - modbtree: fixes for nanbox build
    - moduos_dupterm: reserve buffer bytearray object for dupterm
    - moduos_dupterm: reuse dupterm_arr_obj for write operations

    lib:
    - berkeley-db-1.xx: add Berkeley DB 1.85 as a submodule
    - berkeley-db-1.xx: update to upstream which builds for uPy
    - fatfs/option/ccsbcs: follow uPy optional features model
    - libm: format code to pass gcc v6.1.1 warning
    - libm: remove unused definition of "one"

    drivers:
    - display/ssd1306: add width arg and support 64px wide displays

    tests:
    - recursive_iternext: clang/Linux is even more stack-frugal than MacOS
    - bench: add testcase to compare bytes(N) vs b"\0" * N
    - add testcase for OrderedDict equality
    - add a testcase for machine.PinBase class
    - extmod: add "btree" module test
    - btree1: add testcase for iterating btree object directly
    - add tests for _thread module
    - add 3 more tests for _thread module
    - thread: remove need to sleep to wait for completion in some tests
    - thread: add tests for running GC within a thread, and heap stress
    - thread: rename thread_stress_XXX.py to stress_XXX.py
    - thread: add tests that mutate shared objects
    - thread: add test for concurrent interning of strings
    - thread: add test for concurrent mutating of user instance
    - thread: make stack-size test run correctly and reliable on uPy
    - thread: make sure that thread tests don't rely on floating point
    - thread: allow thread_sleep1 to run without floating point
    - thread: allow some tests to run on ports with not much heap
    - meminfo: update for addition of "max free sz" output
    - run-tests: If running thread tests on unix, don't run mutate ones

    unix port:
    - unbreak "minimal" target by disabling FatFs
    - mpconfigport_minimal.h: clearly mark where user-define config ends
    - deprecate support for GNU Readline (MICROPY_USE_READLINE=2)
    - time to build with --gc-sections
    - move "utime" module config to C level instead of make level
    - Makefile: libffi: Build with -Os
    - alloc: add option to use uPy's alloc-exec implementation even for libffi
    - alloc: make coverage build and its overzealous warnings happy
    - disable FatFs VFS for normal build, keep enabled for coverage
    - modmachine: include PinBase class
    - modmachine: enable time_pulse_us() function
    - fix Makefile to handle gc-sections linker flags on Mac OS
    - add basic thread support using pthreads
    - file: if write syscall returns because of EINTR then try again
    - implement garbage collection with threading
    - mpthreadport: use SA_SIGINFO for GC signal handler
    - gccollect: provide declaration of exported function
    - mpthreadport: suppress compiler warning about unused arguments
    - modtime: release the GIL when sleeping
    - enable btree module
    - Makefile: make "minimal" build be minimal again
    - mpconfigport_minimal.h: allow to print a string within 1KB of heap
    - main: error out on unknown value of suffix in -X heapsize= option
    - main: improve help for -X options a bit
    - main: when preparing sys.path, allocate exact strings on uPy heap
    - disable the GIL to improve performance of non-thread code

    windows port:
    - follow unix port changes regarding "utime" module
    - msvc: include machine_pinbase.c in build and enable umachine module

    stmhal port:
    - add board definition files for Olimex STM32-E407
    - port of f4 hal commit 1d7fb82 to l4 hal (SD card modifications)
    - correct DMA to allow SD card on L4 MCUs
    - enable SD card on L4 MCUs

    cc3200 port:
    - update FreeRTOS to v9.0.0
    - define our own FreeRTOS heap so it can go in a special segment
    - add basic threading capabilities
    - fix call to new exception to be _msg instead of _arg1
    - use xTaskCreateStatic instead of osi_TaskCreate
    - mpthreadport: make mutex statically allocated
    - mpthreadport: properly initialise the main thread's data
    - gccollect: use MP_STATE_THREAD(stack_top) to get top of stack
    - mpthreadport: scan more root pointers from thread data
    - mpthreadport: move mem alloc outside the thread_mutex lock
    - enable the GIL
    - in FreeRTOSConfig.h, comment on configSUPPORT_STATIC_ALLOCATION
    - remove .boot section attribute from osi_TaskCreate function
    - start the simplelink spawn task using the static task creator
    - shrink the FreeRTOS heap and place TCB+stack in freed location
    - allow to compile bootloader with threading enabled
    - remove obsolete singleton heart-beat object

    teensy port:
    - update the README with OSX specific information and tips

    esp8266 port:
    - modnetwork: use struct bss_info::ssid_len for ESSID length
    - let RTC work correctly after deepsleep
    - switch floating-point arith routines to BootROM
    - Makefile: enable --verify option for esptool.py write_flash
    - use RTC to set date & time stamps for files
    - main.c: clear the command line history when (re)booting
    - enable frozen bytecode, with scripts in modules/ subdir
    - README: describe how to build mpy-cross
    - websocket_helper.py: avoid extra string allocations
    - websocket_helper.py: fix typo in debug output
    - modpybuart: allow setting baudrate and other params
    - explicitly collect garbage in bootstrap scripts
    - switch webrepl_setup to use frozen bytecode
    - switch webrepl to use frozen bytecode
    - README: promote from "highly experimental" to "experimental"
    - main: init recently added dupterm_arr_obj port state var
    - esp_mphal: call_dupterm_read: Use readinto() method
    - esp_mphal: properly handle dupterm EOF after switching to readinto()

    qemu-arm port:
    - disable gcc LTO option for nlrthumb.c

    docs:
    - esp8266/tutorial/network_basics: minor typo fix, ap becomes ap_if
    - add link to PDF version of docs in sidebar
    - library/network: wipy: fix literal block indentation
    - esp.socket: remove unused file
    - ure: typo fix
    - usocket: there must be empty line after .only::
    - library/machine.Pin: mention GPIO and cross-link .value() function
    - machine.*: add "currentmodule:: machine" directive
    - pyb.*: add "currentmodule:: pyb" directive
    - machine.Pin: remove explicit target
    - machine.UART: cleanup pyboard section
    - machine.*: use proper class case in method headers
    - machine.Pin: add class designator to all constants
    - pyb.CAN: mark CAN.initfilterbanks() as classmethod explicitly
    - pyb.Pin: af_list() is a normal method, not a class method
    - pyb.ExtInt,pyb.Pin: mark up class methods as such
    - pyb.*: use proper class case in method headers
    - pyb.Pin: sort .af() and .af_list() methods together
    - builtins: enumerate all builtin functions implemented
    - library/index: add builtins.rst
    - machine.Pin: disambiguate object call method
    - machine*: remove explicit targets and "machine." prefixes on classes
    - uctypes: improve documentation
    - sys: detailed description of print_exception() diff from traceback module
    - add sphinx_selective_exclude extension suite
    - conf.py: active sphinx_selective_exclude extensions
    - rebuild docs from scratch, as required for proper only:: handling
    - select: add an article
    - sys: print_exception: Fixes/clarifications
    - conf.py: exclude cmath from modindex for wipy
    - library: fix typo in docs for usocket.listen()

    examples:
    - unix/ffi_example.py: update for current "ffi" module API
    - unix/ffi_example.py: remove TODO, make output more clear

最新回复

功能越来越多了,期待esp8266能够有好的上传代码的方式  详情 回复 发表于 2016-7-11 22:40

赞赏

2

查看全部赞赏

点赞 关注
 
 

回复
举报

1059

帖子

1

TA的资源

版主

沙发
 
不错,线程都支持,可玩性越来越好,

点评

是的,看起来离真正用到产品开发已经不远。  详情 回复 发表于 2016-7-10 22:14
 
 
 

回复

662

帖子

0

TA的资源

纯净的硅(初级)

板凳
 
功能越来越强大了。
 
 
 

回复

1万

帖子

25

TA的资源

版主

4
 
qwerghf 发表于 2016-7-10 22:00
不错,线程都支持,可玩性越来越好,

是的,看起来离真正用到产品开发已经不远。
 
 
 

回复

1950

帖子

4

TA的资源

版主

5
 
支持 Thread support, ESP8266 ,这些都是期待中的功能啊,
版主,果然不负众望啊
顶 pyb!
顶 pyb 团队!

点评

一起加油。  详情 回复 发表于 2016-7-10 22:19
个人签名MicroPython中文社区https://micropython.org.cn/forum/  
 
 
 

回复

846

帖子

0

TA的资源

纯净的硅(中级)

6
 
多谢版主分享信息,回头有空来玩玩ESP8266上面跑micropython,不知道官方或者其它网友有没有STM32上联WIFI模块的工程

点评

官方有集成支持CC3000 和 WIZ820io的版本,但是这两种模块用的人比较少。  详情 回复 发表于 2016-7-10 22:21
 
 
 

回复

1万

帖子

25

TA的资源

版主

7
 
5525 发表于 2016-7-10 22:14
支持 Thread support, ESP8266 ,这些都是期待中的功能啊,
版主,果然不负众望啊
顶 pyb!
顶 p ...

一起加油。
 
 
 

回复

1万

帖子

25

TA的资源

版主

8
 
lkl0305 发表于 2016-7-10 22:15
多谢版主分享信息,回头有空来玩玩ESP8266上面跑micropython,不知道官方或者其它网友有没有STM32上联WIFI ...

官方有集成支持CC3000 和 WIZ820io的版本,但是这两种模块用的人比较少。ESP8266联网很方便,几行代码就完成了。
 
 
 

回复

113

帖子

0

TA的资源

一粒金砂(中级)

9
 
还没去围观更新,厚颜先问一下版主哈

想知道是否已经将U盘那块做成默认线程?
另外这个新的线程模块有没有例程呢?或者应用指导

点评

文档中还没有看到线程部分,线程的资料和例程还没有去看,等我整理了在分享。  详情 回复 发表于 2016-7-11 21:26
 
 
 

回复

1万

帖子

25

TA的资源

版主

10
 
47857872 发表于 2016-7-11 18:27
还没去围观更新,厚颜先问一下版主哈

想知道是否已经将U盘那块做成默认线程?
另外这个新的线程模块有 ...

文档中还没有看到线程部分,线程的资料和例程还没有去看,等我整理了在分享。

点评

这段时间太忙乱了 偶尔手机上一下 就麻烦lz整理啦~  详情 回复 发表于 2016-7-11 21:37
 
 
 

回复

113

帖子

0

TA的资源

一粒金砂(中级)

11
 
dcexpert 发表于 2016-7-11 21:26
文档中还没有看到线程部分,线程的资料和例程还没有去看,等我整理了在分享。

这段时间太忙乱了 偶尔手机上一下 就麻烦lz整理啦~
 
 
 

回复

1158

帖子

2

TA的资源

版主

12
 
功能越来越多了,期待esp8266能够有好的上传代码的方式

点评

ESP8266上传功能还没有增强,不够方便。尝试过几种不同的方法,各有优缺点。  详情 回复 发表于 2016-7-11 23:37
 
 
 

回复

1万

帖子

25

TA的资源

版主

13
 
michael_llh 发表于 2016-7-11 22:40
功能越来越多了,期待esp8266能够有好的上传代码的方式

ESP8266上传功能还没有增强,不够方便。尝试过几种不同的方法,各有优缺点。
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表