aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-01-29stmhal: Add PWM capability for LED(3) and LED(4) on pyboards.Damien George
USB CDC no longer needs TIM3 (which was originally used for LED(4) PWM) and so TIM3 has been freed for general purpose use by the user. Hence LED(4) lost its PWM capabilities. This patch reinstates the PWM capabilities using a semi-generic piece of code which allows to configure a timer and PWM channel to use for any LED. But the PWM capability is only configured if the LED is set to an intensity between 1 and 254 (ie only when needed). In that case the relevant timer is configured for PWM. It's up to the user to make sure the timers are not used if PWM is active. This patch also makes sure that PWM LEDs are turned off using standard GPIO when calling led.off() or led.intensity(0), instead of just setting the PWM counter to zero.
2016-01-29stmhal: Make TIM3 available for use by the user.Damien George
TIM3 is no longer used by USB CDC for triggering outgoing data, so we can now make it available to the user. PWM fading on LED(4) is now gone, but will be reinstated in a new way.
2016-01-29stmhal: Make USB CDC driver use SOF instead of TIM3 for outgoing data.Damien George
Previous to this patch the USB CDC driver used TIM3 to trigger the sending of outgoing data over USB serial. This patch changes the behaviour so that the USB SOF interrupt is used to trigger the processing of the sending. This reduces latency and increases bandwidth of outgoing data. Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype. See PR #1713.
2016-01-29py/formatfloat: Add ability to format doubles with exponents > 99.Damien George
For single prec, exponents never get larger than about 37. For double prec, exponents can be larger than 99 and need 3 bytes to format. This patch makes the number of bytes needed configurable. Addresses issue #1772.
2016-01-29py/runtime: mp_stack_ctrl_init() should be called immediately on startup.Paul Sokolovsky
Calling it from mp_init() is too late for some ports (like Unix), and leads to incomplete stack frame being captured, with following GC issues. So, now each port should call mp_stack_ctrl_init() on its own, ASAP after startup, and taking special precautions so it really was called before stack variables get allocated (because if such variable with a pointer is missed, it may lead to over-collecting (typical symptom is segfaulting)).
2016-01-29unix/main: Remove debug code left from MP_OBJ_TO_PTR refactor.Paul Sokolovsky
2016-01-28lib/utils/printf: Fix printf on release buildsDave Hylands
When using newer glibc's the compiler automatically sets _FORTIFY_SOURCE when building with -O1 and this causes a special inlined version of printf to be declared which then bypasses our version of printf.
2016-01-28py/bc: Update opcode format table now that MP_BC_NOT opcode is gone.Damien George
MP_BC_NOT was removed and the "not" operation made a proper unary operator, and the opcode format table needs to be updated to reflect this change (but actually the change is only cosmetic).
2016-01-27unix/modsocket: sockaddr(): Handle AF_INET6 addresses.Paul Sokolovsky
2016-01-27py/inlineasm: Add ability to specify return type of asm_thumb funcs.Damien George
Supported return types are: object, bool, int, uint. For example: @micropython.asm_thumb def foo(r0, r1) -> uint: add(r0, r0, r1)
2016-01-27stmhal: Add support for the STM32F401NUCLEO board.Carmine Noviello
Includes full version of pins.csv file with correct mapping of the Nucleo STM32F401RE chip (LQFP64 package).
2016-01-26tests: For urandom test, use sys.exit() instead of sys.exit(1).Damien George
2016-01-26windows/msvc: Add modurandom.c to list of source files.Damien George
2016-01-26tests: Add some tests for urandom module.Damien George
2016-01-26windows: Enable urandom module.Damien George
2016-01-26extmod/modurandom: Add some extra random functions.Damien George
Functions added are: - randint - randrange - choice - random - uniform They are enabled with configuration variable MICROPY_PY_URANDOM_EXTRA_FUNCS, which is disabled by default. It is enabled for unix coverage build and stmhal.
2016-01-25extmod/moduhashlib: Use MICROPY_PY_UHASHLIB_SHA1 config define.Paul Sokolovsky
2016-01-24extmod/moduhashlib: Add support for SHA1 (based on axTLS).Paul Sokolovsky
SHA1 is used in a number of protocols and algorithm originated 5 years ago or so, in other words, it's in "wide use", and only newer protocols use SHA2. The implementation depends on axTLS enabled. TODO: Make separate config option specifically for sha1().
2016-01-24py/modmicropython: Add stack_use, heap_lock and heap_unlock functions.Damien George
micropython.stack_use() returns an integer being the number of bytes used on the stack. micropython.heap_lock() and heap_unlock() can be used to prevent the memory manager from allocating anything on the heap. Calls to these are allowed to be nested.
2016-01-23stmhal: Add support for building frozen files.Dave Hylands
This allows FROZEN_DIR=some-directory to be specified on the make command line, which will then add all of the files contained within the indicated frozen directory as frozen files in the image. There is no change in flash/ram usage if not using the feature. This is especially useful on smaller MCUs (like the 401) which only has 64K flash file system.
2016-01-23py/objgetitemiter: Typo fix in comment.Paul Sokolovsky
2016-01-21unix/modsocket: accept(): Make IPv6-clean.Paul Sokolovsky
By reserving enough space for peer address.
2016-01-19stmhal: Add os.statvfsDave Hylands
Implement enough of statvfs to determine the amount of free space on a volume.
2016-01-19py: Add ustruct.pack_into and unpack_fromDave Hylands
2016-01-17.travis.yml: Switch to Ubuntu 14.04 Trusty.Paul Sokolovsky
This allows to cut number of packages installed from 3rd-party package repos, and otherwise cut number of overrides and hacks.
2016-01-17extmod/modurandom: Make yasmarang() function static.Paul Sokolovsky
2016-01-17extmod/modurandom: Add "urandom" module.Paul Sokolovsky
Seedable and reproducible pseudo-random number generator. Implemented functions are getrandbits(n) (n <= 32) and seed(). The algorithm used is Yasmarang by Ilya Levin: http://www.literatecode.com/yasmarang
2016-01-16pic16bit: Minor updates to types to allow port to compile again.Damien George
2016-01-15unix/modffi: Allow to compile modffi in OBJ_REPR_D mode.Damien George
2016-01-15unix/.gitignore: Add nanbox build output to ignore list.Damien George
2016-01-15travis: Add unix NaN-boxing build to Travis builds.Damien George
This will help make sure new commits work with OBJ_REPR_D.
2016-01-15unix: Add option to build 64-bit NaN-boxing interpreter.Damien George
Build using: make nanbox
2016-01-15py/objproperty: Fix static struct to build with OBJ_REPR_D.Damien George
2016-01-14builtin property: accept keyword argumentschrysn
this allows python code to use property(lambda:..., doc=...) idiom. named versions for the fget, fset and fdel arguments are left out in the interest of saving space; they are rarely used and easy to enable when actually needed. a test case is included.
2016-01-14tests: Remove builtin_dict teststijn
This is essentially a duplicate of obj_dict.py
2016-01-13docs: Several minor changes: network, pyb, ADCAll and inline asm.Peter Hinch
2016-01-13py: Use new code pattern for parsing kw args with mp_arg_parse_all.Damien George
Makes code easier to read and more maintainable.
2016-01-13py/emitglue: Use mp_obj_is_float instead of MP_OBJ_IS_TYPE.Damien George
2016-01-12py: unary_op enum type fix, and a cast to remove clang warningAntonin ENFRUN
2016-01-11unix: Allow to build coverage build with OBJ_REPR_D.Damien George
2016-01-11unix: Add socket.inet_ntop functionDave Hylands
2016-01-11py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.Damien George
The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
2016-01-11py: Change type signature of builtin funs that take variable or kw args.Damien George
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
2016-01-11py: Change type of .make_new and .call args: mp_uint_t becomes size_t.Damien George
This patch changes the type signature of .make_new and .call object method slots to use size_t for n_args and n_kw (was mp_uint_t. Makes code more efficient when mp_uint_t is larger than a machine word. Doesn't affect ports when size_t and mp_uint_t have the same size.
2016-01-10extmod: Fix uctypes size calculation for bitfieldsDave Hylands
2016-01-10unix/modtime: strftime(): Support 2nd argument, but as time_t value.Paul Sokolovsky
Instead of struct tm like structure, as required by CPython.
2016-01-10py: Remove long-obsolete mp_method_t typedef.Damien George
2016-01-09examples/unix: Rename example be importable as modules.Paul Sokolovsky
Replace hyphens with undescores in modules.
2016-01-08tests: Fix math_fun_special test so it passes with single prec float.Damien George
2016-01-08py/objint: Fix classification of float so it works for OBJ_REPR_D.Damien George