diff options
author | Nick Brassel <nick@tzarc.org> | 2023-10-22 13:27:31 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-22 13:27:31 +1100 |
commit | 8e614250b4b44a14a6a8c93bea3a6d1fd02790cf (patch) | |
tree | 15c000b7765082911a3a6d84b1499b51c25f43d8 /drivers/painter/comms/qp_comms_spi.c | |
parent | 48d9140cfc197d6f4c54bf8022902d28fac37624 (diff) |
[QP] Add support for OLED, variable framebuffer bpp (#19997)
Co-authored-by: Pablo MartÃnez <58857054+elpekenin@users.noreply.github.com>
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
Fixup delta frame coordinates after #20296.
Diffstat (limited to 'drivers/painter/comms/qp_comms_spi.c')
-rw-r--r-- | drivers/painter/comms/qp_comms_spi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/painter/comms/qp_comms_spi.c b/drivers/painter/comms/qp_comms_spi.c index 7534e844d8..9f52bc7d1f 100644 --- a/drivers/painter/comms/qp_comms_spi.c +++ b/drivers/painter/comms/qp_comms_spi.c @@ -105,13 +105,21 @@ void qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) { } void qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) { + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; for (size_t i = 0; i < sequence_len;) { uint8_t command = sequence[i]; uint8_t delay = sequence[i + 1]; uint8_t num_bytes = sequence[i + 2]; qp_comms_spi_dc_reset_send_command(device, command); if (num_bytes > 0) { - qp_comms_spi_dc_reset_send_data(device, &sequence[i + 3], num_bytes); + if (comms_config->command_params_uses_command_pin) { + for (uint8_t j = 0; j < num_bytes; j++) { + qp_comms_spi_dc_reset_send_command(device, sequence[i + 3 + j]); + } + } else { + qp_comms_spi_dc_reset_send_data(device, &sequence[i + 3], num_bytes); + } } if (delay > 0) { wait_ms(delay); |