Commit Graph

7454 Commits

Author SHA1 Message Date
Damien George
f4ee9f8853 py/bc.h: Rename _mp_code_state to _mp_code_state_t.
This rename was missed in the previous patch.
2016-08-27 23:23:51 +10:00
Damien George
581a59a456 py: Rename struct mp_code_state to mp_code_state_t.
Also at _t to mp_exc_stack pre-declaration in struct typedef.
2016-08-27 23:21:00 +10:00
Damien George
531217a06b extmod/modframebuf: Fix pixel accessor to return a 1-bit result. 2016-08-27 18:31:58 +10:00
Scott Shawcroft
259ae8a39d atmel-samd: Initial ADC support. 2016-08-26 17:01:38 -07:00
Radomir Dopieralski
fea7fe45ea tests/extmod/vfs_fat_ramdisk: Add tests for VFS.umount()
Try to un-mount a file system and re-mount it again.
2016-08-26 23:24:32 +03:00
Damien George
26295e04ff py/emitglue: Use more compact mp_raise_ValueError function. 2016-08-26 23:45:07 +10:00
Damien George
fe3cc5bb53 py/modstruct: Use more compact mp_raise_ValueError function.
Saves a few bytes of code size.
2016-08-26 23:42:40 +10:00
Damien George
3b5affa0d1 tests/cmdline: Add test for -O option to check optimisation value. 2016-08-26 22:29:38 +10:00
Damien George
24df30c133 py/compile: Don't compile assert statements when optimisations enabled.
As per CPython.
2016-08-26 22:28:22 +10:00
Krzysztof Blazewicz
fc73c9b4b2 stmhal/modusocket: set self->nic to MP_OBJ_NULL after socket close
This patch makes second and next calls to <socket>.close() a no-op.
It prevents GC from closing the underlying resource after user
already used <socket>.close() explicitly.

fixes #2355
2016-08-26 10:57:32 +02:00
Damien George
5ffe1d8dc0 py/gc: Add MICROPY_GC_CONSERVATIVE_CLEAR option to always zero memory.
There can be stray pointers in memory blocks that are not properly zero'd
after allocation.  This patch adds a new config option to always zero all
allocated memory (via gc_alloc and gc_realloc) and hence help to eliminate
stray pointers.

See issue #2195.
2016-08-26 15:35:26 +10:00
Radomir Dopieralski
d29ca28288 esp8266/modous: Add os.umount method to unmount a filesystem.
This is an object-oriented approach, where uos is only a proxy for the
methods on the vfs object.  Some internals had to be exposed (the STATIC
keyword removed) for this to work.

Fixes #2338.
2016-08-26 12:45:21 +10:00
Paul Sokolovsky
b0e2106fb8 lib/berkeley-db-1.xx: Update to upstream, fixes MacOSX build. 2016-08-25 21:30:20 +03:00
Radomir Dopieralski
891479e62a esp8266/hspi: Enable duplex operation of hardware SPI
Without this, spi.read(1, 0xff) would use 16 clock cycles,
first to send 0xff and then to receive one byte, as visible
with a logic analyzer.
2016-08-25 21:24:22 +03:00
Paul Sokolovsky
9897bcaa73 lib/utils/stdout_helpers: Fix function signature to match py/mphal.h. 2016-08-25 15:23:50 +03:00
Dave Hylands
a589fa3e0b stmhal: Update pin print to print new constants
This updates the print function for machine.Pin to
print out the new constants from the Hardware API defintion
rather than the legacy definitions.
2016-08-25 16:11:42 +10:00
Damien George
d09b6b9aa1 esp8266/modpybrtc: Use 64-bit arithmetic when computing alarm expiry. 2016-08-25 14:10:25 +10:00
Damien George
78bc31e294 tests/run-tests: Disable thread/stress_heap.py when running on Travis.
It has reliability issues and sometimes fails on Travis (reason currently
unknown).
2016-08-25 14:06:40 +10:00
Matt Brejza
5af6184e72 stmhal: Make ADC channel 16 available on L4 MCUs. 2016-08-25 13:49:51 +10:00
Scott Shawcroft
3cb4938c63 atmel-samd: Support Digital IO pins.
Also bumps up the heap size.
2016-08-24 17:38:08 -07:00
Scott Shawcroft
dade18bddf CODECONVENTIONS.md: Fix typos. 2016-08-24 13:19:25 -07:00
Scott Shawcroft
258804ab16 atmel-samd: Add limited time module support. 2016-08-24 13:17:55 -07:00
Paul Sokolovsky
c428367543 extmod/modubinascii: Make crc32() support configurable.
Disable by default, enable in unix port.
2016-08-24 18:28:43 +03:00
Pavol Rusnak
39799f7564
extmod/modubinascii: implement binascii.crc32 2016-08-24 10:42:46 +02:00
Scott Shawcroft
0c4f9b878a Enable REPL over USB.
All of the code was there except the linker was failing to clear the bss section because I added too many .zeros. The should have only been the exported globals that start with _ like _szero = .. Fixing that and turn on the usb transmit fixed everything.
2016-08-24 00:14:11 -07:00
Scott Shawcroft
386ab580cd Change the board information used in the header to be board specific. 2016-08-23 17:36:29 -07:00
Scott Shawcroft
dea22b0b5d Merge remote-tracking branch 'micropython/master' 2016-08-23 16:51:47 -07:00
Scott Shawcroft
9485634d41 Add support for REPL on Arduino Zero through EDBG via UART. 2016-08-23 16:47:53 -07:00
Krzysztof Blazewicz
6562076454 py/stream.c: use mp_obj_get_type in mp_get_stream_raise
In current state `mp_get_stream_raise` assumes that `self_in` is an object
and always performs a pointer derefence which may cause a segfault.

