summaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAge
* cc3200: Remove socket.timeout class, use OSError(ETIMEDOUT) instead.Damien George2017-02-22
| | | | | | | socket.timeout is a subclass of OSError, and using the latter is more efficient than having a dedicated class. The argument of OSError is ETIMEDOUT so the error can be distinguished from other kinds of OSErrors. This follows how the esp8266 port does it.
* cc3200/mods/modusocket: Init vars to 0 to silence compiler warnings.Damien George2017-02-22
| | | | | Some compilers can't analyse the code to determine that these variables are always set before being used.
* cc3200: Enable uerrno module with short, custom list of error codes.Damien George2017-02-22
| | | | | | | Since we recently replaced the OSError string messages with simple error codes, having the uerrno module gets back some user friendly error messages. The total code size (after removing strings, replacing with uerrno module) is decreased.
* py/moduerrno: Make list of errno codes configurable.Damien George2017-02-22
| | | | | It's configurable by defining MICROPY_PY_UERRNO_LIST. If this is not defined then a default is provided.
* py/moduerrno: Make uerrno.errorcode dict configurable.Damien George2017-02-22
| | | | | | | | It's configured by MICROPY_PY_UERRNO_ERRORCODE and enabled by default (since that's the behaviour before this patch). Without this dict the lookup of errno codes to strings must use the uerrno module itself.
* cc3200: When raising OSError's use MP_Exxx as arg instead of a string.Damien George2017-02-22
|
* cc3200: Convert to using uPy internal errno numbers.Damien George2017-02-22
|
* cc3200: Move wlan socket glue functions from modwlan to modusocket.Damien George2017-02-22
| | | | | It saves about 400 bytes of code space because the functions can now be inlined.
* cc3200: Remove remaining references to std.h.Damien George2017-02-21
|
* drivers/display/lcd160cr: Fix bugs with lcd.get_pixel().Damien George2017-02-21
| | | | Fixes issues #2880 and #2881.
* cc3200/mods/modwlan: Add int casts to silence compiler warnings.Damien George2017-02-21
|
* cc3200/mods/modwlan: Allow antenna diversity to be fully compiled out.Damien George2017-02-21
|
* cc3200/mods/modwlan: Make multi-threaded a proper compile-time option.Damien George2017-02-21
|
* cc3200/mods/modwlan: Remove unused header includes; simplify others.Damien George2017-02-21
|
* cc3200: Remove util/std.h, can just use stdio.h instead.Damien George2017-02-21
|
* cc3200: Use simplelink API instead of emulated BSD API.Damien George2017-02-21
| | | | | Most of cc3200 uses explicit simplelink calls anyway, and this means there are no longer any clashes with macros from the C stdlib.
* cc3200: Move stoupper to ftp.c and define in terms of unichar_toupper.Damien George2017-02-21
| | | | | | ftp.c is the only user of this function so making it static in that file allows it to be inlined. Also, reusing unichar_toupper means we no longer depend on the C stdlib for toupper, saving about 300 bytes of code space.
* tests/cpydiff: Add a test for storing iterable to a list slice.Damien George2017-02-20
|
* docs: Modify Makefile and indexes to generate cPy-differences pages.Rami Ali2017-02-20
|
* tools: Add gen-cpydiff.py to generate docs differences.Rami Ali2017-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the a small framework to track differences between uPy and CPython. The framework consists of: - A set of "tests" which test for an individual feature that differs between uPy and CPy. Each test is like a normal uPy test in the test suite, but has a special comment at the start with some meta-data: a category (eg syntax, core language), a human-readable description of the difference, a cause, and a workaround. Following the meta-data there is a short code snippet which demonstrates the difference. See tests/cpydiff directory for the initial set of tests. - A program (this patch) which runs all the tests (on uPy and CPy) and generates nicely-formated .rst documenting the differences. - Integration into the docs build so that everything is automatic, and the differences appear in a way that is easy for users to read/reference (see latter commits). The idea with using this new framework is: - When a new difference is found it's easy to write a short test for it, along with a description, and add it to the existing ones. It's also easy for contributors to submit tests for differences they find. - When something is no longer different the tool will give an error and difference can be removed (or promoted to a proper feature test).
* tests/cpydiff: Add initial set of tests for uPy-CPython differences.Rami Ali2017-02-20
| | | | | | | These tests are intended to fail, as they provide a programatic record of differences between uPy and CPython. They also contain a special comment at the start of the file which has meta-data describing the difference, including known causes and known workarounds.
* py/objlist: For list slice assignment, allow RHS to be a tuple or list.Damien George2017-02-20
| | | | | Before this patch, assigning anything other than a list would lead to a crash. Fixes issue #2886.
* tests/heapalloc_exc_raise.py: Heap alloc test for raising/catching exc.Paul Sokolovsky2017-02-20
|
* zephyr/README: Network startup issues with frdm_k64f resolved.Paul Sokolovsky2017-02-17
| | | | | But leave a generic warning that users should be aware of Zephyr's limitations/issues for a board they use.
* docs/library/lcd160cr: Mention the valid values for set_power() method.Damien George2017-02-17
|
* drivers/display/lcd160cr: Use correct variable in set_power().Stephan Brauer2017-02-17
|
* windows/.gitignore: Ignore VC.db and VC.opendb files from VS2015stijn2017-02-17
| | | | | | Since VS2015 update 2 .db files are used for storing browsing info, instead of .sdf files. If users don't specify a location for these files excplicitly they end up in the project directory so ignore them.
* teensy/main: Remove unnecessary header includes.Damien George2017-02-17
|
* stmhal/main: Remove unnecessary header includes.Damien George2017-02-17
|
* py/grammar: Remove unused rule.Damien George2017-02-17
| | | | | Since the recent changes to string/bytes literal concatenation, this rule is no longer used.
* py/lexer: Convert mp_uint_t to size_t where appropriate.Damien George2017-02-17
|
* tests/basics/string_join: Add more tests for string concatenation.Damien George2017-02-17
|
* tests/cmdline/cmd_parsetree: Update to work with changes to grammar.Damien George2017-02-17
|
* py: Do adjacent str/bytes literal concatenation in lexer, not compiler.Damien George2017-02-17
| | | | | | | | | | | | | | | | | | | | | It's much more efficient in RAM and code size to do implicit literal string concatenation in the lexer, as opposed to the compiler. RAM usage is reduced because the concatenation can be done right away in the tokeniser by just accumulating the string/bytes literals into the lexer's vstr. Prior to this patch adjacent strings/bytes would create a parse tree (one node per string/bytes) and then in the compiler a whole new chunk of memory was allocated to store the concatenated string, which used more than double the memory compared to just accumulating in the lexer. This patch also significantly reduces code size: bare-arm: -204 minimal: -204 unix x64: -328 stmhal: -208 esp8266: -284 cc3200: -224
* py/lexer: Simplify handling of line-continuation error.Damien George2017-02-17
| | | | | | | | | Previous to this patch there was an explicit check for errors with line continuation (where backslash was not immediately followed by a newline). But this check is not necessary: if there is an error then the remaining logic of the tokeniser will reject the backslash and correctly produce a syntax error.
* py/lexer: Use strcmp to make keyword searching more efficient.Damien George2017-02-17
| | | | | | | | | | | | Since the table of keywords is sorted, we can use strcmp to do the search and stop part way through the search if the comparison is less-than. Because all tokens that are names are subject to this search, this optimisation will improve the overall speed of the lexer when processing a script. The change also decreases code size by a little bit because we now use strcmp instead of the custom str_strn_equal function.
* py/lexer: Move check for keyword to name-tokenising block.Damien George2017-02-17
| | | | | | Keywords only needs to be searched for if the token is a MP_TOKEN_NAME, so we can move the seach to the part of the code that does the tokenising for MP_TOKEN_NAME.
* py/lexer: Simplify handling of indenting of very first token.Damien George2017-02-17
|
* minimal: Update frozentest.mpy file for new .mpy version.Damien George2017-02-17
|
* gitattributes: Remove obsolete lines.Damien George2017-02-17
|
* gitattributes: Add .mpy files to list of binary files.Damien George2017-02-17
|
* py/persistentcode: Bump .mpy version due to change in bytecode.Damien George2017-02-17
|
* py/lexer: Don't generate string representation for period or ellipsis.Damien George2017-02-16
| | | | It's not needed.
* tests/cmdline: Update cmd_parsetree test for changes to grammar order.Damien George2017-02-16
|
* py/grammar: Group no-compile grammar rules together to shrink tables.Damien George2017-02-16
| | | | | | | | | | | | | | | | | | | | | | Grammar rules have 2 variants: ones that are attached to a specific compile function which is called to compile that grammar node, and ones that don't have a compile function and are instead just inspected to see what form they take. In the compiler there is a table of all grammar rules, with each entry having a pointer to the associated compile function. Those rules with no compile function have a null pointer. There are 120 such rules, so that's 120 words of essentially wasted code space. By grouping together the compile vs no-compile rules we can put all the no-compile rules at the end of the list of rules, and then we don't need to store the null pointers. We just have a truncated table and it's guaranteed that when indexing this table we only index the first half, the half with populated pointers. This patch implements such a grouping by having a specific macro for the compile vs no-compile grammar rules (DEF_RULE vs DEF_RULE_NC). It saves around 460 bytes of code on 32-bit archs.
* tests/micropython/heapalloc_iter: Add tests for contains and unpack.Damien George2017-02-16
|
* py: De-optimise some uses of mp_getiter, so they don't use the C stack.Damien George2017-02-16
| | | | | In these cases the heap is anyway used to create a new object so no real need to use the C stack for iterating. It saves a few bytes of code size.
* tests/micropython: Add test for iterating with the heap locked.Damien George2017-02-16
|
* tests/cmdline/cmd_showbc: Update to work with recent changes.Damien George2017-02-16
|
* py/compile: Optimise list/dict/set comprehensions to use stack iter.Damien George2017-02-16
|