From 6b0d93cea3e03a4eac6da6349defa580d78b4bf1 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 28 Dec 2018 21:14:27 +0700 Subject: [PATCH] correct i2c max len --- ports/nrf/common-hal/busio/I2C.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/busio/I2C.c b/ports/nrf/common-hal/busio/I2C.c index f2ba655949..05106d4905 100644 --- a/ports/nrf/common-hal/busio/I2C.c +++ b/ports/nrf/common-hal/busio/I2C.c @@ -39,7 +39,7 @@ // all TWI instances have the same max size // 16 bits for 840, 10 bits for 810, 8 bits for 832 -#define I2C_MAX_XFER_LEN ( 1UL << TWIM0_EASYDMA_MAXCNT_SIZE) +#define I2C_MAX_XFER_LEN ((1UL << TWIM0_EASYDMA_MAXCNT_SIZE) - 1) STATIC twim_peripheral_t twim_peripherals[] = { #if NRFX_CHECK(NRFX_TWIM0_ENABLED)