{"action":"created","comment":{"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments/85647723","pull_request_review_id":6353605,"id":85647723,"diff_hunk":"@@ -628,13 +633,22 @@ static void calculate_speed(struct legoev3_motor_data *ev3_tm)\n \t\t\tev3_tm->speed  = -new_speed;\n \n \t\tev3_tm->stalled = 0;\n+\t\tev3_tm->stalling = 0;\n \t\tev3_tm->got_new_sample = false;\n \n \t} else if (ev3_tm->max_us_per_sample < ktime_to_us(ktime_sub(ktime_get(), ev3_tm->tacho_samples[diff_idx]))) {\n \n \t\tev3_tm->dir_chg_samples = 0;\n \t\tev3_tm->speed = 0;\n-\t\tev3_tm->stalled = 1;\n+\t\tev3_tm->stalled = 0;\n+\n+\t\tif (ev3_tm->stalling) {\n+\t\t\tif ((TACHO_MOTOR_STALLED_MS * USEC_PER_SEC) < ktime_to_us(ktime_sub(ktime_get(), ev3_tm->stalling_since)))","path":"ev3/legoev3_motor.c","position":41,"original_position":41,"commit_id":"3ef55b23c6a78d83b20fcdd642506e8612b6d5f9","original_commit_id":"3ef55b23c6a78d83b20fcdd642506e8612b6d5f9","user":{"login":"dlech","id":963645,"avatar_url":"https://avatars.githubusercontent.com/u/963645?v=3","gravatar_id":"","url":"https://api.github.com/users/dlech","html_url":"https://github.com/dlech","followers_url":"https://api.github.com/users/dlech/followers","following_url":"https://api.github.com/users/dlech/following{/other_user}","gists_url":"https://api.github.com/users/dlech/gists{/gist_id}","starred_url":"https://api.github.com/users/dlech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlech/subscriptions","organizations_url":"https://api.github.com/users/dlech/orgs","repos_url":"https://api.github.com/users/dlech/repos","events_url":"https://api.github.com/users/dlech/events{/privacy}","received_events_url":"https://api.github.com/users/dlech/received_events","type":"User","site_admin":false},"body":"Why not use `ktime_to_ms()`?","created_at":"2016-10-29T20:27:05Z","updated_at":"2016-10-29T20:29:40Z","html_url":"https://github.com/ev3dev/lego-linux-drivers/pull/57#discussion_r85647723","pull_request_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57","_links":{"self":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments/85647723"},"html":{"href":"https://github.com/ev3dev/lego-linux-drivers/pull/57#discussion_r85647723"},"pull_request":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57"}}},"pull_request":{"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57","id":91499320,"html_url":"https://github.com/ev3dev/lego-linux-drivers/pull/57","diff_url":"https://github.com/ev3dev/lego-linux-drivers/pull/57.diff","patch_url":"https://github.com/ev3dev/lego-linux-drivers/pull/57.patch","issue_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/57","number":57,"state":"open","locked":false,"title":"Wait 100ms before setting the stalled flag","user":{"login":"ddemidov","id":270503,"avatar_url":"https://avatars.githubusercontent.com/u/270503?v=3","gravatar_id":"","url":"https://api.github.com/users/ddemidov","html_url":"https://github.com/ddemidov","followers_url":"https://api.github.com/users/ddemidov/followers","following_url":"https://api.github.com/users/ddemidov/following{/other_user}","gists_url":"https://api.github.com/users/ddemidov/gists{/gist_id}","starred_url":"https://api.github.com/users/ddemidov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddemidov/subscriptions","organizations_url":"https://api.github.com/users/ddemidov/orgs","repos_url":"https://api.github.com/users/ddemidov/repos","events_url":"https://api.github.com/users/ddemidov/events{/privacy}","received_events_url":"https://api.github.com/users/ddemidov/received_events","type":"User","site_admin":false},"body":"See rhempel/ev3dev-lang-python#241.\r\n\r\nThis is more of a question than an actual PR. Would this be the correct way to delay setting the `stalled` state?","created_at":"2016-10-29T19:30:02Z","updated_at":"2016-10-29T20:29:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9019be08f53dbb61703a2292b492c6dd4ea5ec9f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57/commits","review_comments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57/comments","review_comment_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/57/comments","statuses_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/statuses/3ef55b23c6a78d83b20fcdd642506e8612b6d5f9","head":{"label":"ddemidov:tacho-motor-delayed-stall","ref":"tacho-motor-delayed-stall","sha":"3ef55b23c6a78d83b20fcdd642506e8612b6d5f9","user":{"login":"ddemidov","id":270503,"avatar_url":"https://avatars.githubusercontent.com/u/270503?v=3","gravatar_id":"","url":"https://api.github.com/users/ddemidov","html_url":"https://github.com/ddemidov","followers_url":"https://api.github.com/users/ddemidov/followers","following_url":"https://api.github.com/users/ddemidov/following{/other_user}","gists_url":"https://api.github.com/users/ddemidov/gists{/gist_id}","starred_url":"https://api.github.com/users/ddemidov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddemidov/subscriptions","organizations_url":"https://api.github.com/users/ddemidov/orgs","repos_url":"https://api.github.com/users/ddemidov/repos","events_url":"https://api.github.com/users/ddemidov/events{/privacy}","received_events_url":"https://api.github.com/users/ddemidov/received_events","type":"User","site_admin":false},"repo":{"id":35220656,"name":"lego-linux-drivers","full_name":"ddemidov/lego-linux-drivers","owner":{"login":"ddemidov","id":270503,"avatar_url":"https://avatars.githubusercontent.com/u/270503?v=3","gravatar_id":"","url":"https://api.github.com/users/ddemidov","html_url":"https://github.com/ddemidov","followers_url":"https://api.github.com/users/ddemidov/followers","following_url":"https://api.github.com/users/ddemidov/following{/other_user}","gists_url":"https://api.github.com/users/ddemidov/gists{/gist_id}","starred_url":"https://api.github.com/users/ddemidov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddemidov/subscriptions","organizations_url":"https://api.github.com/users/ddemidov/orgs","repos_url":"https://api.github.com/users/ddemidov/repos","events_url":"https://api.github.com/users/ddemidov/events{/privacy}","received_events_url":"https://api.github.com/users/ddemidov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ddemidov/lego-linux-drivers","description":"LEGO MINDSTORMS and LEGO WeDo drivers for Linux from the ev3dev project","fork":true,"url":"https://api.github.com/repos/ddemidov/lego-linux-drivers","forks_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/forks","keys_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/teams","hooks_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/hooks","issue_events_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/issues/events{/number}","events_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/events","assignees_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/assignees{/user}","branches_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/branches{/branch}","tags_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/tags","blobs_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/languages","stargazers_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/stargazers","contributors_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/contributors","subscribers_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/subscribers","subscription_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/subscription","commits_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/contents/{+path}","compare_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/merges","archive_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/downloads","issues_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/issues{/number}","pulls_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/labels{/name}","releases_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/releases{/id}","deployments_url":"https://api.github.com/repos/ddemidov/lego-linux-drivers/deployments","created_at":"2015-05-07T13:09:40Z","updated_at":"2015-05-07T13:09:41Z","pushed_at":"2016-10-29T19:31:38Z","git_url":"git://github.com/ddemidov/lego-linux-drivers.git","ssh_url":"git@github.com:ddemidov/lego-linux-drivers.git","clone_url":"https://github.com/ddemidov/lego-linux-drivers.git","svn_url":"https://github.com/ddemidov/lego-linux-drivers","homepage":"http://www.ev3dev.org","size":1643,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ev3dev:master","ref":"master","sha":"189de719a79c68656f0b970023ae7fff30264e30","user":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"repo":{"id":28286217,"name":"lego-linux-drivers","full_name":"ev3dev/lego-linux-drivers","owner":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ev3dev/lego-linux-drivers","description":"LEGO MINDSTORMS and LEGO WeDo drivers for Linux from the ev3dev project","fork":false,"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers","forks_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/forks","keys_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/teams","hooks_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/hooks","issue_events_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/events{/number}","events_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/events","assignees_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/assignees{/user}","branches_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/branches{/branch}","tags_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/tags","blobs_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/languages","stargazers_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/stargazers","contributors_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/contributors","subscribers_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/subscribers","subscription_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/subscription","commits_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/contents/{+path}","compare_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/merges","archive_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/downloads","issues_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues{/number}","pulls_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/labels{/name}","releases_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/releases{/id}","deployments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/deployments","created_at":"2014-12-21T02:41:32Z","updated_at":"2016-10-22T22:38:19Z","pushed_at":"2016-10-29T19:31:39Z","git_url":"git://github.com/ev3dev/lego-linux-drivers.git","ssh_url":"git@github.com:ev3dev/lego-linux-drivers.git","clone_url":"https://github.com/ev3dev/lego-linux-drivers.git","svn_url":"https://github.com/ev3dev/lego-linux-drivers","homepage":"http://www.ev3dev.org","size":1666,"stargazers_count":22,"watchers_count":22,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":1,"forks":31,"open_issues":1,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57"},"html":{"href":"https://github.com/ev3dev/lego-linux-drivers/pull/57"},"issue":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/57"},"comments":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/statuses/3ef55b23c6a78d83b20fcdd642506e8612b6d5f9"}}}}
{"actor":{"display_login":"dlech"}}