Commit Graph

6568 Commits (hacking-on-plane)

Author SHA1 Message Date
stijn d14d4cdb8b windows: Enable MICROPY_PY_UERRNO
This also fixes the test failure for vfs_fat_ramdisk.py
2016-09-10 10:15:30 +10:00
Chris Packham a50b26e4b0 py/makeqstrdefs.py: Use python 2.6 syntax for set creation.
py/makeqstrdefs.py declares that it works with python 2.6 however the
syntax used to initialise of a set with values was only added in python
2.7. This leads to build failures when the host system doesn't have
python 2.7 or newer.

Instead of using the new syntax pass a list of initial values through
set() to achieve the same result. This should work for python versions
from at least 2.6 onwards.

Helped-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2016-09-09 23:01:23 +10:00
Damien George b236b1974b tests/pyb: Update exp file for previously updated extint test. 2016-09-09 19:37:45 +10:00
Damien George 2f02960607 tests/pyb: Add test for ExtInt when doing swint while disabled. 2016-09-09 19:36:09 +10:00
Krzysztof Blazewicz 1ba516f475 stmhal/extint: Force 0 to 1 transition on swint().
If a user tries to call `swint()` while interrupt is disabled the flag in
SWIER is set but the interrupt is not triggered and therefore the SWIER bit
is not cleared.  When the interrupt is again enabled the next call to
`swint()` won't trigger the IRQ because a 0 to 1 transition will not occur.
2016-09-09 19:35:21 +10:00
Krzysztof Blazewicz 06a1194300 stmhal/{accel,lcd}: use GPIO_{set,clear}_pin
different HAL versions implement GPIO differently (BSRR vs BSRRH+BSRRL),
this way both drivers are portable between different HAL's
2016-09-09 10:38:08 +02:00
Tom Soulanille d89de18f40 stmhal/lcd: De-assert chip select after completing SPI transmission.
The LCD interface library fails to deassert the chip select of the LCD
after an SPI transmission.  Consequently using the SPI with other
peripherals disturbs the state of the LCD.  This patch changes
lcd.lcd_out() to deassert CS after each transmission to the LCD.
2016-09-09 14:51:00 +10:00
Antonin ENFRUN f3b19ef634 py/asmthumb: Flush D-cache, and invalidate I-cache on STM32F7.
Tested on a STM32F7DISCO at 216MHz.  All tests generating code (inlineasm,
native, viper) now pass, except pybnative/while.py, but that's because
there is no LED(2).
2016-09-09 14:48:15 +10:00
Damien George 3611dcc260 docs: Bump version to 1.8.4. 2016-09-09 14:07:09 +10:00
Damien George 763e04bba5 tests/run-tests: Disable thread/stress_recurse.py test on Travis.
It has reliability issues (cause unknown at this time).
2016-09-08 13:06:29 +10:00
Damien George f3b5480be7 stmhal,cc3200,esp8266: Consistently use PWRON_RESET constant.
machine.POWER_ON is renamed to machine.PWRON_RESET to match other
reset-cause constants that all end in _RESET.  The cc3200 port keeps a
legacy definition of POWER_ON for backwards compatibility.
2016-09-08 12:50:38 +10:00
Peter Hinch dab0f316d2 docs/reference/isr_rules.rst: Two minor additions to docs for using ISR.
- Refers to the technique of instantiating an object for use in an ISR by
  specifying it as a default argument.

- Footnote detailing the fact that interrupt handlers continue to be
  executed at the REPL.
2016-09-07 17:12:42 +10:00
Paul Sokolovsky 742d8bdbe4 esp8266/modmachine: Map PWR_ON_RESET to vendor's REASON_DEFAULT_RST.
When dealing with a board which controls chip reset with UART's DTR/RTS,
we never see REASON_DEFAULT_RST (0), only REASON_EXT_SYS_RST (6). However,
trying a "raw" module with with just TXD/RXD UART connection, on power up
it has REASON_DEFAULT_RST as a reset reason.
2016-09-07 00:59:02 +03:00
Damien George b4be5a8f34 esp8266/modnetwork: Fix wlan.scan() method so it returns all networks.
According to the Arduino ESP8266 implementation the first argument to the
wifi scan callback is actually a bss_info pointer.  This patch fixes the
iteration over this data so the first 2 entries are no longer skipped.

