{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11220","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11220/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11220/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11220/events","html_url":"https://github.com/MarlinFirmware/Marlin/issues/11220","id":339193165,"node_id":"MDU6SXNzdWUzMzkxOTMxNjU=","number":11220,"title":"[bugfix-1.1.x] Using thermistor table 71 fails to compile","user":{"login":"agrif","id":308296,"node_id":"MDQ6VXNlcjMwODI5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/308296?v=4","gravatar_id":"","url":"https://api.github.com/users/agrif","html_url":"https://github.com/agrif","followers_url":"https://api.github.com/users/agrif/followers","following_url":"https://api.github.com/users/agrif/following{/other_user}","gists_url":"https://api.github.com/users/agrif/gists{/gist_id}","starred_url":"https://api.github.com/users/agrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrif/subscriptions","organizations_url":"https://api.github.com/users/agrif/orgs","repos_url":"https://api.github.com/users/agrif/repos","events_url":"https://api.github.com/users/agrif/events{/privacy}","received_events_url":"https://api.github.com/users/agrif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-07-08T03:23:59Z","updated_at":"2018-07-10T21:05:31Z","closed_at":null,"author_association":"NONE","body":"### Description\r\n\r\nCompiling Marlin on the latest bugfix-1.1.x (ccb225f43ae76dee1eada30b88004352a19a7134) fails when it is configured to use [thermistor table 71][table], with a static assertion:\r\n\r\n    thermistortables.h:207: error: static assertion failed: Temperature conversion tables over 127 entries need special consideration.\r\n\r\nFrom discussion in [this commit][search] and [this follow-up commit][assert], it looks like this is a static assert to guard against an overflow in [temperature.cpp:928][].\r\n\r\n@thinkyhead, you mentioned that no temperature table has more than 128 entries. Am I counting wrong? It looks like [thermistor 71][table] has about 140 entries.\r\n\r\nIt seems this could be fixed for up to 256 entries, at the cost of an extra subtraction, by replacing [temperature.cpp:928][] with:\r\n\r\n    m = l + ((r - l) >> 1);\r\n\r\n [table]: https://github.com/MarlinFirmware/Marlin/blob/ccb225f43ae76dee1eada30b88004352a19a7134/Marlin/thermistortable_71.h\r\n [search]: https://github.com/MarlinFirmware/Marlin/commit/c45bfc1c21a7360c04078bb6cc9b4e4bff8c4f61#r29148131\r\n [assert]: https://github.com/MarlinFirmware/Marlin/commit/dfe90d552deb71afb6bc8f937b2be8a967e947d5#r29158364\r\n [temperature.cpp:928]: https://github.com/MarlinFirmware/Marlin/blob/ccb225f43ae76dee1eada30b88004352a19a7134/Marlin/temperature.cpp#L928\r\n\r\n### Steps to Reproduce\r\n\r\n1. Set `TEMP_SENSOR_0` (or any other thermometer) to 71\r\n2. Attempt to compile.\r\n\r\n**Expected behavior:** Successful compilation.\r\n\r\n**Actual behavior:** Failed compilation.\r\n\r\n#### Additional Information\r\n\r\nI have [zipped my configuration files](https://github.com/MarlinFirmware/Marlin/files/2173306/config.zip), in case that is useful.\r\n"},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/403965634","html_url":"https://github.com/MarlinFirmware/Marlin/issues/11220#issuecomment-403965634","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11220","id":403965634,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzk2NTYzNA==","user":{"login":"agrif","id":308296,"node_id":"MDQ6VXNlcjMwODI5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/308296?v=4","gravatar_id":"","url":"https://api.github.com/users/agrif","html_url":"https://github.com/agrif","followers_url":"https://api.github.com/users/agrif/followers","following_url":"https://api.github.com/users/agrif/following{/other_user}","gists_url":"https://api.github.com/users/agrif/gists{/gist_id}","starred_url":"https://api.github.com/users/agrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrif/subscriptions","organizations_url":"https://api.github.com/users/agrif/orgs","repos_url":"https://api.github.com/users/agrif/repos","events_url":"https://api.github.com/users/agrif/events{/privacy}","received_events_url":"https://api.github.com/users/agrif/received_events","type":"User","site_admin":false},"created_at":"2018-07-10T21:05:31Z","updated_at":"2018-07-10T21:05:31Z","author_association":"NONE","body":"By the spec, it promotes to int, which is 16-bit on ATmegas. It was surprising to me, too.\r\n\r\nIt was also sort of amazing that so many people (including me) have discussed this bug and nobody bothered to see if it even exists until now."}}
{"actor":{"display_login":"agrif"}}