This function shall throw an exception whenever `self_in` does not implement
a stream protocol, that includes qstr's and numbers.

fixes #2331
2016-08-24 01:33:31 +03:00
Krzysztof Blazewicz
5a5449d4eb extmod/modbtree: do CHECK_ERROR after __bt_seq()
In `btree_seq()`, when `__bt_seq()` gets called with invalid
`flags` argument it will return `RET_ERROR` and it won't
initialize `val`. If field `data` of uninitialized `val`
is passed to `mp_obj_new_bytes()` it causes a segfault.
2016-08-24 01:31:16 +03:00
Scott Shawcroft
8f26d181c3 Blinking the LED works. Clocks should be set up correctly.
Everything works fine without USB being plugged in but faults (I think) when USB is plugged in. This is switched away from the USB code from the bootloader onto the USB code thats generated by Atmel Studio using the high level classes from ASF.
2016-08-22 23:53:11 -07:00
Scott Shawcroft
a5f6cb3c57 Compiled and linked SAMD21x18 version successfully. 2016-08-22 23:53:10 -07:00
Dave Hylands
253e1a6f67 teensy: Fix execution of frozen boot.py and main.py 2016-08-22 12:31:33 +10:00
Damien George
d2d9dfcd40 stmhal: Remove obsolete code for special handling of TIM3 irq settings.
TIM3 is no longer special, or at least does not have special IRQ settings.
2016-08-22 12:24:49 +10:00
Dave Hylands
c6983e3ce0 stmhal: Fix timer capture/compare interrupt handling for TIM1 and TIM8.
It turns out that TIM1 and TIM8 have their own Capture/Compare
interrupt vector. For all of the other timers, the capture/compare
interrupt vector is the same as the update vector.

So we need to add handlers for these vectors and enable them
when using capture/compare callbacks.

During testing of this, I also found that passing a channel callback
into the channel constructor would not enable interrupts properly.

I tested using:
```
>>> pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end=''))
```
I tested the above with channels 1, 4, and 8
2016-08-22 12:18:04 +10:00
Paul Sokolovsky
f2a21a2489 esp8266/esp_mphal: No longer disable watchdog on startup.
Disabling it was an omission from early development stages.
2016-08-20 16:33:04 +03:00
Radomir Dopieralski
d076fae219 esp8266/modmachinespi: Add a factory method for SoftSPI/HSPI 2016-08-19 21:19:59 +03:00
Radomir Dopieralski
8e7dfea803 esp8266/modpybhspi: Add a HSPI module for hardware SPI support
This module uses ESP8266's SPI hardware, which allows much higher
speeds. It uses a library from
https://github.com/MetalPhreak/ESP8266_SPI_Driver
2016-08-19 21:19:59 +03:00
Paul Sokolovsky
49dd532180 extmod/uzlib/: Update uzlib to v2.0.2.
Consistently use stdint types. Fixes stmhal build.
2016-08-17 14:47:30 +03:00
Damien George
64c5a9435c docs/library/machine.WDT: Add note that WDT is only available on WiPy. 2016-08-17 14:22:39 +10:00
Damien George
567e7fcd12 tests/run-tests: Disable thread/thread_lock4.py on Travis.
It has reliability issues that need to be worked out.
2016-08-17 13:48:09 +10:00
Paul Sokolovsky
244332df9f extmod/uzlib/: Update uzlib to v2.0.1.
Fixes for pedantic compiler warnings.
2016-08-17 06:24:12 +03:00
Paul Sokolovsky
a6fc90f92a tests/uzlib_decompress: Actually test raw DEFLATE stream. 2016-08-17 06:10:16 +03:00
Paul Sokolovsky
ed4ce196ed extmod/moduzlib: Refactor to new stream-compatible uzlib 2.0 API. 2016-08-17 06:06:34 +03:00
Paul Sokolovsky
ff1c2b03a9 extmod/uzlib/: Update uzlib to v2.0.
New API supporting stream decompression.
2016-08-17 06:06:33 +03:00
Damien George
bb19e7b94b tests/basics/special_methods: Enable tests for extra special methods.
These additional special methods are enabled on most ports so we can test
them in this test.
2016-08-17 12:38:19 +10:00
Damien George
f003310dee qemu-arm: Enable MICROPY_PY_ALL_SPECIAL_METHODS.
The qemu-arm port is for testing, so should have features enabled.
2016-08-17 12:37:28 +10:00
rguillon
ed6a1ada24 tests/basics: Add a test file for overriding special methods. 2016-08-17 12:11:32 +10:00
Paul Sokolovsky
d2cc7c720b extmod/modwebrepl: set_password(): Raise exception for too long password. 2016-08-16 17:02:04 +03:00
Damien George
095e43a9a5 py/sequence: Allow to use bignums as indices in slice objects.
See issue #2264.
2016-08-15 23:26:34 +10:00