rename setBrightness to setPanelBrightness

For some strange reason it causes a panic. Some other arduino function must be conflicting.
This commit is contained in:
mrfaptastic 2019-07-29 12:57:53 +01:00
parent 1ce9f70e4b
commit da358dcb1f
2 changed files with 18 additions and 19 deletions

View file

@ -61,7 +61,7 @@ void RGB64x32MatrixPanel_I2S_DMA::configureDMA(int r1_pin, int g1_pin, int b1_
Serial.printf("lsbMsbTransitionBit of %d gives %d Hz refresh: \r\n", lsbMsbTransitionBit, actualRefreshRate);
if (actualRefreshRate > 150) // HACK Hard Coded: Minimum frame rate of 150
if (actualRefreshRate > 100) // HACK Hard Coded: Minimum frame rate of 150
break;

View file

@ -227,7 +227,6 @@ class RGB64x32MatrixPanel_I2S_DMA : public Adafruit_GFX {
// TODO: Disable/Enable auto buffer flipping (useful for lots of drawPixel usage)...
// Draw pixels
virtual void drawPixel(int16_t x, int16_t y, uint16_t color); // overwrite adafruit implementation
virtual void fillScreen(uint16_t color); // overwrite adafruit implementation
@ -242,7 +241,7 @@ class RGB64x32MatrixPanel_I2S_DMA : public Adafruit_GFX {
// Converts RGB888 to RGB565
uint16_t color565(uint8_t r, uint8_t g, uint8_t b); // This is what is used by Adafruit GFX!
void flipDMABuffer()
inline void flipDMABuffer()
{
// Step 1. Bring backbuffer to the foreground (i.e. show it)
//showDMABuffer();
@ -258,16 +257,17 @@ class RGB64x32MatrixPanel_I2S_DMA : public Adafruit_GFX {
#endif
}
void showDMABuffer()
inline void showDMABuffer()
{
i2s_parallel_flip_to_buffer(&I2S1, backbuf_id);
}
void setBrightness(int _brightness)
{
// Change to set the brightness of the display, range of 1 to matrixWidth (i.e. 1 - 64)
brightness = _brightness;
}
inline void setPanelBrightness(int b)
{
// Change to set the brightness of the display, range of 1 to matrixWidth (i.e. 1 - 64)
brightness = b;
}
// ------- PRIVATE -------
@ -301,7 +301,8 @@ class RGB64x32MatrixPanel_I2S_DMA : public Adafruit_GFX {
int lsbMsbTransitionBit;
int refreshRate;
int brightness;
int brightness;
}; // end Class header
@ -358,6 +359,4 @@ inline uint16_t RGB64x32MatrixPanel_I2S_DMA::color565(uint8_t r, uint8_t g, uint
#endif