{"action":"created","issue":{"url":"https://api.github.com/repos/contiki-os/contiki/issues/1117","labels_url":"https://api.github.com/repos/contiki-os/contiki/issues/1117/labels{/name}","comments_url":"https://api.github.com/repos/contiki-os/contiki/issues/1117/comments","events_url":"https://api.github.com/repos/contiki-os/contiki/issues/1117/events","html_url":"https://github.com/contiki-os/contiki/pull/1117","id":88504169,"number":1117,"title":"Interrupt api","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-15T18:33:13Z","updated_at":"2015-06-19T15:23:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/contiki-os/contiki/pulls/1117","html_url":"https://github.com/contiki-os/contiki/pull/1117","diff_url":"https://github.com/contiki-os/contiki/pull/1117.diff","patch_url":"https://github.com/contiki-os/contiki/pull/1117.patch"},"body":"This is a simple, platform independent API for creating critical sections by disabling interrupts globally.\r\n\r\nI have also provided a reference implementation in CC26XX and have modified the CC26XX radio driver to use the interface (for the purpose of demonstration and testing).\r\n\r\nEventually we would ideally see implementations for every major platform.\r\n\r\nI believe that it is very important that Contiki have such an API so that it is possible to write atomic sections into some of the core, platform agnostic drivers. This will allow developers to take better advantage of interrupt routines in platform agnostic code. It seems to me that in core Contiki use of interrupts is often avoided where they might otherwise be extremely useful (specifically in the ContikiMAC driver) and I intend to start changing this."},"comment":{"url":"https://api.github.com/repos/contiki-os/contiki/issues/comments/113547338","html_url":"https://github.com/contiki-os/contiki/pull/1117#issuecomment-113547338","issue_url":"https://api.github.com/repos/contiki-os/contiki/issues/1117","id":113547338,"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},"created_at":"2015-06-19T15:23:32Z","updated_at":"2015-06-19T15:23:32Z","body":"@vsaw \r\n\r\nI've considered putting the function code in the C file but have opted to keep it in the header file because I have reasoned that it *might* result in a performance increase which makes it worth the increased code size and stylistic concerns. Also, I think that it is particularly important to keep atomic sections as small as possible and that defining these functions in a header as static inline might just help with this ever so slightly.\r\n\r\nI am by no means entirely convinced of this, however, and would love to hear arguments one way or the other.\r\n\r\nFor now, I'll hold off on making this change."}}