- 18 Apr, 2014 9 commits
-
-
Damien George authored
-
Damien George authored
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.
-
Damien George authored
-
Damien George authored
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.
-
Damien George authored
We are not as verbose as CPython, and maybe a bit too cryptic sometimes.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
- 17 Apr, 2014 31 commits
-
-
Damien George authored
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.
-
Damien George authored
-
Damien George authored
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API.
-
Damien George authored
-
Damien George authored
mp_obj_t->subscr now does load/store/delete.
-
Paul Sokolovsky authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
With this fix, all tests in tests/basics pass on pyboard.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
mem_info() is already pretty hacky, let it be more hacky.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
I.e. with its own globals. So, just as for functions, we need to switch globals when resuming a generator.
-
Paul Sokolovsky authored
This follows pattern already used for objtuple, etc.: objfun.h's content is not public - each and every piece of code should not have access to it. It's not private either - with out architecture and implementation language (C) it doesn't make sense to keep implementation of each object strictly private and maintain cumbersome accessors. It's "local" - intended to be used by a small set of "friend" (in C++ terms) objects.
-
Damien George authored
Addresses issue #487.
-
Damien George authored
Any generated headers go in $(BUILD)/genhdr/, and are #included as 'genhdr/xxx.h'.
-
Damien George authored
Merge branch 'relocatable-build-dir' of github.com:lurch/micropython into lurch-relocatable-build-dir
-
Damien George authored
nlr: Add implementation using setjmp/longjmp.
-
Damien George authored
Add 'test' target to unix/Makefile
-
Damien George authored
Allow the uPy used by run-tests to be overridden
-
Damien George authored
-
Damien George authored
Not all functions implemented. Not enabled on pyboard.
-
Damien George authored
-
Damien George authored
-
Damien George authored
Things get tricky when using the nlr code to catch exceptions. Need to ensure that the variables (stack layout) in the exception handler are the same as in the bit protected by the exception handler. Prior to this patch there were a few bugs. 1) The constant mp_const_MemoryError_obj was being preloaded to a specific location on the stack at the start of the function. But this location on the stack was being overwritten in the opcode loop (since it didn't think that variable would ever be referenced again), and so when an exception occurred, the variable holding the address of MemoryError was corrupt. 2) The FOR_ITER opcode detection in the exception handler used sp, which may or may not contain the right value coming out of the main opcode loop. With this patch there is a clear separation of variables used in the opcode loop and in the exception handler (should fix issue (2) above). Furthermore, nlr_raise is no longer used in the opcode loop. Instead, it jumps directly into the exception handler. This tells the C compiler more about the possible code flow, and means that it should have the same stack layout for the exception handler. This should fix issue (1) above. Indeed, the generated (ARM) assembler has been checked explicitly, and with 'goto exception_handler', the problem with &MemoryError is fixed. This may now fix problems with rge-sm, and probably many other subtle bugs yet to show themselves. Incidentally, rge-sm now passes on pyboard (with a reduced range of integration)! Main lesson: nlr is tricky. Don't use nlr_push unless you know what you are doing! Luckily, it's not used in many places. Using nlr_raise/jump is fine.
-
Damien George authored
-
Damien George authored
Tests in basics (which should probably be renamed to core) should not rely on float, or import any non-built-in files. This way these tests can be run when those features are not available. All test in basics now pass on the pyboard using stmhal port, except for string-repr which has some issues with character hex printing.
-
Paul Sokolovsky authored
-
Andrew Scheller authored
As discussed in #504
-
Andrew Scheller authored
As discussed in #504
-