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
Damien George
033c32e694
esp8266/esp_mphal.h: Fix I2C glitching by using input mode for od_high.
...
Certain pins (eg 4 and 5) seem to behave differently at the hardware level
when in open-drain mode: they glitch when set "high" and drive the pin
active high for a brief period before disabling the output driver. To work
around this make the pin an input to let it float high.
2018-03-12 12:45:09 +11:00
Tom Collins
4d3a92c67c
extmod/vfs_fat: Add file size as 4th element of uos.ilistdir tuple.
2018-03-12 12:26:36 +11:00
Damien George
1345093401
stm32/qspi: Do an explicit read instead of using memory-mapped mode.
...
Using an explicit read eliminates the need to invalidate the D-cache after
enabling the memory mapping mode, which takes additional time.
2018-03-11 18:28:48 +11:00
Damien George
cc34b087f0
drivers/memory/spiflash: Fix setting of QE bit in flash register.
2018-03-11 11:25:38 +11:00
Damien George
0d5bccad11
stm32/storage: Provide support for a second block device.
2018-03-10 01:03:27 +11:00