Commit Graph

9946 Commits

Author SHA1 Message Date
Damien George
f03601779e extmod: Convert legacy uppercase macro names to lowercase. 2019-02-12 14:54:51 +11:00
Damien George
054dd33eba py: Downcase MP_xxx_SLOT_IS_FILLED inline functions. 2019-02-12 14:54:51 +11:00
Damien George
eee1e8841a py: Downcase all MP_OBJ_IS_xxx macros to make a more consistent C API.
These macros could in principle be (inline) functions so it makes sense to
have them lower case, to match the other C API functions.

The remaining macros that are upper case are:
- MP_OBJ_TO_PTR, MP_OBJ_FROM_PTR
- MP_OBJ_NEW_SMALL_INT, MP_OBJ_SMALL_INT_VALUE
- MP_OBJ_NEW_QSTR, MP_OBJ_QSTR_VALUE
- MP_OBJ_FUN_MAKE_SIG
- MP_DECLARE_CONST_xxx
- MP_DEFINE_CONST_xxx

These must remain macros because they are used when defining const data (at
least, MP_OBJ_NEW_SMALL_INT is so it makes sense to have
MP_OBJ_SMALL_INT_VALUE also a macro).

For those macros that have been made lower case, compatibility macros are
provided for the old names so that users do not need to change their code
immediately.
2019-02-12 14:54:51 +11:00
Damien George
019433a17e stm32/pendsv: Fix inline asm constant and prefix with # character. 2019-02-12 14:50:27 +11:00
Damien George
d53dc04903 qemu-arm: Use gchelper code to get registers for GC scanning. 2019-02-12 14:48:29 +11:00
Damien George
c9ece68d06 cc3200: Use common gchelper_m3.s code from lib/utils. 2019-02-12 14:41:48 +11:00
Damien George
3058d46892 stm32/gccollect: Use gchelper.h header instead of explicit declaration. 2019-02-12 14:38:30 +11:00
Damien George
8d1275ec0f lib/utils/gchelper: Add gchelper.h header file for assembler functions. 2019-02-12 14:37:41 +11:00
Damien George
f608f54ab0 lib/utils/gchelper_m3: Add gc_helper_get_sp() function. 2019-02-12 14:37:01 +11:00
Damien George
90e1303b2d lib/utils/gchelper_m3: Add license header and clean up code.
This file generates the same code with the cortex-m3 and cortex-m4
assembler directive, so use cortex-m3 to support more CPUs.
2019-02-12 14:16:24 +11:00
Damien George
e6d97e8a0b stm32: Move gchelper assembler code to lib/utils for use by other ports. 2019-02-12 14:11:21 +11:00
Damien George
e7332b0584 qemu-arm: Rework to run bare-metal on boards with Cortex-M CPUs.
Adds support for 3 Cortex-M boards, selectable via "BOARD" in the Makefile:
- microbit, Cortex-M0 via nRF51822
- netduino2, Cortex-M3 via STM32F205
- mps2-an385, Cortex-M3 via FPGA

