- 10 May, 2018 1 commit
-
-
Damien George authored
This new helper function acts like mp_load_method_maybe but is wrapped in an NLR handler so it can catch exceptions. It prevents AttributeError from propagating out, and optionally all other exceptions. This helper can be used to fully implement hasattr (see follow-up commit), and also for cases where mp_load_method_maybe is used but it must now raise an exception.
-
- 09 May, 2018 4 commits
-
-
Damien George authored
The list of qstrs starts with MP_QSTR_NULL followed by MP_QSTR_, and these should never appear in dir() or REPL tab completion, so skip them.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
- 08 May, 2018 1 commit
-
-
Damien George authored
Commit e269cabe added a check that the first argument to the to_bytes() method is an integer, and now uPy follows CPython behaviour and raises a TypeError for this test. Note: CPython checks the argument types before checking the number of arguments, but uPy does it the other way around, so they give different exception messages for this test, but still the same type, a TypeError.
-
- 04 May, 2018 8 commits
-
-
Damien George authored
-
Damien George authored
Commit 68c28174 implemented checking for valid utf-8 data.
-
Damien George authored
Commit 1e70fda6 fixes this difference.
-
Damien George authored
-
Damien George authored
-
Damien George authored
On this 32-bit arch there's no need to use the long version of the format specifier. It's only there to appease the compiler which checks the type of the args passed to printf. Removing the "l" saves a bit of code space.
-
Damien George authored
-
Damien George authored
Using MP_STREAM_POLL_HUP for ERR_RST state follows how *nix handles this case.
-
- 02 May, 2018 19 commits
-
-
Damien George authored
-
Damien George authored
The order of function calls in an arithmetic expression is undefined and so they must be written out as sequential statements. Thanks to @dv-extrarius for reporting this issue, see issue #3690.
-
Damien George authored
-
Damien George authored
If a socket is cleanly shut down by the peer then reads on this socket should continue to return zero bytes. The lwIP socket API does not have this behaviour (it only returns zero once, then blocks on subsequent calls) so this patch adds explicit checks and logic for peer closed sockets.
-
Torwag authored
Add --init to the submodule update example, thus, all submodules get initialised including the nested (--recursive) ones. Without it there might not be a submodule init.
-
Ayke van Laethem authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
Disabling this saves around 6000 bytes of code space and gets the 512k build fitting in the available flash again (it increased lately due to an increase in the size of the ESP8266 SDK).
-
Damien George authored
In adcall.py the pyb module may not be imported, so use ADCAll directly. In dac.py the DAC object now prints more info, so update .exp file. In spi.py the SPI should be deinitialised upon exit, so the test can run a second time correctly.
-
Damien George authored
-
Damien George authored
For a given IRQn (eg UART) there's no need to carry around both a PRI and SUBPRI value (eg IRQ_PRI_UART, IRQ_SUBPRI_UART). Instead, the IRQ_PRI_UART value has been changed in this patch to be the encoded hardware value, using NVIC_EncodePriority. This way the NVIC_SetPriority function can be used directly, instead of going through HAL_NVIC_SetPriority which must do extra processing to encode the PRI+SUBPRI. For a priority grouping of 4 (4 bits for preempt priority, 0 bits for the sub-priority), which is used in the stm32 port, the IRQ_PRI_xxx constants remain unchanged in their value. This patch also "fixes" the use of raise_irq_pri() which should be passed the encoded value (but as mentioned above the unencoded value is the same as the encoded value for priority grouping 4, so there was no bug from this error).
-
Peter D. Gray authored
The problem is the existing code which tries to optimise the reinitialisation of the DMA breaks the abstraction of the HAL. For the STM32L4 the HAL's DMA setup code maintains two private vars (ChannelIndex, DmaBaseAddress) and updates a hardware register (CCR). In HAL_DMA_Init(), the CCR is updated to set the direction of the DMA. This is a problem because, when using the SD Card interface, the same DMA channel is used in both directions, so the direction bit in the CCR must follow that. A quick and effective fix for the L4 is to simply call HAL_DMA_DeInit() and HAL_DMA_Init() every time.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
This makes ADCAll work correctly on L4 MCUs.
-
Damien George authored
-
- 01 May, 2018 7 commits
-
-
Damien George authored
Due to a typo, math.e was too small by around 6e-11.
-
Damien George authored
-
Damien George authored
-
Damien George authored
To reduce dependency on the ST HAL for pin operations.
-
Damien George authored
It should be used after mp_hal_pin_config() or mp_hal_pin_config_alt().
-
Damien George authored
Following the same addition to esp8266 port.
-
Lars Kellogg-Stedman authored
This patch enables iface.config('essid') to work for both AP and STA interfaces.
-