1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sam0_common: use size_t len for I2C transfers, as declared (fixes #19008)

This commit is contained in:
Antonio Galea 2022-12-04 16:57:00 +01:00
parent 945af26648
commit ee76e21c33

View File

@ -50,9 +50,9 @@
#endif
static int _start(SercomI2cm *dev, uint16_t addr);
static inline int _write(SercomI2cm *dev, const uint8_t *data, int length,
static inline int _write(SercomI2cm *dev, const uint8_t *data, size_t length,
uint8_t stop);
static inline int _read(SercomI2cm *dev, uint8_t *data, int length,
static inline int _read(SercomI2cm *dev, uint8_t *data, size_t length,
uint8_t stop);
static inline void _stop(SercomI2cm *dev);
static inline int _wait_for_response(SercomI2cm *dev,
@ -373,10 +373,10 @@ static int _start(SercomI2cm *dev, uint16_t addr)
return 0;
}
static inline int _write(SercomI2cm *dev, const uint8_t *data, int length,
static inline int _write(SercomI2cm *dev, const uint8_t *data, size_t length,
uint8_t stop)
{
uint8_t count = 0;
size_t count = 0;
/* Write data buffer until the end. */
DEBUG("Looping through bytes\n");
@ -413,10 +413,10 @@ static inline int _write(SercomI2cm *dev, const uint8_t *data, int length,
return 0;
}
static inline int _read(SercomI2cm *dev, uint8_t *data, int length,
static inline int _read(SercomI2cm *dev, uint8_t *data, size_t length,
uint8_t stop)
{
uint8_t count = 0;
size_t count = 0;
/* Set action to ack. */
dev->CTRLB.reg &= ~SERCOM_I2CM_CTRLB_ACKACT;