- 11 May, 2018 5 commits
-
-
Damien George authored
-
Damien George authored
Printing of uPy floats can differ by the floating-point precision on different architectures (eg 64-bit vs 32-bit x86), so it's not possible to using printing of floats in some parts of this test. Instead we can just check for equivalence with what is known to be the correct answer.
-
Damien George authored
Some older compilers cannot deduce that q_last is always written to before being read.
-
Damien George authored
For cases where size_t is smaller than mp_int_t (eg nan-boxing builds) the difference between two size_t's is not sign extended into mp_int_t and so the result is never negative. This patch fixes this bug by using ssize_t for the type of the result.
-
Damien George authored
-
- 10 May, 2018 5 commits
-
-
Damien George authored
If MICROPY_PY_ALL_SPECIAL_METHODS is enabled then dir() will now delegate to the special method __dir__ if the object it is listing has this method.
-
Damien George authored
This gives dir() better behaviour when listing the attributes of a user type that defines __getattr__: it will now not list those attributes for which __getattr__ raises AttributeError (meaning the attribute is not supported by the object).
-
Damien George authored
This patch fixes the possibility of a crash of the REPL when tab-completing an object which raises an exception when its attributes are accessed. See issue #3729.
-
Damien George authored
It now allows __getattr__ in a user type to raise AttributeError when the attribute does not exist.
-
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 17 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
-