Commit Graph

7348 Commits

Author SHA1 Message Date
Damien George
f7545b200e stmhal/moduos: Implement POSIX behaviour of rename, allow to overwrite. 2016-12-02 15:13:29 +11:00
Damien George
b7df3e541a extmod/vfs_fat: Implement POSIX behaviour of rename, allow to overwrite.
If the destination of os.rename() exists then it will be overwritten if it
is a file.  This is the POSIX behaviour, which is also the CPython
behaviour, and so we follow suit.

See issue #2598 for discussion.
2016-12-02 15:06:09 +11:00
Jean-François Milants
08bd7d1d31 stmhal/sdcard: Clean/invalidate cache before DMA transfers with SD card.
Add 2 macros in mphalport.h that clean and invalidate data caches only on
STM32F7 MCUs.  They are needed to ensure the cache coherency before/after
DMA transferts.

* MP_HAL_CLEANINVALIDATE_DCACHE cleans and invalidate the data cache. It
  must be called before starting a DMA transfer from the peripheral to the
  RAM memory.

* MP_HAL_CLEAN_DCACHE cleans the data cache.  It must be called before
  starting a DMA transfert from the RAM memory to the peripheral.

These macros are called in sdcard.c, before reading from and writing to
the SDCard, when DMA is used.
2016-12-02 13:51:09 +11:00
Scott Shawcroft
03f49f8209 atmel-samd: Slim down the pin struct to save ~1200 bytes. 2016-12-01 13:47:18 -08:00
Scott Shawcroft
f4a1da4be9 atmel-samd: Only include bitbangio on boards with flash. 2016-12-01 13:46:44 -08:00
Scott Shawcroft
8ef0dd095a Fix two bugs found by clang:
* PWMOut enter and exit weren't hooked up.
* end couldn't be negative in I2C.
2016-12-01 10:33:50 -08:00
Damien George
a081b49d55 extmod/modframebuf: Optimise fill and fill_rect methods.
Fill is a very common operation (eg to clear the screen) and it is worth
optimising it, by providing a specialised fill_rect function for each
framebuffer format.

This patch improved the speed of fill by 10 times for a 16-bit display
with 160*128 pixels.
2016-12-01 16:51:31 +11:00
Damien George
81e171b7bb extmod/modframebuf: Add back legacy FrameBuffer1 "class".
For backwards compatibility.  It simple creates a frame buffer with the
MVLSB format.
2016-12-01 16:43:25 +11:00
Radomir Dopieralski
eb09336e99 drivers/display/ssd1306.py: Update to use FrameBuffer not FrameBuffer1 2016-12-01 16:43:25 +11:00
Radomir Dopieralski
225e22b287 extmod/modframebuf: Make FrameBuffer handle 16bit depth.
Rename FrameBuffer1 into FrameBuffer and make it handle different bit
depths via a method table that has getpixel and setpixel.  Currently
supported formats are MVLSB (monochrome, vertical, LSB) and RGB565.