Fixes issue #2372.
2016-09-06 15:30:39 +10:00
Damien George 4a9542c0c0 docs/library/machine.WDT: Add that WDT is available on pyboard. 2016-09-06 14:20:52 +10:00
Damien George 9103cbe366 stmhal/modmachine: Implement machine.reset_cause() function, and consts. 2016-09-06 14:20:19 +10:00
Damien George b88bf6c76b stmhal/wdt: Implement keyword args to WDT constructor. 2016-09-06 14:19:40 +10:00
Torsten Wagner 69768c97c0 esp8266/espneopixel: Disable IRQs during eps.neopixel_write.
Interrupts during neopixel_write causes timing problems and therefore
wrong light patterns.  Switching off IRQs should help to keep the strict
timing schedule.
2016-09-06 11:51:35 +10:00
Damien George e4d6a10dc9 travis: Build mpy-cross as part of the Travis process.
It's built first in case any ports need to use it.
2016-09-05 17:33:56 +10:00
Damien George 2b882e9aca mpy-cross: Don't use the internal printf functions.
They require mp_hal_stdout_tx_strn_cooked, which requires extra work to
add to mpy-cross.
2016-09-05 17:30:24 +10:00
Peter Hinch ef47a67cf4 stmhal/dac: Fix DAC (re-)initialisation by resetting DMA.
Fixes issue #2176.
2016-09-05 15:07:23 +10:00
Damien George 9526e24234 unix,stmhal,esp8266: When find'ing frozen files follow symbolic links.
It's useful to be able to use symbolic links to add files and directories
to the set of scripts to be frozen.
2016-09-05 12:35:05 +10:00
Delio Brignoli e2ac8bb3f1 py: Add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled.
This new config option allows to control whether MicroPython uses its own
internal printf or not (if not, an external one should be linked in).
Accompanying this new option is the inclusion of lib/utils/printf.c in the
core list of source files, so that ports no longer need to include it
themselves.
2016-09-05 12:18:53 +10:00
Damien George cac8dc3414 tests/extmod/framebuf1: Add tests for scrolling in the x-direction. 2016-09-05 12:08:25 +10:00
Radomir Dopieralski 778729c597 extmod/framebuf: Add the xstep!=0 case to scroll() method.
Adds horizontal scrolling. Right now, I'm just leaving the margins
created by the scrolling as they were -- so they will repeat the
edge of the framebuf. This is fast, and the user can always fill
the margins themselves.
2016-09-05 12:06:56 +10:00
Paul Sokolovsky b4df3e74e1 docs/esp8266/quickref: Further improvements for SPI subsections.
Consistency and formatting.
2016-09-04 23:31:05 +03:00
Paul Sokolovsky 20da9064d7 docs/esp8266/quickref: Update information on SPI classes.
SPI(1) is not used for hardware SPI. Few more details are provided.
2016-09-04 21:13:55 +03:00
Paul Sokolovsky dba40afa70 esp8266/modmachine: Simplify SPI class implementation multiplexing.
modpybhspi now does the needed multiplexing, calling out to modpybspi
(bitbanging SPI) for suitable peripheral ID's. modmachinespi (previous
multiplexer class) thus not needed and removed.

modpybhspi also updated to following standard SPI peripheral naming:
SPI0 is used for FlashROM and thus not supported so far. SPI1 is available
for users, and thus needs to be instantiated as:

