iabdalkader
2ebc538d63
stm32/dma: Enable H7 DMA descriptors.
2018-03-20 23:24:45 +11:00
Damien George
22c693aa6f
tests/pyb/can: Update to test pyb.CAN restart, state, info, inplace recv
2018-03-19 15:15:39 +11:00
Damien George
0abbafd424
stm32/can: Add "list" param to CAN.recv() to receive data inplace.
...
This API matches (as close as possible) how other pyb classes allow inplace
operations, such as pyb.SPI.recv(buf).
2018-03-19 15:12:24 +11:00
Damien George
5e1279d41a
travis: Pass -j4 to make to speed up compilation.
...
This seems to reduce the Travis build time by roughly 1 minute / 10%.
2018-03-19 11:57:38 +11:00
Damien George
e37b8ba5a5
stm32: Use STM32xx macros instead of MCU_SERIES_xx to select MCU type.
...
The CMSIS files for the STM32 range provide macros to distinguish between
the different MCU series: STM32F4, STM32F7, STM32H7, STM32L4, etc. Prefer
to use these instead of custom ones.
2018-03-17 10:42:50 +11:00
Damien George
5edce4539b
py/objexcept: Make MP_DEFINE_EXCEPTION public so ports can define excs.
2018-03-17 00:31:40 +11:00
Damien George
f6a1f18603
py/makeqstrdefs.py: Optimise by using compiled re's so it runs faster.
...
By using pre-compiled regexs, using startswith(), and explicitly checking
for empty lines (of which around 30% of the input lines are), automatic
qstr extraction is speed up by about 10%.
2018-03-16 23:54:06 +11:00
Damien George
06aa13c350
stm32/can: Use explicit byte extraction instead of casting to word ptr.
...
Casting the Data array to a uint32_t* leads to strict aliasing errors on
older gcc compilers.
2018-03-16 23:52:13 +11:00
Damien George
9600a1f207
tests/pyb: Update CAN test to expect that auto_restart is printed.
2018-03-16 18:37:55 +11:00
Damien George
b7d576d69a
docs/library/pyb.CAN: Clean up documentation of data constants.
2018-03-16 18:29:43 +11:00
Damien George
a25e6c6b65
stm32/can: Add CAN.info() method to retrieve error and tx/rx buf info.
2018-03-16 18:28:35 +11:00
Damien George
d7e67fb1b4
stm32/can: Add CAN.state() method to get the state of the controller.
...
This is useful for monitoring errors on the bus and knowing when a restart
is needed.
2018-03-16 17:10:41 +11:00
Damien George
1272c3c65d
stm32/can: Add CAN.restart() method so controller can leave bus-off.
2018-03-15 17:29:30 +11:00
Damien George
823ca03008
stm32/can: Add "auto_restart" option to constructor and init() method.
2018-03-15 17:17:33 +11:00
Damien George
1608c4f5be
stm32/can: Use enums to index keyword arguments, for clarity.
2018-03-15 17:15:41 +11:00
Damien George
2036196d71
stm32/can: Improve can.recv() so it checks for events, eg ctrl-C.
...
This patch provides a custom (and simple) function to receive data on the
CAN bus, instead of the HAL function. This custom version calls
mp_handle_pending() while waiting for messages, which, among other things,
allows to interrupt the recv() method via KeyboardInterrupt.
2018-03-15 16:34:07 +11:00
Damien George
22a9158ced
stm32/boards/STM32L476DISC: Enable CAN peripheral.
...
This board allows to test CAN support on the L4 series.
2018-03-15 16:32:11 +11:00
Damien George
d91a1989f5
docs/library/pyb.CAN: Update markup to use latest doc conventions.
2018-03-15 16:30:05 +11:00
Damien George
0db49c37a4
docs: Fix some references and RST markup to eliminate Sphinx warnings.
2018-03-15 15:50:51 +11:00
Damien George
c926e72750
tests/cpydiff: Indent workaround code snippet so it formats correctly.
2018-03-15 15:49:38 +11:00
Damien George
34e224a4af
esp32/machine_uart: Return None from UART read if no data is available.
...
This is instead of returning an empty bytes object, and matches how other
ports handle non-blocking UART read behaviour.
2018-03-14 13:18:43 +11:00
Damien George
bdc875e602
drivers/memory/spiflash: Fix bugs in and clean up read/write functions.
...
mp_spiflash_read had a bug in it where "dest" and "addr" were incremented
twice for a certain special case. This was fixed, which then allowed the
function to be simplified to reduce code size.
mp_spiflash_write had a bug in it where "src" was not incremented correctly
for the case where the data to be written included the caching buffer as
well as some bytes after this buffer. This was fixed and the resulting
code simplified.
2018-03-13 14:13:30 +11:00
Damien George
e0bc438e4b
py/obj.h: Move declaration of mp_obj_list_init to objlist.h.
...
If this function is used then objlist.h is already included to get the
definition of mp_obj_list_t.
2018-03-13 14:03:15 +11:00
Damien George
9f811e9096
py/obj.h: Clean up by removing commented-out inline versions of macros.
2018-03-13 14:01:55 +11:00
Damien George
d4b55eff44
py/misc.h: Remove unused count_lead_ones() inline function.
...
This function was never used for unicode/utf8 handling code, or anything
else, so remove it to keep things clean.
2018-03-13 13:23:30 +11:00