Paul Sokolovsky
e1b1abc1e8
stream: Revert to checking for the correct error value.
10 years ago
Damien George
de993f4573
Merge pull request #766 from dhylands/allow-dfu-override
Allow DFU_UTIL to be overridden from the environment.
10 years ago
Damien George
7cfae9693b
Merge pull request #746 from blmorris/master
Enable 16-bit memory addresses for i2c.mem_read and i2c_mem_write
10 years ago
Damien George
3e0bce3587
Merge pull request #767 from dhylands/fix-short-read
Deal with reading a buffer less than what was allocated.
10 years ago
blmorris
7a03b5f56a
remove Myriad2 board config files from master
10 years ago
blmorris
86f0b31bcf
Change boolean 'use_16bit_addr' to int 'addr_size', can be either 8 or 16 bits, default value is 8
to maintain compatibility with existing code.
10 years ago
Dave Hylands
1d8816c36b
Deal with reading a buffer less than what was allocated.
With this fix, file_long_read now passes.
10 years ago
Dave Hylands
a2e7a1315d
Allow DFU_UTIL to be overridden from the environment.
10 years ago
Paul Sokolovsky
512465bc66
tests: Add testcase for read by length past EOF.
Currently broken for unicode input streams.
10 years ago
blmorris
721d6240c9
Merge https://github.com/blmorris/micropython into Myriad2
10 years ago
blmorris
4038f513ea
Merge https://github.com/micropython/micropython
10 years ago
Damien George
951ed9d02f
stmhal: Fix REPL printing by cooking output sent to stdout_obj.
Recent changes to builtin print meant that print was printing to the
mp_sys_stdout_obj, which was sending data raw to the USB CDC device.
The data should be cooked so that \n turns into \r\n.
10 years ago
Damien George
1163cb9cb5
stmhal: Change calls to pfenv_printf to pfenv_vprintf.
Fixes printing bugs introduced by
cb66f41ebc
.
10 years ago
Paul Sokolovsky
cb66f41ebc
py: Make print() accept "file" argument, and actually print to stream.
And not system printf(), like it was before. For this, move pfenv_printf()
from stmhal port to py/.
10 years ago
Damien George
04c9fec7d1
Merge pull request #757 from stinos/windows-fsync
Add fsync for windows, i.e. _commit. See dce8876
10 years ago
Damien George
2c0701101b
Merge pull request #759 from micropython/unicode-read-chars
py: Add stream reading of n unicode chars; unicode support by default.
10 years ago
Damien George
1694bc733d
py: Add stream reading of n unicode chars; unicode support by default.
With unicode enabled, this patch allows reading a fixed number of
characters from text-mode streams; eg file.read(5) will read 5 unicode
chars, which can made of more than 5 bytes.
For an ASCII stream (ie no chars > 127) it only needs to do 1 read. If
there are lots of non-ASCII chars in a stream, then it needs multiple
reads of the underlying object.
Adds a new test for this case. Enables unicode support by default on
unix and stmhal ports.
10 years ago
Damien George
02bc882c3d
stmhal: Add file.flush and os.stat.
10 years ago
blmorris
0f4ee2e44a
Merge https://github.com/micropython/micropython
10 years ago
Damien George
5467186b0e
py: Remove unnecessary argument in bytearray print.
10 years ago
Paul Sokolovsky
e3737b858a
formatfloat.c: Typo fix in comment.
10 years ago
Damien George
a4022c92f0
py, inline asm: Change "and" op name to "and_" to avoid keyword clash.
Addresses issue #753 .
10 years ago
Damien George
a50494ab68
Merge pull request #755 from dhylands/teensy-core
Add teensy core files and use same toolchain as stmhal
10 years ago
Damien George
db56ad2915
Merge pull request #754 from dhylands/fix-teensy
Fix teensy to build on latest tree.
10 years ago
stijn
73ab8cc21d
Add fsync for windows, i.e. _commit. See dce8876
10 years ago
blmorris
ef204733d6
Initial commit of Myriad2 board-specific configuration files
10 years ago
blmorris
0429d35f37
Merge https://github.com/micropython/micropython
10 years ago
Dave Hylands
04f5ae1d1c
Add core files and use same toolchain as stmhal
11 years ago
Dave Hylands
4d9dd26818
Fix teensy to build on latest tree.
Put #include of mpconfig.h before misc.h
Replace uses of ARRAY_SIZE with MP_ARRAY_SIZE
10 years ago
Paul Sokolovsky
dce8876dbe
unix: file: No fsync() on Windows.
10 years ago
Paul Sokolovsky
ac736f15c9
stream: Factor out mp_stream_write() method to write a memstring to stream.
10 years ago
Paul Sokolovsky
122c9db3db
unix: file: Implement .flush() method.
This method apparently should be part of stream interface.
10 years ago
Paul Sokolovsky
a1760a56ff
test: Add run-tests-exp.sh, script to run testsuite with only sh dependency.
This script uses expected test results as generated by run-tests --write-exp,
and requires only standard unix shell funtionality (no bash). It is useful
to run testsuite on embedded systems, where there's no CPython and Bash.
10 years ago
Paul Sokolovsky
b82f34edde
unix: Allow to disable MICROPY_EMIT_X64 from commandline.
emitnative in particular requires nlr_* to be real functions, so doesn't
compile with MICROPY_NLR_SETJMP=1.
10 years ago
Paul Sokolovsky
2cf381081a
run-tests: Add option to write CPython's test results to .exp files.
Mostly to run testsuite on targets which doesn't have CPython.
10 years ago
Paul Sokolovsky
564e46452d
py: Add generic helper to align a pointer.
10 years ago
Paul Sokolovsky
58c9586c34
emitbc: Fix structure field alignment issue.
dummy_data field is accessed as uint value (e.g.
in emit_write_bytecode_byte_ptr), but is not aligned as such, which causes
bus errors or incorrect behavior on any arch requiring strictly aligned
data (ARM pre-v7, MIPS, etc, etc).
10 years ago
blmorris
847a6b30b1
Incorporate stylistic changes suggested by @dhylands
10 years ago
blmorris
e687fdbcbc
Add keyword argument 'memaddr_use_16b' to i2c.mem_read and mem_write methods
to allow these methods to transmit 16 bit addresses to an i2c device
Add 'memaddr_use_16b' to qstrdefsport.h
10 years ago
Paul Sokolovsky
2097c8b1e1
moductypes: Add symbolic constants to specify bitfield position/length.
10 years ago
Paul Sokolovsky
8215847b4d
moductypes: Foreign data interface module, roughly based on ctype ideas.
But much smaller and memory-efficient. Uses Python builtin data structures
(dict, tuple, int) to describe structure layout.
11 years ago
Damien George
42b6419056
Merge branch 'dhylands-fix-sdcard-read'
10 years ago
Damien George
594699bc88
stmhal: Protect SD_WriteBlocks by IRQ disable/enable pair.
10 years ago
Dave Hylands
90ba80dc36
Disable IRQs around sdcard reads.
Once the code switches to using DMA, this can be removed.
10 years ago
Paul Sokolovsky
5fa5ca40e6
binary: Factor out mp_binary_set_int().
10 years ago
Damien George
539681fffd
tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.
Addresses issue #727 .
10 years ago
Damien George
0182385ab0
py: Automatically ake __new__ a staticmethod.
Addresses issue #622 .
10 years ago
Paul Sokolovsky
4e0eeebdc2
py: Implement sys.maxsize, standard way to check platform "bitness".
Implementing it as a static constant is a bit peculiar and require cooperation
from long int implementation.
11 years ago
Damien George
381618269a
parser: Convert (u)int to mp_(u)int_t.
11 years ago
Damien George
54eb4e723e
lexer: Convert type (u)int to mp_(u)int_t.
11 years ago