Skip to content

Commit aa92591

Browse files
committed
alif/machine_i2c_target: Change to size_t return.
Signed-off-by: Damien George <damien@micropython.org>
1 parent a1369a5 commit aa92591

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ports/alif/machine_i2c_target.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ static void mp_machine_i2c_target_event_callback(machine_i2c_target_irq_obj_t *i
144144
mp_irq_handler(&irq->base);
145145
}
146146

147-
static mp_int_t mp_machine_i2c_target_read_bytes(machine_i2c_target_obj_t *self, size_t len, uint8_t *buf) {
147+
static size_t mp_machine_i2c_target_read_bytes(machine_i2c_target_obj_t *self, size_t len, uint8_t *buf) {
148148
I2C_Type *i2c = self->i2c;
149149

150150
// Read from the RX FIFO.
151-
mp_int_t i = 0;
151+
size_t i = 0;
152152
while (i < len && (i2c->I2C_STATUS & I2C_IC_STATUS_RECEIVE_FIFO_NOT_EMPTY)) {
153153
buf[i++] = i2c->I2C_DATA_CMD;
154154
}
@@ -159,7 +159,7 @@ static mp_int_t mp_machine_i2c_target_read_bytes(machine_i2c_target_obj_t *self,
159159
return i;
160160
}
161161

162-
static mp_int_t mp_machine_i2c_target_write_bytes(machine_i2c_target_obj_t *self, size_t len, const uint8_t *buf) {
162+
static size_t mp_machine_i2c_target_write_bytes(machine_i2c_target_obj_t *self, size_t len, const uint8_t *buf) {
163163
// Write to the TX FIFO.
164164
self->i2c->I2C_DATA_CMD = buf[0];
165165

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy