Commit Graph

12059 Commits

Author SHA1 Message Date
bildzeitung bf26ffbf56 Updated tests; removed try/catch for ucollections 2018-05-14 14:43:34 -04:00
bildzeitung a8cc4a1a62 Updated library source: ucollections -> collections 2018-05-14 14:33:50 -04:00
bildzeitung 2ff7148d09 Update docs s/ucollections/collections/g 2018-05-14 14:31:56 -04:00
Mike Stipicevic c43a75b115 Add links to CircuitPython guides and example code 2018-05-14 18:05:59 +00:00
Karin Hawley f9ae1ee172 Cleaning up and fixing the docs generation Makefile and README instructions
- moving Makefile to parent folder.  This resolves some of the weird path/build issues
- remove trace references to cpydiff and original file (no longer used anywhere)
- converting SOURCEDIR to a changeable variable, passed through all sphinx-build calls
- adding path to conf.py, in case it moves again
- making `-v` default with VERBOSE
- making `-E` default with FORCE
- creating BASEOPTS to store all the dirs, paths, and settings, passing them to sphinx-build in one long chain, instead of individually
- updating README to use the make command as default.  Also added text explaining some of the customization you can add into a make command
2018-05-14 11:02:25 -07:00
Roy Hooper a0954b9e11 Fix for Issue #770 - Provide a better error message when timers are still available. 2018-05-14 13:52:32 -04:00
Mike Stipicevic f004da1b37 Add all boards with links to specific guides 2018-05-14 17:36:12 +00:00
Scott Shawcroft ad82a2d08d
Merge pull request #830 from rhooper/master
Make python detection more robust
2018-05-14 09:14:36 -07:00
Roy Hooper 1661cbb6e1 Make python detection more robust and allow setting PYTHON2 and PYTHON3 to override python executables during build. 2018-05-14 11:19:19 -04:00
Damien George e6b66f1092 stm32/usb: Initialise cdc variable to prevent compiler warnings.
Some compilers cannot deduce that cdc will always be written before being
used.
2018-05-15 00:18:03 +10:00
Damien George 47ecbbbecb stm32/usb: Add ability to have 2x VCP interfaces on the one USB device.
This patch adds the configuration MICROPY_HW_USB_ENABLE_CDC2 which enables
a new USB device configuration at runtime: VCP+VCP+MSC.  It will give two
independent VCP interfaces available via pyb.USB_VCP(0) and pyb.USB_VCP(1).
The first one is the usual one and has the REPL on it.  The second one is
available for general use.

This configuration is disabled by default because if the mode is not used
then it takes up about 2200 bytes of RAM.  Also, F4 MCUs can't support this
mode on their USB FS peripheral (eg PYBv1.x) because they don't have enough
endpoints.  The USB HS peripheral of an F4 supports it, as well as both the
USB FS and USB HS peripherals of F7 MCUs.
2018-05-14 23:44:45 +10:00
Damien George 2e565cc0d4 stm32/usb: Change HID report funcs to take HID state, not usbdev state. 2018-05-14 17:04:43 +10:00
Damien George 91bca340ec stm32/usb: Change CDC tx/rx funcs to take CDC state, not usbdev state. 2018-05-14 16:55:04 +10:00
Damien George 68271a27e6 stm32/usb: Make CDC endpoint definitions private to core usbdev driver. 2018-05-14 16:53:45 +10:00
Damien George ed92d62326 stm32/usb: Combine HID lower-layer and interface state into one struct. 2018-05-14 16:34:31 +10:00
Damien George bf08a99ccd stm32/usb: Combine CDC lower-layer and interface state into one struct. 2018-05-14 16:15:58 +10:00
Damien George ed32284b70 stm32/usb: Use usbd_cdc_itf_t pointer directly in USB_VCP class. 2018-05-14 15:24:44 +10:00
Damien George fb25c81062 stm32/modpyb: Remove unused includes and clean up comments.
The documentation (including the examples) for elapsed_millis and
elapsed_micros can be found in docs/library/pyb.rst so doesn't need to be
written in full in the source code.
2018-05-14 14:01:50 +10:00
Damien George 88c26a48b4 stm32/pyb_i2c: Put pyb.I2C under MICROPY_PY_PYB_LEGACY setting.
When disabled, the pyb.I2C class saves around 8k of code space and 172
bytes of RAM.  The same functionality is now available in machine.I2C
(for F4 and F7 MCUs).

