@@ -214,7 +214,7 @@ static void _send_pixels(busdisplay_busdisplay_obj_t *self, uint8_t *pixels, uin
214214}
215215
216216static bool _refresh_area (busdisplay_busdisplay_obj_t * self , const displayio_area_t * area ) {
217- uint32_t buffer_size = CIRCUITPY_DISPLAY_AREA_BUFFER_SIZE ; // In uint32_ts
217+ uint32_t buffer_size = CIRCUITPY_DISPLAY_AREA_BUFFER_SIZE / sizeof ( uint32_t ) ; // In uint32_ts
218218
219219 displayio_area_t clipped ;
220220 // Clip the area to the display by overlapping the areas. If there is no overlap then we're done.
@@ -262,8 +262,6 @@ static bool _refresh_area(busdisplay_busdisplay_obj_t *self, const displayio_are
262262
263263 uint16_t remaining_rows = displayio_area_height (& clipped );
264264
265- bool async_bus = (self -> bus .flush != NULL );
266-
267265 for (uint16_t j = 0 ; j < subrectangles ; j ++ ) {
268266 displayio_area_t subrectangle = {
269267 .x1 = clipped .x1 ,
@@ -286,31 +284,15 @@ static bool _refresh_area(busdisplay_busdisplay_obj_t *self, const displayio_are
286284 memset (mask , 0 , mask_length * sizeof (mask [0 ]));
287285 memset (buffer , 0 , buffer_size * sizeof (buffer [0 ]));
288286
289- if (async_bus ) {
290- // Async path: fill_area overlaps with previous DMA transfer.
291- // begin_transaction() waits for prior DMA to finish.
292- displayio_display_core_fill_area (& self -> core , & subrectangle , mask , buffer );
293-
294- if (!displayio_display_bus_begin_transaction (& self -> bus )) {
295- return false;
296- }
297- displayio_display_bus_send_region_commands (& self -> bus , & self -> core , & subrectangle );
298- _send_pixels (self , (uint8_t * )buffer , subrectangle_size_bytes );
299- displayio_display_bus_end_transaction (& self -> bus );
300- } else {
301- // Sync path: set region first, then fill and send.
302- displayio_display_bus_set_region_to_update (& self -> bus , & self -> core , & subrectangle );
303-
304- displayio_display_core_fill_area (& self -> core , & subrectangle , mask , buffer );
287+ displayio_display_core_fill_area (& self -> core , & subrectangle , mask , buffer );
305288
306- if (!displayio_display_bus_is_free (& self -> bus )) {
307- return false;
308- }
289+ displayio_display_bus_set_region_to_update (& self -> bus , & self -> core , & subrectangle );
309290
310- displayio_display_bus_begin_transaction (& self -> bus );
311- _send_pixels (self , (uint8_t * )buffer , subrectangle_size_bytes );
312- displayio_display_bus_end_transaction (& self -> bus );
291+ if (!displayio_display_bus_begin_transaction (& self -> bus )) {
292+ return false;
313293 }
294+ _send_pixels (self , (uint8_t * )buffer , subrectangle_size_bytes );
295+ displayio_display_bus_end_transaction (& self -> bus );
314296
315297 // Run background tasks so they can run during an explicit refresh.
316298 // Auto-refresh won't run background tasks here because it is a background task itself.
0 commit comments