Damien George
beeeec292b
docs/README: Remove references to MICROPY_PORT when building docs.
...
The docs are now built as one for all ports.
2018-12-11 02:55:22 +11:00
Damien George
025d419a77
teensy: Add own uart.h to not rely on stm32's version of the file.
2018-12-10 23:55:11 +11:00
Damien George
dc23978dde
stm32/uart: Add ability to have a static built-in UART object.
...
A static UART is useful for internal peripherals that require a UART and
need to persist outside the soft-reset loop.
2018-12-10 16:21:50 +11:00
Damien George
61ef031687
stm32/uart: Move config of char_width/char_mask to uart.c.
2018-12-10 16:21:50 +11:00
Damien George
6ea45277bf
stm32/uart: For UART init, pass in params directly, not via HAL struct.
...
To provide a cleaner and more abstract C-level interface to the UART.
2018-12-10 16:21:50 +11:00
Damien George
e0c2432503
stm32/uart: Simplify deinit of UART, no need to call HAL.
...
The HAL just clears UE and then clears all the UART control registers.
2018-12-10 16:21:50 +11:00
Damien George
bc3f0dddac
stm32/uart: Remove HAL's UART_HandleTypeDef from UART object struct.
...
This UART_HandleTypeDef is quite large (around 70 bytes in RAM needed for
each UART object) and is not needed: instead the state of the peripheral
held in its registers provides all the required information.
2018-12-10 16:21:50 +11:00
Damien George
7d7f59d78b
stm32/uart: Factor out code to set RX buffer to function uart_set_rxbuf.
2018-12-10 16:21:50 +11:00
Damien George
9690757cca
stm32/uart: Rework uart_get_baudrate so it doesn't need a UART handle.
2018-12-10 16:21:50 +11:00
Damien George
524e13b006
stm32/uart: Factor out code from machine_uart.c that computes baudrate.
2018-12-10 16:21:50 +11:00
Damien George
a2271532be
stm32: Split out UART Python bindings from uart.c to machine_uart.c.
2018-12-10 16:21:50 +11:00
Damien George
55830dd9bf
py/objexcept: Make sure mp_obj_new_exception_msg doesn't copy/format msg
...
mp_obj_new_exception_msg() assumes that the message passed to it is in ROM
and so can use its data directly to create the string object for the
argument of the exception, saving RAM. At the same time, this approach
also makes sure that there is no attempt to format the message with printf,
which could lead to faults if the message contained % characters.
Fixes issue #3004 .
2018-12-10 16:01:05 +11:00
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