aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-04tests/extmod/time_ms_us: Add test for calling ticks_cpu().Damien George
This is just to test that the function exists and returns some kind of valid value. Although this file is for testing ms/us functions, put the ticks_cpu() test here so not to add a new test file.
2018-03-03tests/unix: Add coverage test for uio.resource_stream from frozen str.Damien George
2018-03-03stm32/qspi: Add hardware QSPI driver, with memory-map capability.Damien George
It supports the abstract QSPI protocol defined in drivers/bus/qspi.h.
2018-03-03stm32/spibdev: Convert to use multiple block read/write interface.Damien George
The spiflash driver now supports read/write of multiple blocks at a time.
2018-03-02stm32/storage: Add option for bdev to supply readblock/writeblocks.Damien George
If the underlying block device supports it, it's more efficient to read/write multiple blocks at once.
2018-03-02stm32/spibdev: Add option to configure SPI block dev to use QSPI flash.Damien George
To use QSPI (in software QSPI mode) the configuration needed is: #define MICROPY_HW_SPIFLASH_SIZE_BITS (n * 1024 * 1024) #define MICROPY_HW_SPIFLASH_CS (pin_x1) #define MICROPY_HW_SPIFLASH_SCK (pin_x2) #define MICROPY_HW_SPIFLASH_IO0 (pin_x3) #define MICROPY_HW_SPIFLASH_IO1 (pin_x4) #define MICROPY_HW_SPIFLASH_IO2 (pin_x5) #define MICROPY_HW_SPIFLASH_IO3 (pin_x6)
2018-03-02stm32/spibdev: Update to work with new spiflash driver.Damien George
2018-03-02extmod/machine_spi: Make SPI protocol structure public.Damien George
So it can be referenced directly without the need for the uPy object.
2018-03-02drivers/memory/spiflash: Add support for QSPI interface.Damien George
The spiflash memory driver is reworked to allow the underlying bus to be either normal SPI or QSPI. In both cases the bus can be implemented in software or hardware, as long as the spiflash driver is passed the correct configuration structure.
2018-03-02drivers/bus: Add QSPI abstract type with software QSPI implementation.Damien George
A new directory drivers/bus/ is introduced, which can hold implementations of bus drivers. A software QSPI implementation is added.
2018-03-02py/objint: Remove unreachable code checking for int type in format func.Damien George
All callers of mp_obj_int_formatted() are expected to pass in a valid int object, and they do: - mp_obj_int_print() should always pass through an int object because it is the print special method for int instances. - mp_print_mp_int() checks that the argument is an int, and if not converts it to a small int. This patch saves around 20-50 bytes of code space.
2018-03-02tests: Move heap-realloc-while-locked test from C to Python.Damien George
This test for calling gc_realloc() while the GC is locked can be done in pure Python, so better to do it that way since it can then be tested on more ports.
2018-03-01tests/unix: Add coverage tests for various GC calls.Damien George
2018-03-01py/formatfloat: Fix case where floats could render with negative digits.Damien George
Prior to this patch, some architectures (eg unix x86) could render floats with "negative" digits, like ")". For example, '%.23e' % 1e-80 would come out as "1.0000000000000000/)/(,*0e-80". This patch fixes the known cases.
2018-03-01py/formatfloat: Fix case where floats could render with a ":" character.Damien George
Prior to this patch, some architectures (eg unix x86) could render floats with a ":" character in them, eg 1e+39 would come out as ":e+38" (":" is just after "9" in ASCII so this is like 10e+38). This patch fixes some of these cases.
2018-03-01py/formatfloat: Fix rounding of %f format with edge-case FP values.Damien George
Prior to this patch the %f formatting of some FP values could be off by up to 1, eg '%.0f' % 123 would return "122" (unix x64). Depending on the FP precision (single vs double) certain numbers would format correctly, but others wolud not. This patch should fix all cases of rounding for %f.
2018-02-28tests/extmod/vfs_fat_fileio1: Add test for calling file obj finaliser.Damien George
2018-02-28extmod/vfs_fat_diskio: Use a C-stack-allocated bytearray for block buf.Damien George
This patch eliminates heap allocation in the VFS FAT disk IO layer, when calling the underlying readblocks/writeblocks methods. The bytearray object that is passed to these methods is now allocated on the C stack rather than the heap (it's only 4 words big). This means that these methods should not retain a pointer to the buffer object that is passed in, but this was already a restriction because the original heap-allocated bytearray had its buffer passed by reference.
2018-02-27tests/basics/gc1: Add test which triggers GC threshold.Damien George
2018-02-27tests/unix: Add coverage test for VM executing invalid bytecode.Damien George
2018-02-27py/vm: Simplify handling of special-case STOP_ITERATION in yield from.Damien George
There's no need to have MP_OBJ_NULL a special case, the code can re-use the MP_OBJ_STOP_ITERATION value to signal the special case and the VM can detect this with only one check (for MP_OBJ_STOP_ITERATION).
2018-02-27py/vm: Fix case of handling raised StopIteration within yield from.Damien George
This patch concerns the handling of an NLR-raised StopIteration, raised during a call to mp_resume() which is handling the yield from opcode. Previously, commit 6738c1dded8e436686f85008ec0a4fc47406ab7a introduced code to handle this case, along with a test. It seems that it was lucky that the test worked because the code did not correctly handle the stack pointer (sp). Furthermore, commit 79d996a57b351e0ef354eb1e2f644b194433cc73 improved the way mp_resume() propagated certain exceptions: it changed raising an NLR value to returning MP_VM_RETURN_EXCEPTION. This change meant that the test introduced in gen_yield_from_ducktype.py was no longer hitting the code introduced in 6738c1dded8e436686f85008ec0a4fc47406ab7a. The patch here does two things: 1. Fixes the handling of sp in the VM for the case that yield from is interrupted by a StopIteration raised via NLR. 2. Introduces a new test to check this handling of sp and re-covers the code in the VM.
2018-02-26esp8266/modnetwork: Implement WLAN.status('rssi') for STA interface.Damien George
This will return the RSSI of the AP that the STA is connected to.
2018-02-26esp8266/uart: Allow to compile with event-driven REPL.Damien George
2018-02-26py/mpstate.h: Add repl_line state for MICROPY_REPL_EVENT_DRIVEN.Damien George
2018-02-26tests/float: Adjust float-parsing tests to pass with only a small error.Damien George
Float parsing (both single and double precision) may have a relative error of order the floating point precision, so adjust tests to take this into account by not printing all of the digits of the answer.
2018-02-26tests/extmod/uzlib_decompress: Add uzlib tests to improve coverage.Damien George
2018-02-26tests/extmod/vfs_fat_fileio1: Add test for failing alloc with finaliser.Damien George
2018-02-25tests/unix: Add coverage tests for mpz_set_from_float, mpz_mul_inpl.Damien George
These new tests cover cases that can't be reached from Python and get coverage of py/mpz.c to 100%. These "unreachable from Python" pieces of code could be removed but they form an integral part of the mpz C API and may be useful for non-Python usage of mpz.
2018-02-25py/mpz: In mpz_clone, remove unused check for NULL dig.Damien George
This path for src->deg==NULL is never used because mpz_clone() is always called with an argument that has a non-zero integer value, and hence has some digits allocated to it (mpz_clone() is a static function private to mpz.c all callers of this function first check if the integer value is zero and if so take a special-case path, bypassing the call to mpz_clone()). There is some unused and commented-out functions that may actually pass a zero-valued mpz to mpz_clone(), so some TODOs are added to these function in case they are needed in the future.
2018-02-24tests/stress: Add test to create a dict beyond "maximum" rehash size.Damien George
There is a finite list of ascending primes used for the size of a hash table, and this test tests that the code can handle a dict larger than the maximum value in that list of primes. Adding this tests gets py/map.c to 100% coverage.
2018-02-24tests/basics: Add test for calling a subclass of a native class.Damien George
Adding this test gets py/objtype.c to 100% coverage.
2018-02-24py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func.Damien George
All callers of the asm entry function guarantee that num_locals>=0, so no need to add an explicit check for it. Use an assertion instead. Also, the signature of asm_x86_entry is changed to match the other asm entry functions.
2018-02-24py/compile: Adjust c_assign_atom_expr() to use return instead of goto.Damien George
Makes the flow of the function a little more obvious, and allows to reach 100% coverage of compile.c when using gcov.
2018-02-23extmod/vfs_fat: Remove declaration of mp_builtin_open_obj.Damien George
It's declared already in py/builtin.h.
2018-02-23extmod/vfs_fat: Make fat_vfs_open_obj wrapper public, not its function.Damien George
This patch just moves the definition of the wrapper object fat_vfs_open_obj to the location of the definition of its function, which matches how it's done in most other places in the code base.
2018-02-23extmod/vfs_fat: Merge remaining vfs_fat_misc.c code into vfs_fat.c.Damien George
The only function left in vfs_fat_misc.c is fat_vfs_import_stat() which can logically go into vfs_fat.c, allowing to remove vfs_fat_misc.c.
2018-02-23extmod/vfs_fat: Move ilistdir implementation from misc to main file.Damien George
The fat_vfs_ilistdir2() function was only used by fat_vfs_ilistdir_func() so moving the former into the same file as the latter allows it to be placed directly into the latter function, thus saving code size.
2018-02-23stm32: Move MCU-specific cfg from mphalport.h to mpconfigboard_common.h.Damien George
It's cleaner to have all the MCU-specific configuration in one location, not least to help with adding support for a new MCU series.
2018-02-23stm32/flash: Use FLASH_TYPEPROGRAM_WORD to support newer HALs.Damien George
2018-02-23stm32: Use "GEN" for describing files generated in the build.Damien George
Instead of "Create", to match the build output from the py/ core.
2018-02-23examples/embedding: Don't prefix $(MPTOP) to ports/unix source files.Damien George
Otherwise the build process puts the corresponding output object files in two directories lower, not in build/ports/unix.
2018-02-22examples/embedding: Update broken paths to use correct $(MPTOP).talljosh
Some ".." need to be changed to $(MPTOP), and in some places "ports/" needs to be inserted to get to the "ports/unix/" subdir.
2018-02-22stm32: Add board config option to enable/disable the ADC.Damien George
The new option is MICROPY_HW_ENABLE_ADC and is enabled by default.
2018-02-22minimal/Makefile: Explicitly include lib/utils/printf.c in build.Damien George
The bare-metal port needs it and it's no longer included by default since the Makefile now uses $(PY_CORE_O).
2018-02-22py: Use "GEN" consistently for describing files generated in the build.Damien George
2018-02-22py/py.mk: Remove .. path component from list of extmod files.Damien George
This just makes it a bit cleaner in the output of the build process: instead of "CC ../../py/../extmod/" there is now "CC ../../extmod/".
2018-02-22ports/{bare-arm,minimal}/Makefile: Only build with core source files.Damien George
These ports don't need anything from extmod so don't include those files at all in the build. This speeds up the build by about 10% when building with a single core.
2018-02-22py/py.mk: Split list of uPy sources into core and extmod files.Damien George
If a port only needs the core files then it can now use the $(PY_CORE_O) variable instead of $(PY_O). $(PY_EXTMOD_O) contains the list of extmod files (including some files from lib/). $(PY_O) retains its original definition as the list of all object file (including those for frozen code) and is a convenience variable for ports that want everything.
2018-02-21py/objdeque: Use m_new0 when allocating items to avoid need to clear.Damien George
Saves a few bytes of code space, and is more efficient because with MICROPY_GC_CONSERVATIVE_CLEAR enabled by default all memory is already cleared when allocated.