aboutsummaryrefslogtreecommitdiff
path: root/stmhal
AgeCommit message (Collapse)Author
2015-03-04stmhal: Include fatfs headers using lib/fatfs prefix.Damien George
This helps make files reusable across other ports.
2015-03-02stmhal: Enable MICROPY_PY_ARRAY_SLICE_ASSIGN.Damien George
2015-03-01stmhal: Add I2S2EXT and I2S3EXT constants to stm module.Damien George
2015-02-27py: Use m_{new,renew,del} consistently.Damien George
This is so all memory requests go through the same interface.
2015-02-23stmhal: Reset state of timer when deinit is called.Damien George
2015-02-22stmhal: Fix problem when passing callback= to timer init function.Dave Hylands
In particular, make sure that the globals are all initialized before enabling the interrupt, and also make sure that the timer interrupt has been initialied before enabling the NVIC.
2015-02-22py: Make math special functions configurable and disabled by default.Damien George
The implementation of these functions is very large (order 4k) and they are rarely used, so we don't enable them by default. They are however enabled in stmhal and unix, since we have the room.
2015-02-22lib/libm: Add implementations of erf, erfc, lgamma, tgamma.Damien George
2015-02-22stmhal: For UART, check that baudrate is within 5% of desired value.Damien George
Also includes documentation about minimum baudrate. Addresses issue #1090.
2015-02-15stmhal: Add support for CAN rx callbacks.Henrik Sölver
2015-02-13stmhal: Fix setting of VID.Damien George
2015-02-13stmhal: Add uart.sendbreak() method, to send a break condition.Damien George
2015-02-13minimal: Allow to compile without defining MICROPY_HAL_H.Damien George
2015-02-13stmhal: Make pybstdio usable by other ports, and use it.Damien George
Now all ports can use pybstdio.c to provide sys.stdin/stdout/stderr, so long as they implement mp_hal_stdin_* and mp_hal_stdout_* functions.
2015-02-13stmhal: Remove obsolete usbdev file.Damien George
2015-02-13stmhal: Coding style cleanup in usbd_cdc_msc_hid.c.Damien George
2015-02-13stmhal: Properly define pyb.usb_mode() semantics.Damien George
2015-02-13stmhal: Put CDC last in config descriptors to match with iface nums.Damien George
Apparently the order of interface numbers should be sequential and increasing in a config descriptor. So as to retain compatibility with Windows drivers for the CDC+MSC and CDC+HID modes, we move the CDC configs to the end of the descriptors, instead of changing the interface numbers. See PR #957 for background.
2015-02-13stmhal: Add "CDC" option to pyb.usb_mode, for CDC device only.Damien George
2015-02-13stmhal: Add Python-configurable USB HID mode.Damien George
Different HID modes can be configured in Python. You can either use predefined mouse or keyboard, or write your own report descriptor.
2015-02-13stmhal: Remove unused usbdev files, and move used ones up a dir.Damien George
The unused files are from the ST demos for different USB classes and are not needed for the stmhal port.
2015-02-13stmhal: Properly deinit timer object.Damien George
Addresses issue #1113.
2015-02-11stmhal: Fix ADC multiplier from 4096 to 4095; optimise fp operation.Damien George
2015-02-10stmhal: Add boot.py and main.py to qstr definitions, to save some RAM.Damien George
2015-02-08stmhal: Change type of received chr from char to int.Damien George
2015-02-07py: Protect mp_parse and mp_compile with nlr push/pop block.Damien George
To enable parsing constants more efficiently, mp_parse should be allowed to raise an exception, and mp_compile can already raise a MemoryError. So these functions need to be protected by an nlr push/pop block. This patch adds that feature in all places. This allows to simplify how mp_parse and mp_compile are called: they now raise an exception if they have an error and so explicit checking is not needed anymore.
2015-02-06stmhal/adc.c: Fix calculation of read_core_vref()blmorris
There was a stray factor of 2 (VBAT_DIV) that looks like it was copied incorrectly from the read_core_vbat() function. The factor exists in read_core_vbat() because VBAT is measured through a 2:1 voltage divider. read_core_vref now returns values around 1.21V (assuming that external reference voltage is 3.3V) which is in line with the datasheet values. See comment at http://forum.micropython.org/viewtopic.php?f=6&t=533&p=2991#p2991
2015-01-29py: Change vstr_null_terminate -> vstr_null_terminated_str, returns str.Damien George
2015-01-28py: Change vstr so that it doesn't null terminate buffer by default.Damien George
This cleans up vstr so that it's a pure "variable buffer", and the user can decide whether they need to add a terminating null byte. In most places where vstr is used, the vstr did not need to be null terminated and so this patch saves code size, a tiny bit of RAM, and makes vstr usage more efficient. When null termination is needed it must be done explicitly using vstr_null_terminate.
2015-01-28stmhal: Remove unnecessary #include "systick.h" from pyexec.c.Damien George
Makes pyexec.c more re-usable for other ports.
2015-01-24stmhal: Disable MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE.Damien George
It uses RAM and on pyboard we are generally tight on RAM, so disable this optimisation for general builds. If users need the speed then they can build their own version. Maybe in the future we can have different versions of pyboard firmware built with different tradeoffs.
2015-01-24stmhal: Bug fix for usocket's accept and setsockopt methods.Damien George
accept might raise an exception, in which case the new socket is not fully created. It has a finaliser so will run close() method when GC'd. Before this patch close would try to close an invalid socket. Now fixed. setsockopt took address of stack value which became out of scope. Now fixed.
2015-01-22lib/libm: Add frexp and modf functions; use in stmhal; add tests.Damien George
Addresses issue #1081.
2015-01-22stmhal: Make CC3K object static, so it's only registered once as NIC.Damien George
2015-01-22stmhal: Put mod_network_nic_list in global root-pointer state.Damien George
It needs to be scanned by GC. Thanks to Daniel Campora.
2015-01-21py: Remove mp_obj_str_builder and use vstr instead.Damien George
With this patch str/bytes construction is streamlined. Always use a vstr to build a str/bytes object. If the size is known beforehand then use vstr_init_len to allocate only required memory. Otherwise use vstr_init and the vstr will grow as needed. Then use mp_obj_new_str_from_vstr to create a str/bytes object using the vstr memory. Saves code ROM: 68 bytes on stmhal, 108 bytes on bare-arm, and 336 bytes on unix x64.
2015-01-21stmhal: Add support for FEZ Cerb40 II board from ghielectronics.com.Dave Hylands
2015-01-20py, unix, stmhal: Allow to compile with -Wshadow.Damien George
See issue #699.
2015-01-16pyexec: Add event-driven variant pyexec_friendly_repl().Paul Sokolovsky
pyexec_friendly_repl_process_char() and friends, useful for ports which integrate into existing cooperative multitasking system. Unlike readline() refactor before, this was implemented in less formal, trial&error process, minor functionality regressions are still known (like soft&hard reset support). So, original loop-based pyexec_friendly_repl() is left intact, specific implementation selectable by config setting.
2015-01-12py: Can compile with -Wmissing-declarations and -Wmissing-prototypes.Damien George
2015-01-12stmhal: Add MICROPY_HW_USB_OTG_ID_PIN config, set for relevant boards.Damien George
This config option is for the USB OTG pin, pin A10. This is used on some boards but not others. Eg PYBv3 uses PA10 for LED(2), so it shouldn't be used for OTG ID (actually PA10 is multiplexed on this board, but defaults to LED(2)). Partially addresses issue #1059.
2015-01-12stmhal: Move readline code to lib/mp-readline/.Paul Sokolovsky
2015-01-10py: Add config option MICROPY_COMP_MODULE_CONST for module consts.Damien George
Compiler optimises lookup of module.CONST when enabled (an existing feature). Disabled by default; enabled for unix, windows, stmhal. Costs about 100 bytes ROM on stmhal.
2015-01-09stmhal: Reclaim 72 bytes of stack by factoring out flash init code.Damien George
2015-01-09py: Add MICROPY_PY_MICROPYTHON_MEM_INFO to enable mem-info funcs.Damien George
This allows to enable mem-info functions in micropython module, even if MICROPY_MEM_STATS is not enabled. In this case, you get mem_info and qstr_info but not mem_{total,current,peak}.
2015-01-09py: Disable stack checking by default; enable on most ports.Damien George
2015-01-08stmhal: Allow to build without float support if wanted.Damien George
2015-01-07stmhal: Add MICROPY_HW_USB_VBUS_DETECT_PIN option, for boards without itDamien George
Since all currently supported boards use pin A9 for this function, the value of the macro MICROPY_HW_USB_VBUS_DETECT_PIN is not actually used, just the fact that it is defined. Addresses issue #1048.
2015-01-07stmhal: Collect all root pointers together in 1 place.Damien George
A GC in stmhal port now only scans true root pointers, not entire BSS. This reduces base GC time from 1700ms to 900ms.
2015-01-07py: Add option to cache map lookup results in bytecode.Damien George
This is a simple optimisation inspired by JITing technology: we cache in the bytecode (using 1 byte) the offset of the last successful lookup in a map. This allows us next time round to check in that location in the hash table (mp_map_t) for the desired entry, and if it's there use that entry straight away. Otherwise fallback to a normal map lookup. Works for LOAD_NAME, LOAD_GLOBAL, LOAD_ATTR and STORE_ATTR opcodes. On a few tests it gives >90% cache hit and greatly improves speed of code. Disabled by default. Enabled for unix and stmhal ports.