summaryrefslogtreecommitdiff
path: root/unix
AgeCommit message (Collapse)Author
2014-10-07Allow real memory errors (from locked gc) to be reported with traceback.Dave Hylands
2014-10-05unix: Detect and print compile error.Damien George
2014-10-03py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places.Damien George
This should pretty much resolve issue #50.
2014-10-01unix: Do a proper clean-up on sys.exit/SystemExit.Damien George
Addresses issue #859.
2014-09-29unix: Remove unnecessary #defines from config.Damien George
2014-09-25py: For malloc and vstr functions, use size_t exclusively for int type.Damien George
It seems most sensible to use size_t for measuring "number of bytes" in malloc and vstr functions (since that's what size_t is for). We don't use mp_uint_t because malloc and vstr are not Micro Python specific.
2014-09-23Clean up logical flow for setting LDFLAGS to build for Linux and OSXblmorris
Add more specific comments describing what is going on.
2014-09-22Incorporate change in assignment logic suggested by dhylandsblmorris
2014-09-22Fix unix/Makefile to build on OSXblmorris
Force OSX to compile with clang even if gcc is available Change LDFLAGS syntax to be compatible with clang Fix questionable syntax on line 90 Remove extraneous tab character
2014-09-17py: Add native json printing using existing print framework.Damien George
Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both.
2014-09-15py: Move definition of mp_sys_exit to core.Damien George
sys.exit always raises SystemExit so doesn't need a special implementation for each port. If C exit() is really needed, use the standard os._exit function. Also initialise mp_sys_path and mp_sys_argv in teensy port.
2014-09-06unix: Fix modffi to be able to return double on x86 machines.Damien George
2014-09-06py: Add support for emitting native x86 machine code.Damien George
2014-09-06unix: Don't use -Wno-error=cpp or #warning; fix strict alias warning.Damien George
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.
2014-09-03Code style/whitespace cleanup; remove obsolete headers.Damien George
And move the MAP_ANON redefinition from py/asmx64.c to unix/alloc.c.
2014-09-03unix: Auto-detect MICROPY_EMIT_X64 and MICROPY_GCREGS_SETJMP.Damien George
If not set, MICROPY_EMIT_X64 is set only if on x86-64 machine. If not set, MICROPY_GCREGS_SETJMP is set when on MIPS.
2014-09-03Add cache flush in py/asmarm.c and add new MP_PLAT_ALLOC_EXEC and ↵Fabian Vogt
MP_PLAT_FREE_EXEC macros Fixes issue #840
2014-08-30py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.Damien George
Part of code cleanup, working towards resolving issue #50.
2014-08-30py: Change all uint to mp_uint_t in obj.h.Damien George
Part of code cleanup, working towards resolving issue #50.
2014-08-30py: Make tuple and list use mp_int_t/mp_uint_t.Damien George
Part of code cleanup, to resolve issue #50.
2014-08-30Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George
Addressing issue #50, still some way to go yet.
2014-08-26Add pip-micropython to unix make install.Damien George
Also add -t/--target option to pip-micropython to allowing installing to the pyboard. Thanks to turbinenreiter/Sebastian Plamauer for the patch.
2014-08-24py: Fix bug where GC collected native/viper/asm function data.Damien George
Because (for Thumb) a function pointer has the LSB set, pointers to dynamic functions in RAM (eg native, viper or asm functions) were not being traced by the GC. This patch is a comprehensive fix for this. Addresses issue #820.
2014-08-24unix, modtermios: Make it properly configurable; fix spelling mistake.Damien George
2014-08-23modtermios: Add "termios" unix module, subset of CPython's.Paul Sokolovsky
Also provides setraw() function from "tty" module (which in CPython is implemented in Python). The idea here is that 95% of "termios" module usage is to set raw mode to allow access to normal serial devices. Then, instead of exporting gazillion termios symbols, it's better to implement it in C, and export minimal number of symbols (mostly baud rates and drain values).
2014-08-18Merge pull request #796 from turbinenreiter/makeinstallPaul Sokolovsky
unix: Added install/uninstall
2014-08-16py: Put SystemExit in builtin namespace.Damien George
Also fix unix port so that SystemExit with no arg exits with value 0.
2014-08-13modzlibd: Decompress part of "zlib" module, based on miniz tinfl.c .Paul Sokolovsky
2014-08-11added install/uninstallSebastian Plamauer
2014-08-10modsocket: .recv() returns bytes object.Paul Sokolovsky
2014-08-04Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.Damien George
qstr_init is always called exactly before mp_init, so makes sense to just have mp_init call it. Similarly with mp_init_emergency_exception_buf. Doing this makes the ports simpler and less error prone (ie they can no longer forget to call these).
2014-07-31py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George
Addresses issue #724.
2014-07-29Merge pull request #738 from dhylands/except-argsDamien George
Add support for storing args during an exception raised by an irq.
2014-07-28py: Implement __file__ attribute for modules.Paul Sokolovsky
2014-07-27py: Change stream protocol API: fns return uint; is_text for text.Damien George
2014-07-25Add support for storing args during an exception raised by an irq.Dave Hylands
The user code should call micropython.alloc_emergency_exception_buf(size) where size is the size of the buffer used to print the argument passed to the exception. With the test code from #732, and a call to micropython.alloc_emergenncy_exception_buf(100) the following error is now printed: ```python >>> import heartbeat_irq Uncaught exception in Timer(4) interrupt handler Traceback (most recent call last): File "0://heartbeat_irq.py", line 14, in heartbeat_cb NameError: name 'led' is not defined ```
2014-07-19Merge pull request #757 from stinos/windows-fsyncDamien George
Add fsync for windows, i.e. _commit. See dce8876
2014-07-19py: Add stream reading of n unicode chars; unicode support by default.Damien George
With unicode enabled, this patch allows reading a fixed number of characters from text-mode streams; eg file.read(5) will read 5 unicode chars, which can made of more than 5 bytes. For an ASCII stream (ie no chars > 127) it only needs to do 1 read. If there are lots of non-ASCII chars in a stream, then it needs multiple reads of the underlying object. Adds a new test for this case. Enables unicode support by default on unix and stmhal ports.
2014-07-16Add fsync for windows, i.e. _commit. See dce8876stijn
2014-07-13unix: file: No fsync() on Windows.v1.2Paul Sokolovsky
2014-07-13unix: file: Implement .flush() method.Paul Sokolovsky
This method apparently should be part of stream interface.
2014-07-13unix: Allow to disable MICROPY_EMIT_X64 from commandline.Paul Sokolovsky
emitnative in particular requires nlr_* to be real functions, so doesn't compile with MICROPY_NLR_SETJMP=1.
2014-07-09moductypes: Foreign data interface module, roughly based on ctype ideas.Paul Sokolovsky
But much smaller and memory-efficient. Uses Python builtin data structures (dict, tuple, int) to describe structure layout.
2014-07-03py: Implement sys.maxsize, standard way to check platform "bitness".Paul Sokolovsky
Implementing it as a static constant is a bit peculiar and require cooperation from long int implementation.
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-07-01stackctrl: Add "mp_" prefix.Paul Sokolovsky
2014-07-01modffi: Add special 'C' code for passing a callback function pointer.Paul Sokolovsky
2014-06-29Merge pull request #730 from stinos/windows-mpconfigPaul Sokolovsky
windows: Sync mpconfigport.h with the unix' version
2014-06-29modffi: Support short types.Paul Sokolovsky
2014-06-29windows: Sync mpconfigport.h with the unix' versionstijn
- rearrange/add definitions that were not there so it's easier to compare both - use MICROPY_PY_SYS_PLATFORM in main.c since it's available anyway - define EWOULDBLOCK, it is missing from ingw32