aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-08-05stmhal: Wrap DAC module and os.urandom in relevant #if's.Damien George
2014-08-05stmhal, math: Define _M_LN2 if not already defined.Damien George
Addresses issue #790.
2014-08-05travis: Build stmhal/ST32F4DISC and teensy in Travis tests.Damien George
2014-08-04Merge pull request #789 from dhylands/fix-teensy-2014-08-04Damien George
Follow rename of readline_init to readline_init0 on teensy
2014-08-04Follow rename of readline_init to readline_init0 on teensyDave Hylands
2014-08-04Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-08-04stmhal: Clean up reset/soft-reset code; fix bug init'ing VCP exc.Damien George
Make a clearer distinction between init functions that must be done before any scripts can run (xxx_init0) and those that can be safely deferred (xxx_init). Fix bug initialising USB VCP exception. Addresses issue #788. Re-order some init function to improve reliability of reset/soft-reset.
2014-08-04Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.Damien George
qstr_init is always called exactly before mp_init, so makes sense to just have mp_init call it. Similarly with mp_init_emergency_exception_buf. Doing this makes the ports simpler and less error prone (ie they can no longer forget to call these).
2014-08-03Merge pull request #786 from dhylands/fix-teensy-2014-08-03Damien George
Updated teensys usb.c and switched to using usb.h from stmhal.
2014-08-03Updated teensys usb.c and switched to using usb.h from stmhal.Dave Hylands
Removed the local usb.h from teensey directory and now uses the usb.h from the stmhal directory. Fixed the deploy target to use abspath.
2014-08-03stmhal: Document behaviour of usb_vcp_recv_byte.Damien George
2014-08-03Merge pull request #784 from dhylands/fix-teensy-2014-08-02Damien George
Fix teensy to work with the latest tree.
2014-08-02Fix teensy to work with the latest tree.Dave Hylands
2014-08-02stmhal: Add more documentation for USB_VCP.Damien George
2014-08-02stmhal: Add documentation for LCD; update docs for USB_VCP.Damien George
2014-08-02stmhal: Add preliminary driver for ST32F4DISC accelerometer.Damien George
Written in Python, not currently working. See issue #725.
2014-08-01Merge pull request #781 from dhylands/fix-discDamien George
Fix modos.c to compile for the STM32F4Discovery board
2014-08-01Fix modos.c to compile for the STM32F4Discovery board (which doesn't have an ↵Dave Hylands
sdcard)
2014-07-31stmhal: Change 0:/ and 1:/ to /flash and /sd; add CWD support.Damien George
Some important changes to the way the file system is structured on the pyboard: 1. 0: and 1: drive names are now replaced with POSIX inspired directories, namely /flash and /sd. 2. Filesystem now supports the notion of a current working directory. Supports the standard Python way of manipulating it: os.chdir and os.getcwd. 3. On boot up, current directory is /flash if no SD inserted, else /sd if SD inserted. Then runs boot.py and main.py from the current dir. This is the same as the old behaviour, but is much more consistent and flexible (eg you can os.chdir in boot.py to change where main.py is run from). 4. sys.path (for import) is now set to '' (current dir), plus /flash and /flash/lib, and then /sd and /sd/lib if SD inserted. This, along with CWD, means that import now works properly. You can import a file from the current directory. 5. os.listdir is fixed to return just the basename, not the full path. See issue #537 for background and discussion.
2014-07-31README: Add USB VID/PID to dfu-util command.Damien George
This reflects how it's done in stmhal/Makefile, via deploy.
2014-07-31py: Improve encoding scheme for line-number to bytecode map.Damien George
Reduces by about a factor of 10 on average the amount of RAM needed to store the line-number to bytecode map in the bytecode prelude. Using CPython3.4's stdlib for statistics: previously, an average of 13 bytes were used per (bytecode offset, line-number offset) pair, and now with this improvement, that's down to 1.3 bytes on average. Large RAM usage before was due to some very large steps in line numbers, both from the start of the first line in a function way down in the file, and also functions that have big comments and/or big strings in them (both cases were significant). Although the savings are large on average for the CPython stdlib, it won't have such a big effect for small scripts used in embedded programming. Addresses issue #648.
2014-07-31Merge branch 'master' of https://github.com/micropython/micropythonDamien George
2014-07-31py: Improve handling of long-int overflow.Damien George
This removes mpz_as_int, since that was a terrible function (it implemented saturating conversion). Use mpz_as_int_checked and mpz_as_uint_checked. These now work correctly (they previously had wrong overflow checking, eg print(chr(10000000000000)) on 32-bit machine would incorrectly convert this large number to a small int).
2014-07-31py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George
Addresses issue #724.
2014-07-31stmhal, accel: Increase start-up times to 30ms; add extra 30ms delay.Damien George
For accel to start-up reliably, need to wait 30ms between on/off, and 30ms for it to enter active mode. With this fix the accel can be read immediately after initialising it. Addresses issue #763.
2014-07-31stmhal: Add USB_VCP class/object, for direct USB VCP control.Damien George
Before, pyb.stdin/pyb.stdout allowed some kind of access to the USB VCP device, but it was basic access. This patch adds a proper USB_VCP class and object with much more control over the USB VCP device. Create an object with pyb.USB_VCP(), then use this object as if it were a UART object. It has send, recv, read, write, and other methods. send and recv allow a timeout to be specified. Addresses issue 774.
2014-07-31py: Add mp_obj_str_builder_end_with_len.Damien George
This allows to create str's with a smaller length than initially asked for.
2014-07-30py: Change lexer stream API to return bytes not chars.Damien George
Lexer is now 8-bit clean inside strings.
2014-07-29Merge pull request #738 from dhylands/except-argsDamien George
Add support for storing args during an exception raised by an irq.
2014-07-28py: Implement __file__ attribute for modules.Paul Sokolovsky
2014-07-28py: Make id() return small int for the most common address space mapping.Paul Sokolovsky
Many OSes/CPUs have affinity to put "user" data into lower half of address space. Take advantage of that and remap such addresses into full small int range (including negative part). If address is from upper half, long int will be used. Previously, small int was returned for lower quarter of address space, and upper quarter. For 2 middle quarters, long int was used, which is clearly worse schedule than the above.
2014-07-27py: Change stream protocol API: fns return uint; is_text for text.Damien George
2014-07-25Add support for storing args during an exception raised by an irq.Dave Hylands
The user code should call micropython.alloc_emergency_exception_buf(size) where size is the size of the buffer used to print the argument passed to the exception. With the test code from #732, and a call to micropython.alloc_emergenncy_exception_buf(100) the following error is now printed: ```python >>> import heartbeat_irq Uncaught exception in Timer(4) interrupt handler Traceback (most recent call last): File "0://heartbeat_irq.py", line 14, in heartbeat_cb NameError: name 'led' is not defined ```
2014-07-24Merge pull request #771 from dhylands/gitignore-GNUmakefileDamien George
Add GNUmakefile to the .gitignore file.
2014-07-24py: Make long ints hashable.Damien George
Addresses issue #765.
2014-07-24Add GNUmakefile to the .gitignore file.Dave Hylands
2014-07-23streams: Treat non-error output size as unsigned.Paul Sokolovsky
2014-07-23stream: Revert to checking for the correct error value.Paul Sokolovsky
2014-07-22Merge pull request #766 from dhylands/allow-dfu-overrideDamien George
Allow DFU_UTIL to be overridden from the environment.
2014-07-22Merge pull request #746 from blmorris/masterDamien George
Enable 16-bit memory addresses for i2c.mem_read and i2c_mem_write
2014-07-22Merge pull request #767 from dhylands/fix-short-readDamien George
Deal with reading a buffer less than what was allocated.
2014-07-21remove Myriad2 board config files from masterblmorris
2014-07-21Change boolean 'use_16bit_addr' to int 'addr_size', can be either 8 or 16 ↵blmorris
bits, default value is 8 to maintain compatibility with existing code.
2014-07-21Deal with reading a buffer less than what was allocated.Dave Hylands
With this fix, file_long_read now passes.
2014-07-21Allow DFU_UTIL to be overridden from the environment.Dave Hylands
2014-07-22tests: Add testcase for read by length past EOF.Paul Sokolovsky
Currently broken for unicode input streams.
2014-07-21Merge https://github.com/blmorris/micropython into Myriad2blmorris
2014-07-21Merge https://github.com/micropython/micropythonblmorris
2014-07-20stmhal: Fix REPL printing by cooking output sent to stdout_obj.Damien George
Recent changes to builtin print meant that print was printing to the mp_sys_stdout_obj, which was sending data raw to the USB CDC device. The data should be cooked so that \n turns into \r\n.
2014-07-20stmhal: Change calls to pfenv_printf to pfenv_vprintf.Damien George
Fixes printing bugs introduced by cb66f41ebc4980f4e6b7543bece19e3b9daac25c.