- 10 4月, 2018 9 次提交
-
-
由 Damien George 提交于
-
由 Damien George 提交于
-
由 Damien George 提交于
-
由 iabdalkader 提交于
-
由 iabdalkader 提交于
Includes a fix for H7 DAC DMA requests.
-
由 Jeff Epler 提交于
This turns a hard crash in a recursive generator into a 'maximum recursion depth exceeded' exception.
-
由 armink_ztl 提交于
The 2nd and 3rd args of the ternary operator are treated like they are in the same expression and must have similar types. void is not compatible with int so that's why the compiler is complaining.
-
由 Damien George 提交于
This patch moves the implementation of stream closure from a dedicated method to the ioctl of the stream protocol, for each type that implements closing. The benefits of this are: 1. Rounds out the stream ioctl function, which already includes flush, seek and poll (among other things). 2. Makes calling mp_stream_close() on an object slightly more efficient because it now no longer needs to lookup the close method and call it, rather it just delegates straight to the ioctl function (if it exists). 3. Reduces code size and allows future types that implement the stream protocol to be smaller because they don't need a dedicated close method. Code size reduction is around 200 bytes smaller for x86 archs and around 30 bytes smaller for the bare-metal archs.
-
由 T S 提交于
-
- 05 4月, 2018 3 次提交
-
-
由 Jeff Epler 提交于
-
由 Damien George 提交于
-
由 Damien George 提交于
-
- 04 4月, 2018 12 次提交
-
-
由 Damien George 提交于
The LHS passed to mp_obj_int_binary_op() will always be an integer, either a small int or a big int, so the test for this type doesn't need to include an "other, unsupported type" case.
-
由 Damien George 提交于
-
由 Damien George 提交于
The string "Q+?" is special in that it hashes to zero with the djb2 algorithm (among other strings), and a zero hash should be incremented to a hash of 1.
-
由 Damien George 提交于
-
由 Damien George 提交于
-
由 Damien George 提交于
-
由 Damien George 提交于
-
由 Damien George 提交于
Without the compiler enabled the mp_optimise_value is unused, and the micropython.opt_level() function is not useful, so exclude these from the build to save RAM and code size.
-
由 Damien George 提交于
-
由 Damien George 提交于
-
由 Damien George 提交于
So that these tests test the runtime behaviour, not the compiler (which may be executed offline).
-
由 Damien George 提交于
-
- 03 4月, 2018 3 次提交
-
-
由 Damien George 提交于
The case of a return statement in the try suite of a try-except statement was previously only tested by builtin_compile.py, and only then in the part of this test which checked for the existence of the compile builtin. So this patch adds an explicit unit test for this case.
-
由 Damien George 提交于
When pystack is enabled mp_obj_fun_bc_prepare_codestate() will always return a valid pointer, and if there is no more pystack available then it will raise an exception (a RuntimeError). So having pystack enabled with stackless enabled automatically gives strict stackless mode. There is therefore no need to have code for strict stackless mode when pystack is enabled, and this patch optimises the VM for such a case.
-
由 Damien George 提交于
Neither the ip nor sp variables are used again after the execution of the RAISE_VARARGS opcode, so they don't need to be updated.
-
- 30 3月, 2018 3 次提交
-
-
由 Damien George 提交于
Some code in mp_iternext() was only tested by the native emitter, so the tests added here test this function using just the bytecode emitter.
-
由 Damien George 提交于
The VM expects that, if mp_resume() returns MP_VM_RETURN_EXCEPTION, then the returned value is an exception instance (eg to add a traceback to it). It's possible that a value passed to a generator's throw() is not an exception so must be explicitly checked for if the thrown value is not intercepted by the generator. Thanks to @jepler for finding the bug.
-
由 Damien George 提交于
Prior to this patch the code would crash if a key in a ** dict was anything other than a str or qstr. This is because mp_setup_code_state() assumes that keys in kwargs are qstrs (for efficiency). Thanks to @jepler for finding the bug.
-
- 29 3月, 2018 4 次提交
-
-
由 Damien George 提交于
Instead of using a dedicated variable in RAM it's simpler to use the relevant bits in the DWT register.
-
由 Damien George 提交于
If the board is configured to use a bootloader then that bootloader will pass through the reset_mode.
-
由 Damien George 提交于
The main() function has a predefined type in C which is not so useful for embedded contexts. This patch renames main() to stm32_main() so we can define our own type signature for this function. The type signature is defined to have a single argument which is the "reset_mode" and is passed through as r0 from Reset_Handler. This allows, for example, a bootloader to pass through information into the main application.
-
由 Damien George 提交于
The Reset_Handler needs to copy the data section and zero the BSS, and these operations should be as optimised as possible to reduce start up time. The versions provided in this patch are about 2x faster (on a Cortex M4) than the previous implementations.
-
- 28 3月, 2018 6 次提交
-
-
由 Damien George 提交于
-
由 Damien George 提交于
Rather than pin objects themselves. The actual object is now pin_X_obj and defines are provided so that pin_X is &pin_X_obj. This makes it so that code that uses pin objects doesn't need to know if they are literals or objects (that need pointers taken) or something else. They are just entities that can be passed to the map_hal_pin_xxx functions. This mirrors how the core handles constant objects (eg mp_const_none which is &mp_const_none_obj) and allows for the possibility of different implementations of the pin layer. For example, prior to this patch there was the following: extern const pin_obj_t pin_A0; #define pyb_pin_X1 pin_A0 ... mp_hal_pin_high(&pin_A0); and now there is: extern const pin_obj_t pin_A0_obj; #define pin_A0 (&pin_A0_obj) #define pyb_pin_X1 pin_A0 ... mp_hal_pin_high(pin_A0); This patch should have minimal effect on board configuration files. The only change that may be needed is if a board has .c files that configure pins.
-
由 iabdalkader 提交于
-
由 iabdalkader 提交于
-
由 iabdalkader 提交于
The H7 SD peripheral has direct connection to MDMA instead.
-
由 Damien George 提交于
-