spi = machine.SPI(1, ...)
2016-09-04 20:33:11 +03:00
Paul Sokolovsky 7ddd1a58f6 esp8266/modmachine: Don't expose internal SoftSPI and HSPI classes.
There functionality is available via standard SPI class.
2016-09-04 19:57:16 +03:00
Paul Sokolovsky 1708fe3cc7 esp8266/modmachine: Add WDT_RESET and SOFT_RESET constants.
Both tested to work. (WDT_RESET can be seen by issuing machine.disable_irq()
and waiting for WDT reset, SOFT_RESET - by machine.reset()).
2016-09-04 19:45:58 +03:00
Paul Sokolovsky 61e2dfd97d tests/extmod/uzlib_decompio: Add zlib bitstream testcases. 2016-09-04 14:45:27 +03:00
Paul Sokolovsky 1bc5cb4312 extmod/moduzlib: Support wbits arg to DecompIO. 2016-09-04 14:44:12 +03:00
Dave Hylands fedab995ee stmhal: Set STM32F7DISC CPU Frequency to 216 MHz
This set the CPU frequency to 216 MHz (the max) and
leaves the USB Frequency at 48 MHz.

These settings were copied from one of the HAL examples.
2016-09-04 18:14:41 +10:00
Damien George 2d8740a4d1 tests/extmod: Add a test for framebuf module, tested by coverage build. 2016-09-04 16:40:40 +10:00
Damien George 47899a1ab8 extmod/modframebuf: Include font from stmhal directory explicitly.
So that users of framebuf don't need to have stmhal directory in their
path.  (Eventually the font can be moved elsewhere.)
2016-09-04 16:39:28 +10:00
Chris Packham 8c6856d2e7 py/emitglue.c: provide mp_raw_code_load_file for any unix architecture
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
2016-09-04 16:17:46 +10:00
Paul Sokolovsky 015774a04f esp8266/modmachinewdt: Add .deinit() method. 2016-09-03 20:45:11 +03:00
Paul Sokolovsky 4a33677c97 esp8266/esp8266.ld: Move modmachinewdt to FlashROM. 2016-09-03 20:44:24 +03:00
Damien George 76c366df56 stmhal: Add machine.WDT class.
Usage:

    import machine
    wdt = machine.WDT(0, 5000) # 5 second timeout
    wdt.feed()

Thanks to Moritz for the initial implementation.
2016-09-04 00:12:48 +10:00
Paul Sokolovsky f7c4611523 extmod/moduzlib: Use mperrno.h for error constants. 2016-09-03 00:34:57 +03:00
Paul Sokolovsky fafd587514 tests/extmod: Add test for uzlib.DecompIO. 2016-09-03 00:20:30 +03:00
Paul Sokolovsky a6864a13c7 extmod/moduzlib: Implement zlib stream decompressor class, DecompIO. 2016-09-03 00:19:35 +03:00
Damien George c51c883cc8 tools/mpy-tool.py: Support freezing of complex numbers. 2016-09-03 00:19:02 +10:00
Radomir Dopieralski 41ec22632d extmod/modframebuf: Fix fill and scroll when height not divisible by 8.
There was a bug in `framebuf1_fill` function, that makes it leave a few
lines unfilled at the bottom if the height is not divisible by 8.

A similar bug is fixed in the scroll method.
2016-09-02 23:58:34 +10:00
Damien George b6bdf18deb tools/mpy-tool.py: Compute the hash value for str/bytes objects.
This makes it more efficient at runtime to hash str/bytes objects.
2016-09-02 15:10:45 +10:00
Damien George b4790afdaf tools/mpy-tool.py: Store qstr config values in global config object.
Makes it easier to access them without passing around another dict of the
config values.
2016-09-02 15:09:21 +10:00
Damien George 58f3861358 tests/unix/extra_coverage: Add test for str/bytes with invalid hash. 2016-09-02 15:07:42 +10:00
Damien George 5f3bda422a py: If str/bytes hash is 0 then explicitly compute it. 2016-09-02 14:49:50 +10:00
Damien George f127bef3e4 py/makeqstrdata.py: Compute the qstr hash from bytes, not characters. 2016-09-02 14:32:47 +10:00
Delio Brignoli f98bb2ddcb py/mpprint: Fail an assertion with unsupported format specifiers.
Arguments of an unknown type cannot be skipped and continuing to parse a
format string after encountering an unknown format specifier leads to
undefined behaviour.  This patch helps to find use of unsupported formats.
2016-09-01 18:09:44 +10:00