{"action":"created","comment":{"url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/comments/223333971","pull_request_review_id":162432596,"id":223333971,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzMzMzk3MQ==","diff_hunk":"@@ -47,17 +47,29 @@ impl DelayMs<u8> for Delay {\n \n impl DelayUs<u32> for Delay {\n     fn delay_us(&mut self, us: u32) {\n-        let rvr = us * (self.clocks.hclk().0 / 8_000_000);\n+        // The RVR register is 24 bits wide, as SysTick is based on a 24 bit counter\n+        const MAX_RVR: u32 = (1 << 24);\n \n-        assert!(rvr < (1 << 24));\n+        let mut total_rvr = us * (self.clocks.hclk().0 / 8_000_000);\n \n-        self.syst.set_reload(rvr);\n-        self.syst.clear_current();\n-        self.syst.enable_counter();\n+        while total_rvr != 0 {\n+            let current_rvr = if total_rvr < MAX_RVR {\n+                total_rvr\n+            } else {\n+                MAX_RVR","path":"src/delay.rs","position":18,"original_position":18,"commit_id":"b87997f97f01607c31efd58624052bca7bade675","original_commit_id":"b87997f97f01607c31efd58624052bca7bade675","user":{"login":"therealprof","id":3321888,"node_id":"MDQ6VXNlcjMzMjE4ODg=","avatar_url":"https://avatars2.githubusercontent.com/u/3321888?v=4","gravatar_id":"","url":"https://api.github.com/users/therealprof","html_url":"https://github.com/therealprof","followers_url":"https://api.github.com/users/therealprof/followers","following_url":"https://api.github.com/users/therealprof/following{/other_user}","gists_url":"https://api.github.com/users/therealprof/gists{/gist_id}","starred_url":"https://api.github.com/users/therealprof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealprof/subscriptions","organizations_url":"https://api.github.com/users/therealprof/orgs","repos_url":"https://api.github.com/users/therealprof/repos","events_url":"https://api.github.com/users/therealprof/events{/privacy}","received_events_url":"https://api.github.com/users/therealprof/received_events","type":"User","site_admin":false},"body":"I think you're right.","created_at":"2018-10-08T11:44:11Z","updated_at":"2018-10-08T11:44:12Z","html_url":"https://github.com/therealprof/stm32f4xx-hal/pull/6#discussion_r223333971","pull_request_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/comments/223333971"},"html":{"href":"https://github.com/therealprof/stm32f4xx-hal/pull/6#discussion_r223333971"},"pull_request":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6"}},"in_reply_to_id":223333286},"pull_request":{"url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6","id":221085346,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxMDg1MzQ2","html_url":"https://github.com/therealprof/stm32f4xx-hal/pull/6","diff_url":"https://github.com/therealprof/stm32f4xx-hal/pull/6.diff","patch_url":"https://github.com/therealprof/stm32f4xx-hal/pull/6.patch","issue_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/issues/6","number":6,"state":"closed","locked":false,"title":"Assert-free delay implemtation","user":{"login":"gbip","id":15819864,"node_id":"MDQ6VXNlcjE1ODE5ODY0","avatar_url":"https://avatars3.githubusercontent.com/u/15819864?v=4","gravatar_id":"","url":"https://api.github.com/users/gbip","html_url":"https://github.com/gbip","followers_url":"https://api.github.com/users/gbip/followers","following_url":"https://api.github.com/users/gbip/following{/other_user}","gists_url":"https://api.github.com/users/gbip/gists{/gist_id}","starred_url":"https://api.github.com/users/gbip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbip/subscriptions","organizations_url":"https://api.github.com/users/gbip/orgs","repos_url":"https://api.github.com/users/gbip/repos","events_url":"https://api.github.com/users/gbip/events{/privacy}","received_events_url":"https://api.github.com/users/gbip/received_events","type":"User","site_admin":false},"body":"Assert-free delay implemtation from the one by @jamesmunns in the stm32f103xx-hal crate.\r\n\r\nThe [stm32f103 implementation](https://github.com/japaric/stm32f103xx-hal/blob/master/src/delay.rs#L48).","created_at":"2018-10-08T11:36:34Z","updated_at":"2018-10-08T11:44:12Z","closed_at":"2018-10-08T11:39:37Z","merged_at":"2018-10-08T11:39:37Z","merge_commit_sha":"9a3b1e23d21ebfa8fe302e650139d31549f28325","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6/commits","review_comments_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6/comments","review_comment_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/issues/6/comments","statuses_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/statuses/b87997f97f01607c31efd58624052bca7bade675","head":{"label":"gbip:panicfree-delay","ref":"panicfree-delay","sha":"b87997f97f01607c31efd58624052bca7bade675","user":{"login":"gbip","id":15819864,"node_id":"MDQ6VXNlcjE1ODE5ODY0","avatar_url":"https://avatars3.githubusercontent.com/u/15819864?v=4","gravatar_id":"","url":"https://api.github.com/users/gbip","html_url":"https://github.com/gbip","followers_url":"https://api.github.com/users/gbip/followers","following_url":"https://api.github.com/users/gbip/following{/other_user}","gists_url":"https://api.github.com/users/gbip/gists{/gist_id}","starred_url":"https://api.github.com/users/gbip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbip/subscriptions","organizations_url":"https://api.github.com/users/gbip/orgs","repos_url":"https://api.github.com/users/gbip/repos","events_url":"https://api.github.com/users/gbip/events{/privacy}","received_events_url":"https://api.github.com/users/gbip/received_events","type":"User","site_admin":false},"repo":{"id":152068989,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIwNjg5ODk=","name":"stm32f4xx-hal","full_name":"gbip/stm32f4xx-hal","private":false,"owner":{"login":"gbip","id":15819864,"node_id":"MDQ6VXNlcjE1ODE5ODY0","avatar_url":"https://avatars3.githubusercontent.com/u/15819864?v=4","gravatar_id":"","url":"https://api.github.com/users/gbip","html_url":"https://github.com/gbip","followers_url":"https://api.github.com/users/gbip/followers","following_url":"https://api.github.com/users/gbip/following{/other_user}","gists_url":"https://api.github.com/users/gbip/gists{/gist_id}","starred_url":"https://api.github.com/users/gbip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbip/subscriptions","organizations_url":"https://api.github.com/users/gbip/orgs","repos_url":"https://api.github.com/users/gbip/repos","events_url":"https://api.github.com/users/gbip/events{/privacy}","received_events_url":"https://api.github.com/users/gbip/received_events","type":"User","site_admin":false},"html_url":"https://github.com/gbip/stm32f4xx-hal","description":"A Rust embedded-hal HAL for all MCUs in the STM32 F4 family","fork":true,"url":"https://api.github.com/repos/gbip/stm32f4xx-hal","forks_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/forks","keys_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/teams","hooks_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/hooks","issue_events_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/issues/events{/number}","events_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/events","assignees_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/assignees{/user}","branches_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/branches{/branch}","tags_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/tags","blobs_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/git/refs{/sha}","trees_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/statuses/{sha}","languages_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/languages","stargazers_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/stargazers","contributors_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/contributors","subscribers_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/subscribers","subscription_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/subscription","commits_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/commits{/sha}","git_commits_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/git/commits{/sha}","comments_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/comments{/number}","issue_comment_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/issues/comments{/number}","contents_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/contents/{+path}","compare_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/merges","archive_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/downloads","issues_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/issues{/number}","pulls_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/pulls{/number}","milestones_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/milestones{/number}","notifications_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/labels{/name}","releases_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/releases{/id}","deployments_url":"https://api.github.com/repos/gbip/stm32f4xx-hal/deployments","created_at":"2018-10-08T11:30:10Z","updated_at":"2018-10-08T11:30:11Z","pushed_at":"2018-10-08T11:35:29Z","git_url":"git://github.com/gbip/stm32f4xx-hal.git","ssh_url":"git@github.com:gbip/stm32f4xx-hal.git","clone_url":"https://github.com/gbip/stm32f4xx-hal.git","svn_url":"https://github.com/gbip/stm32f4xx-hal","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"therealprof:master","ref":"master","sha":"2ade24e075b4d234dc2f3673be675752131cb1f8","user":{"login":"therealprof","id":3321888,"node_id":"MDQ6VXNlcjMzMjE4ODg=","avatar_url":"https://avatars2.githubusercontent.com/u/3321888?v=4","gravatar_id":"","url":"https://api.github.com/users/therealprof","html_url":"https://github.com/therealprof","followers_url":"https://api.github.com/users/therealprof/followers","following_url":"https://api.github.com/users/therealprof/following{/other_user}","gists_url":"https://api.github.com/users/therealprof/gists{/gist_id}","starred_url":"https://api.github.com/users/therealprof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealprof/subscriptions","organizations_url":"https://api.github.com/users/therealprof/orgs","repos_url":"https://api.github.com/users/therealprof/repos","events_url":"https://api.github.com/users/therealprof/events{/privacy}","received_events_url":"https://api.github.com/users/therealprof/received_events","type":"User","site_admin":false},"repo":{"id":151166891,"node_id":"MDEwOlJlcG9zaXRvcnkxNTExNjY4OTE=","name":"stm32f4xx-hal","full_name":"therealprof/stm32f4xx-hal","private":false,"owner":{"login":"therealprof","id":3321888,"node_id":"MDQ6VXNlcjMzMjE4ODg=","avatar_url":"https://avatars2.githubusercontent.com/u/3321888?v=4","gravatar_id":"","url":"https://api.github.com/users/therealprof","html_url":"https://github.com/therealprof","followers_url":"https://api.github.com/users/therealprof/followers","following_url":"https://api.github.com/users/therealprof/following{/other_user}","gists_url":"https://api.github.com/users/therealprof/gists{/gist_id}","starred_url":"https://api.github.com/users/therealprof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealprof/subscriptions","organizations_url":"https://api.github.com/users/therealprof/orgs","repos_url":"https://api.github.com/users/therealprof/repos","events_url":"https://api.github.com/users/therealprof/events{/privacy}","received_events_url":"https://api.github.com/users/therealprof/received_events","type":"User","site_admin":false},"html_url":"https://github.com/therealprof/stm32f4xx-hal","description":"A Rust embedded-hal HAL for all MCUs in the STM32 F4 family","fork":false,"url":"https://api.github.com/repos/therealprof/stm32f4xx-hal","forks_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/forks","keys_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/teams","hooks_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/hooks","issue_events_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/issues/events{/number}","events_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/events","assignees_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/assignees{/user}","branches_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/branches{/branch}","tags_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/tags","blobs_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/git/refs{/sha}","trees_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/statuses/{sha}","languages_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/languages","stargazers_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/stargazers","contributors_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/contributors","subscribers_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/subscribers","subscription_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/subscription","commits_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/commits{/sha}","git_commits_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/git/commits{/sha}","comments_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/comments{/number}","issue_comment_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/issues/comments{/number}","contents_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/contents/{+path}","compare_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/merges","archive_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/downloads","issues_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/issues{/number}","pulls_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls{/number}","milestones_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/milestones{/number}","notifications_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/labels{/name}","releases_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/releases{/id}","deployments_url":"https://api.github.com/repos/therealprof/stm32f4xx-hal/deployments","created_at":"2018-10-01T22:03:48Z","updated_at":"2018-10-08T11:39:39Z","pushed_at":"2018-10-08T11:39:38Z","git_url":"git://github.com/therealprof/stm32f4xx-hal.git","ssh_url":"git@github.com:therealprof/stm32f4xx-hal.git","clone_url":"https://github.com/therealprof/stm32f4xx-hal.git","svn_url":"https://github.com/therealprof/stm32f4xx-hal","homepage":null,"size":13,"stargazers_count":4,"watchers_count":4,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6"},"html":{"href":"https://github.com/therealprof/stm32f4xx-hal/pull/6"},"issue":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/issues/6"},"comments":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/therealprof/stm32f4xx-hal/statuses/b87997f97f01607c31efd58624052bca7bade675"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"therealprof"}}