Fix x10 video buffer protection
This commit is contained in:
@@ -422,7 +422,11 @@ void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att)
|
||||
{
|
||||
display_t * p = PIXEL_PTR(x, y);
|
||||
display_t color = lcdColorTable[COLOR_IDX(att)];
|
||||
#if defined(PCBX10)
|
||||
if (p >= displayBuf) { // x10 screen is reversed, so overflow are happening the other way around
|
||||
#else
|
||||
if (p < DISPLAY_END) {
|
||||
#endif
|
||||
*p = color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,10 +76,8 @@ bool menuRadioDiagAnalogs(event_t event)
|
||||
lcdDrawNumber(lcdNextPos + 1, MENU_CONTENT_TOP + 7 * FH, touchState.x);
|
||||
lcdDrawText(lcdNextPos, MENU_CONTENT_TOP + 7 * FH, ", ");
|
||||
lcdDrawNumber(lcdNextPos + 1, MENU_CONTENT_TOP + 7 * FH, touchState.y);
|
||||
coord_t x = limit(10, (coord_t)touchState.x, 469); // TODO remove, prevent an emergency crash when drawing on y 280 line
|
||||
coord_t y = limit(7, (coord_t)touchState.y, 264); // TODO remove, prevent an emergency crash when drawing on y 280 line
|
||||
lcdDrawLine(x - 10, y - 7, x + 10, y + 7, SOLID);
|
||||
lcdDrawLine(x - 10, y + 7, x + 10, y - 7, SOLID);
|
||||
lcdDrawLine(touchState.x - 10, touchState.y - 7, touchState.x + 10, touchState.y + 7, SOLID);
|
||||
lcdDrawLine(touchState.x - 10, touchState.y + 7, touchState.x + 10, touchState.y - 7, SOLID);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user