Skip to content

Commit 91b98dc

Browse files
committed
fix constness
1 parent cff65bb commit 91b98dc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

shared-bindings/dotclockframebuffer/__init__.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ typedef struct {
5353
uint32_t clk_mask;
5454
} dotclockframebuffer_ioexpander_spi_bus;
5555

56-
void dotclockframebuffer_ioexpander_send_init_sequence(dotclockframebuffer_ioexpander_spi_bus *bus, uint8_t *init_sequence, uint16_t init_sequence_len);
56+
void dotclockframebuffer_ioexpander_send_init_sequence(dotclockframebuffer_ioexpander_spi_bus *bus, const uint8_t *init_sequence, uint16_t init_sequence_len);

shared-module/dotclockframebuffer/__init__.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void ioexpander_bus_send(dotclockframebuffer_ioexpander_spi_bus *bus,
4343
// * CPOL=CPHA=0
4444
// * CS deasserted after each init sequence step, but not otherwise just like
4545
// displayio fourwire bus without data_as_commands
46-
void dotclockframebuffer_ioexpander_send_init_sequence(dotclockframebuffer_ioexpander_spi_bus *bus, uint8_t *init_sequence, uint16_t init_sequence_len) {
46+
void dotclockframebuffer_ioexpander_send_init_sequence(dotclockframebuffer_ioexpander_spi_bus *bus, const uint8_t *init_sequence, uint16_t init_sequence_len) {
4747
while (!common_hal_busio_i2c_try_lock(bus->bus)) {
4848
RUN_BACKGROUND_TASKS;
4949
}
@@ -52,11 +52,11 @@ void dotclockframebuffer_ioexpander_send_init_sequence(dotclockframebuffer_ioexp
5252
pin_change(bus, /* set */ bus->cs_mask, /* clear */ bus->clk_mask);
5353

5454
for (uint32_t i = 0; i < init_sequence_len; /* NO INCREMENT */) {
55-
uint8_t *cmd = init_sequence + i;
55+
const uint8_t *cmd = init_sequence + i;
5656
uint8_t data_size = *(cmd + 1);
5757
bool delay = (data_size & DELAY) != 0;
5858
data_size &= ~DELAY;
59-
uint8_t *data = cmd + 2;
59+
const uint8_t *data = cmd + 2;
6060

6161
ioexpander_bus_send(bus, true, cmd, 1);
6262
ioexpander_bus_send(bus, false, data, data_size);

0 commit comments

Comments
 (0)