Damien George
46239413d0
stm: Implement mp_import_stat.
To follow up pull request #309 .
11 years ago
Paul Sokolovsky
4aee119f94
stm: Initialize sys.path with ["0:/", "0:/src", "0:/lib"].
This is compatible with what search path was before sys.path refactor,
with addition of module library path ("0:/lib").
11 years ago
mux
d0ffda91cc
Fix usart_obj_tx_char
11 years ago
Dave Hylands
90928f1194
Fix build for netduino and stm32f4disc
11 years ago
Damien George
402dc31aa7
stm: Factor out GPIO code to its own file. Add functions to set GPIO mode.
GPIO functions are crude, and need to be replaced with better ones!
11 years ago
Damien George
2abbae3419
stm: Rename mma -> accel.
11 years ago
Damien George
754a8dd827
stm: Put REPL functions in own file; add raw REPL mode.
Raw REPL mode is activated by CTRL-A, and allows you to more easily
communicate with the pyboard over the serial channel. In particular,
automated communication using, eg, pyserial on the PC side.
11 years ago
Paul Sokolovsky
44739e280e
Make DEBUG_printf() a proper function, implementation is port-dependent.
In particular, unix outputs to stderr, to allow to run testsuite against
micropython built with debug output (by redirecting stderr to /dev/null).
11 years ago
Damien George
8bb11171da
stm: Only define __packed if not already defined.
Addresses issue #299 .
11 years ago
Damien George
c5966128c7
Implement proper exception type hierarchy.
Each built-in exception is now a type, with base type BaseException.
C exceptions are created by passing a pointer to the exception type to
make an instance of. When raising an exception from the VM, an
instance is created automatically if an exception type is raised (as
opposed to an exception instance).
Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper.
Handling of parse error changed to match new exceptions.
mp_const_type renamed to mp_type_type for consistency.
11 years ago
Damien George
a71c83a1d1
Change mp_obj_type_t.name from const char * to qstr.
Ultimately all static strings should be qstr. This entry in the type
structure is only used for printing error messages (to tell the type of
the bad argument), and printing objects that don't supply a .print method.
11 years ago
Damien George
70d7a83c74
stm: If SD card inserted on hard reset, it is the medium for USB MSD.
11 years ago
Damien George
099a9cb575
Remove mp_obj_new_exception_msg_1_arg and _2_arg.
11 years ago
Damien George
780ba22bb8
stm: Copy COPT style from unix port.
11 years ago
Damien George
9d324b0ac7
stm: Add specific UINT_FMT and INT_FMT.
For some reason, STM port, while it's 32 bit, needs %lu and %ld for
printing machine_uint_t and machine_int_t.
11 years ago
Paul Sokolovsky
20632e4d3f
stm: Provide malloc()/realloc()/free(), as forwarding to gc_*() functions.
Note: none of these functions are used by STM port, so they're provided
to have parity with pre gc refactor status quo, and in case they will be
needed in the future by some extension writers.
11 years ago
Paul Sokolovsky
b62c30b4bc
Generalize malloc-via-gc-heap support, make it available to unix port.
11 years ago
Paul Sokolovsky
287d9620fc
Enable link map file generation.
11 years ago
Damien George
181d190643
stm: Remove unused, useless and not-to-be-used strndup.
Addresses issue #275 .
11 years ago
Damien George
ed378cd12f
stm: Tidy up memory labels; optimise GC root scanning.
Addresses issues #272 and #273 .
11 years ago
Paul Sokolovsky
58ff93bc7c
Get rid of calloc().
If there's malloc and memset, then there's no need for calloc, especially if
we need to implement it ourselves.
11 years ago
Damien George
698ec21e46
Make mp_obj_str_get_data return char* instead of byte*.
Can't decide which is better for string type, char or byte pointer.
Changing to char removes a few casts. Really need to do proper unicode.
11 years ago
Damien George
23177088d2
stm: Mount SD card on 1:/ if present.
If SD card is present on (soft) reset then it's mounted on 1:/ and files
can be openned using, eg, open('1:/test.txt', 'r'), or 'w' for writing.
11 years ago
Damien George
354d15a964
Implement fixed buffer vstrs; use them for import path.
11 years ago
Damien George
e09ffa1400
Search paths properly on import and execute __init__.py if it exists.
11 years ago
Paul Sokolovsky
9110896063
Remove older import helpers, no longer used.
11 years ago
Dave Hylands
1570a96cad
Initial support for Netduino
This also fixes up the IRQ for the PYBOARD4 USERSW
although I was unable to test that functionality.
11 years ago
Damien George
01156d510c
stm: Add support for ctrl-C to interrupt running Python.
Using PendSV interrupt at lowest priority, code can now raise an
exception during an interrupt by calling pendsv_nlr_jump. The exception
will be raised when all interrupts are finished. This is used to trap
ctrl-C from the USB VCP to break out of running Python code.
11 years ago
mux
565fdccfd2
Add usb_vcp_connected prototype to usb.h
11 years ago
mux
b2269b610e
Detect VCP line state.
* Detect VCP line state, based on SET_CONTROL_LINE_STATE request
11 years ago
Damien George
39631bc312
Fix Makefiles: -O3 option was not being applied; mkdir for STM.
11 years ago
Damien George
2d15c1216d
stm: Add optional memory debugging output.
11 years ago
Damien George
01fa4a9164
stm: Fix gccollect ram range.
11 years ago
mux
bfb01e9da6
Fix unused function warning in main
* Add SD card test to fix warning
11 years ago
mux
8592d85b36
Remove redundant include in file.c
* Remove include mpconfigport.h from file.c
11 years ago
mux
76a6335b6e
Move HEAP_END and RAM_END to linker script
* Issue #232
11 years ago
Damien George
217814cc63
stm: Increase timeout for RTC LSE startup; use backup regs.
11 years ago
Damien George
42647e64db
stm: Remove unneccesary include of mpconfigport (already in mpconfig).
11 years ago
mux
8d3b0a9f74
Add LCD check to stdout_print_strn
11 years ago
mux
bd61a6cee8
Add missing LCD driver definitions for STM32F4DISC
* Add missing LCD definitions for STM32F4DISC target, current code
breaks build.
11 years ago
Damien George
75abee206d
stm: USB host mode working! Restructure stm library directories.
11 years ago
Damien George
51f3a6becd
stm: Improved ADC module; add BOARD_NAME config value.
11 years ago
Damien George
b829b5caec
Implement mp_parse_node_free; print properly repr(string).
11 years ago
Damien George
449dd0a69e
stm: Put gc_collect code in separate file; define _ram_start in .ld.
To partly address Issue #220 .
11 years ago
Damien George
0004a84ec0
Revert "Move gc_collect to py/gc.c"
This reverts commit a215b09c0d
.
11 years ago
mux
a215b09c0d
Move gc_collect to py/gc.c
* Move gc_collect from main to py/gc.c
* Define GC's memory boundaries in linker script
* Issue #220
11 years ago
Dave Hylands
c89c681a9f
Rework makefiles. Add proper dependency checking.
11 years ago
mux
40048adabc
Move file obj to separate module
11 years ago
Damien George
3257d3543b
stm: Remove unnecessary #includes; small other changes.
11 years ago
mux
45ad9b405d
Move LED defs to mpconfigport.h
11 years ago