tidy up
This commit is contained in:
parent
c10f54e5af
commit
351c50cc48
2 changed files with 35 additions and 6 deletions
|
@ -238,6 +238,18 @@ __inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__inline void lld_lcdReadStreamStart(void) {
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
|
||||||
|
__inline void lld_lcdReadStreamStop(void) {
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
|
||||||
|
__inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
|
||||||
void lld_lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
|
void lld_lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
|
||||||
uint32_t index = 0, area;
|
uint32_t index = 0, area;
|
||||||
|
|
||||||
|
@ -350,13 +362,33 @@ uint16_t lld_lcdGetWidth(void) {
|
||||||
return lcd_width;
|
return lcd_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* a positive lines value shifts the screen up, negative down */
|
||||||
|
/* TODO: test this */
|
||||||
void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
|
void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
|
||||||
|
uint16_t row0, row1;
|
||||||
|
uint16_t i;
|
||||||
lld_lcdSetWindow(x0, y0, x1, y1);
|
lld_lcdSetWindow(x0, y0, x1, y1);
|
||||||
|
|
||||||
/* if negative shift, then subtract from the height of the area */
|
for(i = 0; i < ((y1-y0) - abs(lines)); i++) {
|
||||||
lines = (lines < 0) ? ((y1-y0) + lines) : lines;
|
if(lines > 0) {
|
||||||
|
row0 = y0 + i + lines;
|
||||||
|
row1 = y0 + i;
|
||||||
|
} else {
|
||||||
|
row0 = (y1 - i - 1) + lines;
|
||||||
|
row1 = (y1 - i - 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: implement */
|
/* read row0 into the buffer and then write at row1*/
|
||||||
|
lld_lcdSetWindow(x0, row0, x1, row0);
|
||||||
|
lld_lcdReadStreamStart();
|
||||||
|
lld_lcdReadStream(buf, x1-x0);
|
||||||
|
lld_lcdReadStreamStop();
|
||||||
|
|
||||||
|
lld_lcdSetWindow(x0, row1, x1, row1);
|
||||||
|
lld_lcdWriteStreamStart();
|
||||||
|
lld_lcdWriteStream(buf, x1-x0);
|
||||||
|
lld_lcdWriteStreamStop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
3
glcd.c
3
glcd.c
|
@ -317,6 +317,3 @@ void lcdDrawCircle(uint16_t x, uint16_t y, uint16_t radius, uint8_t filled, uint
|
||||||
void lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
|
void lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
|
||||||
lld_lcdVerticalScroll(x0,y0,x1,y1,lines);
|
lld_lcdVerticalScroll(x0,y0,x1,y1,lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue