summaryrefslogtreecommitdiffstatshomepage
path: root/lib/timeutils/timeutils.c
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@sheep.art.pl>2016-09-19 20:53:08 +0200
committerDamien George <damien.p.george@gmail.com>2016-09-28 14:45:29 +1000
commit219245e10fa01ab81a7dd10b64fffd07e2ec1a49 (patch)
tree69523f0ef2e75184e0c0f141c8e059dad3c3817b /lib/timeutils/timeutils.c
parent7165fbd8f4e5b772d8fae6b2af9a8aad7524e81d (diff)
downloadmicropython-219245e10fa01ab81a7dd10b64fffd07e2ec1a49.tar.gz
micropython-219245e10fa01ab81a7dd10b64fffd07e2ec1a49.zip
extmod/machine_i2c: Add support for the addrsize parameter in mem xfers.
The memory read/write I2C functions now take an optional keyword-only parameter that specifies the number of bits in the memory address. Only mem-addrs that are a multiple of 8-bits are supported (otherwise the behaviour is undefined). Due to the integer type used for the address, for values larger than 32 bits, only 32 bits of address will be sent, and the rest will be padded with 0s. Right now no exception is raised when that happens. For values smaller than 8, no address is sent. Also no exception then. Tested with a VL6180 sensor, which has 16-bit register addresses. Due to code refactoring, this patch reduces stmhal and esp8266 builds by about 50 bytes.
Diffstat (limited to 'lib/timeutils/timeutils.c')
0 files changed, 0 insertions, 0 deletions