Only delay when explicitly called for

This commit is contained in:
Jeff Epler 2023-09-18 12:58:54 -05:00
parent 67e15bb6a2
commit 5a60b8d573
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -66,15 +66,14 @@ void dotclockframebuffer_ioexpander_send_init_sequence(dotclockframebuffer_ioexp
// deassert CS
pin_change(bus, /* set */ bus->cs_mask, 0);
uint16_t delay_length_ms = 10;
if (delay) {
data_size++;
delay_length_ms = *(cmd + 1 + data_size);
uint16_t delay_length_ms = *(cmd + 1 + data_size);
if (delay_length_ms == 255) {
delay_length_ms = 500;
}
mp_hal_delay_ms(delay_length_ms);
}
mp_hal_delay_ms(delay_length_ms);
i += 2 + data_size;
}
common_hal_busio_i2c_unlock(bus->bus);