| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
inet_pton supports both ipv4 and ipv6 addresses. Interface is also extensible
for other address families, but underlying libc inet_pton() function isn't
really extensible (e.g., it doesn't return length of binary address, i.e. it's
really hardcoded to AF_INET and AF_INET6). But anyway, on Python side, we could
extend it to support other addresses.
|
|
|
|
| |
Required to implement UDP servers.
|
|
|
|
|
|
|
|
|
| |
sendto() turns out to be mandatory function to work with UDP. It may seem
that connect(addr) + send() would achieve the same effect, but what connect()
appears to do is to set source address filter on a socket to its argument.
Then everything falls apart: socket sends to a broad-/multi-cast address,
but reply is sent from real peer address, which doesn't match filter set
by connect(), so local socket never sees a reply.
|
|
|
|
| |
Treating it as signed lead to buffer overflow for ports >= 32768.
|
|
|
|
| |
This usually allows to get just a single address entry.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous to this patch the printing mechanism was a bit of a tangled
mess. This patch attempts to consolidate printing into one interface.
All (non-debug) printing now uses the mp_print* family of functions,
mainly mp_printf. All these functions take an mp_print_t structure as
their first argument, and this structure defines the printing backend
through the "print_strn" function of said structure.
Printing from the uPy core can reach the platform-defined print code via
two paths: either through mp_sys_stdout_obj (defined pert port) in
conjunction with mp_stream_write; or through the mp_plat_print structure
which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
on the platform. The former is only used when MICROPY_PY_IO is defined.
With this new scheme printing is generally more efficient (less layers
to go through, less arguments to pass), and, given an mp_print_t*
structure, one can call mp_print_str for efficiency instead of
mp_printf("%s", ...). Code size is also reduced by around 200 bytes on
Thumb2 archs.
|
|
|
|
| |
See issue #699.
|
| |
|
|
|
|
| |
Addresses issue #1022.
|
|
|
|
|
|
|
|
|
|
|
| |
mp_obj_int_get_truncated is used as a "fast path" int accessor that
doesn't check for overflow and returns the int truncated to the machine
word size, ie mp_int_t.
Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word
sized values.
Addresses issues #779 and #998.
|
|
|
|
|
| |
This is just a clean-up of the code. Generated code is exactly the
same.
|
|
|
|
|
|
|
| |
This makes open() and _io.FileIO() more CPython compliant.
The mode kwarg is fully iplemented.
The encoding kwarg is allowed but not implemented; mainly to allow
the tests to specify encoding for CPython, see #874
|
|
|
|
|
|
| |
Also, usocket.readinto(). Known issue is that .readinto() should be available
only for binary files, but micropython uses single method table for both
binary and text files.
|
|
|
|
|
|
| |
Per new conventions, we'd like to consistently use "u*" naming conventions
for modules which don't offer complete CPython compatibility, while offer
subset or similar API.
|
|
|
|
|
|
|
|
|
|
| |
For the sake of older versions of gcc (and other compilers), don't use
the #warning CPP directive, nor the -Wno-error=cpp option.
Also, fix a strict alias warning in modffi.c for older compilers, and
add a test for ffi module.
Addresses issue #847.
|
|
|
|
| |
Addressing issue #50, still some way to go yet.
|
| |
|
|
|
|
| |
Addresses issue #724.
|
| |
|
|
|
|
| |
See discussion in issue #50.
|
| |
|
|
|
|
|
| |
It sucks to workaround this on uPy side, but upgrading not upgradable
embedded systems sucks even more.
|
| |
|
| |
|
|
|
|
| |
- Move the includes for alloca() intp mpconfigport.h
|
| |
|
| |
|
|
|
|
|
| |
This removes need for some casts (at least, more than it adds need
for new casts!).
|
| |
|
|
|
|
|
| |
.makefile() should allow to specify which stream time to create - byte
or text.
|
|\
| |
| | |
Allow compilation of unix port under clang on OS X
|
| |
| |
| |
| | |
override in vmentrytable.h
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
|
| |
|
| |
|
|
|
|
|
| |
This is CPython-compliant (except that CPython doesn't support buffer
protocol for str).
|
| |
|
|
|
|
|
|
| |
Some BSD socket functions don't return error numbers in errno namespace, but
rather in other error namespaces. CPython resolves this by using OSError
subclasses for them. We don't do that so far, so there's ambiguity here.
|
|
|
|
| |
Well, Python3 also defines an attribute for that, but that's bloat.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This is to reduce ROM usage. stream_p is used in file and socket types
only (at the moment), so seems a good idea to make the protocol
functions a pointer instead of the actual structure.
It saves 308 bytes of ROM in the stmhal/ port, 928 in unix/.
|
|
|
|
|
|
| |
This does not affect code size or performance when debugging turned off.
To address issue #420.
|
|
|