aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-21py: Update makefiles to use $(CAT) variable instead of hard coded "cat".Sébastien Rinsoz
The variable $(CAT) is initialised with the "cat" value in mkenv.mk like for the other command line tools (rm, echo, cp, mkdir etc). With this, for example, Windows users can specify the path of cat.exe.
2019-05-21py/objarray: Add decode method to bytearray.stijn
Reuse the implementation for bytes since it works the same way regardless of the underlying type. This method gets added for CPython compatibility of bytearray, but to keep the code simple and small array.array now also has a working decode method, which is non-standard but doesn't hurt.
2019-05-21stm32/i2c: Support setting the I2C TIMINGR value via keyword arg.Damien George
On MCUs that have an I2C TIMINGR register, this can now be explicitly set via the "timingr" keyword argument to the I2C constructor, for both machine.I2C and pyb.I2C. This allows to configure precise timing values when the defaults are inadequate.
2019-05-21stm32/machine_i2c: Simplify ROM initialisation of static HW I2C objects.Damien George
2019-05-21stm32/i2c: Make timeout for hardware I2C configurable.Andrew Leech
Previously the hardware I2C timeout was hard coded to 50ms which isn't guaranteed to be enough depending on the clock stretching specs of the I2C device(s) in use. This patch ensures the hardware I2C implementation honors the existing timeout argument passed to the machine.I2C constructor. The default timeout for software and hardware I2C is now 50ms.
2019-05-20docs/pyboard/quickref: Refer to new machine.I2C instead of old pyb.I2C.Damien George
On stm32 boards, machine.I2C is now preferred over pyb.I2C.
2019-05-20lib/stm32lib: Update library to fix UART9/10 baudrate on F4 MCUs.Damien George
2019-05-20drivers/display/ssd1306.py: Change to use new i2c.writevto() method.Damien George
Fixes issue #3482.
2019-05-20extmod/machine_i2c: Add i2c.writevto() that can write a vector of bufs.Damien George
For example: i2c.writevto(addr, (buf1, buf2)). This allows to efficiently (wrt memory) write data composed of separate buffers, such as a command followed by a large amount of data.
2019-05-20extmod/machine_i2c: Remove need for temporary memory in writemem() call.Damien George
2019-05-20zephyr/machine_i2c: Update to support new C-level I2C API.Damien George
2019-05-20nrf/machine/i2c: Update to support new C-level I2C API.Damien George
2019-05-20stm32/machine_i2c: Update to support new C-level I2C API.Damien George
2019-05-20extmod/machine_i2c: Change C-level API to allow split I2C transactions.Damien George
API is: int transfer( mp_obj_base_t *obj, uint16_t addr, size_t n, mp_machine_i2c_buf_t *bufs, unsigned int flags )
2019-05-20docs/machine.I2C: Add writevto method to write a vector of byte bufs.Damien George
This allows to efficiently send to an I2C slave data that is made up of more than one buffer. Instead of needing to allocate temporary memory to combine buffers together this new method allows to pass in a tuple or list of buffers. The name is based on the POSIX function writev() which has similar intentions and signature. The reasons for taking this approach (compared to having an interface with separate start/write/stop methods) are: - It's a backwards compatible extension. - It's convenient for the user. - It's efficient because there is only one Python call, then the C code can do everything in one go. - It's efficient on the I2C bus because the implementation can do everything in one go without pauses between blocks of bytes. - It should be possible to implement this extension in all ports, for hardware and software I2C. Further discussion is found in issue #3482, PR #4020 and PR #4763.
2019-05-20stm32/adc: Fix VBAT_DIV to be 4 for STM32F411.Damien George
Fixes issue #4794.
2019-05-17various: Update early copyright years to match actual edit history.Damien George
2019-05-17various: Add and update my copyright line based on git history.Paul Sokolovsky
For modules I initially created or made substantial contributions to.
2019-05-17stm32/modmachine: Create dedicated asm function to branch to bootloader.Damien George
Recent gcc versions (at least 9.1) give a warning about using "sp" in the clobber list. Such code is removed by this patch. A dedicated function is instead used to set SP and branch to the bootloader so the code has full control over what happens. Fixes issue #4785.
2019-05-17esp32/network_ppp: Add a timeout for closing PPP connection.Damien George
This also fixes deleting the PPP task, since eTaskGetState() never returns eDeleted. A limitation with this patch: once the PPP is deactivated (ppp.active(0)) it cannot be used again. A new PPP instance must be created instead.
2019-05-15esp32/machine_uart: Implement UART.deinit() method.Damien George
2019-05-15stm32/boards/NUCLEO_H743ZI: Enable SPI3 on this board.iabdalkader
2019-05-15stm32/irq: Fix IRQ_ENABLE_STATS stats config to work on all MCUs.iabdalkader
Only the M4 and M7 MCUs have an FPU and FPU_IRQn, and FPU_IRQn is not always the last entry/IRQ number.
2019-05-15stm32/spi: Enable SPI IRQs and add IRQHandlers for H7 MCUs.iabdalkader
The H7 HAL uses SPI IRQs when the SPI is running in DMA mode.
2019-05-15stm32/dma: Always reset and configure the H7 DMA peripheral.iabdalkader
This is required for the H7 DMA to work.
2019-05-15tools/upip.py: Add support for multiple index URLs with custom default.Damien George
The user can now select their own package index by either passing the "-i" command line option, or setting the upip.index_urls variable (before doing an install). The https://micropython.org/pi package index hosts packages from micropython-lib and will be searched first when installing a package. If a package is not found here then it will fallback to PyPI.
2019-05-14tests/basics: Add coverage tests for memoryview attributes.Damien George
2019-05-14py/objarray: Add support for memoryview.itemsize attribute.stijn
This allows figuring out the number of bytes in the memoryview object as len(memview) * memview.itemsize. The feature is enabled via MICROPY_PY_BUILTINS_MEMORYVIEW_ITEMSIZE and is disabled by default.
2019-05-14tests/pyb: Update UART expected output now that default timeout is 0.Damien George
Follow up to commit 34942d0a72980173eca51b201f271f67bcae46b5
2019-05-14extmod/modujson: Handle parsing of floats with + in the exponent.Damien George
Fixes issue #4780.
2019-05-13stm32/dma: Initialise all members of DMA structs for H7 MCUs.iabdalkader
2019-05-13nrf: Change types to size_t for all uses of mp_obj_str_get_data.Damien George
2019-05-13esp32/modnetwork: Change type to size_t for uses of mp_obj_str_get_data.Damien George
2019-05-13py/persistentcode: Change "len" type to size_t for mp_obj_str_get_data.Henrik Vendelbo
2019-05-10docs/esp32: Correct quickref for ESP32 hardware SPI with non-default IO.Nicko van Someren
2019-05-10esp8266/modmachine: Handle overflow of timer to get longer periods.Damien George
Can now handle up to about 298 days maximum for millisecond periods. Fixes issue #4664.
2019-05-09py/misc.h: Rename _MP_STRINGIFY to not use leading underscore in ident.Damien George
Macro identifiers with a leading underscore are reserved.
2019-05-09py/objgenerator: Remove unneeded forward decl and clean up white space.Damien George
2019-05-09py/objgenerator: Fix handling of None passed as 2nd arg to throw().Damien George
Fixes issue #4527.
2019-05-09stm32/rtc: Allow overriding startup timeouts from mpconfigboard.Andrew Leech
2019-05-08unix/modusocket: Fix use of setsockopt in usocket.settimeout impl.Elad Namdar
The original code called setsockopt(SO_RCVTIMEO/SO_SNDTIMEO) with NULL timeout structure argument, which is an illegal usage of that function. The old code also didn't validate the return value of setsockopt, missing the bug completely.
2019-05-08stm32/usbd_cdc_interface: Don't retransmit chars if USB is reconnected.Damien George
Before this change, if the USB was reconnected it was possible that some characters in the TX buffer were retransmitted because tx_buf_ptr_out and tx_buf_ptr_out_shadow were reset while tx_buf_ptr_in wasn't. That behaviour is fixed here by retaining the TX buffer state across reconnects. Fixes issue #4761.
2019-05-07stm32: Move factory reset files and code to separate source file.Damien George
The new function factory_reset_make_files() populates the given filesystem with the default factory files. It is defined with weak linkage so it can be overridden by a board. This commit also brings some minor user-facing changes: - boot.py is now no longer created unconditionally if it doesn't exist, it is now only created when the filesystem is formatted and the other files are populated (so, before, if the user deleted boot.py it would be recreated at next boot; now it won't be). - pybcdc.inf and README.txt are only created if the board has USB, because they only really make sense if the filesystem is exposed via USB.
2019-05-07stm32/machine_uart: Change default UART timeout to 0, for non blocking.Damien George
It's more common to need non-blocking behaviour when reading from a UART, rather than having a large timeout like 1000ms (the original behaviour). With a large timeout it's 1) likely that the function will read forever if characters keep trickling it; or 2) the function will unnecessarily wait when characters come sporadically, eg at a REPL prompt.
2019-05-07mpy-cross: Add --version command line option to print version info.Damien George
Prints something like: MicroPython v1.10-304-g8031b7a25 on 2019-05-02; mpy-cross emitting mpy v4
2019-05-07docs/esp8266: Add tutorial for APA102 LEDs.Mike Causer
2019-05-06py: remove "if (0)" and "if (false)" branches.Jun Wu
Prior to this commit, building the unix port with `DEBUG=1` and `-finstrument-functions` the compilation would fail with an error like "control reaches end of non-void function". This change fixes this by removing the problematic "if (0)" branches. Not all branches affect compilation, but they are all removed for consistency.
2019-05-06extmod/moducryptolib: Add AES-CTR support for axTLS builds.Yonatan Goldschmidt
2019-05-06extmod/moducryptolib: Add AES-CTR support.Yonatan Goldschmidt
Selectable at compile time via MICROPY_PY_UCRYPTOLIB_CTR. Disabled by default.
2019-05-03unix/coverage: Add test for printing literal % character.Damien George