{"action":"created","comment":{"url":"https://api.github.com/repos/contiki-os/contiki/pulls/comments/46972771","id":46972771,"diff_hunk":"@@ -46,62 +46,293 @@\n #include \"sys/rtimer.h\"\n #include \"contiki.h\"\n \n+#include <stdio.h>\n+\n #define DEBUG 0\n #if DEBUG\n-#include <stdio.h>\n #define PRINTF(...) printf(__VA_ARGS__)\n #else\n #define PRINTF(...)\n #endif\n \n-static struct rtimer *next_rtimer;\n-\n+static struct rtimer *volatile next_rtimer;\n /*---------------------------------------------------------------------------*/\n-void\n-rtimer_init(void)\n+/*--------------------------MULTIPLE ACCESS RTIMER---------------------------*/\n+/*---------------------------------------------------------------------------*/\n+#if RTIMER_MULTIPLE_ACCESS\n+#include \"sys/isr-control.h\"\n+/*---------------------------------------------------------------------------*/\n+static void\n+schedule_rtimer_isr_safe(struct rtimer *rtimer)\n {\n-  rtimer_arch_init();\n+  rtimer_clock_t min = RTIMER_NOW() + RTIMER_MINIMAL_SAFE_SCHEDULE;\n+  if(rtimer) {","path":"core/sys/rtimer.c","position":30,"original_position":30,"commit_id":"a0b240ec12aaf1f46637d23bcb8f75fdc73296f4","original_commit_id":"a0b240ec12aaf1f46637d23bcb8f75fdc73296f4","user":{"login":"bkozak-scanimetrics","id":12412857,"avatar_url":"https://avatars.githubusercontent.com/u/12412857?v=3","gravatar_id":"","url":"https://api.github.com/users/bkozak-scanimetrics","html_url":"https://github.com/bkozak-scanimetrics","followers_url":"https://api.github.com/users/bkozak-scanimetrics/followers","following_url":"https://api.github.com/users/bkozak-scanimetrics/following{/other_user}","gists_url":"https://api.github.com/users/bkozak-scanimetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/bkozak-scanimetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkozak-scanimetrics/subscriptions","organizations_url":"https://api.github.com/users/bkozak-scanimetrics/orgs","repos_url":"https://api.github.com/users/bkozak-scanimetrics/repos","events_url":"https://api.github.com/users/bkozak-scanimetrics/events{/privacy}","received_events_url":"https://api.github.com/users/bkozak-scanimetrics/received_events","type":"User","site_admin":false},"body":"> Couldn't min be calculated within the if branch?\r\n\r\nGood eye","created_at":"2015-12-08T16:06:52Z","updated_at":"2015-12-08T16:06:52Z","html_url":"https://github.com/contiki-os/contiki/pull/1290#discussion_r46972771","pull_request_url":"https://api.github.com/repos/contiki-os/contiki/pulls/1290","_links":{"self":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/comments/46972771"},"html":{"href":"https://github.com/contiki-os/contiki/pull/1290#discussion_r46972771"},"pull_request":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/1290"}}},"pull_request":{"url":"https://api.github.com/repos/contiki-os/contiki/pulls/1290","id":46447894,"html_url":"https://github.com/contiki-os/contiki/pull/1290","diff_url":"https://github.com/contiki-os/contiki/pull/1290.diff","patch_url":"https://github.com/contiki-os/contiki/pull/1290.patch","issue_url":"https://api.github.com/repos/contiki-os/contiki/issues/1290","number":1290,"state":"open","locked":false,"title":"Add rtimer multiple access support","user":{"login":"bkozak-scanimetrics","id":12412857,"avatar_url":"https://avatars.githubusercontent.com/u/12412857?v=3","gravatar_id":"","url":"https://api.github.com/users/bkozak-scanimetrics","html_url":"https://github.com/bkozak-scanimetrics","followers_url":"https://api.github.com/users/bkozak-scanimetrics/followers","following_url":"https://api.github.com/users/bkozak-scanimetrics/following{/other_user}","gists_url":"https://api.github.com/users/bkozak-scanimetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/bkozak-scanimetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkozak-scanimetrics/subscriptions","organizations_url":"https://api.github.com/users/bkozak-scanimetrics/orgs","repos_url":"https://api.github.com/users/bkozak-scanimetrics/repos","events_url":"https://api.github.com/users/bkozak-scanimetrics/events{/privacy}","received_events_url":"https://api.github.com/users/bkozak-scanimetrics/received_events","type":"User","site_admin":false},"body":"This patch adds the ability to schedule multiple rtimers simultaneously and does some minor cleanup of the rtimer modules. \r\n\r\nTo facilitate this feature, I've also added in an architecture agnostic API for disabling interrupts (essentially the same as #1117 but with some slight modifications). If this PR is merged, #1117 will be redundant. The multiple access support is not available for any platforms which don't implement this API (at the moment I've implemented CC26xx/CC13xx only).\r\n\r\nI am proposing this patch as an alternative to #495 which I believe went to unnecessary lengths to avoid masking interrupts (and is overly complex as a result). I think that my implementation will be better performing and easier to test. Furthermore, this PR has the benefit of keeping the old single-access functionality around until such time as multiple-access is really needed for any given platform (the old implementation will perform better).\r\n\r\nNote also that I've added some similar functionality to #1199 but this PR doesn't make #1199 redundant.","created_at":"2015-09-30T19:52:21Z","updated_at":"2015-12-08T16:06:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"683dee7596fcf7c596230acb6e59f856d9a629b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/contiki-os/contiki/pulls/1290/commits","review_comments_url":"https://api.github.com/repos/contiki-os/contiki/pulls/1290/comments","review_comment_url":"https://api.github.com/repos/contiki-os/contiki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contiki-os/contiki/issues/1290/comments","statuses_url":"https://api.github.com/repos/contiki-os/contiki/statuses/a0b240ec12aaf1f46637d23bcb8f75fdc73296f4","head":{"label":"bkozak-scanimetrics:add_rtimer_multiple_access","ref":"add_rtimer_multiple_access","sha":"a0b240ec12aaf1f46637d23bcb8f75fdc73296f4","user":{"login":"bkozak-scanimetrics","id":12412857,"avatar_url":"https://avatars.githubusercontent.com/u/12412857?v=3","gravatar_id":"","url":"https://api.github.com/users/bkozak-scanimetrics","html_url":"https://github.com/bkozak-scanimetrics","followers_url":"https://api.github.com/users/bkozak-scanimetrics/followers","following_url":"https://api.github.com/users/bkozak-scanimetrics/following{/other_user}","gists_url":"https://api.github.com/users/bkozak-scanimetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/bkozak-scanimetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkozak-scanimetrics/subscriptions","organizations_url":"https://api.github.com/users/bkozak-scanimetrics/orgs","repos_url":"https://api.github.com/users/bkozak-scanimetrics/repos","events_url":"https://api.github.com/users/bkozak-scanimetrics/events{/privacy}","received_events_url":"https://api.github.com/users/bkozak-scanimetrics/received_events","type":"User","site_admin":false},"repo":{"id":37210139,"name":"contiki","full_name":"bkozak-scanimetrics/contiki","owner":{"login":"bkozak-scanimetrics","id":12412857,"avatar_url":"https://avatars.githubusercontent.com/u/12412857?v=3","gravatar_id":"","url":"https://api.github.com/users/bkozak-scanimetrics","html_url":"https://github.com/bkozak-scanimetrics","followers_url":"https://api.github.com/users/bkozak-scanimetrics/followers","following_url":"https://api.github.com/users/bkozak-scanimetrics/following{/other_user}","gists_url":"https://api.github.com/users/bkozak-scanimetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/bkozak-scanimetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkozak-scanimetrics/subscriptions","organizations_url":"https://api.github.com/users/bkozak-scanimetrics/orgs","repos_url":"https://api.github.com/users/bkozak-scanimetrics/repos","events_url":"https://api.github.com/users/bkozak-scanimetrics/events{/privacy}","received_events_url":"https://api.github.com/users/bkozak-scanimetrics/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bkozak-scanimetrics/contiki","description":"The official git repository for Contiki, the open source OS for the Internet of Things","fork":true,"url":"https://api.github.com/repos/bkozak-scanimetrics/contiki","forks_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/forks","keys_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/teams","hooks_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/hooks","issue_events_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/issues/events{/number}","events_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/events","assignees_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/assignees{/user}","branches_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/branches{/branch}","tags_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/tags","blobs_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/statuses/{sha}","languages_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/languages","stargazers_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/stargazers","contributors_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/contributors","subscribers_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/subscribers","subscription_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/subscription","commits_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/contents/{+path}","compare_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/merges","archive_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/downloads","issues_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/issues{/number}","pulls_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/pulls{/number}","milestones_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/milestones{/number}","notifications_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/labels{/name}","releases_url":"https://api.github.com/repos/bkozak-scanimetrics/contiki/releases{/id}","created_at":"2015-06-10T16:55:37Z","updated_at":"2015-06-10T16:55:49Z","pushed_at":"2015-11-20T22:52:32Z","git_url":"git://github.com/bkozak-scanimetrics/contiki.git","ssh_url":"git@github.com:bkozak-scanimetrics/contiki.git","clone_url":"https://github.com/bkozak-scanimetrics/contiki.git","svn_url":"https://github.com/bkozak-scanimetrics/contiki","homepage":"http://www.contiki-os.org/","size":64341,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"contiki-os:master","ref":"master","sha":"3aa4547327fded37cc6e6349ac29bf37f708f39c","user":{"login":"contiki-os","id":2511296,"avatar_url":"https://avatars.githubusercontent.com/u/2511296?v=3","gravatar_id":"","url":"https://api.github.com/users/contiki-os","html_url":"https://github.com/contiki-os","followers_url":"https://api.github.com/users/contiki-os/followers","following_url":"https://api.github.com/users/contiki-os/following{/other_user}","gists_url":"https://api.github.com/users/contiki-os/gists{/gist_id}","starred_url":"https://api.github.com/users/contiki-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiki-os/subscriptions","organizations_url":"https://api.github.com/users/contiki-os/orgs","repos_url":"https://api.github.com/users/contiki-os/repos","events_url":"https://api.github.com/users/contiki-os/events{/privacy}","received_events_url":"https://api.github.com/users/contiki-os/received_events","type":"Organization","site_admin":false},"repo":{"id":6365284,"name":"contiki","full_name":"contiki-os/contiki","owner":{"login":"contiki-os","id":2511296,"avatar_url":"https://avatars.githubusercontent.com/u/2511296?v=3","gravatar_id":"","url":"https://api.github.com/users/contiki-os","html_url":"https://github.com/contiki-os","followers_url":"https://api.github.com/users/contiki-os/followers","following_url":"https://api.github.com/users/contiki-os/following{/other_user}","gists_url":"https://api.github.com/users/contiki-os/gists{/gist_id}","starred_url":"https://api.github.com/users/contiki-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiki-os/subscriptions","organizations_url":"https://api.github.com/users/contiki-os/orgs","repos_url":"https://api.github.com/users/contiki-os/repos","events_url":"https://api.github.com/users/contiki-os/events{/privacy}","received_events_url":"https://api.github.com/users/contiki-os/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contiki-os/contiki","description":"The official git repository for Contiki, the open source OS for the Internet of Things","fork":false,"url":"https://api.github.com/repos/contiki-os/contiki","forks_url":"https://api.github.com/repos/contiki-os/contiki/forks","keys_url":"https://api.github.com/repos/contiki-os/contiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contiki-os/contiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contiki-os/contiki/teams","hooks_url":"https://api.github.com/repos/contiki-os/contiki/hooks","issue_events_url":"https://api.github.com/repos/contiki-os/contiki/issues/events{/number}","events_url":"https://api.github.com/repos/contiki-os/contiki/events","assignees_url":"https://api.github.com/repos/contiki-os/contiki/assignees{/user}","branches_url":"https://api.github.com/repos/contiki-os/contiki/branches{/branch}","tags_url":"https://api.github.com/repos/contiki-os/contiki/tags","blobs_url":"https://api.github.com/repos/contiki-os/contiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contiki-os/contiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contiki-os/contiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/contiki-os/contiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contiki-os/contiki/statuses/{sha}","languages_url":"https://api.github.com/repos/contiki-os/contiki/languages","stargazers_url":"https://api.github.com/repos/contiki-os/contiki/stargazers","contributors_url":"https://api.github.com/repos/contiki-os/contiki/contributors","subscribers_url":"https://api.github.com/repos/contiki-os/contiki/subscribers","subscription_url":"https://api.github.com/repos/contiki-os/contiki/subscription","commits_url":"https://api.github.com/repos/contiki-os/contiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/contiki-os/contiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/contiki-os/contiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/contiki-os/contiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/contiki-os/contiki/contents/{+path}","compare_url":"https://api.github.com/repos/contiki-os/contiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contiki-os/contiki/merges","archive_url":"https://api.github.com/repos/contiki-os/contiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contiki-os/contiki/downloads","issues_url":"https://api.github.com/repos/contiki-os/contiki/issues{/number}","pulls_url":"https://api.github.com/repos/contiki-os/contiki/pulls{/number}","milestones_url":"https://api.github.com/repos/contiki-os/contiki/milestones{/number}","notifications_url":"https://api.github.com/repos/contiki-os/contiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contiki-os/contiki/labels{/name}","releases_url":"https://api.github.com/repos/contiki-os/contiki/releases{/id}","created_at":"2012-10-24T05:59:36Z","updated_at":"2015-12-08T15:06:02Z","pushed_at":"2015-12-08T14:36:12Z","git_url":"git://github.com/contiki-os/contiki.git","ssh_url":"git@github.com:contiki-os/contiki.git","clone_url":"https://github.com/contiki-os/contiki.git","svn_url":"https://github.com/contiki-os/contiki","homepage":"http://www.contiki-os.org/","size":77997,"stargazers_count":1624,"watchers_count":1624,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1222,"mirror_url":null,"open_issues_count":172,"forks":1222,"open_issues":172,"watchers":1624,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/1290"},"html":{"href":"https://github.com/contiki-os/contiki/pull/1290"},"issue":{"href":"https://api.github.com/repos/contiki-os/contiki/issues/1290"},"comments":{"href":"https://api.github.com/repos/contiki-os/contiki/issues/1290/comments"},"review_comments":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/1290/comments"},"review_comment":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/1290/commits"},"statuses":{"href":"https://api.github.com/repos/contiki-os/contiki/statuses/a0b240ec12aaf1f46637d23bcb8f75fdc73296f4"}}}}