{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/190215024","pull_request_review_id":122545077,"id":190215024,"diff_hunk":"@@ -0,0 +1,239 @@\n+/*\n+ * Copyright (c) 2013 Nordic Semiconductor ASA\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without modification,\n+ * are permitted provided that the following conditions are met:\n+ *\n+ *   1. Redistributions of source code must retain the above copyright notice, this list\n+ *      of conditions and the following disclaimer.\n+ *\n+ *   2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA\n+ *      integrated circuit in a product or a software update for such product, must reproduce\n+ *      the above copyright notice, this list of conditions and the following disclaimer in\n+ *      the documentation and/or other materials provided with the distribution.\n+ *\n+ *   3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be\n+ *      used to endorse or promote products derived from this software without specific prior\n+ *      written permission.\n+ *\n+ *   4. This software, with or without modification, must only be used with a\n+ *      Nordic Semiconductor ASA integrated circuit.\n+ *\n+ *   5. Any software provided in binary or object form under this license must not be reverse\n+ *      engineered, decompiled, modified and/or disassembled.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ */\n+\n+#include \"us_ticker_api.h\"\n+#include \"common_rtc.h\"\n+#include \"app_util.h\"\n+#include \"nrf_drv_common.h\"\n+#include \"lp_ticker_api.h\"\n+#include \"mbed_critical.h\"\n+\n+#if defined(NRF52_ERRATA_20)\n+    #include \"softdevice_handler.h\"\n+#endif\n+\n+\n+//------------------------------------------------------------------------------\n+// Common stuff used also by lp_ticker and rtc_api (see \"common_rtc.h\").\n+//\n+#include \"app_util_platform.h\"\n+\n+bool              m_common_rtc_enabled = false;\n+uint32_t volatile m_common_rtc_overflows = 0;\n+bool     volatile lp_ticker_interrupt_fire = false;\n+\n+__STATIC_INLINE void rtc_ovf_event_check(void)\n+{\n+    if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW)) {\n+        nrf_rtc_event_clear(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW);\n+        /* Don't disable this event. It shall occur periodically.\n+         * It is needed for RTC. */\n+\n+        ++m_common_rtc_overflows;\n+    }\n+}\n+\n+#if defined(TARGET_MCU_NRF51822)\n+void common_rtc_irq_handler(void)","path":"targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/common_rtc.c","position":72,"original_position":72,"commit_id":"318063e28428864595bb8804ba0115d95188353b","original_commit_id":"318063e28428864595bb8804ba0115d95188353b","user":{"login":"mprse","id":30721012,"avatar_url":"https://avatars0.githubusercontent.com/u/30721012?v=4","gravatar_id":"","url":"https://api.github.com/users/mprse","html_url":"https://github.com/mprse","followers_url":"https://api.github.com/users/mprse/followers","following_url":"https://api.github.com/users/mprse/following{/other_user}","gists_url":"https://api.github.com/users/mprse/gists{/gist_id}","starred_url":"https://api.github.com/users/mprse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprse/subscriptions","organizations_url":"https://api.github.com/users/mprse/orgs","repos_url":"https://api.github.com/users/mprse/repos","events_url":"https://api.github.com/users/mprse/events{/privacy}","received_events_url":"https://api.github.com/users/mprse/received_events","type":"User","site_admin":false},"body":"This file will be moved to `TARGET_NRF5x`. But I would like to do it in the next step together with some changes proposed by @marcuschangarm.","created_at":"2018-05-23T11:43:08Z","updated_at":"2018-05-23T11:43:08Z","html_url":"https://github.com/ARMmbed/mbed-os/pull/6961#discussion_r190215024","pull_request_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/190215024"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6961#discussion_r190215024"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961"}},"in_reply_to_id":190212351},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961","id":189354854,"html_url":"https://github.com/ARMmbed/mbed-os/pull/6961","diff_url":"https://github.com/ARMmbed/mbed-os/pull/6961.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/6961.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6961","number":6961,"state":"open","locked":false,"title":"NRF52_DK: adapt ticker and sleep drivers to the new standards + test updates","user":{"login":"mprse","id":30721012,"avatar_url":"https://avatars0.githubusercontent.com/u/30721012?v=4","gravatar_id":"","url":"https://api.github.com/users/mprse","html_url":"https://github.com/mprse","followers_url":"https://api.github.com/users/mprse/followers","following_url":"https://api.github.com/users/mprse/following{/other_user}","gists_url":"https://api.github.com/users/mprse/gists{/gist_id}","starred_url":"https://api.github.com/users/mprse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprse/subscriptions","organizations_url":"https://api.github.com/users/mprse/orgs","repos_url":"https://api.github.com/users/mprse/repos","events_url":"https://api.github.com/users/mprse/events{/privacy}","received_events_url":"https://api.github.com/users/mprse/received_events","type":"User","site_admin":false},"body":"### Description\r\n\r\nThis PR:\r\n- enables us tickrer and lp ticker support for NRF52 boards,\r\n- updates sleep driver for NRF52 boards (disable us ticker in deep-sleep mode). It has been verified that hal sleep test passes after these changes,\r\n- adapts some tests (please see commits description).\r\n\r\nIn current version we will use same driver as for NRF51_DK. If this step will be successful, then in the next step we can try to use 32 bit counter for us ticker (instead 16 bit counter) and low power counter instead of RTC for lp ticker.\r\n\r\n@bulislaw @0xc0170 Can we run morph and perform review here ASAP in order to get it merged before Friday?\r\n\r\n### Pull request type\r\n\r\n    [ ] Fix\r\n    [ ] Refactor\r\n    [ ] New target\r\n    [X] Feature\r\n    [ ] Breaking change\r\n\r\n","created_at":"2018-05-21T11:36:00Z","updated_at":"2018-05-23T11:43:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f2b871d0967cf8dbf433f9d0529ffcf6e252700","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bulislaw","id":107253,"avatar_url":"https://avatars2.githubusercontent.com/u/107253?v=4","gravatar_id":"","url":"https://api.github.com/users/bulislaw","html_url":"https://github.com/bulislaw","followers_url":"https://api.github.com/users/bulislaw/followers","following_url":"https://api.github.com/users/bulislaw/following{/other_user}","gists_url":"https://api.github.com/users/bulislaw/gists{/gist_id}","starred_url":"https://api.github.com/users/bulislaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bulislaw/subscriptions","organizations_url":"https://api.github.com/users/bulislaw/orgs","repos_url":"https://api.github.com/users/bulislaw/repos","events_url":"https://api.github.com/users/bulislaw/events{/privacy}","received_events_url":"https://api.github.com/users/bulislaw/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":147112891,"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20review","name":"needs: review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6961/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/318063e28428864595bb8804ba0115d95188353b","head":{"label":"mprse:nrf52_dk_tickers","ref":"nrf52_dk_tickers","sha":"318063e28428864595bb8804ba0115d95188353b","user":{"login":"mprse","id":30721012,"avatar_url":"https://avatars0.githubusercontent.com/u/30721012?v=4","gravatar_id":"","url":"https://api.github.com/users/mprse","html_url":"https://github.com/mprse","followers_url":"https://api.github.com/users/mprse/followers","following_url":"https://api.github.com/users/mprse/following{/other_user}","gists_url":"https://api.github.com/users/mprse/gists{/gist_id}","starred_url":"https://api.github.com/users/mprse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprse/subscriptions","organizations_url":"https://api.github.com/users/mprse/orgs","repos_url":"https://api.github.com/users/mprse/repos","events_url":"https://api.github.com/users/mprse/events{/privacy}","received_events_url":"https://api.github.com/users/mprse/received_events","type":"User","site_admin":false},"repo":{"id":100368044,"name":"mbed-os","full_name":"mprse/mbed-os","owner":{"login":"mprse","id":30721012,"avatar_url":"https://avatars0.githubusercontent.com/u/30721012?v=4","gravatar_id":"","url":"https://api.github.com/users/mprse","html_url":"https://github.com/mprse","followers_url":"https://api.github.com/users/mprse/followers","following_url":"https://api.github.com/users/mprse/following{/other_user}","gists_url":"https://api.github.com/users/mprse/gists{/gist_id}","starred_url":"https://api.github.com/users/mprse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprse/subscriptions","organizations_url":"https://api.github.com/users/mprse/orgs","repos_url":"https://api.github.com/users/mprse/repos","events_url":"https://api.github.com/users/mprse/events{/privacy}","received_events_url":"https://api.github.com/users/mprse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mprse/mbed-os","description":"ARM mbed OS is a platform operating system designed for the internet of things","fork":true,"url":"https://api.github.com/repos/mprse/mbed-os","forks_url":"https://api.github.com/repos/mprse/mbed-os/forks","keys_url":"https://api.github.com/repos/mprse/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mprse/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mprse/mbed-os/teams","hooks_url":"https://api.github.com/repos/mprse/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/mprse/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/mprse/mbed-os/events","assignees_url":"https://api.github.com/repos/mprse/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/mprse/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/mprse/mbed-os/tags","blobs_url":"https://api.github.com/repos/mprse/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mprse/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mprse/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/mprse/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mprse/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/mprse/mbed-os/languages","stargazers_url":"https://api.github.com/repos/mprse/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/mprse/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/mprse/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/mprse/mbed-os/subscription","commits_url":"https://api.github.com/repos/mprse/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/mprse/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/mprse/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/mprse/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/mprse/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/mprse/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mprse/mbed-os/merges","archive_url":"https://api.github.com/repos/mprse/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mprse/mbed-os/downloads","issues_url":"https://api.github.com/repos/mprse/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/mprse/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/mprse/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/mprse/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mprse/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/mprse/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/mprse/mbed-os/deployments","created_at":"2017-08-15T10:48:25Z","updated_at":"2018-04-10T08:29:18Z","pushed_at":"2018-05-23T06:30:17Z","git_url":"git://github.com/mprse/mbed-os.git","ssh_url":"git@github.com:mprse/mbed-os.git","clone_url":"https://github.com/mprse/mbed-os.git","svn_url":"https://github.com/mprse/mbed-os","homepage":"https://mbed.com","size":203659,"stargazers_count":0,"watchers_count":0,"language":"C","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":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ARMmbed:feature-hal-spec-ticker","ref":"feature-hal-spec-ticker","sha":"1ec0e3faee4109cde3f3e0f8311a15ff8e898d1c","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":8270972,"name":"mbed-os","full_name":"ARMmbed/mbed-os","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/mbed-os","description":"ARM Mbed OS is a platform operating system designed for the internet of things","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-os","forks_url":"https://api.github.com/repos/ARMmbed/mbed-os/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-os/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-os/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-os/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-os/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbed-os/deployments","created_at":"2013-02-18T15:23:11Z","updated_at":"2018-05-22T19:56:52Z","pushed_at":"2018-05-23T10:47:25Z","git_url":"git://github.com/ARMmbed/mbed-os.git","ssh_url":"git@github.com:ARMmbed/mbed-os.git","clone_url":"https://github.com/ARMmbed/mbed-os.git","svn_url":"https://github.com/ARMmbed/mbed-os","homepage":"https://mbed.com","size":212617,"stargazers_count":1663,"watchers_count":1663,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1455,"mirror_url":null,"archived":false,"open_issues_count":474,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1455,"open_issues":474,"watchers":1663,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6961"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6961"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6961/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6961/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/318063e28428864595bb8804ba0115d95188353b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mprse"}}