{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5324","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5324/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5324/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5324/events","html_url":"https://github.com/MarlinFirmware/Marlin/pull/5324","id":192291258,"number":5324,"title":"Distribute GLCD screen updates in time","user":{"login":"AnHardt","id":211931,"avatar_url":"https://avatars.githubusercontent.com/u/211931?v=3","gravatar_id":"","url":"https://api.github.com/users/AnHardt","html_url":"https://github.com/AnHardt","followers_url":"https://api.github.com/users/AnHardt/followers","following_url":"https://api.github.com/users/AnHardt/following{/other_user}","gists_url":"https://api.github.com/users/AnHardt/gists{/gist_id}","starred_url":"https://api.github.com/users/AnHardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnHardt/subscriptions","organizations_url":"https://api.github.com/users/AnHardt/orgs","repos_url":"https://api.github.com/users/AnHardt/repos","events_url":"https://api.github.com/users/AnHardt/events{/privacy}","received_events_url":"https://api.github.com/users/AnHardt/received_events","type":"User","site_admin":false},"labels":[{"id":92052497,"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Improvement","name":"Improvement","color":"009800","default":false},{"id":421766514,"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Support:%20LCD%20&%20Controllers","name":"Support: LCD & Controllers","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-11-29T14:09:19Z","updated_at":"2016-12-05T13:58:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/pulls/5324","html_url":"https://github.com/MarlinFirmware/Marlin/pull/5324","diff_url":"https://github.com/MarlinFirmware/Marlin/pull/5324.diff","patch_url":"https://github.com/MarlinFirmware/Marlin/pull/5324.patch"},"body":"Distribute GLCD screen updates in time\r\n\r\nCurrently we draw and send the screens for a graphical LCD all at once.\r\nWe draw in two or four parts but draw them directly behind each other.\r\nFor the tested status screen this takes 59-62ms in a single block.\r\nDuring this time nothing else (except the interrupts) can be done.\r\nWhen printing a sequence of very short moves the buffer drains - sometimes until it's empty.\r\n\r\nThis PR splits the screen update into more parts.\r\nCurrently we have 10 time slots per second. During the first one, the complete screen is drawn. (60,0,0,0,0,0,0,0,0,0,0)\r\nHere i introduce pauses for doing other things. (30,30,0,0,0,0,0,0) or (15,15,15,15,0,0,0,0,0,0)\r\nDrawing in consecutive time slots prevents from lagging too much. Even with a 4 stripe display all the drawing is done after 400ms.\r\nPrevious experiments with a even better distribution of the time slots like (30,0,0,0,0,30,0,0,0,0) and (15,0,15,0,15,0,15,0,0,0) did not feel good when using the menu, because of too much lag.\r\n\r\nBecause of the previous PRs to speed up the display updates and especially reducing the difference between drawing 2 or 4 stripes, it now makes sense for the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER to go from 2 to 4 stripes. This costs about 1-2ms per complete screen update, but is payed back by having partial updates lasting only half of the time and two additional brakes. About ~256 byte of framebuffer are saved in RAM.\r\n\r\n13:45:59.213 : echo: #:17 >:13 s:30;   #:16 >:13 s:29;   S#:33 S>:26 S:59\r\n13:46:00.213 : echo: #:16 >:14 s:30;   #:17 >:13 s:30;   S#:33 S>:27 S:60\r\n13:46:01.215 : echo: #:17 >:13 s:30;   #:16 >:13 s:29;   S#:33 S>:26 S:59\r\n13:46:02.215 : echo: #:16 >:13 s:29;   #:16 >:14 s:30;   S#:32 S>:27 S:59\r\n13:46:03.214 : echo: #:17 >:13 s:30;   #:17 >:13 s:30;   S#:34 S>:26 S:60\r\n13:46:04.214 : echo: #:16 >:13 s:29;   #:16 >:14 s:30;   S#:32 S>:27 S:59\r\n13:46:05.212 : echo: #:16 >:14 s:30;   #:17 >:13 s:30;   S#:33 S>:27 S:60\r\n13:46:06.212 : echo: #:17 >:13 s:30;   #:16 >:13 s:29;   S#:33 S>:26 S:59\r\n\r\n\r\n03:30:36.779 : echo: #:8 >:7 s:15;   #:10 >:7 s:17;   #:8 >:6 s:14;   #:8 >:7 s:15;   S#:34 S>:27 S:61\r\n03:30:37.778 : echo: #:8 >:6 s:14;   #:10 >:7 s:17;   #:9 >:7 s:16;   #:8 >:6 s:14;   S#:35 S>:26 S:61\r\n03:30:38.778 : echo: #:8 >:6 s:14;   #:11 >:7 s:18;   #:8 >:6 s:14;   #:8 >:7 s:15;   S#:35 S>:26 S:61\r\n03:30:39.777 : echo: #:8 >:6 s:14;   #:10 >:7 s:17;   #:8 >:8 s:16;   #:8 >:6 s:14;   S#:34 S>:27 S:61\r\n03:30:40.780 : echo: #:8 >:6 s:14;   #:11 >:7 s:18;   #:8 >:6 s:14;   #:8 >:6 s:14;   S#:35 S>:25 S:60\r\n03:30:41.780 : echo: #:9 >:6 s:15;   #:10 >:7 s:17;   #:8 >:6 s:14;   #:9 >:6 s:15;   S#:36 S>:25 S:61\r\n03:30:42.779 : echo: #:8 >:6 s:14;   #:10 >:8 s:18;   #:8 >:6 s:14;   #:8 >:6 s:14;   S#:34 S>:26 S:60\r\n03:30:43.778 : echo: #:9 >:6 s:15;   #:10 >:7 s:17;   #:8 >:7 s:15;   #:9 >:6 s:15;   S#:36 S>:26 S:62\r\n\r\n#: draw a stripe\r\n\\>: transfer a stripe\r\ns: sum of of draw and transfer for one stripe\r\nS#: sum of draws for a complete screen\r\nS>: sum of transfers for a complete screen\r\nS: time to draw and transfer a complete screen\r\n\r\n \r\n \r\nCommit 1 is best suited for testing.\r\nIn the final version commit 1 and 2 will be squashed.\r\nCommit 3 is only to have a better visualization of the changes and will not be in the final PR.\r\n"},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/264860415","html_url":"https://github.com/MarlinFirmware/Marlin/pull/5324#issuecomment-264860415","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5324","id":264860415,"user":{"login":"AnHardt","id":211931,"avatar_url":"https://avatars.githubusercontent.com/u/211931?v=3","gravatar_id":"","url":"https://api.github.com/users/AnHardt","html_url":"https://github.com/AnHardt","followers_url":"https://api.github.com/users/AnHardt/followers","following_url":"https://api.github.com/users/AnHardt/following{/other_user}","gists_url":"https://api.github.com/users/AnHardt/gists{/gist_id}","starred_url":"https://api.github.com/users/AnHardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnHardt/subscriptions","organizations_url":"https://api.github.com/users/AnHardt/orgs","repos_url":"https://api.github.com/users/AnHardt/repos","events_url":"https://api.github.com/users/AnHardt/events{/privacy}","received_events_url":"https://api.github.com/users/AnHardt/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T13:58:50Z","updated_at":"2016-12-05T13:58:50Z","body":"Updated again.\r\n```\r\nif ( drawing_screen && (drawing_screen = u8g.nextPage()) ) return;\r\n```\r\nwas a good idea but did not work, because it needs the state update further down.\r\n```\r\nif ( drawing_screen && (drawing_screen = u8g.nextPage()) ) {;}\r\n```\r\nsaves the transfer of the `useless` partial screen and updates the state."}}
{"actor":{"display_login":"AnHardt"}}