summaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAge
* py: mp_obj_str_get_str(): Work with bytes too.Paul Sokolovsky2014-10-31
| | | | | | | It should be fair to say that almost in all cases where some API call expects string, it should be also possible to pass byte string. For example, it should be open/delete/rename file with name as bytestring. Note that similar change was done quite a long ago to mp_obj_str_get_data().
* stmhal: Fix ptr arith in CC3000 code; enable network build in travis.Damien George2014-10-30
|
* moductypes: Make .sizeof() work with bytearrays.Paul Sokolovsky2014-10-30
|
* moductypes: Add test for accessing UINT8 array.Paul Sokolovsky2014-10-30
|
* moductypes: When dereferencing a field which is array of uint8, use bytearray.Paul Sokolovsky2014-10-30
| | | | | Because bytearrays are much friendlier to work with, e.g. they can be printed easily.
* moductypes: Make sure we can apply .sizeof() to all aggregate types.Paul Sokolovsky2014-10-30
| | | | | | | | | | | | 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.
* py: Allow to override port config file and thus have >1 configs per port.Paul Sokolovsky2014-10-29
| | | | | | Use it like: make CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_my.h>"'
* Fix errors after enabling -Wpointer-arithstijn2014-10-29
|
* Add -Wpointer-arith flag to prevent problems with pointer arithmetic on void*stijn2014-10-29
|
* docs: Increase size of pyboard pinout.v1.3.5Damien George2014-10-26
|
* unix: Make -v dump memory info at exit.Paul Sokolovsky2014-10-26
| | | | Also, move bytecode dumps to -v -v, because they're too verbose for just -v.
* docs: Add quick reference page, with pinout and short example code.Damien George2014-10-26
|
* stmhal: Allow DAC object to be initialised from a pin.Damien George2014-10-26
| | | | Eg: dac = DAC(Pin.board.X5)
* unix: Implement -m option (execute module from stdlib).Paul Sokolovsky2014-10-26
| | | | | | | | Support for packages as argument not implemented, but otherwise error and exit handling should be correct. This for example will allow to do: pip-micropython install micropython-test.pystone micropython -m test.pystone
* stmhal: Improve REPL control codes; improve pyboard.py script.Damien George2014-10-26
| | | | | | | | | | | | | | | | | | | | Improvements are: 2 ctrl-C's are now needed to truly kill running script on pyboard, so make CDC interface allow multiple ctrl-C's through at once (ie sending b'\x03\x03' to pyboard now counts as 2 ctrl-C's). ctrl-C in friendly-repl can now stop multi-line input. In raw-repl mode, use ctrl-D to indicate end of running script, and also end of any error message. Thus, output of raw-repl is always at least 2 ctrl-D's and it's much easier to parse. pyboard.py is now a bit faster, handles exceptions from pyboard better (prints them and exits with exit code 1), prints out the pyboard output while the script is running (instead of waiting till the end), and allows to follow the output of a previous script when run with no arguments.
* tests: Get builtin_compile to skin properly on pyboard.Damien George2014-10-26
|
* stmhal: Change SPI phase spec to 0,1 to match standard conventions.Damien George2014-10-26
| | | | | | | Was 1 or 2, now 0 or 1 (respectively). 0 means sample MISO on first edge, 1 means sample on second edge. Addresses issue #936.
* py: Fix memoryview referencing so it retains ptr to original buffer.Damien George2014-10-26
| | | | | This way, if original parent object is GC'd, the memoryview still points to the underlying buffer data so that buffer is not GC'd.
* unix/windows: Disable sigaction on windows port.Damien George2014-10-26
|
* py: Fix VM dispatch following a pending exception check.Damien George2014-10-26
|
* changed file paths to new namesSebastian Plamauer2014-10-25
|
* py: Add mp_pending_exception global variable, for VM soft interrupt.Damien George2014-10-25
| | | | | | | | | | | This allows to implement KeyboardInterrupt on unix, and a much safer ctrl-C in stmhal port. First ctrl-C is a soft one, with hope that VM will notice it; second ctrl-C is a hard one that kills anything (for both unix and stmhal). One needs to check for a pending exception in the VM only for jump opcodes. Others can't produce an infinite loop (infinite recursion is caught by stack check).
* stmhal: Change USB PID when in CDC+HID mode.Damien George2014-10-25
| | | | | | | This gets CDC+HID working on Windows, since it needs a different PID for a different USB configuration. Thanks to tmbinc and dhylands.
* tests: Add test for compile builtin.Damien George2014-10-25
|
* py: Implement compile builtin, enabled only on unix port.Damien George2014-10-25
| | | | | | | This should be pretty compliant with CPython, except perhaps for some corner cases to do with globals/locals context. Addresses issue #879.
* py: Factor out mp_obj_is_package() function.Paul Sokolovsky2014-10-25
|
* py: mp_builtin___import__(): Add const to arg type.Paul Sokolovsky2014-10-25
|
* py: Compress load-int, load-fast, store-fast, unop, binop bytecodes.Damien George2014-10-25
| | | | | | | | | | | | | | | | | | | | | | There is a lot potential in compress bytecodes and make more use of the coding space. This patch introduces "multi" bytecodes which have their argument included in the bytecode (by addition). UNARY_OP and BINARY_OP now no longer take a 1 byte argument for the opcode. Rather, the opcode is included in the first byte itself. LOAD_FAST_[0,1,2] and STORE_FAST_[0,1,2] are removed in favour of their multi versions, which can take an argument between 0 and 15 inclusive. The majority of LOAD_FAST/STORE_FAST codes fit in this range and so this saves a byte for each of these. LOAD_CONST_SMALL_INT_MULTI is used to load small ints between -16 and 47 inclusive. Such ints are quite common and now only need 1 byte to store, and now have much faster decoding. In all this patch saves about 2% RAM for typically bytecode (1.8% on 64-bit test, 2.5% on pyboard test). It also reduces the binary size (because bytecodes are simplified) and doesn't harm performance.
* py: Store bytecode arg names in bytecode (were in own array).Damien George2014-10-25
| | | | | | | | | | | | | | | | | | | | This saves a lot of RAM for 2 reasons: 1. For functions that don't have default values, var args or var kw args (which is a large number of functions in the general case), the mp_obj_fun_bc_t type now fits in 1 GC block (previously needed 2 because of the extra pointer to point to the arg_names array). So this saves 16 bytes per function (32 bytes on 64-bit machines). 2. Combining separate memory regions generally saves RAM because the unused bytes at the end of the GC block are saved for 1 of the blocks (since that block doesn't exist on its own anymore). So generally this saves 8 bytes per function. Tested by importing lots of modules: - 64-bit Linux gave about an 8% RAM saving for 86k of used RAM. - pyboard gave about a 6% RAM saving for 31k of used RAM.
* unix: Allow -X heapsize= option take numbers with K & M suffixes.Paul Sokolovsky2014-10-25
| | | | For kilobytes and megabytes respectively.
* stmhal: Change fresh boot.py and main.py to use \r\n newlines.Damien George2014-10-25
| | | | This is so it's compatible with Windows.
* stmhal: Fill in USB class/subclass/proto for CDC+HID device.Damien George2014-10-25
| | | | | Also change HID device from keyboard to mouse (should have been mouse all along).
* USB CDC ACM: populate bFunction{Class,SubClass,Protocol} in the interface ↵Felix Domke2014-10-25
| | | | association descriptor
* py: Improve memory usage debugging; better GC AT dumping.Damien George2014-10-24
| | | | In unix port, mem_info(1) now prints pretty GC alloc table.
* py: Fix debug-printing of bytecode line numbers.Damien George2014-10-24
| | | | Also move the raw bytecode printing code from emitglue to mp_bytecode_print.
* py: Use mp_uint_t where appropriate in stream functions.Damien George2014-10-24
|
* stmhal: Use stream's readinto.Damien George2014-10-24
|
* stmhal: Fix pin af definition: TIM2_CH1_ETR -> TIM2_CH1/TIM2_ETR.Damien George2014-10-23
|
* stream: Add optional 2nd "length" arg to .readinto() - extension to CPython.Paul Sokolovsky2014-10-23
| | | | | While extension to file.readinto() definition of CPython, the additional arg is similar to what in CPython available in socket.recv_into().
* stmhal: Use OSError with POSIX error code for HAL errors.Damien George2014-10-23
| | | | Addresses issue #921.
* py: Properly free string parse-node; add assertion to gc_free.Damien George2014-10-23
|
* py: Add builtin memoryview object (mostly using array code).Damien George2014-10-23
|
* py: Use MP_OBJ_NULL instead of NULL in a few places.Damien George2014-10-23
|
* py: Clean up edge cases of malloc/realloc/free.Damien George2014-10-23
|
* extmod: Add uheapq module.Damien George2014-10-22
|
* py: Fix smallint modulo with negative arguments.Damien George2014-10-22
| | | | Addresses issue #927.
* tools, pydfu: Some fixes to support Python 3.Damien George2014-10-22
|
* Add pydfu.py to the micropython tree. Use dfu_util bgy defaultDave Hylands2014-10-22
| | | | | | | | You can do: make USE_PYDFU=1 deploy to use pydfu.py
* py: Remove unused and unneeded SystemError exception.Damien George2014-10-22
| | | | | It's purpose is for internal errors that are not catastrophic (ie not as bad as RuntimeError). Since we don't use it, we don't need it.
* stmhal: Add MMA_INT/PB2 to available pins on PYBV10.Damien George2014-10-22
| | | | This allows you to register ExtInt on the MMA interrupt pin.