netduino2 is the default board because it's supported by older qemu
versions (down to at least 2.5.0).
2019-02-12 13:50:01 +11:00
Damien George
775c7b86f0 travis: Update to use Ubuntu 16.04 Xenial for CI builds. 2019-02-12 13:29:22 +11:00
Yonatan Goldschmidt
a0d60c574a docs/ure: Fix match.group signature to indicate index param is required. 2019-02-08 17:06:19 +11:00
Damien George
b546e4b7e9 stm32/pendsv: Fix NULL pointer when calling pendsv dispatch function. 2019-02-08 16:38:09 +11:00
Damien George
800871c0cb stm32/modnetwork: Change lwIP polling to be based on background systick. 2019-02-08 16:38:09 +11:00
Damien George
4d214edae8 stm32/systick: Provide better compile-time configurability of slots. 2019-02-08 15:31:02 +11:00
Damien George
18cfa156d6 stm32/pendsv: Add ability to schedule callbacks at pendsv IRQ level. 2019-02-08 01:20:13 +11:00
Damien George
b178958c07 stm32/pendsv: Clean up pendsv IRQ handler and eliminate duplicate code. 2019-02-08 01:20:13 +11:00
Damien George
1bcf4afb10 stm32/systick: Make periodic systick callbacks use a cyclic func table.
Instead of checking each callback (currently storage and dma) explicitly
for each SysTick IRQ, use a simple circular function table indexed by the
lower bits of the millisecond tick counter.  This allows callbacks to be
easily enabled/disabled at runtime, and scales well to a large number of
callbacks.
2019-02-08 01:20:13 +11:00
Damien George
5fbda53d3c stm32/systick: Rename sys_tick_XXX functions to systick_XXX. 2019-02-08 01:20:09 +11:00
Yonatan Goldschmidt
f024b2610f extmod/moduhashlib: Include implementation of sha256 only when required.
Previously crypto-algorithms impl was included even if MICROPY_SSL_MBEDTLS
was in effect, thus we relied on the compiler/linker to cut out the unused
functions.
2019-02-07 23:27:58 +11:00
Damien George
c33f538066 esp32/modmachine: Add support for changing the CPU frequency. 2019-02-07 22:51:55 +11:00
Damien George
1669e049de stm32/boards/STM32F769DISC: Configure for use with mboot by default.
This is a good board to demonstrate the use of Mboot because it only has a
USB HS port exposed so the native ST DFU mode cannot be used.  With Mboot
this port can be used.
2019-02-07 16:28:01 +11:00
Damien George
be1b1835c3 stm32/boards/STM32F769DISC: Support the use of USB HS with external PHY. 2019-02-07 16:26:46 +11:00
Damien George
b26046aca2 stm32/modmachine: Make bootloader() enter custom loader if it's enabled.
If a custom bootloader is enabled (eg mboot) then machine.bootloader() will
now enter that loader.  To get the original ST DFU loader pass any argument
to the function, like machine.bootloader(1).
2019-02-07 16:13:57 +11:00
Damien George
ab423f2969 stm32/usbd_conf: Fully support USB HS with external PHY. 2019-02-07 16:09:25 +11:00
Damien George
9f9c5c19b0 stm32/usb: Use USB HS as main USB device regardless of USB_HS_IN_FS. 2019-02-07 16:09:08 +11:00
Damien George
03a8b1cc50 stm32/mboot: Allow deploying via deploy-stlink. 2019-02-07 16:06:05 +11:00
Damien George
a81cb3576b stm32/mboot: Add support for GPIO ports G, H, I and J. 2019-02-07 16:04:48 +11:00
Damien George
39eb1e9f81 stm32/mboot: Add support for STM32F769 MCUs. 2019-02-07 16:04:06 +11:00
Damien George
9570297dd1 stm32/mboot: Use USB HS as main USB device regardless of USB_HS_IN_FS. 2019-02-07 16:03:18 +11:00
Damien George
43a894fb48 stm32/adc: Add basic support for ADC on a pin on STM32H7 MCUs. 2019-02-06 13:35:28 +11:00
Damien George
b367c425e4 stm32/boards/stm32h743_af.csv: Add ADC entries to pin capability table. 2019-02-06 13:34:53 +11:00
Damien George
02682d52ce stm32/boards/make-pins.py: Add basic support for STM32H7 ADC periphs. 2019-02-06 13:34:23 +11:00
Damien George
7bbde67cb2 lib/utils/printf: Exclude __GI_vsnprintf alias for gcc 9 and above.
See issue #4457.
2019-02-06 01:12:51 +11:00
Yonatan Goldschmidt
343401c6df py/mpconfig.h: Fix comments mentioning dangling file and variable names. 2019-02-06 00:25:30 +11:00
Yonatan Goldschmidt
ec31438c54 py/builtinhelp: Only print help re FS modules if external import enabled 2019-02-06 00:23:16 +11:00
Paul Sokolovsky
8fea833e3f py: Update my copyright info on some files.
Based on git history.
2019-02-06 00:19:00 +11:00
Damien George
6a95e74387 esp32: Use SPIRAM in mem-map mode so all of it can be used for uPy heap.
Also enable CONFIG_SPIRAM_IGNORE_NOTFOUND to allow boards with faulty or
missing SPIRAM to still boot.
2019-02-06 00:10:50 +11:00
Stig Bjørlykke
98f790b03a nrf/timer: Fix disabling Timer 1 when using soft PWM.
Don't exclude the Timer instance 1 entry from machine_timer_obj[] when
using soft PWM. The usage is already checked when creating the Timer,
so just create an empty entry.
2019-02-02 11:15:52 +01:00
Andrew Leech
67689bfd7e stm32/usb: Add flow control option for USB VCP data received from host.
It's off by default and can be enabled at run-time with:

    pyb.USB_VCP().init(flow=pyb.USB_VCP.RTS)
2019-01-31 23:31:26 +11:00
Stig Bjørlykke
63eae33b7b nrf/ticker: Remove duplicate NRFX_IRQ_PRIORITY_SET. 2019-01-31 17:50:10 +11:00
Ayke van Laethem
e8678cd1c9 nrf/pin: Print pull information in Pin.__str__. 2019-01-31 17:38:13 +11:00
Damien George
8faf17b93c lib/nrfx: Upgrade to nrfx v1.3.1. 2019-01-31 17:38:13 +11:00
Ayke van Laethem
2d293873a6 nrf/pin: Cleanup Pin.__str__ to print relevant information.
Code size change:
nrf51: -44
nrf52: -52
2019-01-31 17:31:58 +11:00
Ayke van Laethem
4e1c2fc831 nrf: Shrink "<peripheral> does not exist" error messages.
Code size reductions:
nrf51: -132
nrf52: -188
2019-01-31 17:26:26 +11:00
Ayke van Laethem
1ba962ff57 nrf/uart: Remove unused machine.UART() parameters.
If needed these parameters can be added back and made functional one at a
time.  It's better to explicitly not support them than to silently allow
but ignore them.
2019-01-31 17:18:23 +11:00
Ayke van Laethem
a293fa3d6d nrf/uart: Use formula instead of switch for baudrate calculation.
This saves a bit of code:
nrf51: -176
nrf52: -152
2019-01-31 17:06:59 +11:00
Paul Sokolovsky
2f5d113fad py/warning: Support categories for warnings.
Python defines warnings as belonging to categories, where category is a
warning type (descending from exception type). This is useful, as e.g.
allows to disable warnings selectively and provide user-defined warning
types.  So, implement this in MicroPython, except that categories are
represented just with strings.  However, enough hooks are left to implement
categories differently per-port (e.g. as types), without need to patch each
and every usage.
2019-01-31 16:48:30 +11:00