{"action":"created","comment":{"url":"https://api.github.com/repos/apache/mynewt-core/pulls/comments/191350559","pull_request_review_id":123903283,"id":191350559,"diff_hunk":"@@ -0,0 +1,96 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *  http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+#include <inttypes.h>\n+#include <assert.h>\n+\n+#include \"os/mynewt.h\"\n+\n+#include <hal/hal_timer.h>\n+#include \"mcu/stm32_hal.h\"\n+#include \"stm32_common/stm32_hal.h\"\n+\n+\n+/*\n+ * Generic implementation for determining the frequency\n+ * of a timer.\n+ */\n+\n+uint32_t\n+stm32_hal_timer_get_freq(void *regs)\n+{\n+    RCC_ClkInitTypeDef clocks;\n+    uint32_t fl;\n+    uint32_t freq;\n+\n+    HAL_RCC_GetClockConfig(&clocks, &fl);\n+\n+    /*\n+     * Assuming RCC_DCKCFGR->TIMPRE is 0.\n+     * There's just APB2 timers here.\n+     */\n+    switch ((uint32_t)regs) {\n+#ifdef TIM1\n+    case (uint32_t)TIM1:","path":"hw/mcu/stm/stm32l1xx/src/hal_timer_freq.c","position":50,"original_position":50,"commit_id":"03b204d55842c1094c837ac77c2e99c3335efdb8","original_commit_id":"03b204d55842c1094c837ac77c2e99c3335efdb8","user":{"login":"mlampert","id":7856427,"avatar_url":"https://avatars0.githubusercontent.com/u/7856427?v=4","gravatar_id":"","url":"https://api.github.com/users/mlampert","html_url":"https://github.com/mlampert","followers_url":"https://api.github.com/users/mlampert/followers","following_url":"https://api.github.com/users/mlampert/following{/other_user}","gists_url":"https://api.github.com/users/mlampert/gists{/gist_id}","starred_url":"https://api.github.com/users/mlampert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlampert/subscriptions","organizations_url":"https://api.github.com/users/mlampert/orgs","repos_url":"https://api.github.com/users/mlampert/repos","events_url":"https://api.github.com/users/mlampert/events{/privacy}","received_events_url":"https://api.github.com/users/mlampert/received_events","type":"User","site_admin":false},"body":"ah, thanks for pointing that out, meant to clean it up but apparently forgot.","created_at":"2018-05-29T09:00:07Z","updated_at":"2018-05-29T09:00:07Z","html_url":"https://github.com/apache/mynewt-core/pull/1102#discussion_r191350559","pull_request_url":"https://api.github.com/repos/apache/mynewt-core/pulls/1102","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/comments/191350559"},"html":{"href":"https://github.com/apache/mynewt-core/pull/1102#discussion_r191350559"},"pull_request":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/1102"}},"in_reply_to_id":189988511},"pull_request":{"url":"https://api.github.com/repos/apache/mynewt-core/pulls/1102","id":188587141,"html_url":"https://github.com/apache/mynewt-core/pull/1102","diff_url":"https://github.com/apache/mynewt-core/pull/1102.diff","patch_url":"https://github.com/apache/mynewt-core/pull/1102.patch","issue_url":"https://api.github.com/repos/apache/mynewt-core/issues/1102","number":1102,"state":"open","locked":false,"title":"Feature/stm32 pwm enabled","user":{"login":"mlampert","id":7856427,"avatar_url":"https://avatars0.githubusercontent.com/u/7856427?v=4","gravatar_id":"","url":"https://api.github.com/users/mlampert","html_url":"https://github.com/mlampert","followers_url":"https://api.github.com/users/mlampert/followers","following_url":"https://api.github.com/users/mlampert/following{/other_user}","gists_url":"https://api.github.com/users/mlampert/gists{/gist_id}","starred_url":"https://api.github.com/users/mlampert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlampert/subscriptions","organizations_url":"https://api.github.com/users/mlampert/orgs","repos_url":"https://api.github.com/users/mlampert/repos","events_url":"https://api.github.com/users/mlampert/events{/privacy}","received_events_url":"https://api.github.com/users/mlampert/received_events","type":"User","site_admin":false},"body":"- Adds a pwm driver for stm32 with full suppport for the new pwm API.\r\n- Refactors pwm_test to also support nucleo-f303k8, nucleo-f303re and nucleo-f767zi\r\n- Currently the stm32f3 and stm32f7 are supported - the implementation is generic and should work for all stm32 processors but I have no way of testing.\r\n- Includes start of the GPIO pin refactoring - to be completed in another PR.","created_at":"2018-05-16T23:25:26Z","updated_at":"2018-05-29T09:00:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05b8bb766749fd00c3c7903375eb335d80863a23","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/mynewt-core/pulls/1102/commits","review_comments_url":"https://api.github.com/repos/apache/mynewt-core/pulls/1102/comments","review_comment_url":"https://api.github.com/repos/apache/mynewt-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/mynewt-core/issues/1102/comments","statuses_url":"https://api.github.com/repos/apache/mynewt-core/statuses/03b204d55842c1094c837ac77c2e99c3335efdb8","head":{"label":"mlampert:feature/stm32-pwm-enabled","ref":"feature/stm32-pwm-enabled","sha":"03b204d55842c1094c837ac77c2e99c3335efdb8","user":{"login":"mlampert","id":7856427,"avatar_url":"https://avatars0.githubusercontent.com/u/7856427?v=4","gravatar_id":"","url":"https://api.github.com/users/mlampert","html_url":"https://github.com/mlampert","followers_url":"https://api.github.com/users/mlampert/followers","following_url":"https://api.github.com/users/mlampert/following{/other_user}","gists_url":"https://api.github.com/users/mlampert/gists{/gist_id}","starred_url":"https://api.github.com/users/mlampert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlampert/subscriptions","organizations_url":"https://api.github.com/users/mlampert/orgs","repos_url":"https://api.github.com/users/mlampert/repos","events_url":"https://api.github.com/users/mlampert/events{/privacy}","received_events_url":"https://api.github.com/users/mlampert/received_events","type":"User","site_admin":false},"repo":{"id":116766539,"name":"mynewt-core","full_name":"mlampert/mynewt-core","owner":{"login":"mlampert","id":7856427,"avatar_url":"https://avatars0.githubusercontent.com/u/7856427?v=4","gravatar_id":"","url":"https://api.github.com/users/mlampert","html_url":"https://github.com/mlampert","followers_url":"https://api.github.com/users/mlampert/followers","following_url":"https://api.github.com/users/mlampert/following{/other_user}","gists_url":"https://api.github.com/users/mlampert/gists{/gist_id}","starred_url":"https://api.github.com/users/mlampert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlampert/subscriptions","organizations_url":"https://api.github.com/users/mlampert/orgs","repos_url":"https://api.github.com/users/mlampert/repos","events_url":"https://api.github.com/users/mlampert/events{/privacy}","received_events_url":"https://api.github.com/users/mlampert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mlampert/mynewt-core","description":"An OS to build, deploy and securely manage billions of devices","fork":true,"url":"https://api.github.com/repos/mlampert/mynewt-core","forks_url":"https://api.github.com/repos/mlampert/mynewt-core/forks","keys_url":"https://api.github.com/repos/mlampert/mynewt-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mlampert/mynewt-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mlampert/mynewt-core/teams","hooks_url":"https://api.github.com/repos/mlampert/mynewt-core/hooks","issue_events_url":"https://api.github.com/repos/mlampert/mynewt-core/issues/events{/number}","events_url":"https://api.github.com/repos/mlampert/mynewt-core/events","assignees_url":"https://api.github.com/repos/mlampert/mynewt-core/assignees{/user}","branches_url":"https://api.github.com/repos/mlampert/mynewt-core/branches{/branch}","tags_url":"https://api.github.com/repos/mlampert/mynewt-core/tags","blobs_url":"https://api.github.com/repos/mlampert/mynewt-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mlampert/mynewt-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mlampert/mynewt-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/mlampert/mynewt-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mlampert/mynewt-core/statuses/{sha}","languages_url":"https://api.github.com/repos/mlampert/mynewt-core/languages","stargazers_url":"https://api.github.com/repos/mlampert/mynewt-core/stargazers","contributors_url":"https://api.github.com/repos/mlampert/mynewt-core/contributors","subscribers_url":"https://api.github.com/repos/mlampert/mynewt-core/subscribers","subscription_url":"https://api.github.com/repos/mlampert/mynewt-core/subscription","commits_url":"https://api.github.com/repos/mlampert/mynewt-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/mlampert/mynewt-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/mlampert/mynewt-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/mlampert/mynewt-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/mlampert/mynewt-core/contents/{+path}","compare_url":"https://api.github.com/repos/mlampert/mynewt-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mlampert/mynewt-core/merges","archive_url":"https://api.github.com/repos/mlampert/mynewt-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mlampert/mynewt-core/downloads","issues_url":"https://api.github.com/repos/mlampert/mynewt-core/issues{/number}","pulls_url":"https://api.github.com/repos/mlampert/mynewt-core/pulls{/number}","milestones_url":"https://api.github.com/repos/mlampert/mynewt-core/milestones{/number}","notifications_url":"https://api.github.com/repos/mlampert/mynewt-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mlampert/mynewt-core/labels{/name}","releases_url":"https://api.github.com/repos/mlampert/mynewt-core/releases{/id}","deployments_url":"https://api.github.com/repos/mlampert/mynewt-core/deployments","created_at":"2018-01-09T04:39:27Z","updated_at":"2018-01-09T04:39:44Z","pushed_at":"2018-05-18T14:36:56Z","git_url":"git://github.com/mlampert/mynewt-core.git","ssh_url":"git@github.com:mlampert/mynewt-core.git","clone_url":"https://github.com/mlampert/mynewt-core.git","svn_url":"https://github.com/mlampert/mynewt-core","homepage":"https://mynewt.apache.org/","size":154007,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"d03f91491c0563d7e4dabd1e7627ed023fd054cd","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":45165993,"name":"mynewt-core","full_name":"apache/mynewt-core","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/mynewt-core","description":"An OS to build, deploy and securely manage billions of devices","fork":false,"url":"https://api.github.com/repos/apache/mynewt-core","forks_url":"https://api.github.com/repos/apache/mynewt-core/forks","keys_url":"https://api.github.com/repos/apache/mynewt-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/mynewt-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/mynewt-core/teams","hooks_url":"https://api.github.com/repos/apache/mynewt-core/hooks","issue_events_url":"https://api.github.com/repos/apache/mynewt-core/issues/events{/number}","events_url":"https://api.github.com/repos/apache/mynewt-core/events","assignees_url":"https://api.github.com/repos/apache/mynewt-core/assignees{/user}","branches_url":"https://api.github.com/repos/apache/mynewt-core/branches{/branch}","tags_url":"https://api.github.com/repos/apache/mynewt-core/tags","blobs_url":"https://api.github.com/repos/apache/mynewt-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/mynewt-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/mynewt-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/mynewt-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/mynewt-core/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/mynewt-core/languages","stargazers_url":"https://api.github.com/repos/apache/mynewt-core/stargazers","contributors_url":"https://api.github.com/repos/apache/mynewt-core/contributors","subscribers_url":"https://api.github.com/repos/apache/mynewt-core/subscribers","subscription_url":"https://api.github.com/repos/apache/mynewt-core/subscription","commits_url":"https://api.github.com/repos/apache/mynewt-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/mynewt-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/mynewt-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/mynewt-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/mynewt-core/contents/{+path}","compare_url":"https://api.github.com/repos/apache/mynewt-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/mynewt-core/merges","archive_url":"https://api.github.com/repos/apache/mynewt-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/mynewt-core/downloads","issues_url":"https://api.github.com/repos/apache/mynewt-core/issues{/number}","pulls_url":"https://api.github.com/repos/apache/mynewt-core/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/mynewt-core/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/mynewt-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/mynewt-core/labels{/name}","releases_url":"https://api.github.com/repos/apache/mynewt-core/releases{/id}","deployments_url":"https://api.github.com/repos/apache/mynewt-core/deployments","created_at":"2015-10-29T07:00:07Z","updated_at":"2018-05-28T21:52:57Z","pushed_at":"2018-05-28T21:52:53Z","git_url":"git://github.com/apache/mynewt-core.git","ssh_url":"git@github.com:apache/mynewt-core.git","clone_url":"https://github.com/apache/mynewt-core.git","svn_url":"https://github.com/apache/mynewt-core","homepage":"https://mynewt.apache.org/","size":153723,"stargazers_count":344,"watchers_count":344,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":175,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":175,"open_issues":43,"watchers":344,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/1102"},"html":{"href":"https://github.com/apache/mynewt-core/pull/1102"},"issue":{"href":"https://api.github.com/repos/apache/mynewt-core/issues/1102"},"comments":{"href":"https://api.github.com/repos/apache/mynewt-core/issues/1102/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/1102/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/1102/commits"},"statuses":{"href":"https://api.github.com/repos/apache/mynewt-core/statuses/03b204d55842c1094c837ac77c2e99c3335efdb8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mlampert"}}