mirror of https://github.com/arendst/Tasmota.git
Update LedMatrix.cpp
I have a few MAX7219 modules that use a different column assignment and the 2 already implemented orientations did not work for me. After these changes DisplayRotate 1 and DisplayRotate 3 commands do what they are supposed to do.
This commit is contained in:
parent
324e4e1084
commit
5aadcc7b36
|
@ -330,7 +330,22 @@ void LedMatrix::refresh()
|
|||
}
|
||||
else // ORIENTATION_TURN_RIGHT || ORIENTATION_TURN_LEFT
|
||||
{
|
||||
// not implemented yet
|
||||
col = addr % modulesPerRow;
|
||||
pixelRow = (addr / modulesPerRow) * 8 + ledRow;
|
||||
bufPos = pixelRow * modulesPerRow + col;
|
||||
|
||||
if (moduleOrientation == ORIENTATION_TURN_RIGHT)
|
||||
{
|
||||
// ORIENTATION_TURN_RIGHT
|
||||
deviceDataBuff[addr] = buffer[bufPos];
|
||||
deviceRow = ledRow;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ORIENTATION_TURN_LEFT
|
||||
deviceDataBuff[maxDevices - 1 - addr] = revereBitorder(buffer[bufPos]);
|
||||
deviceRow = 7 - ledRow; // upside down
|
||||
}
|
||||
}
|
||||
}
|
||||
setRow_allDevices(deviceRow, deviceDataBuff);
|
||||
|
|
Loading…
Reference in New Issue