22 void oledc_clear(
int x0,
int y0,
int w,
int h)
24 while(oledc_screenLock());
25 oledc_screenLockSet();
31 switch (TFTROTATION) {
35 x0 = TFTWIDTH - x0 - 1;
36 x1 = TFTWIDTH - x1 - 1;
40 x0 = TFTWIDTH - x0 - 1;
41 y0 = TFTHEIGHT - y0 - 1;
42 x1 = TFTWIDTH - x1 - 1;
43 y1 = TFTHEIGHT - y1 - 1;
50 y0 = TFTHEIGHT - y0 - 1;
51 y1 = TFTHEIGHT - y1 - 1;
57 if ((y0 >= TFTHEIGHT) || (y1 < 0) || (x0 >= TFTWIDTH) || (x1 < 0)) {
58 oledc_screenLockClr();
63 if (x1 >= TFTWIDTH) x1 = TFTWIDTH - 1;
64 if (y1 >= TFTHEIGHT) y1 = TFTHEIGHT - 1;
66 oledc_writeCommand(SSD1331_CMD_CLEAR, 0);
67 oledc_writeCommand(x0, 0);
68 oledc_writeCommand(y0, 0);
69 oledc_writeCommand(x1, 0);
70 oledc_writeCommand(y1, 0);
75 oledc_screenLockClr();