Skip to content

Commit 1a47a21

Browse files
author
Bogdan Marinescu
committed
[KL25Z] Fixed counter type for i2c_read operations.
1 parent 0843613 commit 1a47a21

File tree

1 file changed

+3
-2
lines changed
  • libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL25Z

1 file changed

+3
-2
lines changed

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL25Z/i2c_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void i2c_frequency(i2c_t *obj, int hz) {
232232
}
233233

234234
int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) {
235-
uint8_t count;
235+
int count;
236236
char dummy_read, *ptr;
237237

238238
if (i2c_start(obj)) {
@@ -357,8 +357,9 @@ int i2c_slave_receive(i2c_t *obj) {
357357
}
358358

359359
int i2c_slave_read(i2c_t *obj, char *data, int length) {
360-
uint8_t dummy_read, count;
360+
uint8_t dummy_read;
361361
uint8_t * ptr;
362+
int count;
362363

363364
// set rx mode
364365
obj->i2c->C1 &= ~I2C_C1_TX_MASK;

0 commit comments

Comments
 (0)