- 21 Sep, 2016 1 commit
-
-
Damien George authored
One can instead lookup __name__ in the modules dict to get the value.
-
- 19 Mar, 2016 3 commits
-
-
Damien George authored
-
Damien George authored
-
Damien George authored
It handles more cases than mp_binary_get_int.
-
- 11 Jan, 2016 2 commits
-
-
Damien George authored
The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
-
Damien George authored
This patch changes the type signature of .make_new and .call object method slots to use size_t for n_args and n_kw (was mp_uint_t. Makes code more efficient when mp_uint_t is larger than a machine word. Doesn't affect ports when size_t and mp_uint_t have the same size.
-
- 10 Jan, 2016 1 commit
-
-
Dave Hylands authored
-
- 03 Jan, 2016 1 commit
-
-
Antonin ENFRUN authored
-
- 09 Dec, 2015 1 commit
-
-
Paul Sokolovsky authored
Previously, sizeof() blindly assumed LAYOUT_NATIVE and tried to align size even for packed LAYOUT_LITTLE_ENDIAN & LAYOUT_BIG_ENDIAN. As sizeof() is implemented on a strucuture descriptor dictionary (not an structure object), resolving this required passing layout type around.
-
- 03 Dec, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 29 Nov, 2015 2 commits
-
-
Damien George authored
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
-
Damien George authored
-
- 27 Oct, 2015 1 commit
-
-
Paul Sokolovsky authored
Since we now have it.
-
- 25 Oct, 2015 1 commit
-
-
Paul Sokolovsky authored
This is required to write structures to files, pass to FFI functions, etc.
-
- 06 Jun, 2015 1 commit
-
-
Paul Sokolovsky authored
Now address comes first, and args related to struct type are groupped next. Besides clear groupping, should help catch errors eagerly (e.g. forgetting to pass address will error out). Also, improve args number checking/reporting overall.
-
- 16 Apr, 2015 1 commit
-
-
Damien George authored
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
-
- 11 Apr, 2015 1 commit
-
-
Damien George authored
This simplifies the API for objects and reduces code size (by around 400 bytes on Thumb2, and around 2k on x86). Performance impact was measured with Pystone score, but change was barely noticeable.
-
- 20 Jan, 2015 1 commit
-
-
Damien George authored
See issue #699.
-
- 12 Jan, 2015 1 commit
-
-
Damien George authored
-
- 01 Jan, 2015 1 commit
-
-
Damien George authored
-
- 10 Dec, 2014 1 commit
-
-
Damien George authored
-
- 05 Dec, 2014 1 commit
-
-
Damien George authored
mp_obj_int_get_truncated is used as a "fast path" int accessor that doesn't check for overflow and returns the int truncated to the machine word size, ie mp_int_t. Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word sized values. Addresses issues #779 and #998.
-
- 29 Nov, 2014 1 commit
-
-
Damien George authored
This is just a clean-up of the code. Generated code is exactly the same.
-
- 30 Oct, 2014 3 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Because bytearrays are much friendlier to work with, e.g. they can be printed easily.
-
Paul Sokolovsky authored
Before, sizeof() could be applied to a structure field only if that field was itself a structure. Now it can be applied to PTR and ARRAY fields too. It's not possible to apply it to scalar fields though, because as soon as scalar field (int or float) is dereferenced, its value is converted into Python int/float value, and all original type info is lost. Moreover, we allow sizeof of type definitions too, and there int is used to represent (scalar) types. So, we have ambiguity what int may be - either dereferenced scalar structure field, or encoded scalar type. So, rather throw an error if user tries to apply sizeof() to int.
-
- 06 Oct, 2014 1 commit
-
-
Damien George authored
-
- 28 Sep, 2014 1 commit
-
-
Dave Hylands authored
Teensy doesn't need to worry about overflows since all of its timers are only 16-bit. For PWM, the pulse width needs to be able to vary from 0..period+1 (pulse-width == period+1 corresponds to 100% PWM) I couldn't test the 0xffffffff cases since we can't currently get a period that big in python. With a prescaler of 0, that corresponds to a freq of 0.039 (i.e. cycle every 25.56 seconds), and we can't set that using freq or period. I also tested both stmhal and teensy with floats disabled, which required a few other code changes to compile.
-
- 02 Sep, 2014 1 commit
-
-
Damien George authored
-
- 29 Aug, 2014 1 commit
-
-
Damien George authored
Addressing issue #50, still some way to go yet.
-
- 12 Aug, 2014 1 commit
-
-
Damien George authored
Also fixes compiler error in moductypes when compiled without debugging. Addresses issue #778.
-
- 10 Aug, 2014 1 commit
-
-
Paul Sokolovsky authored
-
- 31 Jul, 2014 1 commit
-
-
Damien George authored
Addresses issue #724.
-
- 10 Jul, 2014 1 commit
-
-
Paul Sokolovsky authored
-
- 09 Jul, 2014 1 commit
-
-
Paul Sokolovsky authored
But much smaller and memory-efficient. Uses Python builtin data structures (dict, tuple, int) to describe structure layout.
-