Also add blit() and fill_rect() methods.
2016-12-01 16:43:25 +11:00
Scott Shawcroft
915e1e5603 atmel-samd: Move the README text out of ROM to save space. We can still ship with it on flash. 2016-11-30 09:50:19 -08:00
Scott Shawcroft
3628a1ae48 atmel-samd: Fix FLASH_ROOT_POINTERS for internal flash builds. 2016-11-30 09:49:39 -08:00
Damien George
8b8242954e extmod/modurandom: Allow to build with float disabled. 2016-11-30 12:58:54 +11:00
Damien George
c19a395cac stmhal/adc: Make channel "16" always map to the temperature sensor.
The temperature sensor on F4 and F7 MCUs is mostly, but not always, on
channel 16.  To retain compatibility across all these MCUs this patch
maps the user-facing channel 16 to the internal temperature sensor.
2016-11-30 12:58:54 +11:00
Damien George
390ce86a30 stmhal/adc: Add support for F767 MCU. 2016-11-30 12:58:54 +11:00
Damien George
52dfad0879 stmhal/adc: Add ADCAll.read_vref method, returning "3.3v" value. 2016-11-30 12:58:54 +11:00
Damien George
e72353cc48 stmhal/adc: Make ADCAll.read_core_temp return accurate float value.
It now uses factory calibration values to get a more accurate value, and
returns a float instead of an integer.
2016-11-30 12:58:53 +11:00
Damien George
87215a0f04 stmhal/adc: Provide more accurate measure of VBAT and VREFINT.
By using factory calibration values.
2016-11-30 12:58:53 +11:00
Scott Shawcroft
9b3afc7b37 shared-bindings: Make MOSI and MISO optional for SPI. 2016-11-29 16:54:20 -08:00
Scott Shawcroft
4933fa1c27 shared-bindings: Ensure pin objects are actually pins.
Fixes #12
2016-11-29 15:50:01 -08:00
Scott Shawcroft
72455e441f atmel-samd: Use MICROPY_VM_HOOK_LOOP to make sure the mass storage handling code is called even in tight Python loops. Fixes #51 2016-11-29 14:58:37 -08:00
Paul Sokolovsky
295266178c zephyr/zephyr_getchar: Update to Zephyr 1.6 unified kernel API. 2016-11-30 01:42:58 +03:00
Scott Shawcroft
16764dfa31 shared-bindings: Fix blinky example. Fixes #55 2016-11-29 14:37:25 -08:00
Scott Shawcroft
ddfa7595b0 Slim down Arduino Zero build by turning off mass storage LEDs. 2016-11-29 14:32:04 -08:00
Scott Shawcroft
94bde17256 Update Ubuntu and GCC versions used in Travis build. Now uses GCC 5.4.1. Also, tweaks what builds are run. 2016-11-29 14:31:08 -08:00
Scott Shawcroft
2d9a0c76c5 atmel-samd: Switch to MICROPY_PORT_ROOT_POINTERS for the flash cache. 2016-11-29 14:29:33 -08:00
Scott Shawcroft
05c14dfe78 Revert "py: Add ability to manually mark blocks during collect."
This reverts commit 9321828158.
2016-11-29 14:11:32 -08:00
Paul Sokolovsky
a6de451a13 zephyr: Add .gitignore to ignore Zephyr's "outdir" directory.
That's where Zephyr keeps object files and produced executables.
2016-11-30 00:26:31 +03:00
Scott Shawcroft
2042aad126 tools: Use a for loop to build all board variants. 2016-11-29 10:47:11 -08:00
Scott Shawcroft
888efa54e2 Only include uheap in debug builds. 2016-11-29 10:46:47 -08:00
Damien George
63e82dcdfe py/asmthumb: Fix build for F7 MCUs after recent code refactoring. 2016-11-30 00:11:25 +11:00
Scott Shawcroft
d2aa05a9fe shared-bindings: Stop using negative length at all. Having uint and int mixed is confusing. 2016-11-28 19:57:05 -08:00
Scott Shawcroft
bda6ee9a14 shared-bindings: Stop using max and min because C doesn't define them. 2016-11-28 19:48:48 -08:00
Scott Shawcroft
55c8c91e07 atmel-samd: Hook in bitbangio 2016-11-28 19:48:17 -08:00
Scott Shawcroft
6292f937da esp8266: Make work with python 3 as default python impl. 2016-11-28 19:47:59 -08:00
Damien George
029f215ead stmhal/adc: Add "mask" selection parameter to pyb.ADCAll constructor.
The "mask" parameter is used to select which pins the ADCAll constructor
will initialise to analog mode.  It defaults to all pins (0xffffffff),
which is backwards compatible with previous behaviour.
2016-11-29 14:32:05 +11:00
Scott Shawcroft
77db3d450e Add links to two more libraries. 2016-11-28 19:24:16 -08:00
Scott Shawcroft
b8bf15de16 atmel-samd: Add Circuit Playground M0 board. Its experimental. 2016-11-28 19:21:40 -08:00
Scott Shawcroft
f8898d01ce py: fix python3 compatibility error 2016-11-28 19:20:51 -08:00
Scott Shawcroft
78f8565270 Add start and end kwargs to writeto and readfrom_into so a single buffer can be used to save memory. 2016-11-28 18:35:19 -08:00
Nicholas Graumann
0d75b0d962 stmhal: Add address parameters to openocd config files.
Also make l4 config the default for STM32L476DISC board.
2016-11-28 15:27:36 +11:00
Nicholas Graumann
50a2966913 stmhal: Add OpenOCD configuration for STM32L4. 2016-11-28 15:27:36 +11:00
Damien George
139b891d6d stmhal: Add back GPIO_BSRRL and GPIO_BSRRH constants to stm module.
These were inadvertently removed with a recent upgrade to CMSIS, where
those registers were no longer defined in the CMSIS headers, and hence
no longer extracted.
2016-11-28 15:02:42 +11:00
Damien George
612599587b py: Factor out common code from assemblers into asmbase.[ch].
All assemblers should "derive" from mp_asm_base_t.
2016-11-28 09:24:50 +11:00
Dave Hylands
21e1703d37 stmhal: Add support for flash storage on STM32F415. 2016-11-26 16:47:45 +11:00
Damien George
dbc09d03f6 tests/basics: Enable tests for list slice getting with 3rd arg.
Also add a test to check case when 3rd arg is 0.
2016-11-26 16:39:25 +11:00
Damien George
4c3c515bd1 tests/basics: Change dict_fromkeys test so it doesn't use generators.
And then it can run with the native emitter.
2016-11-26 16:38:38 +11:00
Damien George
e6cf5fb2cc py/compile: Remove comment about TODO for short circuiting for if-stmt.
Short circuiting is handled correctly by c_if_cond, and constants within
short-circuit expressions are optimised by the parser.
2016-11-26 16:15:55 +11:00
Damien George
a4f96c8c2a tests/basics: Add tests for if-expressions. 2016-11-26 16:15:31 +11:00
Damien George
a31a3a9fd5 tests/basics: Add test for dict.fromkeys where arg is a generator.
Improves coverage because it tests the case where the arg does not have a
__len__ slot.
2016-11-26 15:38:48 +11:00