Skip to content

Commit

Permalink
Add transform_XY() to monochrome
Browse files Browse the repository at this point in the history
  • Loading branch information
board707 committed Jul 19, 2021
1 parent 20a3b79 commit e33fc90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DMD_MonoChrome_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,18 @@ void DMD_MonoChrome_SPI::drawPixel(int16_t x, int16_t y, uint16_t color)
{
unsigned int uiDMDRAMPointer;
uint8_t bPixel = color;
uint16_t bX = x;
uint16_t bY = y;
int16_t bX = x;
int16_t bY = y;
if (bX >= (WIDTH) || bY >= (HEIGHT)) {
return;
}
if (bX < 0 || bY < 0) {
return;
}

// transform X & Y for Rotate and connect scheme
transform_XY(bX, bY);

// inverse data bits for some panels
bPixel = bPixel ^ inverse_ALL_flag;

Expand Down
3 changes: 3 additions & 0 deletions DMD_Monochrome_Parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ void DMD_Monochrome_Parallel::drawPixel(int16_t x, int16_t y, uint16_t color) {
if (bX < 0 || bY < 0) {
return;
}
// transform X & Y for Rotate and connect scheme
transform_XY(bX, bY);

// inverse data bits for some panels
bPixel = bPixel ^ inverse_ALL_flag;
byte panel_row = bY / DMD_PIXELS_DOWN;
Expand Down
2 changes: 2 additions & 0 deletions DMD_Monochrome_Parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class DMD_Monochrome_Parallel :
void scan_dmd();
virtual void clearScreen(byte bNormal);
virtual void shiftScreen(int8_t step);
// changing connect scheme not allowed for Parallel
virtual void setConnectScheme(uint8_t sch) {};

private:

Expand Down

0 comments on commit e33fc90

Please sign in to comment.