aboutsummaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)Author
2020-05-02extmod/modbtree: Retain reference to underlying stream so it's not GC'd.Damien George
For ports that have a system malloc which is not garbage collected (eg unix, esp32), the stream object for the DB must be retained separately to prevent it from being reclaimed by the MicroPython GC (because the berkeley-db library uses malloc to allocate the DB structure which stores the only reference to the stream). Although in some cases the user code will explicitly retain a reference to the underlying stream because it needs to call close() on it, this is not always the case, eg in cases where the DB is intended to live forever. Fixes issue #5940.
2020-04-30all: Fix auto-enable of MICROPY_GCREGS_SETJMP to select GC behaviour.Damien George
Only enable it if MICROPY_GCREGS_SETJMP is not already defined, and no supported architecture is defined.
2020-04-29all: Factor gchelper code to one place and use it for unix & ARM ports.Jim Mussared
No functionality change is intended with this commit, it just consolidates the separate implementations of GC helper code to the lib/utils/ directory as a general set of helper functions useful for any port. This reduces duplication of code, and makes it easier for future ports or embedders to get the GC implementation correct. Ports should now link against gchelper_native.c and either gchelper_m0.s or gchelper_m3.s (currently only Cortex-M is supported but other architectures can follow), or use the fallback gchelper_generic.c which will work on x86/x64/ARM. The gc_helper_get_sp function from gchelper_m3.s is not really GC related and was only used by cc3200, so it has been moved to that port and renamed to cortex_m3_get_sp.
2020-04-05all: Use MP_ERROR_TEXT for all error messages.Jim Mussared
2020-04-05py/dynruntime.mk: Set MICROPY_ENABLE_DYNRUNTIME instead of per module.Jim Mussared
So this setting could be used by other source files if needed.
2020-03-12examples/bluetooth: Replace "connectable" parameter with "adv_type".Thomas Friebel
Follow up to dd0bc26e65734b8a4fafa3769008e92e2ec6645d which changed the parameter list of the IRQ_SCAN_RESULT event. Adapt ble_temperature_central.py accordingly.
2020-03-03examples/natmod: Add .gitignore to ignore generated example .mpy files.Damien George
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28examples/bluetooth/ble_temperature_central.py: Shorten comment.Damien George
So the line length is less than 100 characters.
2020-02-28examples/accellog.py: Shift long comments to their own line.Damien George
To improve interaction with black formatter.
2019-12-19examples/natmod: Add very simple features0 example to compute factorial.Damien George
2019-12-18examples/network: Add testing key/cert to SSL HTTP server example.Damien George
This example will now work on all ports with networking and ssl support, with both axtls and mbedtls.
2019-12-13examples/natmod: Add urandom native module example.Damien George
2019-12-12examples/natmod: Add features1 and features2 examples.Damien George
2019-12-12examples/natmod: Add ure example.Damien George
2019-12-12examples/natmod: Add framebuf example.Damien George
2019-12-12examples/natmod: Add uzlib example.Damien George
2019-12-12examples/natmod: Add uheapq example.Damien George
2019-12-12examples/natmod: Add btree example.Damien George
2019-11-25examples/bluetooth: Add example for reading temperature sensor.Jim Mussared
2019-11-25examples/bluetooth: Add helpers for decoding advertising payloads.Jim Mussared
Extracts name and service UUID fields.
2019-11-11examples/embedding: Remove obsolete fatfs files from build.Damien George
2019-10-29examples/bluetooth/ble_uart_peripheral: Use append mode for RX char.Jim Mussared
2019-10-29examples/embedding: Replace symlink of mpconfigport.h with real file.Damien George
2019-10-22examples/bluetooth/ble_uart_peripheral.py: Add usage demo.Jim Mussared
2019-10-22examples/bluetooth: Use UUIDs directly to add services to adv payload.Jim Mussared
2019-10-18examples/bluetooth: Add basic BLE peripheral examples.Jim Mussared
Consisting of: - ble_advertising.py -- helper to generate advertising payload. - ble_temperature.py -- simple temperature device. - ble_uart_periperhal.py -- BLE UART wrapper. - ble_uart_repl.py -- dupterm-compatible uart.
2019-08-28py: Add global default_emit_opt variable to make emit kind persistent.Damien George
mp_compile no longer takes an emit_opt argument, rather this setting is now provided by the global default_emit_opt variable. Now, when -X emit=native is passed as a command-line option, the emitter will be set for all compiled modules (included imports), not just the top-level script. In the future there could be a way to also set this variable from a script. Fixes issue #4267.
2018-10-23examples/unix/ffi_example: Clean up and update the ffi example.Paul Sokolovsky
1. Use uctypes.bytearray_at(). Implementation of the "ffi" module predates that of "uctypes", so initially some convenience functions to access memory were added to ffi. Later, they landed in uctypes (which follows CPython's ctype module). So, replace undocumented experimental functions from ffi to documented ones from uctypes. 2. Use more suitable type codes for arguments (e.g. "P" (const void*) instead of "p" (void*). 3. Some better var naming. 4. Clarify some messages printed by the example.
2018-09-14examples/embedding: Fix hard-coded MP_QSTR_ value.Damien George
2018-09-14examples/embedding: Fix reference to freed memory, lexer src name.Dave Hylands
This issue was brought up by BramPeters in the forum: https://forum.micropython.org/viewtopic.php?p=30066
2018-06-18examples/embedding: Add code markup and fix typo in README.md.Damien George
2018-02-23examples/embedding: Don't prefix $(MPTOP) to ports/unix source files.Damien George
Otherwise the build process puts the corresponding output object files in two directories lower, not in build/ports/unix.
2018-02-22examples/embedding: Update broken paths to use correct $(MPTOP).talljosh
Some ".." need to be changed to $(MPTOP), and in some places "ports/" needs to be inserted to get to the "ports/unix/" subdir.
2018-02-14unix/Makefile,embedding/Makefile: Remove obsolete use of STMHAL_SRC_C.Damien George
2017-10-09examples: hwconfig_console: Add .on()/.off() methods.Paul Sokolovsky
Add these methods to this "GPIO output emulated with console prints" config.
2017-09-06all: Update Makefiles and others to build with new ports/ dir layout.Damien George
Also renames "stmhal" to "stm32" in documentation and everywhere else.
2017-08-21all: Make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros.Damien George
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-19all: Remove trailing spaces, per coding conventions.Damien George
2017-06-07examples/embedding: Use core-provided KeyboardInterrupt object.Damien George
2017-05-29various: Spelling fixesVille Skyttä
2017-05-17examples/hwapi/soft_pwm2_uasyncio: Update for call_later_ms().Paul Sokolovsky
Following finalized naming in uasyncio.
2017-05-12examples/hwapi/hwconfig*: Use inline Signal() args where possible.Paul Sokolovsky
2017-04-27examples/hwapi: Add config for Zephyr port of 96Boards Carbon.Paul Sokolovsky
2017-04-15extmod/machine_signal: Rename "inverted" arg to "invert", it's shorter.Damien George
A shorter name takes less code size, less room in scripts and is faster to type at the REPL. Tests and HW-API examples are updated to reflect the change.
2017-04-01all: Move BYTES_PER_WORD definition from ports to py/mpconfig.hDamien George
It can still be overwritten by a port in mpconfigport.h but for almost all cases one can use the provided default.
2017-03-31all: Use full path name when including mp-readline/timeutils/netutils.Damien George
This follows the pattern of how all other headers are now included, and makes it explicit where the header file comes from. This patch also removes -I options from Makefile's that specify the mp-readline/timeutils/ netutils directories, which are no longer needed.
2017-03-23all/Makefile: Remove -ansi from GCC flags, its ignored anyway.Krzysztof Blazewicz
The -ansi flag is used for C dialect selection and it is equivalent to -std=c90. Because it goes right before -std=gnu99 it is ignored as for conflicting flags GCC always uses the last one.
2017-03-14examples/embedding: Place lexer constructor within NLR handler block.Damien George
The lexer constructor may now raise an exception and it needs to be caught.