Paul Sokolovsky
acb743da64
unix/modffi: Mark 'O' type specifier as implemented.
9 years ago
Damien George
54df549b5f
unix/moduselect: Initialise variable so can compile in non-debug mode.
9 years ago
Paul Sokolovsky
65971f5160
unix: Add "uselect" module, with poll() function.
Underlyingly, uses standard POSIX poll() for portability.
9 years ago
Paul Sokolovsky
79c4ec1102
unix/input: Switch to POSIX I/O for history reading/writing.
9 years ago
Paul Sokolovsky
ec314c951d
unix/modos: getenv(): Handle non-existing envvar correctly.
9 years ago
Paul Sokolovsky
908f5159cf
unix/modos: Add Windows workaround for mkdir().
9 years ago
Paul Sokolovsky
27dafa5ed5
unix/modos: Add mkdir().
Dependency of upip.
9 years ago
Paul Sokolovsky
d8557834c0
unix/modos: Add getenv().
Dependency of upip.
9 years ago
Paul Sokolovsky
a01f6c9ae7
unix/main: Remove stray mp_printf() from previous commit.
9 years ago
Paul Sokolovsky
66fd3e4a7b
unix: Use standard mphalport.h header.
This also unbreaks "make minimal".
9 years ago
Paul Sokolovsky
3a6b3d230c
main.c: Switch stderr printing from ANSI C to native POSIX.
9 years ago
Paul Sokolovsky
94f9330d3e
unix: Allow to override MICROPY_PY_MATH_SPECIAL_FUNCTIONS from command-line.
9 years ago
Paul Sokolovsky
6d1eabfeaa
unix/mpconfigport: Move log2() definition to modmath.c.
It's safer to define it where it's used, defining it for all source files
may lead to hard to diagnose conflicts in corner cases.
9 years ago
Paul Sokolovsky
f882d53fcd
unix/main: Use builtin unichar_isdigit() in preference if libc's.
Less dependencies.
9 years ago
Paul Sokolovsky
3c7e1b80ac
unix/modjni: Add missing get_jclass_name() function.
9 years ago
Paul Sokolovsky
6e68a68d18
unix/gccollect: Fallback to setjmp-based register fetching automatically.
Now, if we build for an architecture which doesn't have dedicated support
for getting registers for GC scanning, fallback to setjmp-based method
automatically. It's still possible to force setjmp-based implementation
on archs with dedicated support (e.g. for testing, or for peculiar calling
conventions/optimizations).
9 years ago
Paul Sokolovsky
06f70973f7
unix/unix_mphal: Typo fix in comment.
9 years ago
Damien George
731f359292
all: Add py/mphal.h and use it in all ports.
py/mphal.h contains declarations for generic mp_hal_XXX functions, such
as stdio and delay/ticks, which ports should provide definitions for. A
port will also provide mphalport.h with further HAL declarations.
9 years ago
Paul Sokolovsky
404dae80a9
unix, stmhal: Introduce mp_hal_delay_ms(), mp_hal_ticks_ms().
These MPHAL functions are intended to replace previously used HAL_Delay(),
HAL_GetTick() to provide better naming and MPHAL separation (they are
fully equivalent otherwise).
Also, refactor extmod/modlwip to use them.
9 years ago
Paul Sokolovsky
91f2168dd5
unix/modjni: Actually check argument type when doing method resolution.
This is required to properly select among overloaded methods. It however
relies on java.lang.Object-overloaded method to come last, which appears
to be the case for OpenJDK.
9 years ago
Paul Sokolovsky
9ebd4dabf2
unix/modjni: Don't pass Java object to a method which doesn't expect it.
For example, don't pass Integer to double method. This is still not
selective enough to choose the right overloaded method maong those
taking objects.
9 years ago
Paul Sokolovsky
8e6e9eaea5
unix: Use "Ctrl" as a name of the key, not "CTRL".
9 years ago
Paul Sokolovsky
2c040edef8
libffi: Skip building docs.
This requires makeinfo installed and wastes time (especially in CI).
9 years ago
Paul Sokolovsky
39a380b621
unix/modos: Android Bionic lacks statvfs(), has BSD statfs().
9 years ago
Paul Sokolovsky
e0f5df579b
all: Make netutils.h available to all ports by default.
Generally, ports should inherit INC from py.mk, append to it, not
overwrite it. TODO: Likely should do the same for other vars too.
9 years ago
Paul Sokolovsky
8ee153f234
unix/modtime: Implement ticks_ms(), ticks_us() and ticks_diff().
All of these functions return positive small int, thus range is 2 bits less
than word size (30 bit on 32-bit systems, 62 bit on 64-bit systems).
9 years ago
Paul Sokolovsky
fd379db286
unix/modtime: Implement sleep_ms(), sleep_us().
9 years ago
Paul Sokolovsky
949c5c9180
unix/unix_mphal: Implement HAL_Delay() and HAL_GetTick().
9 years ago
Paul Sokolovsky
2ca7b05552
unix/modos: Checking config macros requires mpconfig.h.
9 years ago
Paul Sokolovsky
f8e9ef5cd0
unix/modos: Guard sys/statvfs.h include with MICROPY_PY_OS_STATVFS check.
E.g. Windows lacks this header.
9 years ago
Paul Sokolovsky
c3000b6f69
unix/modos: Add statvfs() function.
Another function (like stat) which is problematic to deal with on ABI level
(FFI), as struct statvfs layout may differ unpredictably between OSes and
even different versions of a same OS. So, implement it in C, returning a
10-element tuple of f_bsize, f_frsize, f_blocks, f_bfree, f_bavail, f_files,
f_ffree, f_favail, f_flag, f_namemax. This is exactly the order described
in Python3 docs, https://docs.python.org/3/library/os.html#os.statvfs
(but note that os.statvfs() should make these values available as
attributes).
9 years ago
Paul Sokolovsky
6ec6f51326
unix: Build libffi in a directory which is gitgnored.
To avoid "-dirty" version previous and spurious "modified" output from
git status, etc.
9 years ago
Damien George
556c8a9a4f
unix: Fix coverage build now that mp_plat_print uses write.
9 years ago
Damien George
4300c7dba2
py: Remove dependency on printf/fwrite in mp_plat_print.
See issue #1500 .
9 years ago
Paul Sokolovsky
74d0df7324
unix: Allow to build against Android down to 1.5.
Bionic libc in Android 1.5 missed log2() and nan() functions.
9 years ago
Paul Sokolovsky
fe29cc192d
unix/modjni: Add iteration support for Java List objects.
Using generic iteration-via-subscription support (TODO: factor it out for
reuse).
9 years ago
Paul Sokolovsky
41eb705477
unix/modjni: call_method: Check for Java exception after method return.
9 years ago
Paul Sokolovsky
21f43ba9b0
unix/modtermios: tcsetattr: If 0 passed for "when" param, treat as TCSANOW.
As we dn't export constants for TCSANOW, etc., zero makes a good "don't
care" param, and now it will work also under Android Bionic and any other
libc.
9 years ago
Damien George
3aa7dd23c9
unix: Add exit and paste-mode hints to shell startup banner.
Thanks to @nyov for the initial patch.
9 years ago
Damien George
0334058fa4
Rename "Micro Python" to "MicroPython" in REPL, help, readme's and misc.
9 years ago
Damien George
46a1102852
repl: Add paste mode to friendly REPL, entered via CTRL-E.
Use CTRL-E to enter paste mode. Prompt starts with "===" and accepts
all characters verbatim, echoing them back. Only control characters are
CTRL-C which cancels the input and returns to normal REPL, and CTRL-D
which ends the input and executes it. The input is executed as though
it were a file. The input is not added to the prompt history.
9 years ago
Paul Sokolovsky
1b586f3a73
py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.
9 years ago
Anmol Sarma
95b352064e
unix/modsocket: Fix usage of pointers to locals outside scope
9 years ago
Paul Sokolovsky
7381b7ac71
unix/modjni: py2jvalue: Support bool and None values.
9 years ago
Paul Sokolovsky
02041bf2e0
unix/modjni: jvalue2py() is currently not used.
Not remove so far, may be needed later.
9 years ago
Paul Sokolovsky
216b6a494e
unix/modjni: Allow to access fields of objects.
9 years ago
Paul Sokolovsky
fd38799049
unix/modjni: After Call*Method(), Java exception should always be checked.
OpenJDK seemed to return NULL in case of exception, but Dalvik returns
arbitrary value, so skip such "optimizations".
9 years ago
Paul Sokolovsky
aaa8867d4a
modussl: SSL socket wrapper module based on axTLS.
9 years ago
Paul Sokolovsky
326ff54649
unix: Add support for building axtls dependency lib.
9 years ago
Paul Sokolovsky
1ea4b77a9a
unix/modjni: jclass.__str__/__repr__: Return Java .toString() value.
9 years ago