aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-05-20py: Declare constant data as properly constant.Damien George
Otherwise some compilers (eg without optimisation) will put this read-only data in RAM instead of ROM.
2016-05-19esp8266: Add APA102 serial individually controllable LEDs support.misterdanb
APA102 is a new "smart LED", similar to WS2812 aka "Neopixel".
2016-05-19esp8266/README: Add a very first start section.Torwag
Adding a very first start section to get people going after flashing. I tried to condense it to a minimum to avoid as much as possible redundancy and bloating.
2016-05-18py/stream: Support both "exact size" and "one underlying call" operations.Paul Sokolovsky
Both read and write operations support variants where either a) a single call is made to the undelying stream implementation and returned buffer length may be less than requested, or b) calls are repeated until requested amount of data is collected, shorter amount is returned only in case of EOF or error. These operations are available from the level of C support functions to be used by other C modules to implementations of Python methods to be used in user-facing objects. The rationale of these changes is to allow to write concise and robust code to work with *blocking* streams of types prone to short reads, like serial interfaces and sockets. Particular object types may select "exact" vs "once" types of methods depending on their needs. E.g., for sockets, revc() and send() methods continue to be "once", while read() and write() thus converted to "exactly" versions. These changes don't affect non-blocking handling, e.g. trying "exact" method on the non-blocking socket will return as much data as available without blocking. No data available is continued to be signaled as None return value to read() and write(). From the point of view of CPython compatibility, this model is a cross between its io.RawIOBase and io.BufferedIOBase abstract classes. For blocking streams, it works as io.BufferedIOBase model (guaranteeing lack of short reads/writes), while for non-blocking - as io.RawIOBase, returning None in case of lack of data (instead of raising expensive exception, as required by io.BufferedIOBase). Such a cross-behavior should be optimal for MicroPython needs.
2016-05-18unix/mpconfigport_coverage.h: Add dedicated config file for coverage build.Paul Sokolovsky
This allows to enable the options which aren't enabled in the normal unix config (as unix port is no longer an enable-all port).
2016-05-17esp8266/scripts/webrepl_setup: Add max password length check.Paul Sokolovsky
modwebrepl truncates password to 9 chars, and that led people to confusion.
2016-05-16unix: Add ability to include frozen bytecode in the build.Damien George
To use frozen bytecode make a subdirectory under the unix/ directory (eg frozen/), put .py files there, then run: make FROZEN_MPY_DIR=frozen Be sure to build from scratch. The .py files will then be available for importing.
2016-05-16tools/mpy-tool.py: Add checks for critical configuration vars.Damien George
When an mpy file is frozen it must know the values of certain configuration variables. This patch provides an explicit check in the generated C file that the configuration variables are what they are supposed to be.
2016-05-17esp8266/scripts/webrepl_setup: Show password placeholder char.Paul Sokolovsky
That was the intent for the initial user setup, but didn't work before due to lwIP issues. Enable now that they're fixed.
2016-05-16esp8266/scripts/port_diag: Add network diagnostic output.Paul Sokolovsky
2016-05-16esp8266/moduos.c: Addition of the rename method to module uos.Robert HH
That one was missing in the module, even if it was available in the vfs object. The change consist of adding the name and preparing the call to the underlying vfs module, similar to what was already implemented e.g. for remove. Rename is useful by itself, or for instance for a safe file replace, consisting of the sequence: write to a temp file delete the original file rename the temp file to the original file's name
2016-05-15extmod/modlwip: Rework how Python accept callback is called.Paul Sokolovsky
Calling it from lwIP accept callback will lead incorrect functioning and/or packet leaks if Python callback has any networking calls, due to lwIP non-reentrancy. So, instead schedule "poll" callback to do that, which will be called by lwIP when it does not perform networking activities. "Poll" callback is called infrequently though (docs say every 0.5s by default), so for better performance, lwIP needs to be patched to call poll callback soon after accept callback, but when current packet is already processed.
2016-05-14docs/ustruct: Describe supported type codes.Paul Sokolovsky
2016-05-14tools/make-frozen.py: Quick fix to support package-modules.Paul Sokolovsky
It allows to "import foo.bar", but not "from foo import bar".
2016-05-14tests/struct1: Add testcase for an unknown type char.Paul Sokolovsky
2016-05-14py/modstruct: Raise ValueError on unsupported format char.Paul Sokolovsky
2016-05-14py/objstringio: Add TODO comment about avoiding copying on .getvalue().Paul Sokolovsky
2016-05-14README: Add explicit note that subdirs contain more READMEs.Paul Sokolovsky
2016-05-14docs/esp8266/quickstart: remove i2c examples with stop=FalseRadomir Dopieralski
Since the ``stop`` parameter has been dropped.
2016-05-13stmhal/sdcard: Allow to do unaligned read-from/write-to SD card.Damien George
For example, the following code now works with a file on the SD card: f = open('test', 'rb') # test must be 1024 bytes or more in size f.seek(511) f.read(513) Also works for writing. Fixes issue #1863.
2016-05-13tools/make-frozen.py: Properly escape hex chars when making C strings.Damien George
2016-05-13tests/basics/string_splitlines: Reinstate feature test for splitlines.Damien George
2016-05-13py/objstr: Make dedicated splitlines function, supporting diff newlines.Damien George
It now supports \n, \r and \r\n as newline separators. Adds 56 bytes to stmhal and 80 bytes to unix x86-64. Fixes issue #1689.
2016-05-13stmhal/i2c: Expose I2CHandle3 for use by custom C code.Damien George
If custom C code uses the I2C busses then it needs access to these structures for i2c_init().
2016-05-13stmhal/led: Allow LEDs to be in PWM mode with TIM1 and channels 1-4.Damien George
This allows PYBv3 to use PWM for LED(1) and LED(2).
2016-05-13py/gc: gc_dump_alloc_table(): Dump heap offset instead of actual address.Paul Sokolovsky
Address printed was truncated anyway and in general confusing to outsider. A line which dumps it is still left in the source, commented, for peculiar cases when it may be needed (e.g. when running under debugger).
2016-05-13gc: gc_dump_alloc_table(): Use '=' char for tail blocks.Paul Sokolovsky
'=' is pretty natural character for tail, and gives less dense picture where it's easier to see what object types are actually there.
2016-05-13py/moduerrno: Add EACCES, pretty common error on Unix.Paul Sokolovsky
2016-05-12py/objexcept: Don't convert errno to str in constructor, do it in print.Damien George
OSError's are now printed like: OSError: [Errno 1] EPERM but only if the string corresponding to the errno is found.
2016-05-12py/emitglue: Fix build on AArch64 (ARMv8, etc.) related to loading .mpy files.Paul Sokolovsky
Actual loading of .mpy files isn't tested.
2016-05-12py/objfloat, py/modmath: Ensure M_PI and M_E defined.Colin Hogben
In some compliation enviroments (e.g. mbed online compiler) with strict standards compliance, <math.h> does not define constants such as M_PI. Provide fallback definitions of M_E and M_PI where needed.
2016-05-12py: Add mp_errno_to_str() and use it to provide nicer OSError msgs.Damien George
If an OSError is raised with an integer argument, and that integer corresponds to an errno, then the string for the errno is used as the argument to the exception, instead of the integer. Only works if the uerrno module is enabled.
2016-05-12py/moduerrno: Add more constants to the errno module.Damien George
2016-05-12esp8266: Change to use internal errno's.Damien George
2016-05-12extmod/modlwip: Convert errno's to use MP_Exxx symbols.Damien George
2016-05-12py/mperrno: Add some more MP_Exxx constants, related to networking.Damien George
2016-05-11py/gc: Make (byte)array type dumping conditional on these types being enabled.Paul Sokolovsky
2016-05-11py/gc: gc_dump_alloc_table(): Show byte/str and (byte)array objects.Paul Sokolovsky
These are typical consumers of large chunks of memory, so it's useful to see at least their number (how much memory isn't clearly shown, as the data for these objects is allocated elsewhere).
2016-05-11py/repl: Fix handling of backslash in quotes when checking continuation.Damien George
2016-05-11docs/esp8266/tutorial: Fix typo in do_connect() network example.Damien George
Fixes issue #2065.
2016-05-10drivers/cc3000: Rename timeval to cc3000_timeval, to avoid clash.Damien George
The timeval struct can be defined by system C headers.
2016-05-10stmhal: For network drivers, convert to use MP_Exxx errno symbols.Damien George
2016-05-10py/mperrno: Add EAFNOSUPPORT definition.Damien George
2016-05-10esp8266: Enable uerrno module, weak linked also as errno.Damien George
2016-05-10esp8266: Convert to use new MP_Exxx errno symbols.Damien George
These symbols are still defined in terms of the system Exxx symbols, and can be switched to internal numeric definitions at a later stage. Note that extmod/modlwip still uses many system Exxx symbols.
2016-05-10stmhal: Convert to use internal errno symbols; enable uerrno module.Damien George
2016-05-10unix: Enable uerrno module.Damien George
2016-05-10py/parse: Add uerrno to list of modules to look for constants in.Damien George
2016-05-10py: Add uerrno module, with errno constants and dict.Damien George
2016-05-10py: Add mperrno.h file with uPy defined errno constants.Damien George