1. 29 Jan, 2016 2 commits
    • Damien George's avatar
      stmhal: Make USB CDC driver use SOF instead of TIM3 for outgoing data. · d3631339
      Damien George authored
      Previous to this patch the USB CDC driver used TIM3 to trigger the
      sending of outgoing data over USB serial.  This patch changes the
      behaviour so that the USB SOF interrupt is used to trigger the processing
      of the sending.  This reduces latency and increases bandwidth of outgoing
      data.
      
      Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype.
      
      See PR #1713.
      d3631339
    • Paul Sokolovsky's avatar
      py/runtime: mp_stack_ctrl_init() should be called immediately on startup. · d3b1f0b6
      Paul Sokolovsky authored
      Calling it from mp_init() is too late for some ports (like Unix), and leads
      to incomplete stack frame being captured, with following GC issues. So, now
      each port should call mp_stack_ctrl_init() on its own, ASAP after startup,
      and taking special precautions so it really was called before stack variables
      get allocated (because if such variable with a pointer is missed, it may lead
      to over-collecting (typical symptom is segfaulting)).
      d3b1f0b6
  2. 27 Jan, 2016 1 commit
  3. 26 Jan, 2016 1 commit
    • Damien George's avatar
      extmod/modurandom: Add some extra random functions. · a53af6c8
      Damien George authored
      Functions added are:
      - randint
      - randrange
      - choice
      - random
      - uniform
      
      They are enabled with configuration variable
      MICROPY_PY_URANDOM_EXTRA_FUNCS, which is disabled by default.  It is
      enabled for unix coverage build and stmhal.
      a53af6c8
  4. 23 Jan, 2016 1 commit
    • Dave Hylands's avatar
      stmhal: Add support for building frozen files. · 42a6364a
      Dave Hylands authored
      This allows FROZEN_DIR=some-directory to be specified on the make
      command line, which will then add all of the files contained within
      the indicated frozen directory as frozen files in the image.
      
      There is no change in flash/ram usage if not using the feature.
      
      This is especially useful on smaller MCUs (like the 401) which only
      has 64K flash file system.
      42a6364a
  5. 19 Jan, 2016 1 commit
  6. 17 Jan, 2016 1 commit
  7. 11 Jan, 2016 1 commit
    • Damien George's avatar
      py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*. · 5b3f0b7f
      Damien George authored
      The first argument to the type.make_new method is naturally a uPy type,
      and all uses of this argument cast it directly to a pointer to a type
      structure.  So it makes sense to just have it a pointer to a type from
      the very beginning (and a const pointer at that).  This patch makes
      such a change, and removes all unnecessary casting to/from mp_obj_t.
      5b3f0b7f
  8. 07 Jan, 2016 2 commits
  9. 31 Dec, 2015 1 commit
  10. 25 Dec, 2015 1 commit
  11. 22 Dec, 2015 1 commit
    • Damien George's avatar
      stmhal: Add pyb.irq_stats() to get statistics about IRQ calls. · 401af50d
      Damien George authored
      Adds a lot of code, makes IRQs a bit less efficient, but is very useful
      for debugging.  Usage: pyb.irq_stats() returns a memory view that can be
      read and written, eg:
      
          list(pyb.irq_stats())
          pyb.irq_stats()[0]
          pyb.irq_stats()[0] = 0
      
      The patch provides general IRQ_ENTER() and IRQ_EXIT() macros that can be
      modified to provide further IRQ statistics if desired.
      401af50d
  12. 19 Dec, 2015 1 commit
  13. 18 Dec, 2015 3 commits
  14. 16 Dec, 2015 2 commits
  15. 12 Dec, 2015 2 commits
  16. 10 Dec, 2015 1 commit
  17. 09 Dec, 2015 2 commits
    • Damien George's avatar
      stmhal/timer: Use mp_float_t instead of float. · f54a96d6
      Damien George authored
      This way mp_float_t can be changed to, eg, double.
      f54a96d6
    • neilh10's avatar
      stmhal: Enable two USB phys to be supported together. · 1be0fde4
      neilh10 authored
      This is refactoring to enable support for the two USB PHYs available on
      some STM32F4 processors to be used at the same time. The F405/7 & F429
      have two USB PHYs, others such as the F411 only have one PHY.
      
      This has been tested separately on a pyb10 (USB_FS PHY) and F429DISC
      (USB_HS PHY) to be able to invoke a REPL/USB.  I have modified a PYBV10
      to support two PHYs.
      
      The long term objective is to support a 2nd USB PHY to be brought up as a
      USB HOST, and possibly a single USB PHY to be OTG.
      1be0fde4
  18. 07 Dec, 2015 2 commits
    • Dave Hylands's avatar
      stmhal: Print exception information in nlr_jump_failed · f380904b
      Dave Hylands authored
      Currently nlr_jump_fail prints that there was an uncaught exception
      but nothing about the exception.
      This patch causes nlr_jump_failed to try to print the exception.
      Given that printf was called on the line above, I think that
      the call to mp_obj_print_exception has about as much likelyhood
      of succeeding as the printf does.
      f380904b
    • Dave Hylands's avatar
      stmhal: Execute boot.py and main.py when formatting the file system. · acc20841
      Dave Hylands authored
      When you use the USER button to perform a filesystem reset
      at boot time then it wipes out the filesystem and creates
      a new boot.py and main.py.  With this patch these files are
      executed after formatting, ensuring that pyb and machine modules
      get imported.
      acc20841
  19. 04 Dec, 2015 6 commits
  20. 02 Dec, 2015 2 commits
  21. 30 Nov, 2015 2 commits
  22. 26 Nov, 2015 3 commits
  23. 25 Nov, 2015 1 commit