1. 26 Jun, 2021 2 commits
    • robert-hh's avatar
      mimxrt/machine_spi: Add the SPI class to the machine module. · f4541279
      robert-hh authored
      This class supports SPI bus controller mode, with blocking transfers.
      
      SPI device numbers start at 0, to comply with the pinout of the Teensy
      boards.  With the configured clock frequency the fastest baud rate is
      33MHz.  For messages longer 16 bytes DMA is used.  The class uses the
      existing framework with extmod/machine_spi.c.
      
      Extended driver options:
      
      - drive=n with n being between 1 and 6 or PIN.POWER_1 to PIN.POWER_6.
        Since the pins used by the SPI are fixed, no Pin settings can be made.
        Thus the drive option is added allowing to control ringing and crosstalk
        on the connection.
      
      - gap_ns=nnnnn is the time between sent data items in a frame given in ns.
        Default is 2 clock cycles.
      f4541279
    • Damien George's avatar
      github/workflows: Switch from lcov to gcov. · f3e4ed82
      Damien George authored
      Coverage calculated by Codecov has the same reliability/deterministic
      issues as Coveralls did, so the problem is likely to do with the output of
      lcov/gcov, rather than the analysis and display of the data.
      
      Switch from lcov to gcov for data generation to try and simplify this
      process of computing coverage.
      Signed-off-by: default avatarDamien George <damien@micropython.org>
      f3e4ed82
  2. 25 Jun, 2021 12 commits
  3. 24 Jun, 2021 4 commits
    • David Lechner's avatar
      py/mperrno: Add MP_ECANCELED error code. · b51ae20c
      David Lechner authored
      This is useful when binding asynchronous functions in C.
      Signed-off-by: default avatarDavid Lechner <david@pybricks.com>
      b51ae20c
    • Amir Gonnen's avatar
      unix/modffi: Add option to lock GC in callback, and cfun access. · cb332dda
      Amir Gonnen authored
      Add an optional 'lock' kwarg to callback that locks GC and scheduler.  This
      allows the callback to be invoked asynchronously in 'interrupt context',
      for example as a signal handler.
      
      Also add the 'cfun' member function to callback, that allows retrieving the
      C callback function address.  This is needed when the callback should be
      set to a struct field.
      
      See related #7373.
      Signed-off-by: default avatarAmir Gonnen <amirgonnen@gmail.com>
      cb332dda
    • Jeff Epler's avatar
      all: Fix signed shifts and NULL access errors from -fsanitize=undefined. · 413f34cd
      Jeff Epler authored
      Fixes the following (the line numbers match commit 0e87459e):
      
      ../../extmod/crypto-algorithms/sha256.c:49:19: runtime error: left shif...
      ../../extmod/moduasyncio.c:106:35: runtime error: member access within ...
      ../../py/binary.c:210:13: runtime error: left shift of negative value -...
      ../../py/mpz.c:744:16: runtime error: negation of -9223372036854775808 ...
      ../../py/objint.c:109:22: runtime error: left shift of 1 by 31 places c...
      ../../py/objint_mpz.c:374:9: runtime error: left shift of 4611686018427...
      ../../py/objint_mpz.c:374:9: runtime error: left shift of negative valu...
      ../../py/parsenum.c:106:14: runtime error: left shift of 46116860184273...
      ../../py/runtime.c:395:33: runtime error: left shift of negative value ...
      ../../py/showbc.c:177:28: runtime error: left shift of negative value -...
      ../../py/vm.c:321:36: runtime error: left shift of negative value -1```
      
      Testing was done on an amd64 Debian Buster system using gcc-8.3 and these
      settings:
      
          CFLAGS += -g3 -Og -fsanitize=undefined
          LDFLAGS += -fsanitize=undefined
      
      The introduced TASK_PAIRHEAP macro's conditional (x ? &x->i : NULL)
      assembles (under amd64 gcc 8.3 -Os) to the same as &x->i, since i is the
      initial field of the struct.  However, for the purposes of undefined
      behavior analysis the conditional is needed.
      Signed-off-by: default avatarJeff Epler <jepler@gmail.com>
      413f34cd
    • Damien George's avatar
      esp32/main: Allow MICROPY_DIR to be overridden. · 0009a7dc
      Damien George authored
      This is necessary when building a custom out-of-tree board.
      Signed-off-by: default avatarDamien George <damien@micropython.org>
      0009a7dc
  4. 23 Jun, 2021 8 commits
  5. 22 Jun, 2021 2 commits
  6. 20 Jun, 2021 1 commit
  7. 18 Jun, 2021 6 commits
  8. 17 Jun, 2021 5 commits