1. 29 Jan, 2017 1 commit
    • Paul Sokolovsky's avatar
      extmod/machine_signal: Implement "signal" abstraction for machine module. · 7a7516d4
      Paul Sokolovsky authored
      A signal is like a pin, but ca also be inverted (active low). As such, it
      abstracts properties of various physical devices, like LEDs, buttons,
      relays, buzzers, etc. To instantiate a Signal:
      
      pin = machine.Pin(...)
      signal = machine.Signal(pin, inverted=True)
      
      signal has the same .value() and __call__() methods as a pin.
      7a7516d4
  2. 27 Jan, 2017 2 commits
    • Damien George's avatar
      extmod: Add generic VFS sub-system. · dcb9ea72
      Damien George authored
      This provides mp_vfs_XXX functions (eg mount, open, listdir) which are
      agnostic to the underlying filesystem type, and just require an object with
      the relevant filesystem-like methods (eg .mount, .open, .listidr) which can
      then be mounted.
      
      These mp_vfs_XXX functions would typically be used by a port to implement
      the "uos" module, and mp_vfs_open would be the builtin open function.
      
      This feature is controlled by MICROPY_VFS, disabled by default.
      dcb9ea72
    • Damien George's avatar
  3. 22 Jan, 2017 1 commit
  4. 21 Dec, 2016 1 commit
    • Paul Sokolovsky's avatar
      extmod/modutimeq: Refactor into optimized class. · d02f6a99
      Paul Sokolovsky authored
          import utimeq, utime
          # Max queue size, the queue allocated statically on creation
          q = utimeq.utimeq(10)
          q.push(utime.ticks_ms(), data1, data2)
          res = [0, 0, 0]
          # Items in res are filled up with results
          q.pop(res)
      d02f6a99
  5. 09 Dec, 2016 2 commits
    • Damien George's avatar
      py: Add inline Xtensa assembler. · f76b1bfa
      Damien George authored
      This patch adds the MICROPY_EMIT_INLINE_XTENSA option, which, when
      enabled, allows the @micropython.asm_xtensa decorator to be used.
      
      The following opcodes are currently supported (ax is a register, a0-a15):
      
          ret_n()
          callx0(ax)
          j(label)
          jx(ax)
      
          beqz(ax, label)
          bnez(ax, label)
          mov(ax, ay)
          movi(ax, imm) # imm can be full 32-bit, uses l32r if needed
      
          and_(ax, ay, az)
          or_(ax, ay, az)
          xor(ax, ay, az)
          add(ax, ay, az)
          sub(ax, ay, az)
          mull(ax, ay, az)
      
          l8ui(ax, ay, imm)
          l16ui(ax, ay, imm)
          l32i(ax, ay, imm)
          s8i(ax, ay, imm)
          s16i(ax, ay, imm)
          s32i(ax, ay, imm)
          l16si(ax, ay, imm)
          addi(ax, ay, imm)
      
          ball(ax, ay, label)
          bany(ax, ay, label)
          bbc(ax, ay, label)
          bbs(ax, ay, label)
          beq(ax, ay, label)
          bge(ax, ay, label)
          bgeu(ax, ay, label)
          blt(ax, ay, label)
          bnall(ax, ay, label)
          bne(ax, ay, label)
          bnone(ax, ay, label)
      
      Upon entry to the assembly function the registers a0, a12, a13, a14 are
      pushed to the stack and the stack pointer (a1) decreased by 16.  Upon
      exit, these registers and the stack pointer are restored, and ret.n is
      executed to return to the caller (caller address is in a0).
      
      Note that the ABI for the Xtensa emitters is non-windowing.
      f76b1bfa
    • Damien George's avatar
      py: Integrate Xtensa assembler into native emitter. · 8e5aced1
      Damien George authored
      The config option MICROPY_EMIT_XTENSA can now be enabled to target the
      Xtensa architecture with @micropython.native and @micropython.viper
      decorators.
      8e5aced1
  6. 27 Nov, 2016 1 commit
  7. 20 Nov, 2016 1 commit
  8. 16 Nov, 2016 5 commits
  9. 15 Nov, 2016 1 commit
  10. 08 Nov, 2016 1 commit
  11. 25 Oct, 2016 1 commit
  12. 20 Oct, 2016 1 commit
  13. 14 Oct, 2016 1 commit
  14. 23 Sep, 2016 1 commit
  15. 22 Sep, 2016 1 commit
  16. 05 Sep, 2016 1 commit
    • Delio Brignoli's avatar
      py: Add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled. · e2ac8bb3
      Delio Brignoli authored
      This new config option allows to control whether MicroPython uses its own
      internal printf or not (if not, an external one should be linked in).
      Accompanying this new option is the inclusion of lib/utils/printf.c in the
      core list of source files, so that ports no longer need to include it
      themselves.
      e2ac8bb3
  17. 01 Sep, 2016 1 commit
  18. 30 Jul, 2016 1 commit
  19. 29 Jul, 2016 1 commit
  20. 16 Jul, 2016 1 commit
  21. 12 Jul, 2016 2 commits
  22. 28 Jun, 2016 1 commit
  23. 18 Jun, 2016 1 commit
  24. 14 Jun, 2016 1 commit
  25. 31 May, 2016 1 commit
  26. 26 May, 2016 1 commit
    • Paul Sokolovsky's avatar
      extmod/virtpin: Initial implementation of open-ended C-level Pin interface. · 751e3b7a
      Paul Sokolovsky authored
      Using usual method of virtual method tables. Single virtual method,
      ioctl, is defined currently for all operations. This universal and
      extensible vtable-based method is also defined as a default MPHAL
      GPIO implementation, but a specific port may override it with its
      own implementation (e.g. close-ended, but very efficient, e.g. avoiding
      virtual method dispatch).
      751e3b7a
  27. 10 May, 2016 1 commit
  28. 28 Apr, 2016 1 commit
    • Paul Sokolovsky's avatar
      extmod/modwebrepl: Module to handle WebREPL protocol. · 25d0f7d5
      Paul Sokolovsky authored
      While just a websocket is enough for handling terminal part of WebREPL,
      handling file transfer operations requires demultiplexing and acting
      upon, which is encapsulated in _webrepl class provided by this module,
      which wraps a websocket object.
      25d0f7d5
  29. 25 Apr, 2016 1 commit
  30. 16 Apr, 2016 2 commits
    • Jan Čapek's avatar
      py/py.mk: Add makefile variable for qstr autogeneration control. · 000eae12
      Jan Čapek authored
      - any architecture may explicitely build with qstring make
        QSTR_AUTOGEN_DISABLE=1 autogeneration disabled and provide its
        own list of qstrings by the standard
        mechanisms (qstrdefsport.h).
      000eae12
    • Jan Čapek's avatar
      py: Add rules for automated extraction of qstrs from sources. · d76c65f5
      Jan Čapek authored
      - add template rule that converts a specified source file into a qstring file
      
      - add special rule for generating a central header that contains all
        extracted/autogenerated strings - defined by QSTR_DEFS_COLLECTED
        variable. Each platform appends a list of sources that may contain
        qstrings into a new build variable: SRC_QSTR. Any autogenerated
        prerequisities are should be appened to SRC_QSTR_AUTO_DEPS variable.
      
      - remove most qstrings from py/qstrdefs, keep only qstrings that
        contain special characters - these cannot be easily detected in the
        sources without additional annotations
      
      - remove most manual qstrdefs, use qstrdef autogen for: py, cc3200,
        stmhal, teensy, unix, windows, pic16bit:
      
         - remove all micropython generic qstrdefs except for the special strings that contain special characters (e.g. /,+,<,> etc.)
         - remove all port specific qstrdefs except for special strings
         - append sources for qstr generation in platform m...
      d76c65f5
  31. 12 Apr, 2016 2 commits