Damien George
c7c4a84397
stm: Update to compile with latest changes to core py.
11 years ago
Damien George
a3f94e0030
py: Add arg checking helper functions.
These are to assist in writing native C functions that take positional
and keyword arguments. mp_arg_check_num is for just checking the
number of arguments is correct. mp_arg_parse_all is for parsing
positional and keyword arguments with default values.
11 years ago
Paul Sokolovsky
efc36f0cea
test/class-super: Expose super() breakage.
11 years ago
Paul Sokolovsky
d6e12723ed
objarray: Implement slice subscription.
11 years ago
Paul Sokolovsky
9ae0912496
modffi: Update for MP_OBJ_STOP_ITERATION refactor.
11 years ago
Damien George
27dd471098
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
3d19137442
stmhal: Add pyb.Pin.init method to re-init GPIO pin mode.
11 years ago
Damien George
6e44381cce
stmhal: Improve RTC class; make fatfs use RTC for time stamping files.
11 years ago
Damien George
ed5117f6a8
stmhal: Add pyb.unique_id, to get unique id of MCU.
11 years ago
Paul Sokolovsky
206dd2a905
stmhal: Update for mp_binary_get_size() refactor.
11 years ago
Paul Sokolovsky
6204460461
modstruct: Initial implementation of struct.pack().
11 years ago
Paul Sokolovsky
504e23388c
objstr: Init hash in mp_obj_str_builder_start() to 0.
11 years ago
Paul Sokolovsky
4602b9a79f
obj.h: Typo fix in comment.
11 years ago
Paul Sokolovsky
1355cf42f2
modstruct: Fix .calcsize() to account for struct type/alignment.
11 years ago
Paul Sokolovsky
5695e07256
modstruct: Support 'q' & 'Q' type codes.
11 years ago
Paul Sokolovsky
752d2080b7
modffi: Mark 'p' type spec deprecated, replace with 'P'.
'p' in struct module is "pascal string". 'P' is void*.
11 years ago
Damien George
44ee42de50
stmhal: Rename pyb.Led to pyb.LED to conform to naming rules.
It's Light Emitting Diode, so should be LED.
11 years ago
Damien George
8cf08a58a1
stmhal: Remove pyb.input (use sys.stdio.read(1) instead).
11 years ago
Damien George
f20e093b9b
stmhal: Add lots of constants to stm module.
11 years ago
Damien George
561f83c9cf
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
38ae014e42
stmhal: Update ADC, DAC and I2C objects to use new buffer protocol.
Main reason for expanding buffer protocol API was to support writes to a
buffer in ADC module (see read_timed). With this change you can now
create an array of arbitrary type and ADC.read_timed will store into
that array in the correct format (byte, int, float). I wonder though if
all these changes were really worth it to support just this function.
Hopefully this enhanced buffer protocol API (with typecode specified)
will be used elsewhere.
11 years ago
Damien George
71e9bfa20d
py: Add mp_binary_set_val_array_from_int, to store an int directly.
11 years ago
Damien George
b11b85adaa
py: Allow to pass buffer protocol flags to get_buffer helper funcs.
11 years ago
Damien George
a8f5d15fc6
stmhal: Update help and comments re gpio changing to Pin.
11 years ago
Damien George
c66d86c5ce
stmhal: Big cleanup; merge gpio into Pin; make names consistent.
This is an attempt to clean up the Micro Python API on the pyboard.
Gpio functionality is now in the Pin object, which seems more natural.
Constants for MODE and PULL are now in pyb.Pin. Names of some
classes have been adjusted to conform to CamelCase. Other
miscellaneous changes and clean up here and there.
11 years ago
Damien George
738bdeb73a
unix: Update to use new buffer protocol interface with typecode.
11 years ago
Damien George
57a4b4f178
py: Add typecode to buffer protocol.
When querying an object that supports the buffer protocol, that object
must now return a typecode (as per binary.[ch]). This does not have to
be honoured by the caller, but can be useful for determining element
size.
11 years ago
Damien George
3fd2d7fad2
py: Tidy up function argument error messages.
We are not as verbose as CPython, and maybe a bit too cryptic sometimes.
11 years ago
Damien George
32ca164992
py: Tidy up array.array; add more error handling.
11 years ago
Paul Sokolovsky
0fc4775cd6
sequence: Further simplify sequence comparison.
11 years ago
Paul Sokolovsky
83eba5dec5
sequence: Fix glaring bug in sequence comparison.
11 years ago
Paul Sokolovsky
7de5377ca7
objfloat: Try to achieve the same float printing format as CPython does.
Test usecase I used is print(time.time()) and print(time.time() - time.time()).
On Linux/Glibc they now give the same output as CPython 3.3. Specifically,
time.time() gives non-exponential output with 7 decimal digits, and subtraction
gives exponential output e-06/e-07.
11 years ago
Damien George
90edf9e13b
inlinethumb: Add wfi, cpsid and cpsie instructions.
11 years ago
Damien George
906d383850
stmhal: Remove non-ascii character from include file.
11 years ago
Damien George
90ac822097
Add Python code conventions to CODECONVENTIONS.
11 years ago
Paul Sokolovsky
599bbc111c
py: from import * should not import symbols starting with underscore.
I skipped implementing this initially, but then it causes __name__
of current module be overwritten and relative imports fail.
11 years ago
Damien George
5b65f0c7d3
py: Rename USE_COMPUTED_GOTOS to USE_COMPUTED_GOTO and enable on stmhal.
On stmhal, computed gotos make the binary about 1k bigger, but makes it
run faster, and we have the room, so why not. All tests pass on
pyboard using computed gotos.
11 years ago
Damien George
559d8239ca
tests: Move gen_context to import tests, because it relies on import.
11 years ago
Damien George
ea8d06c39d
py: Add MP_OBJ_STOP_ITERATION and make good use of it.
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL.
This helps a lot in debugging and understanding of function API.
11 years ago
Damien George
1e935d8689
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
729f7b42d6
py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.
mp_obj_t->subscr now does load/store/delete.
11 years ago
Paul Sokolovsky
4abaa1b12b
unix modffi: Convert to static module structures.
11 years ago
Damien George
de7c425139
py: Simplify objfun/objgenerator connection, no need to call bc_get.
11 years ago
Damien George
d89b69eb3a
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
d0f9f6cd3f
py: Fix pfenv_print_strn to return correct number of chars printed.
With this fix, all tests in tests/basics pass on pyboard.
11 years ago
Paul Sokolovsky
e1e4249a67
unix modsocket: Convert to static module structures.
11 years ago
Paul Sokolovsky
59a2f4828d
unix: Make mem_info() dump GC info too.
mem_info() is already pretty hacky, let it be more hacky.
11 years ago
Paul Sokolovsky
eb2fc9787a
unix modtime: Convert to static module structures.
11 years ago
Paul Sokolovsky
de8292202e
unix modtime: Adhere to MICROPY_ENABLE_FLOAT better.
11 years ago
Paul Sokolovsky
b7e90ea078
objgenerator: Generator must execute in its defining lexical context.
I.e. with its own globals. So, just as for functions, we need to switch
globals when resuming a generator.
11 years ago