Hello @Spaghetto
the way I understand the system is that there are three levels of "screen" data. The sprite, the internal display buffer and the actual pixels on the screen. Now, to put something onto screen, first data is drawn onto the sprite, next the sprite is pushed to the display driver which compares the sprite data with the internal buffer and every pixel which is different is then changed on the screen.
So for example starting with a blank sprite, blank buffer and blank screen then update the screen two times (w/o shutdown in between):
sprite buf action screen
00000 | 00000 | ----- | 00000
draw to sprite 11000 | 00000 | ----- | 00000
push sprite 11000 | 11000 | SS--- | 11000
clear sprite 00000 | 11000 | ----- | 11000
draw to sprite 10001 | 11000 | ----- | 11000
push sprite 10001 | 10001 | -C--S | 10001
Note: action means the old state of the buffer is compared to the new and then a pixel gets either set (S), cleared (C) or is unchanged (-).
Now the same, but with shutdown and restart between first and second update:
sprite buf action screen
00000 | 00000 | ----- | 00000
draw to sprite 11000 | 00000 | ----- | 00000
push sprite 11000 | 11000 | SS--- | 11000
shutdown
soft restart 00000 | 00000 | ----- | 11000
draw to sprite 10001 | 00000 | ----- | 11000
push sprite 10001 | 10001 | S---S | 11001
Note: the shutdown also turns off the power to the display driver and this clears the display buffer which leads to pixels only getting set.
The trick to avoid that is to setup the display buffer after the restart with the data it contained before the shutdown. In my RTC clock example I achieve this by waking the device up 2 seonds before the minute changes. This allows me to push the "old" data to the display driver first (which changes nothing on the screen), wait until the minute has changed (seconds equal zero) and then push the new data.
sprite buf action screen
00000 | 00000 | ----- | 00000
draw to sprite 11000 | 00000 | ----- | 00000
push sprite 11000 | 11000 | SS--- | 11000
shutdown
soft restart 00000 | 00000 | ----- | 11000
prepare buf with old data
draw to sprite 11000 | 00000 | ----- | 00000
push sprite 11000 | 11000 | SS--- | 11000
wait for minute change
draw to sprite 10001 | 11000 | ----- | 11000
push sprite 10001 | 10001 | -C--S | 10001
Thanks
Felix