aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-03-25esp32/modsocket: Handle poll of a closed socket.Damien George
This gets tests/extmod/uselect_poll_basic.py working on the esp32.
2020-03-25drivers/onewire: Fix undefined variable errors.Andreas Motl
On CPython, and with pylint, the variables MATCH_ROM and SEARCH_ROM are undefined. This code works in MicroPython because these variables are constants and the MicroPython parser/compiler optimises them out. But it is not valid Python because they are technically undefined within the scope they are used. This commit makes the code valid Python code. The const part is removed completely because these constants are part of the public API and so cannot be moved to the global scope (where they could still use the MicroPython const optimisation).
2020-03-25py/stream.h: Include sys/types.h to get size_t and off_t for POSIX API.David Lechner
2020-03-25extmod/vfs_posix_file: Include unistd.h to get STD{IN,OUT,ERR}_FILENO.David Lechner
2020-03-25windows/windows_mphal: Fix missing semicolon.David Lechner
2020-03-25unix,windows: Use STDIN_FILENO, STDOUT_FILENO macros where appropriate.David Lechner
This replaces 0 and 1 with STDIN_FILENO and STDOUT_FILENO to make the intention of the code clearer.
2020-03-25windows: Remove custom definition of MP_PLAT_PRINT_STRN.David Lechner
This removes the port-specific definition of MP_PLAT_PRINT_STRN on the windows port, so that the default mp_hal_stdout_tx_strn_cooked() is always used. This fixes releasing the GIL during the call to write() (this was missed in bc3499f0103abcae39ad048bb42a518a665b8497). Also, mp_hal_dupterm_tx_strn() was defined but never used anywhere so it is safe to delete it.
2020-03-25unix: Remove custom definition of MP_PLAT_PRINT_STRN.David Lechner
This removes the port-specific definition of MP_PLAT_PRINT_STRN on the unix port. Since fee7e5617f55b4778de74ee185fcc3950cdc7b6d this is no longer a single function call so we are not really optimising anything over using the default definition of MP_PLAT_PRINT_STRN which calls mp_hal_stdout_tx_strn_cooked().
2020-03-25esp8266/modnetwork: Add support for wlan.ifconfig('dhcp').Damien George
Fixes issue #5780.
2020-03-25all: Remove spaces between nested paren and inside function arg paren.Damien George
Using new options enabled in the uncrustify configuration.
2020-03-25windows/msvc: Fix warnings regarding function declarations.stijn
Fix missing mkdir and gettimeofday declarations, then silence msvc-specific compiler warning C4996: 'The POSIX name for this item is deprecated'.
2020-03-25tools/codeformat.py: Include all msvc C code in auto-format.stijn
2020-03-25zephyr: Update machine.Pin class to use new zephyr gpio api.Maureen Helm
Zephyr v2.2 reworked its gpio api to support linux device tree bindings and pin logical levels. This commit updates the zephyr port's machine.Pin class to replace the deprecated gpio api calls with the new supported gpio api. This resolves several build warnings. Tested on frdm_k64f and mimxrt1050_evk boards.
2020-03-25stm32/mboot: Remove unnecessary test for led being 1 in led_state.Damien George
The "led" argument is always a pointer to the GPIO port, or'd with the pin that the LED is on, so testing that it is "1" is unnecessary. The type of "led" is also changed to uint32_t so it can properly hold a 32-bit pointer.
2020-03-25stm32/mboot: Update LED0 state from systick handler.Andrew Leech
Updating the LED0 state from systick handler ensures LED0 is always consistent with its flash rate regardless of other processing going on in either interrupts or main. This improves the visible stability of the bootloader, rather than LED0 flashing somewhat randomly at times. This commit also changes the LED0 flash rate depending on the current state of DFU, giving slightly more visual feedback on what the device is doing.
2020-03-22tools/pydfu.py: Display any error strings from device/mboot.Andrew Leech
2020-03-22stm32/mboot: Protect against invalid address flash writes.Andrew Leech
And provide a DFU error message for invalid erases and writes.
2020-03-22stm32/mboot: Update dfu state/status flags to better match standard.Andrew Leech
2020-03-22stm32/mboot: Allow overriding led_init and led_state in board folder.Andrew Leech
Allows for custom functions/logic to display mboot state.
2020-03-22tools/pydfu.py: Add args for VID/PID & exit with cleaner error handling.Andrew Leech
2020-03-22esp32/README.md: Update build instructions for newer toolchain.Jim Mussared
Also fix Espressif links to the specific version they apply to.
2020-03-22esp8266/README.md: Add docker build instructions.Jim Mussared
2020-03-20esp8266/modmachine: Implement machine.soft_reset().Damien George
Fixes issue #5764.
2020-03-18tests/run-multitests.py: Print test summary and do exit(1) on failure.Damien George
2020-03-18unix: Remove custom file implementation to use extmod's VFS POSIX one.Damien George
The implementation in extmod/vfs_posix_file.c is now equivalent to that in ports/unix/file.c, so remove the latter and use the former instead.
2020-03-18extmod/vfs_posix_file: Lock GIL when writing and allow stdio flush.Damien George
Also support MP_STREAM_GET_FILENO ioctl. The stdio flush change was done previously for the unix port in 3e0b46b9af8b7a6934b7ac68671ef8f55be2b848. These changes make this POSIX file implementation equivalent to the unix file implementation.
2020-03-18all: Convert exceptions to use mp_raise_XXX helpers in remaining places.Damien George
2020-03-18extmod/modlwip: Properly handle non-blocking and timeout on UDP recv.Damien George
Fixes UDP non-blocking recv so it returns EAGAIN instead of ETIMEDOUT. Timeout waiting for incoming data is also improved by replacing 100ms delay with poll_sockets(), as is done in other parts of this module. Fixes issue #5759.
2020-03-18extmod/modlwip: Fix polling of UDP socket so it doesn't return HUP.Damien George
STATE_NEW will return HUP when polled so put active UDP sockets into a new state which is different to STATE_NEW. Fixes issue #5758.
2020-03-12stm32/main: Fix bug mounting 3rd SD partition.Damien George
Fixes issue #5753.
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-11zephyr: Execute main.py file if it exists.Maureen Helm
Adds support in the zephyr port to execute main.py if the file system is enabled and the file exists. Existing support for executing a main.py frozen module is preserved, since pyexec_file_if_exists() works just like pyexec_frozen_module() if there's no vfs.
2020-03-11zephyr: Enable usb mass storage class on mimxrt1050_evk.Maureen Helm
Enables the zephyr usb device stack and mass storage class on the mimxrt1050_evk board. The mass storage class is backed by the sdhc disk access driver, so it's now possible to browse and modify the contents of the SD card from a USB host (your PC). This is in preparation to support writing a main.py script to the SD card, and then executing it after the next reset.
2020-03-11zephyr: Mount a file system during init.Maureen Helm
Adds support in the zephyr port to mount a file system if a block device (sdhc disk access or flash area) is available. The mount point is either "/sd" or "/flash" depending on the type of block device. Tested with an sdhc disk access block device and fatfs on the mimxrt1050_evk board. Tested with a flash area block device and littlefs on the reel_board.
2020-03-11travis: For unix tests use Makefile target instead of explicit commands.Damien George
2020-03-11tests/run-tests: Consider all tests as native when emit=native is used.Damien George
So that they are skipped when running on a target that doesn't support the native emitter, eg a nanbox build.
2020-03-11unix/Makefile: Detect and pass thru mpy-cross flags when running tests.Damien George
2020-03-11py/modmicropython: Add heap_locked function to test state of heap.Andrew Leech
This commit adds micropython.heap_locked() which returns the current lock-depth of the heap, and can be used by Python code to check if the heap is locked or not. This new function is configured via MICROPY_PY_MICROPYTHON_HEAP_LOCKED and is disabled by default. This commit also changes the return value of micropython.heap_unlock() so it returns the current lock-depth as well.
2020-03-11mimxrt: Add MIMXRT1010 board.Jim Mussared
2020-03-11mimxrt: Add new, minimal port to NXP i.MX RT series CPUs.Jim Mussared
This is an extremely minimal port to the NXP i.MX RT, in the style of the SAMD port It's largely based on the TinyUSB mimxrt implementation, using the NXP SDK. It currently supports the Teensy 4.0 board with a REPL over the USB-VCP interface. This commit also adds the NXP SDK submodule (also from TinyUSB) to lib/nxp_driver. Note: if you already have the tinyusb submodule initialized recursively you will need to run the following as the tinyusb sub-submodules have been rearranged (upstream): git submodule deinit lib/tinyusb rm -rf .git/modules/lib/tinyusb git submodule update --init lib/tinyusb
2020-03-11samd: Fix to build with latest tinyusb.Jim Mussared
2020-03-11lib/tinyusb: Update to a6b916ba for i.MX support.Jim Mussared
2020-03-11py/objstringio: Expose tell() on StringIO and BytesIO objects.Andrew Leech
To match file objects. Fixes issue #5581.
2020-03-11tools/codeformat.py: Eliminate need for sizeof fixup.David Lechner
This eliminates the need for the sizeof regex fixup by rearranging things a bit. All other bitfields already use the parentheses around expressions with sizeof, so one case is fixed by following this convention. VM_MAX_STATE_ON_STACK is the only remaining problem and it can be worked around by changing the order of the operands.
2020-03-11py/objstr: Remove duplicate % in error string.Tom Collins
The double-% was added in 11de8399fe5f9ef54589b14470faf8d4fcc5ccaa (Jun 2014) when such errors were formatted with printf. But then 55830dd9bf4fee87c0a6d3f38c51614fea0eb483 (Dec 2018) changed mp_obj_new_exception_msg() to not format the message, as discussed in #3004. So such error strings are no longer formatted and a % is just that.
2020-03-11extmod/vfs: Factor out vfs mount-and-chdir helper from stm32.Damien George
2020-03-11tools/metrics.py: Use check_call instead of run to error out on error.Damien George
2020-03-11extmod/nimble: When getting BLE MAC try public address if random fails.Damien George
This is needed for BLE.config('mac') to work on esp32.
2020-03-11extmod/modbluetooth: Change scan result's "connectable" to "adv_type".Damien George
This commit changes the BLE _IRQ_SCAN_RESULT data from: addr_type, addr, connectable, rssi, adv_data to: addr_type, addr, adv_type, rssi, adv_data This allows _IRQ_SCAN_RESULT to handle all scan result types (not just connectable and non-connectable passive scans), and to distinguish between them using adv_type which is an integer taking values 0x00-0x04 per the BT specification. This is a breaking change to the API, albeit a very minor one: the existing connectable value was a boolean and True now becomes 0x00, False becomes 0x02. Documentation is updated and a test added. Fixes #5738.
2020-03-11esp32: Deinitialize Bluetooth on soft reset.Thomas Friebel
This fixes a crash, caused by NimBLE continuing to call the Python BLE interrupt handler after soft reboot.