Brightness re-enabled.
Brightness code was commented out, uncommented. Default the library so that panels display max brightness.
This commit is contained in:
parent
77914725f0
commit
f2208be6e7
2 changed files with 3 additions and 4 deletions
|
@ -220,13 +220,13 @@ void RGB64x32MatrixPanel_I2S_DMA::updateMatrixDMABuffer(int16_t x_coord, int16_t
|
||||||
// turn off OE after brightness value is reached when displaying MSBs
|
// turn off OE after brightness value is reached when displaying MSBs
|
||||||
// MSBs always output normal brightness
|
// MSBs always output normal brightness
|
||||||
// LSB (!color_depth_idx) outputs normal brightness as MSB from previous row is being displayed
|
// LSB (!color_depth_idx) outputs normal brightness as MSB from previous row is being displayed
|
||||||
//if((color_depth_idx > lsbMsbTransitionBit || !color_depth_idx) && ((x_coord) >= brightness)) v|=BIT_OE; // ???
|
if((color_depth_idx > lsbMsbTransitionBit || !color_depth_idx) && ((x_coord) >= brightness)) v|=BIT_OE; // For Brightness
|
||||||
|
|
||||||
// special case for the bits *after* LSB through (lsbMsbTransitionBit) - OE is output after data is shifted, so need to set OE to fractional brightness
|
// special case for the bits *after* LSB through (lsbMsbTransitionBit) - OE is output after data is shifted, so need to set OE to fractional brightness
|
||||||
if(color_depth_idx && color_depth_idx <= lsbMsbTransitionBit) {
|
if(color_depth_idx && color_depth_idx <= lsbMsbTransitionBit) {
|
||||||
// divide brightness in half for each bit below lsbMsbTransitionBit
|
// divide brightness in half for each bit below lsbMsbTransitionBit
|
||||||
int lsbBrightness = brightness >> (lsbMsbTransitionBit - color_depth_idx + 1);
|
int lsbBrightness = brightness >> (lsbMsbTransitionBit - color_depth_idx + 1);
|
||||||
// if((x_coord) >= lsbBrightness) v|=BIT_OE; // ???
|
if((x_coord) >= lsbBrightness) v|=BIT_OE; // For Brightness
|
||||||
}
|
}
|
||||||
|
|
||||||
// need to turn off OE one clock before latch, otherwise can get ghosting
|
// need to turn off OE one clock before latch, otherwise can get ghosting
|
||||||
|
|
|
@ -171,7 +171,7 @@ class RGB64x32MatrixPanel_I2S_DMA : public Adafruit_GFX {
|
||||||
allocateDMAbuffers();
|
allocateDMAbuffers();
|
||||||
|
|
||||||
backbuf_id = 0;
|
backbuf_id = 0;
|
||||||
brightness = 32;
|
brightness = 64; // default to max brightness, wear sunglasses when looking directly at panel.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,6 @@ class RGB64x32MatrixPanel_I2S_DMA : public Adafruit_GFX {
|
||||||
void setBrightness(int _brightness)
|
void setBrightness(int _brightness)
|
||||||
{
|
{
|
||||||
// Change to set the brightness of the display, range of 1 to matrixWidth (i.e. 1 - 64)
|
// Change to set the brightness of the display, range of 1 to matrixWidth (i.e. 1 - 64)
|
||||||
// Warning: When set to 64, make sure to wear sunglasses when looking directly at panel :-)
|
|
||||||
brightness = _brightness;
|
brightness = _brightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue