1. 24 6月, 2021 1 次提交
  2. 23 6月, 2021 8 次提交
  3. 22 6月, 2021 2 次提交
  4. 20 6月, 2021 1 次提交
  5. 19 6月, 2021 2 次提交
  6. 18 6月, 2021 5 次提交
  7. 17 6月, 2021 6 次提交
  8. 16 6月, 2021 1 次提交
    • D
      extmod/uasyncio: Fix race with cancelled task waiting on finished task. · 514bf1a1
      Damien George 提交于
      This commit fixes a problem with a race between cancellation of task A and
      completion of task B, when A waits on B.  If task B completes just before
      task A is cancelled then the cancellation of A does not work.  Instead,
      the CancelledError meant to cancel A gets passed through to B (that's
      expected behaviour) but B handles it as a "Task exception wasn't retrieved"
      scenario, printing out such a message (this is because finished tasks point
      their "coro" attribute to themselves to indicate they are done, and
      implement the throw() method, but that method inadvertently catches the
      CancelledError).  The correct behaviour is for B to bounce that
      CancelledError back out.
      
      This bug is mainly seen when wait_for() is used, and in that context the
      symptoms are:
      - occurs when using wait_for(T, S), if the task T being waited on finishes
        at exactly the same time as the wait-for timeout S expires
      - task T will have run to completion
      - the "Task exception wasn't retrieved message" is printed with
        "<class 'CancelledError'>" as the error (ie no traceback)
      - the wait_for(T, S) call never returns (it's never put back on the
        uasyncio run queue) and all tasks waiting on this are blocked forever
        from running
      - uasyncio otherwise continues to function and other tasks continue to be
        scheduled as normal
      
      The fix here reworks the "waiting" attribute of Task to be called "state"
      and uses it to indicate whether a task is: running and not awaited on,
      running and awaited on, finished and not awaited on, or finished and
      awaited on.  This means the task does not need to point "coro" to itself to
      indicate finished, and also allows removal of the throw() method.
      
      A benefit of this is that "Task exception wasn't retrieved" messages can go
      back to being able to print the name of the coroutine function.
      
      Fixes issue #7386.
      Signed-off-by: NDamien George <damien@micropython.org>
      514bf1a1
  9. 15 6月, 2021 6 次提交
  10. 14 6月, 2021 2 次提交
  11. 13 6月, 2021 3 次提交
  12. 12 6月, 2021 3 次提交
    • R
      mimxrt/machine_rtc: Maintain microsecond offset. · 3ab8806c
      robert-hh 提交于
      The supplied value for microseconds in datetime() will be treated as a
      starting value for the reported microseconds.  Due to internal processing
      in setting the time, there is an offset about 1 ms.
      3ab8806c
    • R
      mimxrt/machine_rtc: Change RTC.datetime() tuple to match other ports. · fd4eec55
      robert-hh 提交于
      This change moves the datetime tuple format back to the one used by all the
      other ports:
      
          (year, month, day, weekday, hour, minute, second, microsecond)
      
      Weekday is a number between 0 and 6, with 0 assigned to Monday.  It has to
      be provided when setting the RTC with datetime(), but will be ignored on
      entry and calculated when needed.
      
      The weekday() method was removed, since that is now again a part of the
      datetime tuple.
      
      The now() method was updated so it continues to return a tuple that matches
      CPython's datetime module.
      fd4eec55
    • K
      rp2/machine_rtc: Add initial support for RTC. · 37d01d4b
      Krzysztof Adamski 提交于
      Initial support for machine.RTC on rp2 port. It only supports datetime()
      method and nothing else. The method gets/returns a tuple of 8 items, just
      like esp32 port, for example, but the usec parameter is ignored as the RP2
      RTC only works up to seconds precision.
      
      The Pico RTC isn't very useful as the time is lost during reset and there
      seems to be no way to easily power up just the RTC clock with a low current
      voltage, but still there seems to be use-cases for that, see issues #6831,
      and a Thonny issue #1592. It was also requested for inclusion on v1.15
      roadmap on #6832.
      Signed-off-by: NKrzysztof Adamski <k@japko.eu>
      37d01d4b