aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-09-21stm32/dcmi: Add F4/F7/H7 hal files and dma definitions for DCMI periph.Andrew Leech
2018-09-21tools/pydfu: Workaround stdio flush error on Windows with Python 3.6.Andrew Leech
There appears to be an issue on Windows with CPython >= 3.6, sys.stdout.flush() raises an exception: OSError: [WinError 87] The parameter is incorrect It works fine to just catch and ignore the error on the flush line. Tested on Windows 10 x64 1803 (Build 17134.228), Python 3.6.4 amd64.
2018-09-20stm32/adc: Increase sample time for internal sensors on L4 MCUs.Damien George
They need time (around 4us for VREFINT) to obtain accurate results. Fixes issue #4022.
2018-09-20stm32/adc: Fix ADC calibration scale for L4 MCUs, they use 3.0V.Damien George
2018-09-20tests/float/float_parse.py: Add tests for accuracy of small decimals.Damien George
2018-09-20py/parsenum: Avoid rounding errors with negative powers-of-10.Romain Goyet
This patches avoids multiplying with negative powers-of-10 when parsing floating-point values, when those powers-of-10 can be exactly represented as a positive power. When represented as a positive power and used to divide, the resulting float will not have any rounding errors. The issue is that mp_parse_num_decimal will sometimes not give the closest floating representation of the input string. Eg for "0.3", which can't be represented exactly in floating point, mp_parse_num_decimal gives a slightly high (by 1LSB) result. This is because it computes the answer as 3 * 0.1, and since 0.1 also can't be represented exactly, multiplying by 3 multiplies up the rounding error in the 0.1. Computing it as 3 / 10, as now done by the change in this commit, gives an answer which is as close to the true value of "0.3" as possible.
2018-09-20esp32/machine_rtc: Fix locals dict entry, init qstr points to init meth.Damien George
2018-09-20docs/pyboard: Fix to use Sphinx style for internal/external links.Damien George
2018-09-20drivers/sdcard: Remove debugging print statement in ioctl method.Peter Hinch
2018-09-20stm32/Makefile: Include copysign.c in double precision float builds.Damien George
This is required for DEBUG=1 builds when MICROPY_FLOAT_IMPL=double. Thanks to Andrew Leech.
2018-09-20lib/libm_dbl: Add implementation of copysign() for DEBUG builds.Andrew Leech
This provides a double variant of the float copysignf from libm/math.c which is required for DEBUG=1 builds when MICROPY_FLOAT_IMPL=double
2018-09-20docs/library/pyb: Add deprecation warning for mount and old block proto.Peter Hinch
pyb.mount(None, mountpoint) functionality is also removed and replaced by uos.umount.
2018-09-20drivers/sdcard: In test use os.umount and machine module instead of pyb.Peter Hinch
pyb.umount(None, mountpoint) no longer works.
2018-09-20unix/modjni: Get building under coverage and nanbox builds.Damien George
Changes made: - make use of MP_OBJ_TO_PTR and MP_OBJ_FROM_PTR where necessary - fix shadowing of index variable i, renamed to j - fix type of above variable to size_t to prevent comparison warning - fix shadowing of res variable - use "(void)" instead of "()" for functions that take no arguments
2018-09-20unix/modjni: Update .getiter signature to include mp_obj_iter_buf_t* .Paul Sokolovsky
And thus be buildable again.
2018-09-20py/objgenerator: Implement PEP479, StopIteration convs to RuntimeError.Damien George
This commit implements PEP479 which disallows raising StopIteration inside a generator to signal that it should be finished. Instead, the generator should simply return when it is complete. See https://www.python.org/dev/peps/pep-0479/ for details.
2018-09-20stm32: Add support for STM32F765xx MCUs.Andrew Leech
This part is functionally similar to STM32F767xx (they share a datasheet) so support is generally comparable. When adding board support the stm32f767_af.csv and stm32f767.ld should be used.
2018-09-20py/modbuiltins: Make oct/hex work when !MICROPY_PY_BUILTINS_STR_OP_MODULOPaul Sokolovsky
Instead of redirecting to str.__mod__(), use str.format() in this case.
2018-09-20py/objstr: Make % (__mod__) formatting operator configurable.Paul Sokolovsky
Default is enabled, disabled for minimal builds. Saves 1296 bytes on x86, 976 bytes on ARM.
2018-09-20py: Shorten error messages by using contractions and some rewording.Damien George
2018-09-20py/objtype: Clarify comment about configuring inplace op methods.Damien George
In 0e80f345f88c5db7c2353a5a9d29ed08b0af42f4 the inplace operations __iadd__ and __isub__ were made unconditionally available, so the comment about this section is changed to reflect that.
2018-09-20stm32/boards/STM32F769DISC: Add optional support for external SDRAM.Damien George
2018-09-20stm32/sdram: Add support for 32-bit wide data bus and 256MB in MPU cfg.Damien George
2018-09-18drivers/display/lcd160cr.py: In fast_spi, send command before flushing.Damien George
The intention of oflush() is to flush the "fast SPI" command itself so that the SPI object is ready to use when the function returns.
2018-09-16stm32/dma: Get DMA working on F0 MCUs.Damien George
Changes made: - fix DMA_SUB_INSTANCE_AS_UINT8 - fix dma_id numbers in dma_descr_t - add F0 DMA IRQ handlers - set DmaBaseAddress and ChannelIndex when reinit'ing
2018-09-16py/asmthumb: Detect presence of I-cache using CMSIS macro.Damien George
Fixes issue #4113.
2018-09-16py/asmxtensa: Make indirect calls using func table, not raw pointers.Damien George
Loading a pointer by indexing into the native function table mp_fun_table, rather than loading an immediate value (via a PC-relative load), uses less code space.
2018-09-15py/emitnative: Make viper funcs run with their correct globals context.Damien George
Viper functions will now capture the globals at the point they were defined and use these globals when executing.
2018-09-15py/emitnative: Use macros instead of raw offsetof for slot locations.Damien George
Old globals are now stored in the second slot (ip in mp_code_state_t) to make things simpler for viper.
2018-09-15py/emitnative: Support arbitrary number of arguments to viper functions.Damien George
2018-09-15py: Make viper functions have the same entry signature as native.Damien George
This commit makes viper functions have the same signature as native functions, at the level of the emitter/assembler. This means that viper functions can now be wrapped in the same uPy object as native functions. Viper functions are now responsible for parsing their arguments (before it was done by the runtime), and this makes calling them more efficient (in most cases) because the viper entry code can be custom generated to suit the signature of the function. This change also opens the way forward for viper functions to take arbitrary numbers of arguments, and for them to handle globals correctly, among other things.
2018-09-15py/emitnative: Reuse mp_native_type_from_qstr when searching for a cast.Damien George
2018-09-15py/compile: Factor code that compiles viper type annotations.Damien George
2018-09-15py/compile: Merge viper annotation and normal param compilation stages.Damien George
Now that the compiler can store the results of the viper types in the scope, the viper parameter annotation compilation stage can be merged with the normal parameter compilation stage.
2018-09-15py/emit: Completely remove set_native_type, arg type is set in compiler.Damien George
In viper mode, the type of the argument is now stored in id_info->flags.
2018-09-15py/emit: Remove need to call set_native_type to set viper return type.Damien George
Instead this return type is now stored in the scope_flags.
2018-09-15py/emit: Remove need to call set_native_type to set native/viper mode.Damien George
The native emitter can easily determine the mode via scope->emit_options.
2018-09-15py/emit: Move MP_EMIT_OPT_xxx enums from compile.h to emitglue.h.Damien George
2018-09-14py/{asmx86,asmx64}: Extend test_r8_with_r8 to accept all 8 lower regs.Damien George
2018-09-14py/asmx64: Fix bug in assembler when creating disp with r13 and 0 offsetDamien George
2018-09-14py: Optimise call to mp_arg_check_num by compressing fun signature.Damien George
With 5 arguments to mp_arg_check_num(), some architectures need to pass values on the stack. So compressing n_args_min, n_args_max, takes_kw into a single word and passing only 3 arguments makes the call more efficient, because almost all calls to this function pass in constant values. Code size is also reduced by a decent amount: bare-arm: -116 minimal x86: -64 unix x64: -256 unix nanbox: -112 stm32: -324 cc3200: -192 esp8266: -192 esp32: -144
2018-09-14examples/embedding: Fix hard-coded MP_QSTR_ value.Damien George
2018-09-14examples/embedding: Fix reference to freed memory, lexer src name.Dave Hylands
This issue was brought up by BramPeters in the forum: https://forum.micropython.org/viewtopic.php?p=30066
2018-09-14esp32: Fix int overflow in machine.sleep/deepsleep functions.Siarhei Farbotka
2018-09-14unix/modos: Include extmod/vfs.h for MP_S_IFDIR, etc.Paul Sokolovsky
If DTTOIF() macro is not defined, the code refers to MP_S_IFDIR, etc. symbols defined in extmod/vfs.h, so should include it. This fixes build for Android.
2018-09-14zephyr/CMakeLists: Update for latest Zephyr CMake usage refactorings.Paul Sokolovsky
Added cmake_minimum_required and updated target_link_libraries directives.
2018-09-14zephyr/prj_base.conf: Update for net_config subsys refactor.Paul Sokolovsky
net_config subsystem was split off from net_app, and as a result, settings need renaming from CONFIG_NET_APP_* to CONFIG_NET_CONFIG_*.
2018-09-13py: Fix native functions so they run with their correct globals context.Damien George
Prior to this commit a function compiled with the native decorator @micropython.native would not work correctly when accessing global variables, because the globals dict was not being set upon function entry. This commit fixes this problem by, upon function entry, setting as the current globals dict the globals dict context the function was defined within, as per normal Python semantics, and as bytecode does. Upon function exit the original globals dict is restored. In order to restore the globals dict when an exception is raised the native function must guard its internals with an nlr_push/nlr_pop pair. Because this push/pop is relatively expensive, in both C stack usage for the nlr_buf_t and CPU execution time, the implementation here optimises things as much as possible. First, the compiler keeps track of whether a function even needs to access global variables. Using this information the native emitter then generates three different kinds of code: 1. no globals used, no exception handlers: no nlr handling code and no setting of the globals dict. 2. globals used, no exception handlers: an nlr_buf_t is allocated on the C stack but it is not used if the globals dict is unchanged, saving execution time because nlr_push/nlr_pop don't need to run. 3. function has exception handlers, may use globals: an nlr_buf_t is allocated and nlr_push/nlr_pop are always called. In the end, native functions that don't access globals and don't have exception handlers will run more efficiently than those that do. Fixes issue #1573.
2018-09-12stm32/sdcard: Fully reset SDMMC periph before calling HAL DMA functions.Damien George
The HAL DMA functions enable SDMMC interrupts before fully resetting the peripheral, and this can lead to a DTIMEOUT IRQ during the initialisation of the DMA transfer, which then clears out the DMA state and leads to the read/write not working at all. The DTIMEOUT is there from previous SDMMC DMA transfers, even those that succeeded, and is of duration ~180 seconds, which is 0xffffffff / 24MHz (default DTIMER value, and clock of peripheral). To work around this issue, fully reset the SDMMC peripheral before calling the HAL SD DMA functions. Fixes issue #4110.
2018-09-12unix/mpconfigport_coverage.h: Enable uhashlib.md5.Damien George