Paul Sokolovsky
fcff4663dd
unix: Allow -X heapsize= option take numbers with K & M suffixes.
For kilobytes and megabytes respectively.
10 years ago
Damien George
8204db6831
stmhal: Change fresh boot.py and main.py to use \r\n newlines.
This is so it's compatible with Windows.
10 years ago
Damien George
21dfd207ca
stmhal: Fill in USB class/subclass/proto for CDC+HID device.
Also change HID device from keyboard to mouse (should have been mouse
all along).
10 years ago
Felix Domke
a64d5d67b5
USB CDC ACM: populate bFunction{Class,SubClass,Protocol} in the interface association descriptor
10 years ago
Damien George
0b13f3e026
py: Improve memory usage debugging; better GC AT dumping.
In unix port, mem_info(1) now prints pretty GC alloc table.
10 years ago
Damien George
564963a170
py: Fix debug-printing of bytecode line numbers.
Also move the raw bytecode printing code from emitglue to mp_bytecode_print.
10 years ago
Damien George
d00d8ac95c
py: Use mp_uint_t where appropriate in stream functions.
10 years ago
Damien George
e294bee45b
stmhal: Use stream's readinto.
10 years ago
Damien George
e5b1b7348a
stmhal: Fix pin af definition: TIM2_CH1_ETR -> TIM2_CH1/TIM2_ETR.
10 years ago
Paul Sokolovsky
e2f8d98525
stream: Add optional 2nd "length" arg to .readinto() - extension to CPython.
While extension to file.readinto() definition of CPython, the additional arg
is similar to what in CPython available in socket.recv_into().
10 years ago
Damien George
185cb0d943
stmhal: Use OSError with POSIX error code for HAL errors.
Addresses issue #921 .
10 years ago
Damien George
e7bb0443cd
py: Properly free string parse-node; add assertion to gc_free.
10 years ago
Damien George
dd4f4530ab
py: Add builtin memoryview object (mostly using array code).
10 years ago
Damien George
3aa09f5784
py: Use MP_OBJ_NULL instead of NULL in a few places.
10 years ago
Damien George
37378f8a9d
py: Clean up edge cases of malloc/realloc/free.
10 years ago
Damien George
f5d69794a8
extmod: Add uheapq module.
10 years ago
Damien George
e72be1b999
py: Fix smallint modulo with negative arguments.
Addresses issue #927 .
10 years ago
Damien George
5fc42a6c97
tools, pydfu: Some fixes to support Python 3.
10 years ago
Dave Hylands
842210f53a
Add pydfu.py to the micropython tree. Use dfu_util bgy default
You can do:
make USE_PYDFU=1 deploy
to use pydfu.py
10 years ago
Damien George
e7a478204a
py: Remove unused and unneeded SystemError exception.
It's purpose is for internal errors that are not catastrophic (ie not as
bad as RuntimeError). Since we don't use it, we don't need it.
10 years ago
Damien George
efa04eafd3
stmhal: Add MMA_INT/PB2 to available pins on PYBV10.
This allows you to register ExtInt on the MMA interrupt pin.
10 years ago
Dave Hylands
d46a822262
Fixed TIM2_CH1 definition.
TIM2_CH1_ETR is really bundling 2 functions to the same pin:
TIM2_CH1 (where its used as a channel)
TIM2_ETR (where iss used as an external trigger).
I fixed most of these a while back, but it looks like I missed this one.
10 years ago
Damien George
3be6984b8f
stmhal: Don't return SystemExit value from parse_compile_execute.
There is no need, since we don't (currently) use the value.
10 years ago
Dave Hylands
8d62bbd46a
Add pyb.hard_reset, and make sys.exit() or raise SystemExit do a soft reset.
10 years ago
Damien George
3e42570538
stmhal: Change cc3k.recv to only make 1 call to underlying recv().
Also make cc3k.send and cc3k.recv independent functions (not wrapped by
stream write/read). Also make wiznet5k.recv more memory efficient.
This might address issue #920 .
10 years ago
Damien George
481d714bd5
stmhal: Overhaul UART class to use read/write, and improve it.
UART object now uses a stream-like interface: read, readall, readline,
readinto, readchar, write, writechar.
Timeouts are configured when the UART object is initialised, using
timeout and timeout_char keyword args.
The object includes optional read buffering, using interrupts. You can set
the buffer size dynamically using read_buf_len keyword arg. A size of 0
disables buffering.
10 years ago
Damien George
20f59e182e
py: Make mp_const_empty_bytes globally available.
10 years ago
Damien George
b1e217222e
Merge pull request #922 from swegener/for-upstream
stmhal: Set entry point for ELF binary debugging
10 years ago
stijn
a3efe04dce
Use mode/encoding kwargs in io and unicode tests
mode argument is used to assert it works
encoding argument is used to make sure CPython uses the correct encoding
as it does not automatically use utf-8
10 years ago
stijn
2fe4cf7761
Implement kwargs for builtin open() and _io.FileIO
This makes open() and _io.FileIO() more CPython compliant.
The mode kwarg is fully iplemented.
The encoding kwarg is allowed but not implemented; mainly to allow
the tests to specify encoding for CPython, see #874
10 years ago
Sven Wegener
abf0f07a5a
stmhal: Set entry point for ELF binary debugging
When loading the ELF binary to the board with a debugger, the debugger
needs to know at which point to start executing the code. Currently the
entry point defaults to the start of the .text section.
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
10 years ago
Damien George
072bd07f17
stmhal: Add retry to SD card init.
This fixed an issue with a certain SD card sometimes not initialising
first time round. See issue #822 for related, and thanks to
@iabdalkader for the idea.
10 years ago
Damien George
0c3955b506
examples: Update conwaylife to work with new LCD API.
10 years ago
Damien George
21ca2d76a2
py: Partially fix viper multi-comparison; add test for it.
10 years ago
Damien George
9c9db3a7a1
tools, pyboard.py: Allow exec argument to be bytes or str.
10 years ago
Paul Sokolovsky
1a55b6a787
unix, stmhal: Implement file.readinto() method.
Also, usocket.readinto(). Known issue is that .readinto() should be available
only for binary files, but micropython uses single method table for both
binary and text files.
10 years ago
Damien George
c92672d7f8
unix: Make -c option parse input script as a file, as per CPython.
Addresses issue #915 .
10 years ago
Damien George
b7a4b0f86f
py: Improve stream_read so it doesn't need to alloc 2 bits of heap.
10 years ago
Paul Sokolovsky
297d8469b8
modure: Update to re1.5 v0.6.1, fixed and extended character class support.
10 years ago
Damien George
391db8669b
py: Add more compiler optimisations for constant if/while conditions.
10 years ago
Damien George
235f9b33c8
py: Simplify compilation of elif blocks.
10 years ago
Damien George
9870fdd4b0
tests: Add test for nested while with exc and break.
10 years ago
Damien George
c30595eb1b
py: Add more debug printing code in gc_dump_alloc_table.
10 years ago
Damien George
090c9236e8
py: Fix compiling of nested while/for and exception handler.
Addresses issue #912 .
10 years ago
Damien George
37ada236b3
py: Take gc_pool_start out of bss section, to reclaim 1st block of heap.
10 years ago
Paul Sokolovsky
923a8a8320
stream: Handle non-blocking errors in readline() properly.
Just like they handled in other read*(). Note that behavior of readline()
in case there's no data when it's called is underspecified in Python lib
spec, implemented to behave as read() - return None.
10 years ago
Paul Sokolovsky
0c7b26c0f8
stream: Return errno value as first arg of OSError exception.
This is CPython-compatible convention established yet in acb13886fc
.
10 years ago
Paul Sokolovsky
067ae1269d
objclosure: Fix printing of generator closures.
The code previously assumed that only functions can be closed over.
10 years ago
Damien George
9b0b373e5e
py: Fix GC realloc issue, where memory chunks were never shrunk.
Previously, a realloc to a smaller memory chunk size would not free the
unused blocks in the tail of the chunk.
10 years ago
Damien George
4859edb95b
py: Fix dummy definition of BEGIN/END_ATOMIC_SECTION.
10 years ago