aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-14stm32/fatfs_port: Fix bug when MICROPY_HW_ENABLE_RTC not enabled.Peter D. Gray
Prior to this patch, get_fattime() was calling a HAL RTC function with the HW instance pointer as null because rtc_init_start() was never called. Also marked it as a weak function, to allow a board to override it.
2018-07-14esp32: Implement WLAN.status() return codes.Mitchell Currie
Resolves #3913: missing esp32 status() implementation.
2018-07-12py/emitnative: Optimise for iteration asm code for non-debug build.Damien George
In non-debug mode MP_OBJ_STOP_ITERATION is zero and comparing something to zero can be done more efficiently in assembler than comparing to a non-zero value.
2018-07-11extmod/vfs_posix: Use DTTOIF if available to convert type in ilistdir.Damien George
2018-07-11unix/modos: Convert dir-type to stat-type for file type in ilistdir.Damien George
Fixes issue #3931.
2018-07-10py/objgenerator: Implement __name__ with normal fun attr accessor code.Damien George
With the recent change b488a4a8480533a6a3c9468c2f8bd359c94d4d02, a generating function now has the same layout in memory as a normal bytecode function, and so can reuse the latter's attribute accessor code to implement __name__.
2018-07-10mpy-cross: Make build independent of extmod directory.Damien George
mpy-cross doesn't depend on any code in the extmod directory so completely exclude it from the build (extmod may still be scanned for qstrs but that is controlled by py/py.mk). This speeds up the build a little, and improves abstraction of this component. Also, make -I$(BUILD) take precedence over -I$(TOP) in case there are stray files in the root directory that would be picked up.
2018-07-10extmod/vfs_posix: Support ilistdir with no (or empty) argument.Damien George
2018-07-10docs/pyboard: For latex build, use smaller quickref jpg, and no gifs.Damien George
The latexpdf target needs images that fit on the page, and does not support gifs.
2018-07-09py/malloc: Give a compile warning if using finaliser without GC.Damien George
Fixes issue #3844.
2018-07-09esp32/modnetwork: Add support for bssid parameter in WLAN.connect().Damien George
2018-07-09tools/mpy-tool.py: Put frozen bignum digit data in ROM, not in RAM.Damien George
2018-07-09tools/mpy-tool.py: Support freezing of floats in obj representation D.Damien George
2018-07-08py/obj.h: Give compile error if using obj repr D with single-prec float.Damien George
Object representation D only works with no floats, or double precision floats.
2018-07-08stm32: Support compiling with object representation D.Damien George
With this and previous patches the stm32 port can now be compiled using object representation D (nan boxing). Note that native code and frozen mpy files with float constants are currently not supported with this object representation.
2018-07-08extmod: Fix to support compiling with object representation D.Damien George
2018-07-08lib/utils: Fix to support compiling with object representation D.Damien George
2018-07-08py/objmodule: Make mp_obj_module_get_globals an inline function.Damien George
Because this function is simple it saves code size to have it inlined. Being an auxiliary helper function (and only used in the py/ core) the argument should always be an mp_obj_module_t*, so there's no need for the assert (and having it would require including assert.h in obj.h).
2018-07-08py/objdict: Make mp_obj_dict_get_map an inline function.Damien George
It's a very simple function and saves code, and improves efficiency, by being inline. Note that this is an auxiliary helper function and so doesn't need mp_check_self -- that's used for functions that can be accessed directly from Python code (eg from a method table).
2018-07-08stm32: Access dict map directly instead of using helper function.Damien George
2018-07-08cc3200/mods: Access dict map directly instead of using helper func.Damien George
2018-07-08py: Simplify some cases of accessing the map of module and type dict.Damien George
mp_obj_module_get_globals() returns a mp_obj_dict_t*, and type->locals_dict is a mp_obj_dict_t*, so access the map entry of the dict directly instead of needing to cast this mp_obj_dict_t* up to an object and then calling the mp_obj_dict_get_map() helper function.
2018-07-05windows: Make printing of debugging info work out of the box.stijn
Printing debugging info by defining MICROPY_DEBUG_VERBOSE expects a definition of the DEBUG_printf function which is readily available in printf.c so include that file in the build. Before this patch one would have to manually provide such definition which is tedious. For the msvc port disable MICROPY_USE_INTERNAL_PRINTF though: the linker provides no (easy) way to replace printf with the custom version as defined in printf.c.
2018-07-05lib/utils/printf: Make DEBUG_printf implementation more accessible.stijn
The definition of DEBUG_printf doesn't depend on MICROPY_USE_INTERNAL_PRINTF so move it out of that preprocessor block and compile it conditionally just depending on the MICROPY_DEBUG_PRINTERS macro. This allows a port to use DEBUG_printf while providing it's own printf definition.
2018-07-05drivers/sdcard: Do not release CS during the middle of read operations.Mateusz Kijowski
It seems that some cards do not tolerate releasing the card (by setting CS high) after issuing CMD17 (and 18) and raising it again before reading data. Somehow this causes the 0xfe data start marker not being read and SDCard.readinto() is spinning forever (or until this byte is in the data). This seems to fix weird behviour of SDCard.readblocks() returning different data, also solved hanging os.mount() for my case with a 16GB Infineon card. This stackexchange answer gives more context: https://electronics.stackexchange.com/questions/307214/sd-card-spi-interface-issue-read-operation-returns-0x3f-0xff-instead-of-0x7f-0#307268
2018-07-04esp32: Reduce latency for handling of scheduled Python callbacks.Nicko van Someren
Prior to this patch there was a large latency for executing scheduled callbacks when when Python code is sleeping: at the heart of the implementation of sleep_ms() is a call to vTaskDelay(1), which always sleeps for one 100Hz tick, before performing another call to MICROPY_EVENT_POLL_HOOK. This patch fixes this issue by using FreeRTOS Task Notifications to signal the main thread that a new callback is pending.
2018-07-03esp8266: Let machine.WDT trigger the software WDT if obj is not fed.Damien George
This patch allows scripts to have more control over the software WDT. If an instance of machine.WDT is created then the underlying OS is prevented from feeding the software WDT, and it is up to the user script to feed it instead via WDT.feed(). The timeout for this WDT is currently fixed and will be between 1.6 and 3.2 seconds.
2018-07-03esp8266/modesp: Run ets_loop_iter before/after doing flash erase/write.Damien George
A flash erase/write takes a while and during that time tasks may be scheduled via an IRQ. To prevent overflow of the task queue (and loss of tasks) call ets_loop_iter() before and after slow flash operations. Note: if a task is posted to a full queue while a flash operation is in progress then this leads to a fault when trying to print out the error message that the queue is full. This patch doesn't try to fix this particular issue, it just prevents it from happening in the first place.
2018-07-03extmod/vfs: Support opening a file descriptor (int) with VfsPosix.Damien George
Fixes issue #3865.
2018-07-03esp32: Allow to build with uPy floats disabled.Damien George
2018-07-03py/obj.h: Fix broken build for object repr C when float disabled.Nicko van Someren
Fixes issue #3914.
2018-07-02py/objgenerator: Eliminate need for mp_obj_gen_wrap wrapper instances.Damien George
For generating functions there is no need to wrap the bytecode function in a generator wrapper instance. Instead the type of the bytecode function can be changed to mp_type_gen_wrap. This reduces code size and saves a block of GC heap RAM for each generator.
2018-07-02ports: Enable ure.sub() on stm32, esp8266 (not 512k) and esp32.Damien George
2018-07-02docs/ure: Document some more supported regex operators.Damien George
2018-07-02docs/ure: Document sub(), groups(), span(), start() and end().Damien George
2018-07-02unix/mpconfigport_coverage: Enable ure groups, span, start, end and sub.Damien George
2018-07-02extmod/modure: Add ure.sub() function and method, and tests.Damien George
This feature is controlled at compile time by MICROPY_PY_URE_SUB, disabled by default. Thanks to @dmazzella for the original patch for this feature; see #3770.
2018-07-02extmod/modure: Add match.span(), start() and end() methods, and tests.Damien George
This feature is controlled at compile time by MICROPY_PY_URE_MATCH_SPAN_START_END, disabled by default. Thanks to @dmazzella for the original patch for this feature; see #3770.
2018-07-02extmod/modure: Add match.groups() method, and tests.Damien George
This feature is controlled at compile time by MICROPY_PY_URE_MATCH_GROUPS, disabled by default. Thanks to @dmazzella for the original patch for this feature; see #3770.
2018-06-28docs/uos: Make it clear that block device block_num param is an index.Damien George
2018-06-28esp8266/esp8266_common.ld: Put mp_keyboard_interrupt in iRAM.Damien George
This function may be called from a UART IRQ, which may interrupt the system when it is erasing/reading/writing flash. In such a case all code executing from the IRQ must be in iRAM (because the SPI flash is busy), so put mp_keyboard_interrupt in iRAM so ctrl-C can be caught during flash access. This patch also takes get_fattime out of iRAM and puts it in iROM to make space for mp_keyboard_interrupt. There's no real need to have get_fattime in iRAM because it calls other functions in iROM. Fixes issue #3897.
2018-06-27py/compile: Handle return/break/continue correctly in async with.Damien George
Before this patch the context manager's __aexit__() method would not be executed if a return/break/continue statement was used to exit an async with block. async with now has the same semantics as normal with. The fix here applies purely to the compiler, and does not modify the runtime at all. It might (eventually) be better to define new bytecode(s) to handle async with (and maybe other async constructs) in a cleaner, more efficient way. One minor drawback with addressing this issue purely in the compiler is that it wasn't possible to get 100% CPython semantics. The thing that is different here to CPython is that the __aexit__ method is not looked up in the context manager until it is needed, which is after the body of the async with statement has executed. So if a context manager doesn't have __aexit__ then CPython raises an exception before the async with is executed, whereas uPy will raise it after it is executed. Note that __aenter__ is looked up at the beginning in uPy because it needs to be called straightaway, so if the context manager isn't a context manager then it'll still raise an exception at the same location as CPython. The only difference is if the context manager has the __aenter__ method but not the __aexit__ method, then in that case uPy has different behaviour. But this is a very minor, and acceptable, difference.
2018-06-27tests: Move non-filesystem io tests to basics dir with io_ prefix.Damien George
2018-06-27esp8266/mpconfigport.h: Enable ucryptolib module for standard build.Damien George
It remains disabled for the 512k build.
2018-06-27extmod/moducryptolib: Don't include arpa/inet.h, it's not needed.Damien George
And some ports (eg esp8266) don't have it.
2018-06-27esp32/mpconfigport.h: Enable ucryptolib module.Damien George
2018-06-27extmod/moducryptolib: Shorten exception messages to reduce code size.Yonatan Goldschmidt
2018-06-27extmod/moducryptolib: Prefix all Python methods/objects with ucryptolib.Yonatan Goldschmidt
Follows what was done in b045ebd35 for uhashlib.
2018-06-27extmod/moducryptolib: Add an mbedTLS implementation for this module.Yonatan Goldschmidt
2018-06-27extmod/moducryptolib: Refactor functions for clean interface with axTLS.Yonatan Goldschmidt
This will allow implementations other than axTLS. This commit includes additions of checks and clarifications of exceptions related to user input. To make the interface cleaner, I've disallowed switching from encrypt to decrypt in the same object, as this is not always possible with other crypto libraries (not all libraries have AES_convert_key like axTLS).