Andrew Scheller
37067666ee
Fix the builtin min() and max() functions (and add tests).
Fixes #539
11 years ago
Andrew Scheller
1f740bdaf4
Make pyboard.enter_raw_repl more robust
In case there's a program in the microcontroller's main.py running in an infinite loop
11 years ago
Dave Hylands
e911cfdb22
Fix pin initialization when a mode argument is provided
11 years ago
Andrew Scheller
ed9d8d6354
Add flashboard target to the stmhal Makefile to run dfu-util
Which allows you to run "make -C stmhal flashboard" from the top-level directory.
Also ties in nicely with my configurable BUILD directory from #506
11 years ago
Paul Sokolovsky
d32bab27bb
py: Add copyright/license header to each file.
11 years ago
Paul Sokolovsky
1f85d6255d
py: Add tentative scheme for error messages configuration.
11 years ago
Paul Sokolovsky
68551a8428
objfun: Add function name accessor and .print slot method.
11 years ago
Damien George
dddf5bd330
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
f4b7e9bd2e
stmhal, docs: Small changes to URL links; adds list of files if none given.
This documentation is now available at micropython.org/doc/
11 years ago
Damien George
37977b7b27
Merge pull request #528 from pfalcon/native-subclass1
Initial support for subclassing native types
11 years ago
Damien George
4ae52d454c
stmhal: Reinstate CC3000 driver from old stm/ port.
It's not enabled by default because it doesn't fully work. It can
connect to an AP, get an IP address and do a host-lookup, but not yet do
send or recv on a socket.
11 years ago
Damien George
cab23051d9
stmhal: Make LED.intensity return the same value it was set to.
Also give proper error message when trying to construct a non-existent
LED.
Addresses issue #530 .
11 years ago
Paul Sokolovsky
22d0598818
objfun: Factor out function to report positional args mismatch.
11 years ago
Paul Sokolovsky
e908591baa
py: Abstract no-return attribute for functions a bit.
11 years ago
Paul Sokolovsky
b1ce37d32e
py: If setjmp NLR implementation is forced, omit native versions.
11 years ago
Paul Sokolovsky
851c856585
nlr.h: As we treat all warnings as errors, can't use #warning.
And this is not good.
11 years ago
Paul Sokolovsky
c963310123
tests: Add test for calling inherited native method on subclass.
11 years ago
Paul Sokolovsky
7f0419c0e5
objtype: Support calling normal methods inherited from native base class.
Biggest part of this support is refactoring mp_obj_class_lookup() to return
standard "bound member" pair (mp_obj_t[2]). Actual support of inherited
native methods is 3 lines then. Some inherited features may be not supported
yet (e.g. native class methods, native properties, etc., etc.). There may
be opportunities for further optimization too.
11 years ago
Damien George
da9f27103d
stmhal: Oops, typo.
11 years ago
Damien George
8d09640b22
stmhal: Add documentation in comments, and script to generate HTML.
Decided to write own script to pull documentation from comments in C code.
Style for writing auto generated documentation is: start line with ///
and then use standard markdown to write the comment. Keywords
recognised by the scraper begin with backslash. See code for examples.
Running: python gendoc.py modpyb.c accel.c adc.c dac.c extint.c i2c.c
led.c pin.c rng.c servo.c spi.c uart.c usrsw.c, will generate a HTML
structure in gendoc-out/.
gendoc.py is crude but functional. Needed something quick, and this was
it.
11 years ago
Paul Sokolovsky
5a12137c3e
tests: Add test for accessing attribute of inherited native type.
11 years ago
Paul Sokolovsky
443857de98
objtype: Add support for looking up non-method attrs in native base class.
11 years ago
Paul Sokolovsky
4f46c441ef
tests: Add basic tests for subclassing native types and using special methods.
Even of these, some features do not yet work as expected.
11 years ago
Paul Sokolovsky
6ead0d2fbc
objtype: Implement basic framework for subclassing native types.
This implements checking of base types, allocation and basic initialization,
and optimized support for special method lookups. Other features are not yet
supported.
11 years ago
Damien George
186e463a9e
py: Fix bug in map lookup of interned string vs non-interned.
Had choice of either interning or forcing full equality comparison, and
chose latter. See comments in mp_map_lookup.
Addresses issue #523 .
11 years ago
Damien George
185f9c1c46
py: Fix lexerunix, where not all data may be read from a file.
Addresses issue #526 .
11 years ago
Damien George
0c8fcb9c49
py: Remove silly comment about interning keywords.
Of course, keywords are turned into lexer tokens in the lexer, so will
never need to be interned (unless you do something like x="def").
As it is now, the following on pyboard makes no new qstrs:
import pyb
pyb.info()
11 years ago
Paul Sokolovsky
a224067846
py: Clear allocated, but unused memory in containers.
Also, clear up freed slots in containers.
As a follow up to 32bef315be
.
11 years ago
Paul Sokolovsky
7ce6a8fe46
objlist: We no longer need to assert on mem alloc results.
They either succeed or raise exception.
11 years ago
Paul Sokolovsky
48bf6b3bd0
objlist: Use static small int constructor.
11 years ago
Damien George
708c073250
py: Add '*' qstr for 'import *'; use blank qstr for comprehension arg.
11 years ago
Damien George
968bf34c4c
py: Remove unnecessary LOAD_CONST_ID bytecode.
It's the same as LOAD_CONST_STR.
11 years ago
Damien George
db12891918
py: Eliminate 'op' variable in VM dispatch loop.
Remembering the last op is rarely needed, and when it is, can simply use
*save_ip.
11 years ago
Damien George
9d181f62dc
py: Save some ROM by shortening compiler error messages.
Messages are still explanatory, while taking a little less ROM.
11 years ago
Damien George
2c0842b3c5
py: Change the way function arguments are compiled.
New way uses slightly less ROM and RAM, should be slightly faster, and,
most importantly, allows to catch the error "non-keyword arg following
keyword arg".
Addresses issue #466 .
11 years ago
Damien George
2827d62e8b
py: Implement keyword-only args.
Implements 'def f(*, a)' and 'def f(*a, b)', but not default
keyword-only args, eg 'def f(*, a=1)'.
Partially addresses issue #524 .
11 years ago
Damien George
36cbd0db7e
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
32bef315be
py, gc: Only zero out the extra bytes at the end of the heap chunk.
This is a small optimisation to zero out only the additional bytes that
the caller did not ask for.
11 years ago
Paul Sokolovsky
27f5bdd6d4
py: "read" & "write" are so common that make them core.
Few other strings move to core, but make depend on "io" module.
11 years ago
Paul Sokolovsky
100cd36a0e
objstringio: Compile only if MICROPY_ENABLE_MOD_IO defined.
11 years ago
Paul Sokolovsky
cb9dc086a3
modio: Implement io.StringIO class.
11 years ago
Damien George
dbc81df5d4
Simplify names for argcheck.c / arg parsing.
11 years ago
Damien George
6d3c5e4301
Add ARRAY_SIZE macro, and use it where possible.
11 years ago
Damien George
d139c489ba
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
6cebe24b7d
bare-arm: Disable more stuff to reduce binary size.
11 years ago
Damien George
107c9fb235
py: Make collections module configurable, enabled by default.
11 years ago
Paul Sokolovsky
e14d096cb7
objstr: Optimize .rstrip() by scanning string from end.
11 years ago
Paul Sokolovsky
881078403e
objstr: Implement .lstrip() & .rstrip().
Share code with .strip(). TODO: optimize .rstrip().
11 years ago
Paul Sokolovsky
12a9cfed76
modsocket: Make .send() support arbitrary objects with buffer interface.
This is CPython-compliant (except that CPython doesn't support buffer
protocol for str).
11 years ago
Paul Sokolovsky
45fb143ba6
streams: Make .write() support arbitrary objects with buffer interface.
This in particular fixes writing str vs bytes.
11 years ago