aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-12-27py/runtime: Unlock the GIL in mp_deinit function.Damien George
This mirrors what is done in mp_init. Some RTOSs require this symmetry to get back to a clean state (when doing a soft reset, for example).
2018-12-22py/mpconfig: Move MICROPY_VERSION macros to static ones in mpconfig.h.Damien George
It's more robust to have the version defined statically in a header file, rather than dynamically generating it via git using a git tag. In case git doesn't exist, or a different source control tool is used, it's important to still have the uPy version number available.
2018-12-22stm32/main: Add board config option to enable/disable mounting SD card.Andrew Leech
The new option MICROPY_HW_SDCARD_MOUNT_AT_BOOT can now be defined to 0 in mpconfigboard.h to allow SD hardware to be enabled but not auto-mounted at boot. This feature is enabled by default to retain previous behaviour. Previously, if an SD card is enabled in hardware it is also used to boot from. While this can be disabled with a SKIPSD file on internal flash, this wont be available at first boot or if the internal flash gets corrupted.
2018-12-20py/gc: Adjust gc_alloc() signature to be able to accept multiple flags.Paul Sokolovsky
The older "bool has_finaliser" gets recast as GC_ALLOC_FLAG_HAS_FINALISER=1 so this is a backwards compatible change to the signature. Since bool gets implicitly converted to 1 this patch doesn't include conversion of all calls.
2018-12-20py/objarray: Introduce "memview_offset" alias for "free" field of objectPaul Sokolovsky
Both mp_type_array and mp_type_memoryview use the same object structure, mp_obj_array_t, but for the case of memoryview, some fields, e.g. "free", have different meaning. As the "free" field is also a bitfield, assume that (anonymous) union can't be used here (for the concerns of possible compatibility issues with wide array of toolchains), and just add a field alias using a #define. As it's a define, it should be a selective identifier, so use verbose "memview_offset" to avoid any clashes.
2018-12-15tools/mpy-tool.py: Fix build error when no qstrs present in frozen mpy.Dave Hylands
If you happen to only have a really simple frozen file that doesn't contain any new qstrs then the generated frozen_mpy.c file contains an empty enumeration which causes a C compile time error.
2018-12-15py/qstr: Put a lower bound on new qstr pool allocation.Damien George
2018-12-15windows: Remove remaining traces of old GNU readline support.Damien George
GNU readline support for the unix port was removed in acaa30b6046d449f5f58a8f02c83459702759df7 and in 5e83a75c78dc8c370b25e7ee669295854ea45130, so it's also no longer supported in the windows port.
2018-12-13stm32/boards/NUCLEO_L432KC: Specify L4 OpenOCD config file for this MCU.Damien George
2018-12-13stm32/boards: Allow OpenOCD stm_flash procedure to accept single FW img.Damien George
To support deplop-openocd on target boards that use TEXT0_ADDR only and have their firmware in a single binary image.
2018-12-13tests/basics/special_methods2: Typo fix in comment.Paul Sokolovsky
2018-12-13tools/mpy-tool.py: Fix calc of opcode size for opcodes with map caching.Damien George
Following an equivalent fix to py/bc.c. The reason the incorrect values for the opcode constants were not previously causing a bug is because they were never being used: these opcodes always have qstr arguments so the part of the code that was comparing them would never be reached. Thanks to @malinah for finding the problem and providing the initial patch.
2018-12-13py/bc: Fix calculation of opcode size for opcodes with map caching.Damien George
All 4 opcodes that can have caching bytes also have qstrs, so the test for them must go in the qstr part of the code. The reason this incorrect calculation of the opcode size did not lead to a bug is because the caching byte is at the end of the opcode (byte, qstr, qstr, cache) and is always 0x00 when saving/loading, so was just treated as a single byte no-op opcode. Hence these opcodes were being saved/loaded/decoded correctly. Thanks to @malinah for finding the problem and providing the initial patch.
2018-12-13py/objdict: Make .fromkeys() method configurable.Paul Sokolovsky
On by default, turned off for minimal/bare-arm. Saves 144 bytes on x86.
2018-12-13docs/ure: Fully describe supported syntax subset, add example.Paul Sokolovsky
2018-12-12stm32/adc: Support 16-bit ADC configuration on H7 MCUs.Damien George
2018-12-12stm32/adc: Increase ADC sampling time for internal sources on H7 MCUs.Damien George
2018-12-12stm32/adc: Fix calibrated volt/temp readings on H7 by using 16bit scale.Damien George
2018-12-12stm32/extint: Use correct EXTI channels on H7 MCUs for RTC events.Damien George
2018-12-10nrf/bluetooth: Update BLE stack download script.Glenn Ruben Bakke
Due to new webpages at nordicsemi.com, the download links for Bluetooth LE stacks were broken. This patch updates the links to new locations for the current targets.
2018-12-11docs/README: Remove references to MICROPY_PORT when building docs.Damien George
The docs are now built as one for all ports.
2018-12-10teensy: Add own uart.h to not rely on stm32's version of the file.Damien George
2018-12-10stm32/uart: Add ability to have a static built-in UART object.Damien George
A static UART is useful for internal peripherals that require a UART and need to persist outside the soft-reset loop.
2018-12-10stm32/uart: Move config of char_width/char_mask to uart.c.Damien George
2018-12-10stm32/uart: For UART init, pass in params directly, not via HAL struct.Damien George
To provide a cleaner and more abstract C-level interface to the UART.
2018-12-10stm32/uart: Simplify deinit of UART, no need to call HAL.Damien George
The HAL just clears UE and then clears all the UART control registers.
2018-12-10stm32/uart: Remove HAL's UART_HandleTypeDef from UART object struct.Damien George
This UART_HandleTypeDef is quite large (around 70 bytes in RAM needed for each UART object) and is not needed: instead the state of the peripheral held in its registers provides all the required information.
2018-12-10stm32/uart: Factor out code to set RX buffer to function uart_set_rxbuf.Damien George
2018-12-10stm32/uart: Rework uart_get_baudrate so it doesn't need a UART handle.Damien George
2018-12-10stm32/uart: Factor out code from machine_uart.c that computes baudrate.Damien George
2018-12-10stm32: Split out UART Python bindings from uart.c to machine_uart.c.Damien George
2018-12-10py/objexcept: Make sure mp_obj_new_exception_msg doesn't copy/format msgDamien George
mp_obj_new_exception_msg() assumes that the message passed to it is in ROM and so can use its data directly to create the string object for the argument of the exception, saving RAM. At the same time, this approach also makes sure that there is no attempt to format the message with printf, which could lead to faults if the message contained % characters. Fixes issue #3004.
2018-12-10py/objexcept: Use macros to make offsets in emergency exc buf clearer.Damien George
2018-12-10extmod/moductypes: Add aliases for native C types.Paul Sokolovsky
SHORT, INT, LONG, LONGLONG, and unsigned (U*) variants are being defined. This is done at compile using GCC-style predefined macros like __SIZEOF_INT__. If the compiler doesn't have such defines, no such types will be defined.
2018-12-10tests/extmod/uctypes_error: Add test for unsupported unary op.Damien George
2018-12-10tests/extmod/uctypes_ptr_le: Test int() operation on a pointer field.Paul Sokolovsky
2018-12-10extmod/moductypes: Implement __int__ for PTR.Paul Sokolovsky
Allows to get address a pointer contains, as an integer.
2018-12-07tests/basics/special_methods: Add testcases for __int__.Paul Sokolovsky
2018-12-07py/obj: Add support for __int__ special method.Paul Sokolovsky
Based on the discussion, this special method is available unconditionally, as converting to int is a common operation.
2018-12-06py/objboundmeth: Support loading generic attrs from the method.Damien George
Instead of assuming that the method is a bytecode object, and only supporting load of __name__, make the operation generic by delegating the load to the method object itself. Saves a bit of code size and fixes the case of attempting to load __name__ on a native method, see issue #4028.
2018-12-06esp32/modmachine: Enable machine.sleep() now that the IDF supports it.Damien George
2018-12-06esp32/machine_pwm: On deinit stop routing PWM signal to the pin.Damien George
Fixes issue #4273.
2018-12-06esp32/machine_pwm: Support higher PWM freq by auto-scaling timer res.Damien George
2018-12-06esp32/machine_uart: Implement UART.sendbreak() method.Damien George
The uart_write_bytes_with_break() function requires non-zero data to be sent before the break, so a standalone break must be synthesised.
2018-12-06stm32/boards: Add NUCLEO_L432KC board configuration files.boochow
2018-12-06stm32: Add peripheral support for STM32L432.boochow
The L432 does not have: GPIOD, TIM3, SPI2, ADC dual mode operation, 2-banks flash.
2018-12-06stm32/boards: Add STM32L432KC chip configuration files.boochow
The pin alternate function information is derived from ST's datasheet https://www.st.com/resource/en/datasheet/stm32l432kc.pdf In the datasheet, the line 2 of AF4 includes I2C2 but actually the chip does not have I2C2 so it is removed.
2018-12-05esp8266/machine_uart: Add rxbuf keyword arg to UART constructor/init.Damien George
As per the machine.UART documentation, this is used to set the length of the UART RX buffer.
2018-12-05esp32/machine_uart: Add txbuf/rxbuf keyword args to UART construct/init.Damien George
As per the machine.UART documentation, these are used to set the length of the TX and RX buffers.
2018-12-05stm32/uart: Add rxbuf keyword arg to UART constructor and init method.Damien George
As per the machine.UART documentation, this is used to set the length of the RX buffer. The legacy read_buf_len argument is retained for backwards compatibility, with rxbuf overriding it if provided.