Damien George
86a03044e3
stmhal: Add stdin/stdout/stderr objects.
...
Available via sys.std{in,out,err}. Basic reading and writing supported.
Even sys.stdin.readline!
2014-04-13 19:00:56 +01:00
Damien George
212f89e61a
stmhal: Improve USB CDC write function (increase timeout).
2014-04-13 16:39:04 +01:00
Damien George
73496fbbe4
py: Fix up source-line calculation.
...
Should address issue #475 .
2014-04-13 14:51:56 +01:00
Damien George
cb861a5c6a
stm[hal]: Init mp_sys_path and mp_sys_argv correctly.
2014-04-13 13:19:09 +01:00
Damien George
640e7e4779
Merge pull request #476 from pfalcon/static-sys
...
Convert sys module to static allocation
2014-04-13 12:52:39 +01:00
Damien George
8a1cab952f
py: Fix mp_get_buffer, and use it in more places.
...
Must use mp_obj_get_type to get the type of an object. Can't assume
mp_obj_t is castable to mp_obj_base_t.
2014-04-13 12:08:52 +01:00
Damien George
0aab675108
stmhal: Little hack to dump GC allocation table using pyb.info().
...
Pass a single parameter (doesn't matter what): pyb.info(1), will dump
the GC alloc table.
2014-04-13 11:10:58 +01:00
Paul Sokolovsky
4165cd1c0c
stmhal: Update for static mod sys.
2014-04-13 07:02:57 +03:00
Damien George
82c7b1b1d5
stmhal: Put a USB structure in ROM; GC doesn't scan the data segment.
2014-04-12 18:50:20 +01:00
Damien George
b96c7c03ca
stmhal: Move fatfs volume/partition lookup table to ROM.
2014-04-12 00:51:57 +01:00
Damien George
60427864b1
stmhal: Move I2C objects to ROM.
2014-04-12 00:51:41 +01:00
Damien George
037b3e0e21
Merge pull request #458 from lurch/patch-1
...
Tweak pybcdc.inf to match recent changes to pybcdc.h
2014-04-10 22:51:48 +01:00
Damien George
3f4898456b
stmhal: Add stm module, which contains some constants for the MCU.
...
Also contains raw memory read/write functions, read8, read16, read32,
write8, write16, write32. Can now do:
stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13)
This turns on the red LED.
With the new constant folding, the above constants for the GPIO address
are actually compiled to constants (and the addition done) at compile
time. For viper code and inline assembler, this optimisation will make
a big difference. In the inline assembler, using these constants would
not be possible without this constant folding.
2014-04-10 22:46:40 +01:00
Andrew Scheller
fec6f018ee
Tweak pybcdc.inf to match recent changes to pybcdc.h
2014-04-10 02:07:55 +01:00
Damien George
7a5f9e94ad
stmhal: Make /src/main.py just /main.py; allow SD to be used as root device.
2014-04-09 23:30:34 +01:00
Damien George
a5c18f3285
stmhal: Update windows driver; \r\n newlines and addition USB id.
2014-04-09 02:23:24 +01:00
Damien George
b99ca2cdde
stmhal: Add windows cdc .inf driver to flash filesystem.
2014-04-09 01:16:49 +01:00
Damien George
8e6f98b166
stmhal: Improve help() function.
2014-04-09 01:16:29 +01:00
Damien George
229347139b
stmhal: Add functionality to Servo object.
...
Can now calibrate, set pulse width, angle and speed.
2014-04-09 00:45:45 +01:00
Dave Hylands
3bbceeaaf7
Fix make-pins.py to support having multiple names for a pin.
...
SW and X17 now both map to PB3
2014-04-08 15:45:47 -07:00
Damien George
b04488151e
stmhal: Make USRSW re-register the EXTI callback each time it's set.
2014-04-08 22:35:42 +01:00
Damien George
2137bc7124
stmhal: in EXTI interrupt handler wrap uPy calls in gc_lock and nlr_buf.
2014-04-08 15:21:26 +01:00
Damien George
26cf55ae05
Add a check for NULL nlr_top in nlr_jump.
...
If no nlr_buf has been pushed, and an nlr_jump is called, then control
is transferred to nlr_jump_fail (which should bail out with a fatal
error).
2014-04-08 14:08:14 +00:00
Damien George
97790455fe
Improve REPL detecting when input needs to continue.
...
Full CPython compatibility with this requires actually parsing the
input so far collected, and if it fails parsing due to lack of tokens,
then continue collecting input. It's not worth doing it this way. Not
having compatibility at this level does not hurt the goals of Micro
Python.
2014-04-08 11:04:29 +00:00
Paul Sokolovsky
72d70cb045
unix, stmhal: Consistently use "FileIO" as class name for file objects.
...
They correspond to io.FileIO in io module hierarchy (with small caveat
that io.FileIO is raw file and works with bytes, not strings).
2014-04-08 04:08:16 +03:00