@@ -36,6 +36,22 @@ void render_stage(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
3636 uint16_t * buffer , size_t buffer_size ,
3737 displayio_display_obj_t * display , uint8_t scale ) {
3838
39+
40+ displayio_area_t area ;
41+ area .x1 = x0 ;
42+ area .y1 = y0 ;
43+ area .x2 = x1 ;
44+ area .y2 = y1 ;
45+ displayio_display_core_set_region_to_update (
46+ & display -> core , display -> set_column_command , display -> set_row_command ,
47+ NO_COMMAND , NO_COMMAND , display -> data_as_commands , false, & area );
48+
49+ while (!displayio_display_core_begin_transaction (& display -> core )) {
50+ RUN_BACKGROUND_TASKS ;
51+ }
52+ display -> core .send (display -> core .bus , DISPLAY_COMMAND ,
53+ CHIP_SELECT_TOGGLE_EVERY_BYTE ,
54+ & display -> write_ram_command , 1 );
3955 size_t index = 0 ;
4056 for (uint16_t y = y0 ; y < y1 ; ++ y ) {
4157 for (uint8_t yscale = 0 ; yscale < scale ; ++ yscale ) {
@@ -57,8 +73,9 @@ void render_stage(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
5773 index += 1 ;
5874 // The buffer is full, send it.
5975 if (index >= buffer_size ) {
60- display -> core .send (display -> core .bus , DISPLAY_DATA , CHIP_SELECT_UNTOUCHED , ((uint8_t * )buffer ),
61- buffer_size * 2 );
76+ display -> core .send (display -> core .bus , DISPLAY_DATA ,
77+ CHIP_SELECT_UNTOUCHED ,
78+ ((uint8_t * )buffer ), buffer_size * 2 );
6279 index = 0 ;
6380 }
6481 }
@@ -67,6 +84,10 @@ void render_stage(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
6784 }
6885 // Send the remaining data.
6986 if (index ) {
70- display -> core .send (display -> core .bus , DISPLAY_DATA , CHIP_SELECT_UNTOUCHED , ((uint8_t * )buffer ), index * 2 );
87+ display -> core .send (display -> core .bus , DISPLAY_DATA ,
88+ CHIP_SELECT_UNTOUCHED ,
89+ ((uint8_t * )buffer ), index * 2 );
7190 }
91+
92+ displayio_display_core_end_transaction (& display -> core );
7293}
0 commit comments