It is still enabled by default.
2018-05-14 13:53:46 +10:00
Damien George 92c5e2708d stm32/modpyb: Introduce MICROPY_PY_PYB_LEGACY config option for pyb mod.
This is enabled by default.  When it is disabled all legacy functions and
classes in the pyb module are excluded from the build.
2018-05-14 13:49:22 +10:00
Damien George a0f7b4c678 stm32/accel: Switch pyb.Accel to use new C-level I2C API. 2018-05-14 13:23:18 +10:00
Damien George ce824bb67e stm32/machine_i2c: Use new F4 hardware I2C driver for machine.I2C class.
And remove the old one based on ST code.
2018-05-14 13:22:12 +10:00
Damien George b21415ed4f stm32/i2c: Add new hardware I2C driver for F4 MCUs.
This driver uses low-level register access to control the I2C peripheral
(ie it doesn't rely on the ST HAL) and provides the same C-level API as the
existing F7 hardware driver.
2018-05-14 13:19:03 +10:00
Jerry Needell d9f1b1f5b7 remove #include py/nlr.h from I2C.c 2018-05-13 22:32:32 -04:00
Jerry Needell aa9309704b revise to use mp_raise_msg insead of nlr_raise.... 2018-05-13 22:21:05 -04:00
Peter D. Gray ca36645410 stm32/usbd_hid_interface: Address possible race condition vs. interrupt.
The USB IRQ may fire once USBD_HID_ClearNAK() is called and then change the
last_read_len value.
2018-05-14 12:08:34 +10:00
Peter D. Gray 1f1623d3b7 stm32/usbdev: Be honest about data not being written to HID endpoint.
USB_HID.send() should now return 0 if it could not send the report to the
host.
2018-05-14 12:01:27 +10:00
Jerry Needell d6c26942a5 add timeout keyword to I2C - for bitbangio - ignored for busio 2018-05-13 21:54:44 -04:00
Bas Wijnen 67e1a4f8be esp32: Update to latest ESP IDF version.
- Updated supported git hash to current IDF version.
- Added missing targets and includes to Makefile.
- Updated error codes for networking module.
- Added required constant to sdkconfig configuration.
2018-05-14 11:42:46 +10:00
Damien George 749b16174b py/mpstate.h: Adjust start of root pointer section to exclude non-ptrs.
This patch moves the start of the root pointer section in mp_state_ctx_t
so that it skips entries that are not pointers and don't need scanning.

Previously, the start of the root pointer section was at the very beginning
of the mp_state_ctx_t struct (which is the beginning of mp_state_thread_t).
This was the original assembler version of the NLR code was hard-coded to
have the nlr_top pointer at the start of this state structure.  But now
that the NLR code is partially written in C there is no longer this
restriction on the location of nlr_top (and a comment to this effect has
been removed in this patch).

So now the root pointer section starts part way through the
mp_state_thread_t structure, after the entries which are not root pointers.

This patch also moves the non-pointer entries for MICROPY_ENABLE_SCHEDULER
outside the root pointer section.

Moving non-pointer entries out of the root pointer section helps to make
the GC more precise and should help to prevent some cases of collectable
garbage being kept.

This patch also has a measurable improvement in performance of the
pystone.py benchmark: on unix x86-64 and stm32 there was an improvement of
roughly 0.6% (tested with both gcc 7.3 and gcc 8.1).
2018-05-13 22:53:28 +10:00
Scott Shawcroft ce5eae1c76
Merge pull request #761 from jepler/nrf-modules
nrf: Enable binascii, hashlib modules
2018-05-11 19:40:45 -07:00
Damien George aeaace0737 stm32/usbdev: Remove unused RxState variable, and unused struct. 2018-05-11 23:20:59 +10:00
Damien George 4b3c629067 .gitattributes: Remove special text handling of stm32 usbdev files. 2018-05-11 23:07:57 +10:00
Damien George abde0fa226 stm32/usbdev: Convert files to unix line endings.
Also remove trailing whitespace and convert tabs to spaces.
2018-05-11 23:03:52 +10:00
Jeff Epler 471fdae993 nrf: Enable binascii, hashlib modules
These modules would be very handy to have in order to implement a
more robust replacement for ampy.  It costs around 2KiB of text and
no data or bss.

'binascii' has base64 encoding, which can be used to create a fully
8-bit-clean transport above the slightly cooked serial connection of
these boards.

'hashlib' is a bit less critical, but I have found it handy to
be able to robustly checksum remote files.

I see this as only being useful on ports which don't have USB block
device support, so atmel-samd doesn't need it.  These modules are
already on esp8266 so I think nrf52 seems like the only one that
needs it.
2018-05-11 07:41:09 -05:00
Damien George 56a273ebff stm32/usbd_conf: Changes files to unix line endings and apply styling.
This patch is only cosmetic and has no functional change.
2018-05-11 22:17:58 +10:00
Damien George 9f4eda542a stm32/usbd_conf.h: Remove unused macros and clean up header file. 2018-05-11 22:04:56 +10:00
Damien George 9630376dbc py/mpconfig.h: Be stricter when autodetecting machine endianness.
This patch changes 2 things in the endianness detection:

1. Don't assume that __BYTE_ORDER__ not being __ORDER_LITTLE_ENDIAN__ means
   that the machine is big endian, so add an explicit check that this macro
   is indeed __ORDER_BIG_ENDIAN__ (same with __BYTE_ORDER, __LITTLE_ENDIAN
   and __BIG_ENDIAN).  A machine could have PDP endianness.

2. Remove the checks which base their autodetection decision on whether any
   little or big endian macros are defined (eg __LITTLE_ENDIAN__ or
   __BIG_ENDIAN__).  Just because a system defines these does not mean it
   has that endianness.

See issue #3760.
2018-05-11 21:51:34 +10:00
Damien George 7541be5637 tests/basics/special_methods2: Enable some additional tests that work.
These special methods are all available if MICROPY_PY_ALL_SPECIAL_METHODS
is enabled.
2018-05-11 17:37:16 +10:00
Damien George 421b84af99 docs: Bump version to 1.9.4. 2018-05-11 16:39:59 +10:00
Damien George d2c1db1e5c tests/float/float_parse: Allow test to run on 32-bit archs.
Printing of uPy floats can differ by the floating-point precision on
different architectures (eg 64-bit vs 32-bit x86), so it's not possible to
using printing of floats in some parts of this test.  Instead we can just
check for equivalence with what is known to be the correct answer.
2018-05-11 13:51:18 +10:00
Damien George 6046e68fe1 py/repl: Initialise q_last variable to prevent compiler warnings.
Some older compilers cannot deduce that q_last is always written to before
being read.
2018-05-11 13:48:47 +10:00
Damien George 095d397017 py/objdeque: Fix sign extension bug when computing len of deque object.
For cases where size_t is smaller than mp_int_t (eg nan-boxing builds) the
difference between two size_t's is not sign extended into mp_int_t and so
the result is never negative.  This patch fixes this bug by using ssize_t
for the type of the result.
2018-05-11 13:44:50 +10:00
Scott Shawcroft 51106db93d
Merge pull request #827 from dhalbert/3.0_pb_pins_digitalinout
PBxx pins were not setting DRVSTR or reporting PULL properly
2018-05-10 20:42:26 -07:00
Dan Halbert 240659da0e PBxx pins were not setting DRVSTR or reporting PULL properly 2018-05-10 23:09:51 -04:00
Scott Shawcroft 80acef52a6
Merge pull request #826 from jepler/nrf-framebuf
nrf52: enable framebuf module
2018-05-10 20:06:07 -07:00
Damien George b208aa189e stm32/README: Update to reflect current MCU support. 2018-05-11 10:36:46 +10:00
Jeff Epler 2acd5d88b6 nrf52: enable framebuf module
Closes: #656
2018-05-10 18:37:08 -05:00
Damien George 3678a6bdc6 py/modbuiltins: Make built-in dir support the __dir__ special method.
If MICROPY_PY_ALL_SPECIAL_METHODS is enabled then dir() will now delegate
to the special method __dir__ if the object it is listing has this method.
2018-05-10 23:14:23 +10:00
Damien George 29d28c2574 py/modbuiltins: In built-in dir make use of mp_load_method_protected.
This gives dir() better behaviour when listing the attributes of a user
type that defines __getattr__: it will now not list those attributes for
which __getattr__ raises AttributeError (meaning the attribute is not
supported by the object).
2018-05-10 23:07:19 +10:00