@@ -114,7 +114,7 @@ void displayio_display_bus_end_transaction(displayio_display_bus_t *self) {
114114 self -> end_transaction (self -> bus );
115115}
116116
117- void displayio_display_bus_set_region_to_update (displayio_display_bus_t * self , displayio_display_core_t * display , displayio_area_t * area ) {
117+ static void _displayio_display_bus_send_region_commands (displayio_display_bus_t * self , displayio_display_core_t * display , displayio_area_t * area , bool manage_transactions ) {
118118 uint16_t x1 = area -> x1 + self -> colstart ;
119119 uint16_t x2 = area -> x2 + self -> colstart ;
120120 uint16_t y1 = area -> y1 + self -> rowstart ;
@@ -141,7 +141,9 @@ void displayio_display_bus_set_region_to_update(displayio_display_bus_t *self, d
141141 }
142142
143143 // Set column.
144- displayio_display_bus_begin_transaction (self );
144+ if (manage_transactions ) {
145+ displayio_display_bus_begin_transaction (self );
146+ }
145147 uint8_t data [5 ];
146148 data [0 ] = self -> column_command ;
147149 uint8_t data_length = 1 ;
@@ -176,20 +178,28 @@ void displayio_display_bus_set_region_to_update(displayio_display_bus_t *self, d
176178 }
177179
178180 self -> send (self -> bus , data_type , chip_select , data , data_length );
179- displayio_display_bus_end_transaction (self );
181+ if (manage_transactions ) {
182+ displayio_display_bus_end_transaction (self );
183+ }
180184
181185 if (self -> set_current_column_command != NO_COMMAND ) {
182186 uint8_t command = self -> set_current_column_command ;
183- displayio_display_bus_begin_transaction (self );
187+ if (manage_transactions ) {
188+ displayio_display_bus_begin_transaction (self );
189+ }
184190 self -> send (self -> bus , DISPLAY_COMMAND , chip_select , & command , 1 );
185191 // Only send the first half of data because it is the first coordinate.
186192 self -> send (self -> bus , DISPLAY_DATA , chip_select , data , data_length / 2 );
187- displayio_display_bus_end_transaction (self );
193+ if (manage_transactions ) {
194+ displayio_display_bus_end_transaction (self );
195+ }
188196 }
189197
190198
191199 // Set row.
192- displayio_display_bus_begin_transaction (self );
200+ if (manage_transactions ) {
201+ displayio_display_bus_begin_transaction (self );
202+ }
193203 data [0 ] = self -> row_command ;
194204 data_length = 1 ;
195205 if (!self -> data_as_commands ) {
@@ -220,18 +230,34 @@ void displayio_display_bus_set_region_to_update(displayio_display_bus_t *self, d
220230 }
221231
222232 self -> send (self -> bus , data_type , chip_select , data , data_length );
223- displayio_display_bus_end_transaction (self );
233+ if (manage_transactions ) {
234+ displayio_display_bus_end_transaction (self );
235+ }
224236
225237 if (self -> set_current_row_command != NO_COMMAND ) {
226238 uint8_t command = self -> set_current_row_command ;
227- displayio_display_bus_begin_transaction (self );
239+ if (manage_transactions ) {
240+ displayio_display_bus_begin_transaction (self );
241+ }
228242 self -> send (self -> bus , DISPLAY_COMMAND , chip_select , & command , 1 );
229243 // Only send the first half of data because it is the first coordinate.
230244 self -> send (self -> bus , DISPLAY_DATA , chip_select , data , data_length / 2 );
231- displayio_display_bus_end_transaction (self );
245+ if (manage_transactions ) {
246+ displayio_display_bus_end_transaction (self );
247+ }
232248 }
233249}
234250
251+ void displayio_display_bus_set_region_to_update (displayio_display_bus_t * self , displayio_display_core_t * display , displayio_area_t * area ) {
252+ _displayio_display_bus_send_region_commands (self , display , area , true);
253+ }
254+
255+ #if CIRCUITPY_QSPIBUS
256+ void displayio_display_bus_send_region_commands (displayio_display_bus_t * self , displayio_display_core_t * display , displayio_area_t * area ) {
257+ _displayio_display_bus_send_region_commands (self , display , area , false);
258+ }
259+ #endif
260+
235261void displayio_display_bus_collect_ptrs (displayio_display_bus_t * self ) {
236262 self -> collect_ptrs (self -> bus );
237263}
0 commit comments