Skip to content
Snippets Groups Projects
  1. Jun 12, 2018
  2. Jun 08, 2018
    • Damien George's avatar
      tools/pydfu.py: Increase download packet size to full 2048 bytes. · 8fb95d65
      Damien George authored
      The ST DFU bootloader supports a transfer size up to 2048 bytes, so send
      that much data on each download (to device) packet.  This almost halves
      total download time.
      8fb95d65
    • Damien George's avatar
      stm32/mboot: Increase USB rx_buf and DFU buf sizes to full 2048 bytes. · 24c416cc
      Damien George authored
      The DFU USB config descriptor returns 0x0800=2048 for the supported
      transfer size, and this applies to both TX (IN) and RX (OUT).  So increase
      the rx_buf to support this size without having a buffer overflow on
      received data.
      
      With this patch mboot in USB DFU mode now works with dfu-util.
      24c416cc
    • Glenn Moloney's avatar
      esp32/modnetwork: Fix isconnected() when using static IP config. · 039f196c
      Glenn Moloney authored
      Currently <WLAN>.isconnected() always returns True if a static IP is set,
      regardless of the state of the connection.
      
      This patch introduces a new flag 'wifi_sta_connected' which is set in
      event_handler() when GOT_IP event is received and reset when DISCONNECTED
      event is received (unless re-connect is successful).  isconnected() now
      simply returns the status of this flag (for STA_IF).
      
      The pre-existing flag misleadingly named 'wifi_sta_connected" is also
      renamed to 'wifi_sta_connect_requested'.
      
      Fixes issue #3837
      039f196c
    • Damien George's avatar
      tests/pyb: Make i2c and pyb1 pyboard tests run again. · a12d046c
      Damien George authored
      For i2c.py: the accelerometer now uses the new I2C driver so need to
      explicitly init the legacy i2c object to get the test working.
      
      For pyb1.py: the legacy pyb.hid() call will crash if the USB_HID object is
      not initialised.
      a12d046c
    • Damien George's avatar
      stm32/mpconfigport.h: Enable DELATTR_SETATTR and BUILTINS_NOTIMPLEMENTED · 190c7dba
      Damien George authored
      MICROPY_PY_DELATTR_SETATTR can now be enabled without a performance hit for
      classes that don't use this feature.
      
      MICROPY_PY_BUILTINS_NOTIMPLEMENTED is a minor addition that improves
      compatibility with CPython.
      190c7dba
    • Damien George's avatar
      ports: Enable descriptors on stm32, esp8266, esp32 ports. · 93150a0d
      Damien George authored
      They are now efficient (in runtime performance) and provide a useful
      feature that's hard to obtain without them enabled.
      
      See issue #3644 and PR #3826 for background.
      93150a0d
    • Damien George's avatar
      py/objtype: Optimise instance get/set/del by skipping special accessors. · 36c10521
      Damien George authored
      This patch is a code optimisation, trading text bytes for speed.  On
      pyboard it's an increase of 0.06% in code size for a gain (in pystone
      performance) of roughly 6.5%.
      
      The patch optimises load/store/delete of attributes in user defined classes
      by not looking up special accessors (@property, __get__, __delete__,
      __set__, __setattr__ and __getattr_) if they are guaranteed not to exist in
      the class.
      
      Currently, if you do my_obj.foo() then the runtime has to do a few checks
      to see if foo is a property or has __get__, and if so delegate the call.
      And for stores things like my_obj.foo = 1 has to first check if foo is a
      property or has __set__ defined on it.
      
      Doing all those checks each and every time the attribute is accessed has a
      performance penalty.  This patch eliminates all those checks for cases when
      it's guaranteed that the checks will always fail, ie no attributes are
      properties nor have any special accessor methods defined on them.
      
      To make this guarantee it checks all attributes of a user-defined class
      when it is first created.  If any of the attributes of the user class are
      properties or have special accessors, or any of the base classes of the
      user class have them, then it sets a flag in the class to indicate that
      special accessors must be checked for.  Then in the load/store/delete code
      it checks this flag to see if it can take the shortcut and optimise the
      lookup.
      
      It's an optimisation that's pretty widely applicable because it improves
      lookup performance for all methods of user defined classes, and stores of
      attributes, at least for those that don't have special accessors.  And, it
      allows to enable descriptors with minimal additional runtime overhead if
      they are not used for a particular user class.
      
      There is one restriction on dynamic class creation that has been introduced
      by this patch: a user-defined class cannot go from zero special accessors
      to one special accessor (or more) after that class has been subclassed.  If
      the script attempts this an AttributeError is raised (see addition to
      tests/misc/non_compliant.py for an example of this case).
      
      The cost in code space bytes for the optimisation in this patch is:
      
         unix x64:  +528
      unix nanbox:  +508
            stm32:  +192
           cc3200:  +200
          esp8266:  +332
            esp32:  +244
      
      Performance tests that were done:
      
      - on unix x86-64, pystone improved by about 5%
      - on pyboard, pystone improved by about 6.5%, from 1683 up to 1794
      - on pyboard, bm_chaos (from CPython benchmark suite) improved by about 5%
      - on esp32, pystone improved by about 30% (but there are caching effects)
      - on esp32, bm_chaos improved by about 11%
      36c10521
    • Damien George's avatar
      py/objtype: Don't expose mp_obj_instance_attr(). · bace1a16
      Damien George authored
      mp_obj_is_instance_type() can be used instead to check for instance types.
      bace1a16
    • Damien George's avatar
  3. Jun 06, 2018
  4. Jun 05, 2018
  5. Jun 04, 2018
  6. Jun 03, 2018
  7. Jun 01, 2018
  8. May 31, 2018
  9. May 30, 2018
  10. May 29, 2018
Loading