Paul Sokolovsky
3eb532e974
extmod/modbtree: Implement __contains__ operation.
8 years ago
Damien George
8766bc02dc
cc3200, teensy: Remove broken malloc/free/realloc macro helpers.
These macros are broken and are anyway unused on these two ports. If they
are ever needed in the future then their implementation can be taken from
either stmhal (working macros in mpconfigport.h) or esp8266 (functions).
8 years ago
Mike Causer
b4564841b6
docs: Add DHT to ESP8266 Quick Ref and Tutorial
8 years ago
Paul Sokolovsky
0e4cae5212
esp8266: Make APA102 driver inclusion configurable.
8 years ago
Paul Sokolovsky
88d3cd582e
esp8266/eagle.rom.addr.v6.ld: Add Enable_QMode symbol from SDK 2.0.0.
8 years ago
Paul Sokolovsky
bc3912980a
tests/machine1: Revamp to work with unix port (which has "umachine").
8 years ago
Paul Sokolovsky
eb0e3bab1e
tests/machine_mem.py: Too non-portable, rework as an example for unix port.
8 years ago
Paul Sokolovsky
4d22ade102
esp8266: Enable btree module.
8 years ago
Paul Sokolovsky
64ad838fde
esp8266/esp_mphal: Implement libc's errno.
Using __errno() function, and redirect it to use mp_stream_errno from
stream module. This is pre-requisite for integrating with 3rd-party libs,
like BerkeleyDB.
8 years ago
Paul Sokolovsky
617bda27e9
tests/extmod/btree1: Tests against in-memory DB (using io.BytesIO).
8 years ago
Paul Sokolovsky
aac9e8cfa3
unix/Makefile: And note why btree module is disabled for coverage build.
8 years ago
Paul Sokolovsky
99061d1dcb
extmod/modbtree: Switch to accepting stream object instead of filename.
Requires "embedded" BerkeleyDB BTree implementation.
8 years ago
Paul Sokolovsky
0dfe849413
py/py.mk: Extra switches to build "embedded" BerkeleyDB BTree lib.
8 years ago
Paul Sokolovsky
2ec943284a
lib/berkeley-db-1.xx: Switch to "embedded" branch.
It allows to access files via a virtual method tables and thus can integrate
with MicroPython's stream objects.
8 years ago
Dave Hylands
460bceca39
stmhal: Make SPI NSS pin definition optional.
Some boards (like the GHI Electronics G30 Dev Board) don't use
NSS at all and rather just use GPIO chip selects.
8 years ago
Matt Brejza
afd4909a0f
stmhal: fixing malloc when used with external libraries
8 years ago
stijn
37b143ce9e
mpy-cross: Fix mingw and msys2 compilation
When compiling with msys2's gcc there's no need to apply the binary fmode
so adjust the Makefile to reflect that.
When compiling with mingw we need to include malloc.h since there is no
alloca.h, and the 64bit detection in mpconfigport.h needs some adjustment.
8 years ago
Paul Sokolovsky
61e77a4e88
py/mpconfig.h: Add MICROPY_STREAMS_POSIX_API setting.
To filter out even prototypes of mp_stream_posix_*() functions, which
require POSIX types like ssize_t & off_t, which may be not available in
some ports.
8 years ago
Paul Sokolovsky
58d9d85a56
lib/abort_.c: Add prototype to make coverage build happy.
8 years ago
Paul Sokolovsky
ba2c503541
esp8266/mpconfigport.h: Include sys/types.h for POSIX types definitions.
As required for related functions in stream.h.
8 years ago
Paul Sokolovsky
50fea19416
esp8266/axtls_helpers: Remove abort_(), now in lib/embed/.
8 years ago
Paul Sokolovsky
c8b80e4740
lib/embed/abort_: Implementation of abort_() function raising uPy exception.
Helpful when porting existing C libraries to MicroPython. abort()ing in
embedded environment isn't a good idea, so when compiling such library,
-Dabort=abort_ option can be given to redirect standard abort() to this
"safe" version.
8 years ago
Paul Sokolovsky
4f1b0292db
py/stream: Add adapter methods with POSIX-compatible signatures.
Previoussly such read() and write() methods were used by modussl_axtls,
move to py/stream for reuse.
8 years ago
Paul Sokolovsky
abd5a57ea1
tests/io/bytesio_ext: Test for .seek()/.flush() on BytesIO.
8 years ago
Paul Sokolovsky
3990b1715d
py/objstringio: Implement MP_STREAM_SEEK ioctl and add seek() method.
8 years ago
Paul Sokolovsky
f039ac5bd7
py/objstringio: Add MP_STREAM_FLUSH ioctl and flush() method.
No-op for this object.
8 years ago
Paul Sokolovsky
64da62ec2e
unix/file: Use generic stream flush() method.
8 years ago
daniel-k
aa4ada943a
esp8266/modpybuart: Fix UART parity setting.
The configuration bits for the UART register were wrong and the parity
couldn't be enabled, because the exist_parity member hasn't been updated. I
took this ESP8266 register description (http://esp8266.ru/esp8266-uart-reg/ )
as reference.
Verification has been done with a logic analyzer.
8 years ago
Paul Sokolovsky
01816068c8
unix/file: fdfile_ioctl(): Fix argument to check_fd_is_open().
8 years ago
Paul Sokolovsky
a60b0263ba
py/stream: Implement generic flush() method, in terms of C-level ioctl.
8 years ago
Paul Sokolovsky
ade36806c8
unix/file: ioctl(): Check that file is open before operations.
8 years ago
Paul Sokolovsky
8fac939889
unix/file: Implement MP_STREAM_FLUSH ioctl.
8 years ago
Paul Sokolovsky
6ead9f6f3d
tests/run-tests: Make "regex'ed .exp" facility available to device tests.
Required to pass bytes_compare3.py (opptional warnings) on devices.
8 years ago
Paul Sokolovsky
f2f761c0c3
py/stream: Stream module works with errno's, so should include mperrno.h.
8 years ago
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.
8 years ago
Paul Sokolovsky
d1771bbae0
tests/unicode_subscr.py: Detailed test for subscripting unicode strings.
8 years ago
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.
8 years ago
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.
8 years ago
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.
8 years ago
Paul Sokolovsky
1a7e28d8b7
py/stream.h: Move mp_stream_write_adaptor() inside ifdef block.
8 years ago
Paul Sokolovsky
5a38694f55
tests/extmod/btree1: Close database at the end of test.
8 years ago
Paul Sokolovsky
25df419c67
extmod/modbtree: Check __bt_open() return value for error.
8 years ago
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.
8 years ago
Paul Sokolovsky
2dd21d9a68
extmod/modwebrepl: Use mp_stream_close() method.
8 years ago
Paul Sokolovsky
614deb82c7
examples/http_client*: Be sure to close socket.
Otherwise, on bare-metal/RTOS systems can lead to resource leaks.
8 years ago
Paul Sokolovsky
a53e0e59f3
extmod/modussl_axtls: Use mp_stream_close() method.
8 years ago
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.
8 years ago
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).
8 years ago
Paul Sokolovsky
4d4cfc2ee6
examples/embedding: Add README.
9 years ago
Paul Sokolovsky
1e77e25675
examples/embedding: Example for embedding MicroPython in an app.
9 years ago