lcdVerticalScroll() uses worker
This commit is contained in:
parent
096701a6ad
commit
d0c92628ed
2 changed files with 31 additions and 4 deletions
24
glcd/glcd.c
24
glcd/glcd.c
|
@ -99,6 +99,13 @@ static msg_t ThreadGLCDWorker(void *arg) {
|
||||||
msg->result = GLCD_DONE;
|
msg->result = GLCD_DONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case GLCD_VERTICAL_SCROLL: {
|
||||||
|
EMSG(glcd_msg_vertical_scroll);
|
||||||
|
lld_lcdVerticalScroll(emsg->x0, emsg->y0, emsg->x1, emsg->y1, emsg->lines);
|
||||||
|
msg->result = GLCD_DONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Done, release msg again. */
|
/* Done, release msg again. */
|
||||||
|
@ -250,6 +257,19 @@ static void lcdWriteStream(uint16_t *buffer, uint16_t size) {
|
||||||
chMsgSend(workerThread, (msg_t)&msg);
|
chMsgSend(workerThread, (msg_t)&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
|
||||||
|
struct glcd_msg_vertical_scroll msg;
|
||||||
|
|
||||||
|
msg.action = GLCD_VERTICAL_SCROLL;
|
||||||
|
msg.x0 = x0;
|
||||||
|
msg.y0 = y0;
|
||||||
|
msg.x1 = x1;
|
||||||
|
msg.y1 = y1;
|
||||||
|
msg.lines = lines;
|
||||||
|
|
||||||
|
chMsgSend(workerThread, (msg_t)&msg);
|
||||||
|
}
|
||||||
|
|
||||||
void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
|
void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
|
||||||
int16_t dy, dx;
|
int16_t dy, dx;
|
||||||
int16_t addx = 1, addy = 1;
|
int16_t addx = 1, addy = 1;
|
||||||
|
@ -523,7 +543,3 @@ void lcdDrawEllipse(uint16_t x, uint16_t y, uint16_t a, uint16_t b, uint8_t fill
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
|
|
||||||
lld_lcdVerticalScroll(x0,y0,x1,y1,lines);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ enum glcd_action { GLCD_SET_POWERMODE,
|
||||||
GLCD_WRITE_STREAM_START,
|
GLCD_WRITE_STREAM_START,
|
||||||
GLCD_WRITE_STREAM_STOP,
|
GLCD_WRITE_STREAM_STOP,
|
||||||
GLCD_WRITE_STREAM,
|
GLCD_WRITE_STREAM,
|
||||||
|
GLCD_VERTICAL_SCROLL,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum glcd_result { GLCD_DONE,
|
enum glcd_result { GLCD_DONE,
|
||||||
|
@ -108,5 +109,15 @@ struct glcd_msg_write_stream {
|
||||||
uint16_t size;
|
uint16_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct glcd_msg_vertical_scroll {
|
||||||
|
_glcd_msg_base
|
||||||
|
|
||||||
|
uint16_t x0;
|
||||||
|
uint16_t y0;
|
||||||
|
uint16_t x1;
|
||||||
|
uint16_t y1;
|
||||||
|
int16_t lines;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue