Init code common to both constructors
| 331 | |
| 332 | // Init code common to both constructors |
| 333 | inline void PxMATRIX::init(uint16_t width, uint16_t height,uint8_t LATCH, uint8_t OE, uint8_t A, uint8_t B){ |
| 334 | _LATCH_PIN = LATCH; |
| 335 | _OE_PIN = OE; |
| 336 | _display_color=0; |
| 337 | |
| 338 | _A_PIN = A; |
| 339 | _B_PIN = B; |
| 340 | |
| 341 | if (width > PxMATRIX_MAX_WIDTH){ |
| 342 | #ifdef DEBUG_ESP_PORT |
| 343 | DEBUG_ESP_PORT.print("[PxMatrix] Width larger than PxMATRIX_MAX_WIDTH.\n"); |
| 344 | #endif |
| 345 | } |
| 346 | |
| 347 | if (height > PxMATRIX_MAX_HEIGHT){ |
| 348 | #ifdef DEBUG_ESP_PORT |
| 349 | DEBUG_ESP_PORT.print("[PxMatrix] Height larger than PxMATRIX_MAX_HEIGHT.\n"); |
| 350 | #endif |
| 351 | } |
| 352 | |
| 353 | _width = width; |
| 354 | _height = height; |
| 355 | _brightness=255; |
| 356 | _panels_width = 1; |
| 357 | |
| 358 | _rows_per_buffer = _height/2; |
| 359 | _panel_width_bytes = (_width/_panels_width)/8; |
| 360 | |
| 361 | _active_buffer=false; |
| 362 | |
| 363 | _color_R_offset=0; |
| 364 | _color_G_offset=0; |
| 365 | _color_B_offset=0; |
| 366 | |
| 367 | _test_last_call=0; |
| 368 | _test_pixel_counter=0; |
| 369 | _test_line_counter=0; |
| 370 | _rotate=0; |
| 371 | _flip=0; |
| 372 | _fast_update=0; |
| 373 | |
| 374 | _row_pattern=0; |
| 375 | _scan_pattern=LINE; |
| 376 | _driver_chip=SHIFT; |
| 377 | |
| 378 | _mux_delay_A=0; |
| 379 | _mux_delay_B=0; |
| 380 | _mux_delay_C=0; |
| 381 | _mux_delay_D=0; |
| 382 | _mux_delay_E=0; |
| 383 | |
| 384 | clearDisplay(0); |
| 385 | #ifdef PxMATRIX_double_buffer |
| 386 | clearDisplay(1); |
| 387 | #endif |
| 388 | } |
| 389 | |
| 390 | #ifdef ESP32 |
nothing calls this directly
no outgoing calls
no test coverage detected