better screensaver handling - release

This commit is contained in:
philippe44
2020-03-21 13:24:26 -07:00
parent ff40290610
commit fb499982c2
8 changed files with 32 additions and 24 deletions

View File

@@ -735,12 +735,18 @@ static void grfa_handler(u8_t *data, int len) {
int length = htonl(pkt->length);
artwork.enable = (length != 0);
// clean up if we are disabling previously enabled artwork
if (!artwork.enable) {
if (artwork.size) GDS_ClearWindow(display, artwork.x, artwork.y, -1, -1, GDS_COLOR_BLACK);
// just a config or an actual artwork
if (length < 32) {
if (artwork.enable) {
// this is just to specify artwork coordinates
artwork.x = htons(pkt->x);
artwork.y = htons(pkt->y);
} else if (artwork.size) GDS_ClearWindow(display, artwork.x, artwork.y, -1, -1, GDS_COLOR_BLACK);
// done in any case
return;
}
}
// new grfa artwork, allocate memory
if (!offset) {
@@ -1071,11 +1077,3 @@ static void displayer_task(void *args) {
visu.wake -= sleep;
}
}