aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-12-12stmhal: For SPI config, use HW_SPIx_SCK instead of HW_ENABLE_SPIx.Damien George
Previously, SPI was configured by a board defining MICROPY_HW_ENABLE_SPIx to 0 or 1. Now, the board should define MICROPY_HW_SPIx_SCK, MISO, MOSI and NSS. This makes it the same as how I2C is configured.
2015-12-12py: Fix compiler to handle lambdas used as default arguments.Damien George
Addresses issue #1709.
2015-12-12tools: Upgrade upip to 0.6.3.Paul Sokolovsky
Updated for _os -> uos builtin module rename.
2015-12-12unix: Rename "_os" module to "uos" for consistency with baremetal ports.Paul Sokolovsky
2015-12-11msvc: Use different output directories depending on build typestijn
This allows multiple versions (e.g. Debug/Release, x86/x64) of micropython.exe to co-exist instead and also solves potential problems where msbuild does not completely rebuild the output and/or pdb files when switching between builds, which in turn can cause linker errors in dependent projects. By default exe/map/... files go in windows/build/$(Configuration)$(Platform) After each build micropython.exe is still copied from the above directory to the windows directory though, as that is consistent with the other ports and the test runner by default uses that location as well. Also rename env.props -> path.props which is a clearer name, and add ample documentation in the affected build files. (also see discussion in #1538)
2015-12-11unix/moduselect: Implement "one-shot" flag for poll.poll().Paul Sokolovsky
After an I/O event is triggered for fd, event flags are automatically reset, so no further events are reported until new event flags are set. This is an optimization for uasyncio, required to account for coroutine semantics: each coroutine issues explicit read/write async call, and once that trigger, no events should be reported to coroutine, unless it again explicitly requests it. One-shot mode saves one linear scan over the poll array.
2015-12-10stmhal: add order-only dependency on build directorySven Wegener
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2015-12-10tests: Add test for "not" of a user defined class.Damien George
2015-12-10py: Make UNARY_OP_NOT a first-class op, to agree with Py not semantics.Damien George
Fixes #1684 and makes "not" match Python semantics. The code is also simplified (the separate MP_BC_NOT opcode is removed) and the patch saves 68 bytes for bare-arm/ and 52 bytes for minimal/. Previously "not x" was implemented as !mp_unary_op(x, MP_UNARY_OP_BOOL), so any given object only needs to implement MP_UNARY_OP_BOOL (and the VM had a special opcode to do the ! bit). With this patch "not x" is implemented as mp_unary_op(x, MP_UNARY_OP_NOT), but this operation is caught at the start of mp_unary_op and dispatched as !mp_obj_is_true(x). mp_obj_is_true has special logic to test for truthness, and is the correct way to handle the not operation.
2015-12-10py/emitinlinethumb: Add support for MRS instruction.Henrik Sölver
Only IPSR and BASEPRI special registers supported at the moment, but easy to extend in the future.
2015-12-10lib/utils/printf: Apply workaround for static linking with uclibc.Paul Sokolovsky
uclibc objects call __GI_vsnprintf().
2015-12-10py/mkrules.mk: Don't pass COPT to linker.Paul Sokolovsky
Oftentimes, libc, libm, etc. don't come compiled with CPU compressed code option (Thumb, MIPS16, etc.), but we may still want to use such compressed code for MicroPython itself.
2015-12-09unix/modtermios: DJGPP appears to have unicode-capable cc_t type.Paul Sokolovsky
At least it's defined as "unsiged". We don't try to support unicode still, but at least apply workaround for DJGPP build.
2015-12-09unix/modtermios: Provide B57600 and B115200 constants only if defined.Paul Sokolovsky
2015-12-09extmod/moductypes: sizeof operation depends on layout type of structure.Paul Sokolovsky
Previously, sizeof() blindly assumed LAYOUT_NATIVE and tried to align size even for packed LAYOUT_LITTLE_ENDIAN & LAYOUT_BIG_ENDIAN. As sizeof() is implemented on a strucuture descriptor dictionary (not an structure object), resolving this required passing layout type around.
2015-12-09extmod: Add test which demonstrates LITTLE_ENDIAN packing failureDave Hylands
2015-12-09py: Add mp_get_stream_raise to factor out check for stream methods.Damien George
2015-12-09stmhal/timer: Use mp_float_t instead of float.Damien George
This way mp_float_t can be changed to, eg, double.
2015-12-09py: Fix calling of parent classmethod from instance of subclass.Damien George
Addresses issue #1697.
2015-12-09stmhal: Enable two USB phys to be supported together.neilh10
This is refactoring to enable support for the two USB PHYs available on some STM32F4 processors to be used at the same time. The F405/7 & F429 have two USB PHYs, others such as the F411 only have one PHY. This has been tested separately on a pyb10 (USB_FS PHY) and F429DISC (USB_HS PHY) to be able to invoke a REPL/USB. I have modified a PYBV10 to support two PHYs. The long term objective is to support a 2nd USB PHY to be brought up as a USB HOST, and possibly a single USB PHY to be OTG.
2015-12-08tests: Disable for_range.py test for native emitter (it requires yield).Damien George
2015-12-08py: Don't try to optimise for+range when args are not simple expressions.Damien George
Addresses issue #1693.
2015-12-08tools: Fix pyboard.py to work under Python 3.Damien George
2015-12-08tools: Add option to pyboard.py to wait for serial device to be ready.Peter Hinch
Also prints a nicer error message if the serial connection could not be established.
2015-12-08py/misc.h: Include stdint.h only once (unconditionally at the top).Paul Sokolovsky
2015-12-07unix/main: mp_verbose_flag available only if MICROPY_DEBUG_PRINTERS is true.Paul Sokolovsky
Not available for minimal build for example.
2015-12-07py/misc.h: Include stdint.h, as large share of code now depends on it.Paul Sokolovsky
2015-12-07tests/builtin_minmax: Make compatible with @native codegen.Paul Sokolovsky
2015-12-07stmhal: Print exception information in nlr_jump_failedDave Hylands
Currently nlr_jump_fail prints that there was an uncaught exception but nothing about the exception. This patch causes nlr_jump_failed to try to print the exception. Given that printf was called on the line above, I think that the call to mp_obj_print_exception has about as much likelyhood of succeeding as the printf does.
2015-12-07tests/builtin_minmax: Add testcase for lazy iterable (generator).Paul Sokolovsky
2015-12-07tests: Add min/max "default" agrument testpohmelie
2015-12-07py: Add min/max "default" keyword argumentpohmelie
2015-12-07py: Add MICROPY_PY_BUILTINS_MIN_MAX, disable for minimal ports.pohmelie
2015-12-07stmhal: Execute boot.py and main.py when formatting the file system.Dave Hylands
When you use the USER button to perform a filesystem reset at boot time then it wipes out the filesystem and creates a new boot.py and main.py. With this patch these files are executed after formatting, ensuring that pyb and machine modules get imported.
2015-12-07py: Make it easy to build without MICROPY_PY_BUILTINS_COMPLEX.Paul Sokolovsky
Automagically skip related modules.
2015-12-06tools: Allow pyboard.py to work when boot.py prints things.Dave Hylands
2015-12-06tests: Actuall add feature check for complex type being available.Paul Sokolovsky
2015-12-06tests/run-tests: Allow to skip complex tests if it's not compiled in.Paul Sokolovsky
2015-12-05unix/moduselect: register(): Allow to call with duplicate file descriptor.Paul Sokolovsky
Per CPython docs, "Registering a file descriptor that’s already registered is not an error, and has the same effect as registering the descriptor exactly once." https://docs.python.org/3/library/select.html#select.poll.register That's somewhat ambiguous, what's implemented here is that if fd si not yet registered, it is registered. Otherwise, the effect is equivalent to modify() method.
2015-12-05py/modsys: Use MP_ROM_PTR() initializer for sys.modules.Paul Sokolovsky
Based on similar usage for sys.argv/sys.path.
2015-12-04stmhal: Fix uart off by 1 circular buffer size.Ryan Shaw
2015-12-05tests/extra_coverage: Update for sys.modules addition.Paul Sokolovsky
2015-12-05py/modsys: Implement sys.modules.Paul Sokolovsky
This for example will allow people to reload modules which didn't load successfully (e.g. due to syntax error).
2015-12-04unix/main: Check pending exception at the end of code block execution.Paul Sokolovsky
Usually this checking is done by VM on jump instructions, but for linear sequences of instructions and builtin functions this won't happen. Particular target of this change is long-running builtin functions like time.sleep().
2015-12-04stmhal: Add option to free up TIM3 from USB VCP polling.Damien George
This is a hack to free up TIM3 so that it can be used by the user. Instead we use the PVD irq to call the USB VCP polling function, and trigger it from SysTick (so SysTick itself does not do any processing). The feature is enabled for pyboard lite only, since it lacks timers.
2015-12-04cc3200: Add __get_BASEPRI and __set_BASEPRI inline function definitions.Damien George
2015-12-04stmhal: Only use BASEPRI irq stuff if Cortex is M3 or higher.Damien George
2015-12-04stmhal: Add rtc.init() method to force RTC to re-initialise.Damien George
2015-12-04stmhal: Protect SD card DMA transactions against USB MSC contention.Damien George
Consider the following scenario: SD card is being read by pyboard; USB irq comes in for MSC read request; SD card needs to be read from within USB irq while SD read is already ongoing. Such contention needs to be avoided. This patch provides a simple solution, to raise the irq priority above that of the USB irq during SD DMA transfers. Pyboard and PC can now read from the SD card at the same time (well, reads are interleaved).
2015-12-04stmhal: Add raise_irq_pri and restore_irq_pri functions.Damien George
These can be used to disable only certain interrupts, ones at or above the given priority value.