Paul Sokolovsky
243f8988be
unix/mpconfigport.h: Include stdio.h by default.
...
This allows to use printf() in a any source file with unix port, for quick
debugging.
2016-07-26 02:51:25 +03:00
Paul Sokolovsky
d1771bbae0
tests/unicode_subscr.py: Detailed test for subscripting unicode strings.
2016-07-25 19:28:19 +03:00
Paul Sokolovsky
ed1c194ebf
py/objstrunicode: str_index_to_ptr: Implement positive indexing properly.
...
Order out-of-bounds check, completion check, and increment in the right way.
2016-07-25 19:28:04 +03:00
Paul Sokolovsky
6af90b2972
py/objstrunicode: str_index_to_ptr: Should handle bytes too.
...
There's single str_index_to_ptr() function, called for both bytes and
unicode objects, so should handle each properly.
2016-07-25 14:45:08 +03:00
Paul Sokolovsky
16f324641f
py/stream.h: Remove dated comment of POSIX-specificity of EAGAIN.
...
We have adopted POSIX-compatible error numbers as MicroPython's native.
2016-07-25 00:47:00 +03:00
Paul Sokolovsky
1a7e28d8b7
py/stream.h: Move mp_stream_write_adaptor() inside ifdef block.
2016-07-25 00:16:51 +03:00
Paul Sokolovsky
5a38694f55
tests/extmod/btree1: Close database at the end of test.
2016-07-24 00:30:32 +03:00
Paul Sokolovsky
25df419c67
extmod/modbtree: Check __bt_open() return value for error.
2016-07-24 00:29:32 +03:00
Paul Sokolovsky
0d221775f5
esp8266/_boot.py: Decrease GC alloc threshold to quarter of heap size.
...
The idea behind decrease is: bytecode and other static data is also kept on
heap, and can easily become half of heap, then setting threshold to half of
heap will have null effect - GC will happen on complete heap exhaustion like
before. But exactly in such config maintaining heap defragmented is very
important, so lower threshold to accommodate that.
2016-07-23 13:56:24 +03:00
Paul Sokolovsky
2dd21d9a68
extmod/modwebrepl: Use mp_stream_close() method.
2016-07-23 00:52:35 +03:00
Paul Sokolovsky
614deb82c7
examples/http_client*: Be sure to close socket.
...
Otherwise, on bare-metal/RTOS systems can lead to resource leaks.
2016-07-23 00:41:19 +03:00
Paul Sokolovsky
a53e0e59f3
extmod/modussl_axtls: Use mp_stream_close() method.
2016-07-23 00:38:56 +03:00
Paul Sokolovsky
c141584e1e
esp8266/_boot.py: Set GC alloc threshold to half of heap size.
...
Should keep good chunk of heap unfragmented, if a user application allows
that at all.
2016-07-23 00:20:49 +03:00
Paul Sokolovsky
77f0cd8027
esp8266: dupterm_task_init() should be called before running _boot.py, etc.
...
Because they may use dupterm functionality (e.g. WebREPL running on boot).
2016-07-23 00:05:38 +03:00
Paul Sokolovsky
4d4cfc2ee6
examples/embedding: Add README.
2016-07-22 22:13:03 +03:00
Paul Sokolovsky
1e77e25675
examples/embedding: Example for embedding MicroPython in an app.
2016-07-22 22:13:03 +03:00
Paul Sokolovsky
e47c2ec64a
wundows/README: Typo fix.
2016-07-22 21:24:26 +03:00
stijn
9bdb82ef6b
mpy-cross: Use binary file translation mode for creating mpy files on windows
...
This is a fix for https://github.com/micropython/micropython/issues/2209 :
by default a file created using open() uses text translation mode so writing
\n to it will result in the file having \r\n. This is obviously problematic
for binary .mpy files, so provide functions for setting the open mode
and use binary mode in mpy-cross' main().
2016-07-22 21:21:54 +03:00
Paul Sokolovsky
43473372e6
lib/utils/stdout_helpers: Move from minimal/uart_extra.c for reuse.
2016-07-22 19:56:27 +03:00
Paul Sokolovsky
b652ee705b
tests/bytes_compare: Rework test for bytes <-> str comparison.
...
This may produce a warning, depending on MicroPython configuration.
2016-07-22 12:02:04 +03:00
Paul Sokolovsky
40214b9e26
esp8266: Enable MICROPY_PY_STR_BYTES_CMP_WARN.
2016-07-22 00:57:55 +03:00
Paul Sokolovsky
918851e836
unix: Enable MICROPY_PY_STR_BYTES_CMP_WARN.
...
Also, fix a warning text (remove "duplicate" BytesWarning).
2016-07-22 00:52:07 +03:00
Paul Sokolovsky
a1b442bc07
py/mpconfig.h: Fix description for MICROPY_PY_STR_BYTES_CMP_WARN.
2016-07-22 00:46:24 +03:00
Paul Sokolovsky
707cae7494
py/obj: Issue a warning when str and bytes objects are compared.
...
Something like:
if foo == "bar":
will be always false if foo is b"bar". In CPython, warning is issued if
interpreter is started as "python3 -b". In MicroPython,
MICROPY_PY_STR_BYTES_CMP_WARN setting controls it.
2016-07-22 00:34:34 +03:00
Dave Hylands
26b7d8a7be
py: Fix nlrthumb.c when DEBUG=1 is defined
2016-07-21 00:54:21 +03:00