@@ -58,17 +58,17 @@ primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT];
5858primary_display_bus_t * display_buses_dyn = & display_buses [0 ];
5959primary_display_t * displays_dyn = & displays [0 ];
6060#define DYN_DISPLAY_BUSES (indx ) (indx < CIRCUITPY_DISPLAY_LIMIT ? display_buses[indx] : display_buses_dyn[indx - CIRCUITPY_DISPLAY_LIMIT])
61- #define DYN_DISPLAY_BUSES_ADR (indx ,membr ) (indx < CIRCUITPY_DISPLAY_LIMIT ? &display_buses[indx].membr : &display_buses_dyn[indx - CIRCUITPY_DISPLAY_LIMIT].membr)
61+ #define DYN_DISPLAY_BUSES_ADR (indx , membr ) (indx < CIRCUITPY_DISPLAY_LIMIT ? &display_buses[indx].membr : &display_buses_dyn[indx - CIRCUITPY_DISPLAY_LIMIT].membr)
6262#define DYN_DISPLAY_BUSES_ADR0 (indx ) (indx < CIRCUITPY_DISPLAY_LIMIT ? &display_buses[indx] : &display_buses_dyn[indx - CIRCUITPY_DISPLAY_LIMIT])
6363#define DYN_DISPLAYS (indx ) (indx < CIRCUITPY_DISPLAY_LIMIT ? displays[indx] : displays_dyn[indx - CIRCUITPY_DISPLAY_LIMIT])
64- #define DYN_DISPLAYS_ADR (indx ,membr ) (indx < CIRCUITPY_DISPLAY_LIMIT ? &displays[indx].membr : &displays_dyn[indx - CIRCUITPY_DISPLAY_LIMIT].membr)
64+ #define DYN_DISPLAYS_ADR (indx , membr ) (indx < CIRCUITPY_DISPLAY_LIMIT ? &displays[indx].membr : &displays_dyn[indx - CIRCUITPY_DISPLAY_LIMIT].membr)
6565#define DYN_DISPLAYS_ADR0 (indx ) (indx < CIRCUITPY_DISPLAY_LIMIT ? &displays[indx] : &displays_dyn[indx - CIRCUITPY_DISPLAY_LIMIT])
6666#else
6767#define DYN_DISPLAY_BUSES (indx ) (display_buses[indx])
68- #define DYN_DISPLAY_BUSES_ADR (indx ,membr ) (&display_buses[indx].membr)
68+ #define DYN_DISPLAY_BUSES_ADR (indx , membr ) (&display_buses[indx].membr)
6969#define DYN_DISPLAY_BUSES_ADR0 (indx ) (&display_buses[indx])
7070#define DYN_DISPLAYS (indx ) (displays[indx])
71- #define DYN_DISPLAYS_ADR (indx ,membr ) (&displays[indx].membr)
71+ #define DYN_DISPLAYS_ADR (indx , membr ) (&displays[indx].membr)
7272#define DYN_DISPLAYS_ADR0 (indx ) (&displays[indx])
7373#endif
7474
@@ -89,7 +89,7 @@ displayio_buffer_transform_t null_transform = {
8989static bool any_display_uses_this_framebuffer (mp_obj_base_t * obj ) {
9090 for (uint8_t i = 0 ; i < max_num_displays ; i ++ ) {
9191 if (DYN_DISPLAYS (i ).display_base .type == & framebufferio_framebufferdisplay_type ) {
92- framebufferio_framebufferdisplay_obj_t * display = DYN_DISPLAYS_ADR (i ,framebuffer_display );
92+ framebufferio_framebufferdisplay_obj_t * display = DYN_DISPLAYS_ADR (i , framebuffer_display );
9393 if (display -> framebuffer == obj ) {
9494 return true;
9595 }
@@ -118,15 +118,15 @@ void displayio_background(void) {
118118 if (false) {
119119 #if CIRCUITPY_BUSDISPLAY
120120 } else if (display_type == & busdisplay_busdisplay_type ) {
121- busdisplay_busdisplay_background (DYN_DISPLAYS_ADR (i ,display ));
121+ busdisplay_busdisplay_background (DYN_DISPLAYS_ADR (i , display ));
122122 #endif
123123 #if CIRCUITPY_FRAMEBUFFERIO
124124 } else if (display_type == & framebufferio_framebufferdisplay_type ) {
125- framebufferio_framebufferdisplay_background (DYN_DISPLAYS_ADR (i ,framebuffer_display ));
125+ framebufferio_framebufferdisplay_background (DYN_DISPLAYS_ADR (i , framebuffer_display ));
126126 #endif
127127 #if CIRCUITPY_EPAPERDISPLAY
128128 } else if (display_type == & epaperdisplay_epaperdisplay_type ) {
129- epaperdisplay_epaperdisplay_background (DYN_DISPLAYS_ADR (i ,epaper_display ));
129+ epaperdisplay_epaperdisplay_background (DYN_DISPLAYS_ADR (i , epaper_display ));
130130 #endif
131131 }
132132 }
@@ -148,15 +148,15 @@ static void common_hal_displayio_release_displays_impl(bool keep_primary) {
148148 continue ;
149149 #if CIRCUITPY_BUSDISPLAY
150150 } else if (display_type == & busdisplay_busdisplay_type ) {
151- release_busdisplay (DYN_DISPLAYS_ADR (i ,display ));
151+ release_busdisplay (DYN_DISPLAYS_ADR (i , display ));
152152 #endif
153153 #if CIRCUITPY_EPAPERDISPLAY
154154 } else if (display_type == & epaperdisplay_epaperdisplay_type ) {
155- release_epaperdisplay (DYN_DISPLAYS_ADR (i ,epaper_display ));
155+ release_epaperdisplay (DYN_DISPLAYS_ADR (i , epaper_display ));
156156 #endif
157157 #if CIRCUITPY_FRAMEBUFFERIO
158158 } else if (display_type == & framebufferio_framebufferdisplay_type ) {
159- release_framebufferdisplay (DYN_DISPLAYS_ADR (i ,framebuffer_display ));
159+ release_framebufferdisplay (DYN_DISPLAYS_ADR (i , framebuffer_display ));
160160 #endif
161161 }
162162 if (i < CIRCUITPY_DISPLAY_LIMIT ) {
@@ -173,39 +173,39 @@ static void common_hal_displayio_release_displays_impl(bool keep_primary) {
173173 continue ;
174174 #if CIRCUITPY_FOURWIRE
175175 } else if (bus_type == & fourwire_fourwire_type ) {
176- common_hal_fourwire_fourwire_deinit (DYN_DISPLAY_BUSES_ADR (i ,fourwire_bus ));
176+ common_hal_fourwire_fourwire_deinit (DYN_DISPLAY_BUSES_ADR (i , fourwire_bus ));
177177 #endif
178178 #if CIRCUITPY_I2CDISPLAYBUS
179179 } else if (bus_type == & i2cdisplaybus_i2cdisplaybus_type ) {
180- common_hal_i2cdisplaybus_i2cdisplaybus_deinit (DYN_DISPLAY_BUSES_ADR (i ,i2cdisplay_bus ));
180+ common_hal_i2cdisplaybus_i2cdisplaybus_deinit (DYN_DISPLAY_BUSES_ADR (i , i2cdisplay_bus ));
181181 #endif
182182 #if CIRCUITPY_DOTCLOCKFRAMEBUFFER
183183 } else if (bus_type == & dotclockframebuffer_framebuffer_type ) {
184- common_hal_dotclockframebuffer_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i ,dotclock ));
184+ common_hal_dotclockframebuffer_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i , dotclock ));
185185 #endif
186186 #if CIRCUITPY_PARALLELDISPLAYBUS
187187 } else if (bus_type == & paralleldisplaybus_parallelbus_type ) {
188- common_hal_paralleldisplaybus_parallelbus_deinit (DYN_DISPLAY_BUSES_ADR (i ,parallel_bus ));
188+ common_hal_paralleldisplaybus_parallelbus_deinit (DYN_DISPLAY_BUSES_ADR (i , parallel_bus ));
189189 #endif
190190 #if CIRCUITPY_RGBMATRIX
191191 } else if (bus_type == & rgbmatrix_RGBMatrix_type ) {
192- common_hal_rgbmatrix_rgbmatrix_deinit (DYN_DISPLAY_BUSES_ADR (i ,rgbmatrix ));
192+ common_hal_rgbmatrix_rgbmatrix_deinit (DYN_DISPLAY_BUSES_ADR (i , rgbmatrix ));
193193 #endif
194194 #if CIRCUITPY_IS31FL3741
195195 } else if (bus_type == & is31fl3741_framebuffer_type ) {
196- common_hal_is31fl3741_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i ,is31fl3741 ));
196+ common_hal_is31fl3741_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i , is31fl3741 ));
197197 #endif
198198 #if CIRCUITPY_SHARPDISPLAY
199199 } else if (bus_type == & sharpdisplay_framebuffer_type ) {
200- common_hal_sharpdisplay_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i ,sharpdisplay ));
200+ common_hal_sharpdisplay_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i , sharpdisplay ));
201201 #endif
202202 #if CIRCUITPY_VIDEOCORE
203203 } else if (bus_type == & videocore_framebuffer_type ) {
204- common_hal_videocore_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i ,videocore ));
204+ common_hal_videocore_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i , videocore ));
205205 #endif
206206 #if CIRCUITPY_PICODVI
207207 } else if (bus_type == & picodvi_framebuffer_type ) {
208- common_hal_picodvi_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i ,picodvi ));
208+ common_hal_picodvi_framebuffer_deinit (DYN_DISPLAY_BUSES_ADR (i , picodvi ));
209209 #endif
210210 }
211211 if (i < CIRCUITPY_DISPLAY_LIMIT ) {
@@ -230,7 +230,7 @@ void malloc_display_memory(void) {
230230 if (max_num_displays > CIRCUITPY_DISPLAY_LIMIT ) {
231231 display_buses_dyn = (primary_display_bus_t * )port_malloc (sizeof (primary_display_bus_t ) * (max_num_displays - CIRCUITPY_DISPLAY_LIMIT ), false);
232232 displays_dyn = (primary_display_t * )port_malloc (sizeof (primary_display_t ) * (max_num_displays - CIRCUITPY_DISPLAY_LIMIT ), false);
233-
233+
234234 for (uint8_t i = CIRCUITPY_DISPLAY_LIMIT ; i < max_num_displays ; i ++ ) {
235235 memset (& displays_dyn [i - CIRCUITPY_DISPLAY_LIMIT ], 0 , sizeof (displays_dyn [i - CIRCUITPY_DISPLAY_LIMIT ]));
236236 memset (& display_buses_dyn [i - CIRCUITPY_DISPLAY_LIMIT ], 0 , sizeof (display_buses_dyn [i - CIRCUITPY_DISPLAY_LIMIT ]));
@@ -252,7 +252,7 @@ void reset_displays(void) {
252252 continue ;
253253 #if CIRCUITPY_FOURWIRE
254254 } else if (display_bus_type == & fourwire_fourwire_type ) {
255- fourwire_fourwire_obj_t * fourwire = DYN_DISPLAY_BUSES_ADR (i ,fourwire_bus );
255+ fourwire_fourwire_obj_t * fourwire = DYN_DISPLAY_BUSES_ADR (i , fourwire_bus );
256256 if (((size_t )fourwire -> bus ) < ((size_t )& display_buses ) ||
257257 ((size_t )fourwire -> bus ) > ((size_t )& display_buses + max_num_displays * sizeof (primary_display_bus_t ))) {
258258 busio_spi_obj_t * original_spi = fourwire -> bus ;
@@ -282,7 +282,7 @@ void reset_displays(void) {
282282 #endif
283283 #if CIRCUITPY_I2CDISPLAYBUS
284284 } else if (display_bus_type == & i2cdisplaybus_i2cdisplaybus_type ) {
285- i2cdisplaybus_i2cdisplaybus_obj_t * i2c = DYN_DISPLAY_BUSES_ADR (i ,i2cdisplay_bus );
285+ i2cdisplaybus_i2cdisplaybus_obj_t * i2c = DYN_DISPLAY_BUSES_ADR (i , i2cdisplay_bus );
286286 // Check to see if we need to inline the I2C bus.
287287 if (((size_t )i2c -> bus ) < ((size_t )& display_buses ) ||
288288 ((size_t )i2c -> bus ) > ((size_t )& display_buses + max_num_displays * sizeof (primary_display_bus_t ))) {
@@ -310,7 +310,7 @@ void reset_displays(void) {
310310 #endif
311311 #if CIRCUITPY_RGBMATRIX
312312 } else if (display_bus_type == & rgbmatrix_RGBMatrix_type ) {
313- rgbmatrix_rgbmatrix_obj_t * pm = DYN_DISPLAY_BUSES_ADR (i ,rgbmatrix );
313+ rgbmatrix_rgbmatrix_obj_t * pm = DYN_DISPLAY_BUSES_ADR (i , rgbmatrix );
314314 if (!any_display_uses_this_framebuffer (& pm -> base )) {
315315 common_hal_rgbmatrix_rgbmatrix_deinit (pm );
316316 } else {
@@ -319,7 +319,7 @@ void reset_displays(void) {
319319 #endif
320320 #if CIRCUITPY_IS31FL3741
321321 } else if (display_bus_type == & is31fl3741_framebuffer_type ) {
322- is31fl3741_framebuffer_obj_t * is31fb = DYN_DISPLAY_BUSES_ADR (i ,is31fl3741 );
322+ is31fl3741_framebuffer_obj_t * is31fb = DYN_DISPLAY_BUSES_ADR (i , is31fl3741 );
323323
324324 if (((uint32_t )is31fb -> is31fl3741 -> i2c ) < ((uint32_t )& display_buses ) ||
325325 ((uint32_t )is31fb -> is31fl3741 -> i2c ) > ((uint32_t )& display_buses + max_num_displays )) {
@@ -349,12 +349,12 @@ void reset_displays(void) {
349349 #endif
350350 #if CIRCUITPY_SHARPDISPLAY
351351 } else if (display_bus_type == & sharpdisplay_framebuffer_type ) {
352- sharpdisplay_framebuffer_obj_t * sharp = DYN_DISPLAY_BUSES_ADR (i ,sharpdisplay );
352+ sharpdisplay_framebuffer_obj_t * sharp = DYN_DISPLAY_BUSES_ADR (i , sharpdisplay );
353353 common_hal_sharpdisplay_framebuffer_reset (sharp );
354354 #endif
355355 #if CIRCUITPY_VIDEOCORE
356356 } else if (display_bus_type == & videocore_framebuffer_type ) {
357- videocore_framebuffer_obj_t * vc = DYN_DISPLAY_BUSES_ADR (i ,videocore );
357+ videocore_framebuffer_obj_t * vc = DYN_DISPLAY_BUSES_ADR (i , videocore );
358358 if (!any_display_uses_this_framebuffer (& vc -> base )) {
359359 common_hal_videocore_framebuffer_deinit (vc );
360360 }
@@ -363,15 +363,15 @@ void reset_displays(void) {
363363 #endif
364364 #if CIRCUITPY_PICODVI
365365 } else if (display_bus_type == & picodvi_framebuffer_type ) {
366- picodvi_framebuffer_obj_t * vc = DYN_DISPLAY_BUSES_ADR (i ,picodvi );
366+ picodvi_framebuffer_obj_t * vc = DYN_DISPLAY_BUSES_ADR (i , picodvi );
367367 if (!any_display_uses_this_framebuffer (& vc -> base )) {
368368 common_hal_picodvi_framebuffer_deinit (vc );
369369 }
370370 #endif
371371 #if CIRCUITPY_AURORA_EPAPER
372372 } else if (display_bus_type == & aurora_framebuffer_type ) {
373373 #if CIRCUITPY_BOARD_SPI
374- aurora_epaper_framebuffer_obj_t * aurora = DYN_DISPLAY_BUSES_ADR (i ,aurora_epaper );
374+ aurora_epaper_framebuffer_obj_t * aurora = DYN_DISPLAY_BUSES_ADR (i , aurora_epaper );
375375 if (common_hal_board_is_spi (aurora -> bus )) {
376376 common_hal_aurora_epaper_framebuffer_set_free_bus (false);
377377 }
@@ -393,16 +393,16 @@ void reset_displays(void) {
393393 continue ;
394394 #if CIRCUITPY_BUSDISPLAY
395395 } else if (display_type == & busdisplay_busdisplay_type ) {
396- reset_busdisplay (DYN_DISPLAYS_ADR (i ,display ));
396+ reset_busdisplay (DYN_DISPLAYS_ADR (i , display ));
397397 #endif
398398 #if CIRCUITPY_EPAPERDISPLAY
399399 } else if (display_type == & epaperdisplay_epaperdisplay_type ) {
400- epaperdisplay_epaperdisplay_obj_t * display = DYN_DISPLAYS_ADR (i ,epaper_display );
400+ epaperdisplay_epaperdisplay_obj_t * display = DYN_DISPLAYS_ADR (i , epaper_display );
401401 epaperdisplay_epaperdisplay_reset (display );
402402 #endif
403403 #if CIRCUITPY_FRAMEBUFFERIO
404404 } else if (display_type == & framebufferio_framebufferdisplay_type ) {
405- framebufferio_framebufferdisplay_reset (DYN_DISPLAYS_ADR (i ,framebuffer_display ));
405+ framebufferio_framebufferdisplay_reset (DYN_DISPLAYS_ADR (i , framebuffer_display ));
406406 #endif
407407 }
408408 }
@@ -416,22 +416,22 @@ void displayio_gc_collect(void) {
416416 }
417417 #if CIRCUITPY_RGBMATRIX
418418 if (display_bus_type == & rgbmatrix_RGBMatrix_type ) {
419- rgbmatrix_rgbmatrix_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i ,rgbmatrix ));
419+ rgbmatrix_rgbmatrix_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i , rgbmatrix ));
420420 }
421421 #endif
422422 #if CIRCUITPY_IS31FL3741
423423 if (display_bus_type == & is31fl3741_framebuffer_type ) {
424- is31fl3741_framebuffer_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i ,is31fl3741 ));
424+ is31fl3741_framebuffer_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i , is31fl3741 ));
425425 }
426426 #endif
427427 #if CIRCUITPY_SHARPDISPLAY
428428 if (display_bus_type == & sharpdisplay_framebuffer_type ) {
429- common_hal_sharpdisplay_framebuffer_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i ,sharpdisplay ));
429+ common_hal_sharpdisplay_framebuffer_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i , sharpdisplay ));
430430 }
431431 #endif
432432 #if CIRCUITPY_AURORA_EPAPER
433433 if (display_bus_type == & aurora_framebuffer_type ) {
434- common_hal_aurora_epaper_framebuffer_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i ,aurora_epaper ));
434+ common_hal_aurora_epaper_framebuffer_collect_ptrs (DYN_DISPLAY_BUSES_ADR (i , aurora_epaper ));
435435 }
436436 #endif
437437 }
@@ -445,15 +445,15 @@ void displayio_gc_collect(void) {
445445 // but this is more precise, and is the only field that needs marking.
446446 #if CIRCUITPY_BUSDISPLAY
447447 } else if (display_type == & busdisplay_busdisplay_type ) {
448- busdisplay_busdisplay_collect_ptrs (DYN_DISPLAYS_ADR (i ,display ));
448+ busdisplay_busdisplay_collect_ptrs (DYN_DISPLAYS_ADR (i , display ));
449449 #endif
450450 #if CIRCUITPY_FRAMEBUFFERIO
451451 } else if (display_type == & framebufferio_framebufferdisplay_type ) {
452- framebufferio_framebufferdisplay_collect_ptrs (DYN_DISPLAYS_ADR (i ,framebuffer_display ));
452+ framebufferio_framebufferdisplay_collect_ptrs (DYN_DISPLAYS_ADR (i , framebuffer_display ));
453453 #endif
454454 #if CIRCUITPY_EPAPERDISPLAY
455455 } else if (display_type == & epaperdisplay_epaperdisplay_type ) {
456- epaperdisplay_epaperdisplay_collect_ptrs (DYN_DISPLAYS_ADR (i ,epaper_display ));
456+ epaperdisplay_epaperdisplay_collect_ptrs (DYN_DISPLAYS_ADR (i , epaper_display ));
457457 #endif
458458 }
459459 }
@@ -465,7 +465,7 @@ static bool is_display_active(mp_obj_base_t *display_maybe) {
465465
466466primary_display_t * allocate_display (void ) {
467467 for (uint8_t i = 0 ; i < max_num_displays ; i ++ ) {
468- if (!is_display_active (DYN_DISPLAYS_ADR (i ,display_base ))) {
468+ if (!is_display_active (DYN_DISPLAYS_ADR (i , display_base ))) {
469469 // Clear this memory so it is in a known state before init.
470470// memset(DYN_DISPLAYS_ADR0(i), 0, sizeof(DYN_DISPLAYS(i)));
471471 memset (DYN_DISPLAYS_ADR0 (i ), 0 , sizeof (displays [0 ]));
@@ -551,7 +551,7 @@ void common_hal_displayio_auto_primary_display(void) {
551551 return ;
552552 }
553553 for (uint8_t i = 0 ; i < max_num_displays ; i ++ ) {
554- if (is_display_active (DYN_DISPLAYS_ADR (i ,display_base ))) {
554+ if (is_display_active (DYN_DISPLAYS_ADR (i , display_base ))) {
555555 primary_display_number = i ;
556556 return ;
557557 }
0 commit comments