@@ -240,29 +240,13 @@ namespace pimoroni {
240
240
}
241
241
242
242
void ST7789::write_blocking_parallel (const uint8_t *src, size_t len) {
243
- const uint8_t *p = src;
244
- while (len--) {
245
- // Does not byte align correctly
246
- // pio_sm_put_blocking(parallel_pio, parallel_sm, *p);
247
- while (pio_sm_is_tx_fifo_full (parallel_pio, parallel_sm))
248
- ;
249
- *(volatile uint8_t *)¶llel_pio->txf [parallel_sm] = *p;
250
- p++;
251
- }
243
+ write_blocking_dma (src, len);
244
+ dma_channel_wait_for_finish_blocking (st_dma);
252
245
253
- uint32_t sm_stall_mask = 1u << (parallel_sm + PIO_FDEBUG_TXSTALL_LSB);
254
- parallel_pio->fdebug = sm_stall_mask;
255
- while (!(parallel_pio->fdebug & sm_stall_mask))
256
- ;
257
- /* uint32_t mask = 0xff << d0;
258
- while(len--) {
259
- gpio_put(wr_sck, false);
260
- uint8_t v = *src++;
261
- gpio_put_masked(mask, v << d0);
262
- //asm("nop;");
263
- gpio_put(wr_sck, true);
264
- asm("nop;");
265
- }*/
246
+ // This may cause a race between PIO and the
247
+ // subsequent chipselect deassert for the last pixel
248
+ while (!pio_sm_is_tx_fifo_empty (parallel_pio, parallel_sm))
249
+ ;
266
250
}
267
251
268
252
void ST7789::command (uint8_t command, size_t len, const char *data) {
0 commit comments