Update ESP32-HUB75-MatrixPanel-I2S-DMA.cpp

This commit is contained in:
mrfaptastic 2021-08-12 15:50:48 +01:00 committed by GitHub
parent e6aa0cbd80
commit 9f82254f03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -768,8 +768,9 @@ uint8_t MatrixPanel_I2S_DMA::setLatBlanking(uint8_t pulses){
void MatrixPanel_I2S_DMA::hlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, uint8_t red, uint8_t green, uint8_t blue){ void MatrixPanel_I2S_DMA::hlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, uint8_t red, uint8_t green, uint8_t blue){
if ( !initialized ) if ( !initialized )
return; return;
if ( x_coord < 0 || y_coord < 0 || l < 1 || x_coord >= PIXELS_PER_ROW || y_coord >= m_cfg.mx_height) // AdaFruit_GFX x and y co-ords start at 0 and go to width-1 or height-1 (i.e. 0-63, 0-31 for a 64x32 panel)
if ( x_coord < 0 || y_coord < 0 || l < 1 || x_coord > PIXELS_PER_ROW || y_coord > m_cfg.mx_height)
return; return;
if (x_coord+l > PIXELS_PER_ROW) if (x_coord+l > PIXELS_PER_ROW)
@ -842,8 +843,9 @@ void MatrixPanel_I2S_DMA::hlineDMA(int16_t x_coord, int16_t y_coord, int16_t l,
void MatrixPanel_I2S_DMA::vlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, uint8_t red, uint8_t green, uint8_t blue){ void MatrixPanel_I2S_DMA::vlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, uint8_t red, uint8_t green, uint8_t blue){
if ( !initialized ) if ( !initialized )
return; return;
if ( x_coord < 0 || y_coord < 0 || l < 1 || x_coord >= PIXELS_PER_ROW || y_coord >= m_cfg.mx_height) // AdaFruit_GFX x and y co-ords start at 0 and go to width-1 or height-1 (i.e. 0-63, 0-31 for a 64x32 panel)
if ( x_coord < 0 || y_coord < 0 || l < 1 || x_coord > PIXELS_PER_ROW || y_coord > m_cfg.mx_height)
return; return;
if (y_coord + l > m_cfg.mx_height) if (y_coord + l > m_cfg.mx_height)
@ -930,4 +932,4 @@ void MatrixPanel_I2S_DMA::fillRectDMA(int16_t x, int16_t y, int16_t w, int16_t h
} }
} }
#endif // NO_FAST_FUNCTIONS #endif // NO_FAST_FUNCTIONS