aboutsummaryrefslogtreecommitdiff
path: root/extmod/moductypes.c
AgeCommit message (Collapse)Author
2014-10-30moductypes: When dereferencing a field which is array of uint8, use bytearray.Paul Sokolovsky
Because bytearrays are much friendlier to work with, e.g. they can be printed easily.
2014-10-30moductypes: Make sure we can apply .sizeof() to all aggregate types.Paul Sokolovsky
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.
2014-10-06py: Make mp_binary_set_val work on big endian machine.Damien George
2014-09-27Fix timer overflow code.Dave Hylands
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.
2014-09-02extmod: Fix type-punned-ptr error.Damien George
2014-08-30Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George
Addressing issue #50, still some way to go yet.
2014-08-12stmhal: Enable moductypes by default.Damien George
Also fixes compiler error in moductypes when compiled without debugging. Addresses issue #778.
2014-08-10moductypes: Remove debug inclusion of stdio.h .Paul Sokolovsky
2014-07-31py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George
Addresses issue #724.
2014-07-11moductypes: Add symbolic constants to specify bitfield position/length.Paul Sokolovsky
2014-07-09moductypes: Foreign data interface module, roughly based on ctype ideas.Paul Sokolovsky
But much smaller and memory-efficient. Uses Python builtin data structures (dict, tuple, int) to describe structure layout.