aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-29lib, libm: Add back dummy definition of tanf.Damien George
2014-08-29lib: Add lib and libm, moving current files from stmhal.Damien George
Top-level lib directory is for standard C libraries that we want to provide our own versions of (for efficiency and stand-alone reasons). It currently has libm in it for math functions. Also add atanf and atan2f, which addresses issue #837.
2014-08-29py: Use memmove instead of memcpy when appropriate.Damien George
Found this bug by running unix/ tests with DEBUG=1 enabled when compiling.
2014-08-29py: Fix 2 bugs in native emitter: jump_or_pop and stack settling.Damien George
Addresses issue #838.
2014-08-29py: Add compiler optimisation for conditions in parenthesis.Damien George
Optimises: if () -> if False if (x,...) -> if True if (a and b) -> if a and b
2014-08-29tests: Add option to run-tests to enable native emitter.Damien George
2014-08-28py: Move native glue code from runtime.c to new file nativeglue.c.Damien George
This way, the native glue code is only compiled if native code is enabled (which makes complete sense; thanks to Paul Sokolovsky for the idea). Should fix issue #834.
2014-08-28Merge pull request #833 from Vogtinator/arm-nativeDamien George
Basic native ARM emitter
2014-08-28py, gc: Further reduce heap fragmentation with new, faster gc alloc.Damien George
The heap allocation is now exactly as it was before the "faster gc alloc" patch, but it's still nearly as fast. It is fixed by being careful to always update the "last free block" pointer whenever the heap changes (eg free or realloc). Tested on all tests by enabling EXTENSIVE_HEAP_PROFILING in py/gc.c: old and new allocator have exactly the same behaviour, just the new one is much faster.
2014-08-28py: Reduce fragmentation of GC heap.Damien George
Recent speed up of GC allocation made the GC have a fragmented heap. This patch restores "original fragmentation behaviour" whilst still retaining relatively fast allocation. This patch works because there is always going to be a single block allocated now and then, which advances the gc_last_free_atb_index pointer often enough so that the whole heap doesn't need scanning. Should address issue #836.
2014-08-28Clarify copyright on asmarm filesFabian Vogt
2014-08-27Basic native ARM emitterFabian Vogt
2014-08-27Merge branch 'dhylands-int-bytes'Damien George
2014-08-27py: Improve efficiency of MP_OBJ_IS_STR_OR_BYTES.Damien George
Saves ROM (16 on stmhal, 240 on 64-bit unix) and should be quicker since there is 1 less branch.
2014-08-27Merge branch 'int-bytes' of https://github.com/dhylands/micropython into ↵Damien George
dhylands-int-bytes
2014-08-26Make int(b'123') work properly.Dave Hylands
2014-08-27pip-micropython: Revert to using PIP_MICROPY_DEST environment var.Paul Sokolovsky
-t/--target is a pip option. Trying to use pip options for different meanings in pip-micropython may lead to big confusion. That's why the original passed any extra parameters using environment variables. "All options belong to pip."
2014-08-26py: Fix line number printing for file with 1 line.Damien George
With a file with 1 line (and an error on that line), used to show the line as number 0. Now shows it correctly as line number 1. But, when line numbers are disabled, it now prints line number 1 for any line that has an error (instead of 0 as previously). This might end up being confusing, but requires extra RAM and/or hack logic to make it print something special in the case of no line numbers.
2014-08-26Merge pull request #824 from dhylands/sdcard-powerDamien George
Fix sdcard_power_on to not do anything if the card is already powered on...
2014-08-26stmhal, STM32F4DISC: Small changes to ST accel driver.Damien George
2014-08-26Merge branch 'siorpaes-master'Damien George
2014-08-26stmhal, staccel.py: Style cleanup.Damien George
2014-08-26Added LIS302DL ID checkDavid Siorpaes
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-26stmhal: Hookup USB_VCP.any().Damien George
Thanks to Dave Hylands for this patch.
2014-08-26stmhal: Fix build issues with (old) CC3000 driver.Damien George
Addresses issue #825.
2014-08-26py: Add dispatch for user defined ==, >, <=, >=.Damien George
Addresses issue #827.
2014-08-25tests: Add test for pyb.disable_irq and pyb.enable_irq.Damien George
2014-08-25Fix sdcard_power_on to not do anything if the card is already powered on.Dave Hylands
2014-08-25stmhal: Improve efficiency of SysTick IRQ and HAL_Delay.Damien George
SysTick IRQ now increases millisecond counter directly (ie without calling HAL_IncTick). Provide our own version of HAL_Delay that does a wfi while waiting. This more than halves power consumption when running a loop containing a pyb.delay call. It used to be like this, but new version of HAL library regressed this feature.
2014-08-25teensy: Fix multiple definition of irq functions.Damien George
2014-08-25stmhal: Use MP_OBJ_NEW_SMALL_INT directly in pyb.micros/millis.Damien George
Also some whitespace cleanup.
2014-08-25Add support for pyb.micros() by using the systick timer.Dave Hylands
I also removed trailing spaces from modpyb.c which affected a couple of lines technically not part of this patch. Tested using: https://github.com/dhylands/upy-examples/blob/master/micros_test.py which eventually fails due to wraparound issues (I could fix the test to compensate but didn't bother)
2014-08-25Add save/restore_irqDave Hylands
Factored irq functions into a separate file.
2014-08-25stmhal: Make enable_irq and disable_irq inline functions.Damien George
These functions are generally 1 machine instruction, and are used in critical code, so makes sense to have them inline. Also leave these functions uninverted (ie 0 means enable, 1 means disable) and provide macro constants if you really need to distinguish the states. This makes for smaller code as well (combined with inlining). Applied to teensy port as well.
2014-08-25Add save/restore_irqDave Hylands
Factored irq functions into a separate file.
2014-08-24py: Consolidate min/max functions into one, and add key= argument.Damien George
Addresses issue #811.
2014-08-24examples: Added pins.py example script to list pin config/af.Damien George
Script is due to Dave Hylands.
2014-08-24stmhal, pin: Update documentation.Damien George
2014-08-24Added python script to map AF to a pin nameDave Hylands
Added some functions to Pin class to query mode, pull, and af
2014-08-24Merge branch 'dhylands-localtime'Damien George
2014-08-24stmhal, modtime: Small changes, reduced code size by around 80 bytes.Damien George
Also added test for modtime.
2014-08-24Add time.mktime and enhance time.localtime (for stmhal)Dave Hylands
Now you can use time.localtime on the timestamps presented by os.stat
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-22extmod, zlibd: Make some simple ROM and RAM savings.Damien George
ROM down by 320 bytes on stmhal. RAM down by 5.5k for a decompression object.
2014-08-22py: Change hash and len members of str from 16 bit to full word.Damien George
This allows to make strings longer than 64k. It doesn't use any more RAM with current GC because a str object still fits in a GC block.
2014-08-22py: Small cleanup in stream.c.Damien George