Damien George
bad4e15da5
py/objexcept: Use macros to make offsets in emergency exc buf clearer.
2018-12-10 15:53:38 +11:00
Paul Sokolovsky
38151f35c1
extmod/moductypes: Add aliases for native C types.
...
SHORT, INT, LONG, LONGLONG, and unsigned (U*) variants are being defined.
This is done at compile using GCC-style predefined macros like
__SIZEOF_INT__. If the compiler doesn't have such defines, no such types
will be defined.
2018-12-10 14:40:43 +11:00
Damien George
074597f172
tests/extmod/uctypes_error: Add test for unsupported unary op.
2018-12-10 14:29:41 +11:00
Paul Sokolovsky
0de6815ec1
tests/extmod/uctypes_ptr_le: Test int() operation on a pointer field.
2018-12-10 14:25:06 +11:00
Paul Sokolovsky
9d864bde04
extmod/moductypes: Implement __int__ for PTR.
...
Allows to get address a pointer contains, as an integer.
2018-12-10 14:25:05 +11:00
Paul Sokolovsky
d690c2e148
tests/basics/special_methods: Add testcases for __int__.
2018-12-07 17:28:04 +11:00
Paul Sokolovsky
b1d08726ee
py/obj: Add support for __int__ special method.
...
Based on the discussion, this special method is available unconditionally,
as converting to int is a common operation.
2018-12-07 17:28:04 +11:00
Damien George
113f00a9ab
py/objboundmeth: Support loading generic attrs from the method.
...
Instead of assuming that the method is a bytecode object, and only
supporting load of __name__, make the operation generic by delegating the
load to the method object itself. Saves a bit of code size and fixes the
case of attempting to load __name__ on a native method, see issue #4028 .
2018-12-06 18:02:41 +11:00
Damien George
da7355e213
esp32/modmachine: Enable machine.sleep() now that the IDF supports it.
2018-12-06 17:23:27 +11:00
Damien George
9c6c32cc51
esp32/machine_pwm: On deinit stop routing PWM signal to the pin.
...
Fixes issue #4273 .
2018-12-06 17:05:16 +11:00
Damien George
287b02d98a
esp32/machine_pwm: Support higher PWM freq by auto-scaling timer res.
2018-12-06 16:43:39 +11:00
Damien George
87623082e3
esp32/machine_uart: Implement UART.sendbreak() method.
...
The uart_write_bytes_with_break() function requires non-zero data to be
sent before the break, so a standalone break must be synthesised.
2018-12-06 15:40:22 +11:00
boochow
69b7b8fa12
stm32/boards: Add NUCLEO_L432KC board configuration files.
2018-12-06 13:33:29 +11:00
boochow
9d3372bded
stm32: Add peripheral support for STM32L432.
...
The L432 does not have: GPIOD, TIM3, SPI2, ADC dual mode operation, 2-banks
flash.
2018-12-06 13:32:43 +11:00
boochow
1a8baad7ca
stm32/boards: Add STM32L432KC chip configuration files.
...
The pin alternate function information is derived from ST's datasheet
https://www.st.com/resource/en/datasheet/stm32l432kc.pdf
In the datasheet, the line 2 of AF4 includes I2C2 but actually the chip
does not have I2C2 so it is removed.
2018-12-06 13:32:43 +11:00
Damien George
52bec93755
esp8266/machine_uart: Add rxbuf keyword arg to UART constructor/init.
...
As per the machine.UART documentation, this is used to set the length of
the UART RX buffer.
2018-12-05 23:31:24 +11:00
Damien George
9ddc182ec7
esp32/machine_uart: Add txbuf/rxbuf keyword args to UART construct/init.
...
As per the machine.UART documentation, these are used to set the length of
the TX and RX buffers.
2018-12-05 16:48:34 +11:00
Damien George
8007d0bd16
stm32/uart: Add rxbuf keyword arg to UART constructor and init method.
...
As per the machine.UART documentation, this is used to set the length of
the RX buffer. The legacy read_buf_len argument is retained for backwards
compatibility, with rxbuf overriding it if provided.
2018-12-05 13:24:11 +11:00
Damien George
c6365ffb92
stm32/powerctrl: Add support for standby mode on L4 MCUs.
...
This maps to machine.deepsleep() which is now supported.
2018-12-05 00:40:05 +11:00
Damien George
a1c81761b1
stm32/mboot: Add documentation for using mboot on PYBv1.x.
2018-12-04 23:48:47 +11:00
Damien George
c040961e91
stm32/boards: Add configuration for putting mboot on PYBv1.x.
2018-12-04 23:48:18 +11:00
Damien George
eed522d69f
stm32/mboot: Add support for 4th board LED.
2018-12-04 23:14:30 +11:00
Damien George
13e92e1225
stm32/mboot: Provide led_state_all function to reduce code size.
2018-12-04 23:11:51 +11:00
Damien George
9262f54138
stm32/uart: Always show the flow setting when printing a UART object.
...
Also change the order of printing of flow so it is after stop (so bits,
parity, stop are one after the other), and reduce code size by using
mp_print_str instead of mp_printf where possible.
See issue #1981 .
2018-12-04 19:16:16 +11:00
Damien George
da1d849ad1
stm32,esp8266,cc3200: Use MICROPY_GC_STACK_ENTRY_TYPE to save some RAM.
2018-12-04 18:32:10 +11:00