1. 03 Jul, 2017 1 commit
  2. 02 Mar, 2017 1 commit
    • Damien George's avatar
      stmhal: Rename sys_tick ticks/delay functions to corresp. mp_hal ones. · 89738e82
      Damien George authored
      The renames are:
      HAL_Delay -> mp_hal_delay_ms
      sys_tick_udelay -> mp_hal_delay_us
      sys_tick_get_microseconds -> mp_hal_ticks_us
      And mp_hal_ticks_ms is added to provide the full set of timing functions.
      Also, a separate HAL_Delay function is added which differs slightly from
      mp_hal_delay_ms and is intended for use only by the ST HAL functions.
  3. 15 Feb, 2017 1 commit
    • Damien George's avatar
      stmhal: Implement a proper thread scheduler. · 05a48595
      Damien George authored
      This patch changes the threading implementation from simple round-robin
      with busy waits on mutexs, to proper scheduling whereby threads that are
      waiting on a mutex are only scheduled when the mutex becomes available.
  4. 06 Feb, 2017 2 commits
  5. 31 Jan, 2017 2 commits
    • Damien George's avatar
    • Damien George's avatar
      stmhal: Initial implementation of multithreading, currently disabled. · 882ec01e
      Damien George authored
      This patch brings the _thread module to stmhal/pyboard.  There is a very
      simple round-robin thread scheduler, which is disabled if there is only
      one thread (for efficiency when threading is not used).
      The scheduler currently switches threads at a rate of 250Hz using the
      systick timer and the pend-SV interrupt.
      The GIL is disabled so one must be careful to use lock objects to prevent
      concurrent access of objects.
      The threading is disabled by default, one can enabled it with the config
      option MICROPY_PY_THREAD to test it out.
  6. 05 Dec, 2016 1 commit
  7. 16 Nov, 2016 2 commits
  8. 22 Aug, 2016 1 commit
    • Dave Hylands's avatar
      stmhal: Fix timer capture/compare interrupt handling for TIM1 and TIM8. · c6983e3c
      Dave Hylands authored
      It turns out that TIM1 and TIM8 have their own Capture/Compare
      interrupt vector. For all of the other timers, the capture/compare
      interrupt vector is the same as the update vector.
      So we need to add handlers for these vectors and enable them
      when using capture/compare callbacks.
      During testing of this, I also found that passing a channel callback
      into the channel constructor would not enable interrupts properly.
      I tested using:
      >>> pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end=''))
      I tested the above with channels 1, 4, and 8
  9. 05 May, 2016 1 commit
  10. 29 Jan, 2016 2 commits
    • Damien George's avatar
      stmhal: Make TIM3 available for use by the user. · ea89b80f
      Damien George authored
      TIM3 is no longer used by USB CDC for triggering outgoing data, so we
      can now make it available to the user.
      PWM fading on LED(4) is now gone, but will be reinstated in a new way.
    • 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
      Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype.
      See PR #1713.
  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:
          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.
  12. 09 Dec, 2015 1 commit
    • 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.
  13. 04 Dec, 2015 1 commit
    • Damien George's avatar
      stmhal: Add option to free up TIM3 from USB VCP polling. · 66b96822
      Damien George authored
      This is a hack to free up TIM3 so that it can be used by the user.
      Instead we use the PVD irq to call the USB VCP polling function, and
      trigger it from SysTick (so SysTick itself does not do any processing).
      The feature is enabled for pyboard lite only, since it lacks timers.
  14. 26 Nov, 2015 1 commit
  15. 25 Nov, 2015 1 commit
  16. 24 Nov, 2015 4 commits
  17. 07 Nov, 2015 1 commit
  18. 31 Oct, 2015 1 commit
    • Damien George's avatar
      all: Add py/mphal.h and use it in all ports. · 731f3592
      Damien George authored
      py/mphal.h contains declarations for generic mp_hal_XXX functions, such
      as stdio and delay/ticks, which ports should provide definitions for.  A
      port will also provide mphalport.h with further HAL declarations.
  19. 02 Aug, 2015 1 commit
  20. 29 Jul, 2015 2 commits
  21. 31 May, 2015 1 commit
  22. 20 Mar, 2015 1 commit
  23. 15 Mar, 2015 1 commit
  24. 15 Feb, 2015 1 commit
  25. 20 Jan, 2015 1 commit
  26. 01 Jan, 2015 1 commit
  27. 21 Oct, 2014 1 commit
    • Damien George's avatar
      stmhal: Overhaul UART class to use read/write, and improve it. · 481d714b
      Damien George authored
      UART object now uses a stream-like interface: read, readall, readline,
      readinto, readchar, write, writechar.
      Timeouts are configured when the UART object is initialised, using
      timeout and timeout_char keyword args.
      The object includes optional read buffering, using interrupts.  You can set
      the buffer size dynamically using read_buf_len keyword arg.  A size of 0
      disables buffering.
  28. 25 Aug, 2014 2 commits
  29. 28 Jun, 2014 1 commit
  30. 03 May, 2014 1 commit
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      Blanket wide to all .c and .h files.  Some files originating from ST are
      difficult to deal with (license wise) so it was left out of those.
      Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
  31. 21 Apr, 2014 1 commit