{"action":"created","comment":{"url":"https://api.github.com/repos/apache/mynewt-core/pulls/comments/193797028","pull_request_review_id":126843178,"id":193797028,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mzc5NzAyOA==","diff_hunk":"@@ -1920,52 +1924,115 @@ int lis2dw12_get_int1_on_int2_map(struct sensor_itf *itf, uint8_t *val)\n int lis2dw12_run_self_test(struct sensor_itf *itf, int *result)\n {\n     int rc;\n-    /*configure min and max values for reading 5 samples, and accounting for\n-     * both negative and positive offset */\n-    int min = LIS2DW12_ST_MIN*5*2;\n-    int max = LIS2DW12_ST_MAX*5*2;\n-\n-    int16_t data[3], diff[3] = {0,0,0};\n+    int16_t no_st[3], st[3], data[3] = {0,0,0};\n+    int32_t scratch[3] = {0,0,0};\n     int i;\n     uint8_t prev_config[6];\n-    /* set config per datasheet, with positive self test mode enabled. */\n-    uint8_t st_config[] = {0x44, 0x04, 0x40, 0x00, 0x00, 0x10};\n+    *result = 0;\n+    uint8_t config[6] = { LIS2DW12_DATA_RATE_50HZ | LIS2DW12_PM_HIGH_PERF, LIS2DW12_CTRL_REG2_IF_ADD_INC, 0x00, 0x00, 0x00, LIS2DW12_FS_4G};\n+    uint8_t fs;\n \n     rc = lis2dw12_readlen(itf, LIS2DW12_REG_CTRL_REG1, prev_config, 6);\n     if (rc) {\n         return rc;\n     }\n-    rc = lis2dw12_writelen(itf, LIS2DW12_REG_CTRL_REG2, &st_config[1], 5);\n-    rc = lis2dw12_writelen(itf, LIS2DW12_REG_CTRL_REG1, st_config, 1);\n+\n+    rc = lis2dw12_writelen(itf, LIS2DW12_REG_CTRL_REG2, &config[1], 5);\n+    if (rc) {\n+        return rc;\n+    }\n+\n+    rc = lis2dw12_write8(itf, LIS2DW12_REG_CTRL_REG1, config[0]);\n     if (rc) {\n         return rc;\n     }\n \n+    /* wait 200ms */\n+    os_time_delay(OS_TICKS_PER_SEC / 200);","path":"hw/drivers/sensors/lis2dw12/src/lis2dw12.c","position":null,"original_position":150,"commit_id":"eaad01cd2dbb00703d12ef80ca65b9e8874b92df","original_commit_id":"7c16b62d91eafff995c7741a5eb1607f81732670","user":{"login":"jacobrosenthal","id":455796,"node_id":"MDQ6VXNlcjQ1NTc5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/455796?v=4","gravatar_id":"","url":"https://api.github.com/users/jacobrosenthal","html_url":"https://github.com/jacobrosenthal","followers_url":"https://api.github.com/users/jacobrosenthal/followers","following_url":"https://api.github.com/users/jacobrosenthal/following{/other_user}","gists_url":"https://api.github.com/users/jacobrosenthal/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobrosenthal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobrosenthal/subscriptions","organizations_url":"https://api.github.com/users/jacobrosenthal/orgs","repos_url":"https://api.github.com/users/jacobrosenthal/repos","events_url":"https://api.github.com/users/jacobrosenthal/events{/privacy}","received_events_url":"https://api.github.com/users/jacobrosenthal/received_events","type":"User","site_admin":false},"body":"Good catch. Thanks fixed in eaad01c","created_at":"2018-06-07T15:47:02Z","updated_at":"2018-06-07T15:47:03Z","html_url":"https://github.com/apache/mynewt-core/pull/1154#discussion_r193797028","pull_request_url":"https://api.github.com/repos/apache/mynewt-core/pulls/1154","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/comments/193797028"},"html":{"href":"https://github.com/apache/mynewt-core/pull/1154#discussion_r193797028"},"pull_request":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/1154"}},"in_reply_to_id":193692705},"pull_request":{"url":"https://api.github.com/repos/apache/mynewt-core/pulls/1154","id":192197076,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMTk3MDc2","html_url":"https://github.com/apache/mynewt-core/pull/1154","diff_url":"https://github.com/apache/mynewt-core/pull/1154.diff","patch_url":"https://github.com/apache/mynewt-core/pull/1154.patch","issue_url":"https://api.github.com/repos/apache/mynewt-core/issues/1154","number":1154,"state":"open","locked":false,"title":"Lis2dw12 fixes from lis2ds12 port","user":{"login":"jacobrosenthal","id":455796,"node_id":"MDQ6VXNlcjQ1NTc5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/455796?v=4","gravatar_id":"","url":"https://api.github.com/users/jacobrosenthal","html_url":"https://github.com/jacobrosenthal","followers_url":"https://api.github.com/users/jacobrosenthal/followers","following_url":"https://api.github.com/users/jacobrosenthal/following{/other_user}","gists_url":"https://api.github.com/users/jacobrosenthal/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobrosenthal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobrosenthal/subscriptions","organizations_url":"https://api.github.com/users/jacobrosenthal/orgs","repos_url":"https://api.github.com/users/jacobrosenthal/repos","events_url":"https://api.github.com/users/jacobrosenthal/events{/privacy}","received_events_url":"https://api.github.com/users/jacobrosenthal/received_events","type":"User","site_admin":false},"body":"Needs testing, I dont have this device this is just my set of notes from porting. Happy to rebase or remove any commits.\r\n\r\nId especially like to see if self test is still passing for people as it had a few problems still. I dont personally feel like its properly implemented even yet.\r\n\r\nAN5038 Section 8 says\r\n\r\n> The procedure consists of:\r\n> 1. enabling the accelerometer\r\n> 2. averaging five samples before enabling the self-test\r\n> 3. averaging five samples after enabling the self-test\r\n> 4. computing the difference in absolute value for each axis and verifying that it falls within\r\n> a given range. The min and max values are provided in the datasheet.\r\n\r\nAnd Im not sure I consider the current implementation following that quote\r\nThis https://github.com/apache/mynewt-core/pull/948/commits/787e2a2a915b9f3e4da2fce6ea60989b5e6cc1ba is passing for me and my current recommendation, but I dont have your board.","created_at":"2018-06-02T13:09:15Z","updated_at":"2018-06-07T15:47:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"738a7a330e1c78020327ba5d08010d849aa04f25","assignee":null,"assignees":[],"requested_reviewers":[{"login":"vrahane","id":7097467,"node_id":"MDQ6VXNlcjcwOTc0Njc=","avatar_url":"https://avatars0.githubusercontent.com/u/7097467?v=4","gravatar_id":"","url":"https://api.github.com/users/vrahane","html_url":"https://github.com/vrahane","followers_url":"https://api.github.com/users/vrahane/followers","following_url":"https://api.github.com/users/vrahane/following{/other_user}","gists_url":"https://api.github.com/users/vrahane/gists{/gist_id}","starred_url":"https://api.github.com/users/vrahane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrahane/subscriptions","organizations_url":"https://api.github.com/users/vrahane/orgs","repos_url":"https://api.github.com/users/vrahane/repos","events_url":"https://api.github.com/users/vrahane/events{/privacy}","received_events_url":"https://api.github.com/users/vrahane/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/apache/mynewt-core/milestones/2","html_url":"https://github.com/apache/mynewt-core/milestone/2","labels_url":"https://api.github.com/repos/apache/mynewt-core/milestones/2/labels","id":3385045,"node_id":"MDk6TWlsZXN0b25lMzM4NTA0NQ==","number":2,"title":"1.5.0","description":null,"creator":{"login":"sjanc","id":10303625,"node_id":"MDQ6VXNlcjEwMzAzNjI1","avatar_url":"https://avatars2.githubusercontent.com/u/10303625?v=4","gravatar_id":"","url":"https://api.github.com/users/sjanc","html_url":"https://github.com/sjanc","followers_url":"https://api.github.com/users/sjanc/followers","following_url":"https://api.github.com/users/sjanc/following{/other_user}","gists_url":"https://api.github.com/users/sjanc/gists{/gist_id}","starred_url":"https://api.github.com/users/sjanc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjanc/subscriptions","organizations_url":"https://api.github.com/users/sjanc/orgs","repos_url":"https://api.github.com/users/sjanc/repos","events_url":"https://api.github.com/users/sjanc/events{/privacy}","received_events_url":"https://api.github.com/users/sjanc/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2018-05-29T18:23:23Z","updated_at":"2018-06-04T06:55:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/apache/mynewt-core/pulls/1154/commits","review_comments_url":"https://api.github.com/repos/apache/mynewt-core/pulls/1154/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/1154/comments","statuses_url":"https://api.github.com/repos/apache/mynewt-core/statuses/eaad01cd2dbb00703d12ef80ca65b9e8874b92df","head":{"label":"jacobrosenthal:lis2dw12","ref":"lis2dw12","sha":"eaad01cd2dbb00703d12ef80ca65b9e8874b92df","user":{"login":"jacobrosenthal","id":455796,"node_id":"MDQ6VXNlcjQ1NTc5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/455796?v=4","gravatar_id":"","url":"https://api.github.com/users/jacobrosenthal","html_url":"https://github.com/jacobrosenthal","followers_url":"https://api.github.com/users/jacobrosenthal/followers","following_url":"https://api.github.com/users/jacobrosenthal/following{/other_user}","gists_url":"https://api.github.com/users/jacobrosenthal/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobrosenthal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobrosenthal/subscriptions","organizations_url":"https://api.github.com/users/jacobrosenthal/orgs","repos_url":"https://api.github.com/users/jacobrosenthal/repos","events_url":"https://api.github.com/users/jacobrosenthal/events{/privacy}","received_events_url":"https://api.github.com/users/jacobrosenthal/received_events","type":"User","site_admin":false},"repo":{"id":80243929,"node_id":"MDEwOlJlcG9zaXRvcnk4MDI0MzkyOQ==","name":"mynewt-core","full_name":"jacobrosenthal/mynewt-core","owner":{"login":"jacobrosenthal","id":455796,"node_id":"MDQ6VXNlcjQ1NTc5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/455796?v=4","gravatar_id":"","url":"https://api.github.com/users/jacobrosenthal","html_url":"https://github.com/jacobrosenthal","followers_url":"https://api.github.com/users/jacobrosenthal/followers","following_url":"https://api.github.com/users/jacobrosenthal/following{/other_user}","gists_url":"https://api.github.com/users/jacobrosenthal/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobrosenthal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobrosenthal/subscriptions","organizations_url":"https://api.github.com/users/jacobrosenthal/orgs","repos_url":"https://api.github.com/users/jacobrosenthal/repos","events_url":"https://api.github.com/users/jacobrosenthal/events{/privacy}","received_events_url":"https://api.github.com/users/jacobrosenthal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacobrosenthal/mynewt-core","description":"Mirror of Apache MyNewt Core (Incubating)","fork":true,"url":"https://api.github.com/repos/jacobrosenthal/mynewt-core","forks_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/forks","keys_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/teams","hooks_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/hooks","issue_events_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/issues/events{/number}","events_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/events","assignees_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/assignees{/user}","branches_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/branches{/branch}","tags_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/tags","blobs_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/statuses/{sha}","languages_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/languages","stargazers_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/stargazers","contributors_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/contributors","subscribers_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/subscribers","subscription_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/subscription","commits_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/contents/{+path}","compare_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/merges","archive_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/downloads","issues_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/issues{/number}","pulls_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/pulls{/number}","milestones_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/milestones{/number}","notifications_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/labels{/name}","releases_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/releases{/id}","deployments_url":"https://api.github.com/repos/jacobrosenthal/mynewt-core/deployments","created_at":"2017-01-27T20:37:31Z","updated_at":"2017-07-13T18:17:16Z","pushed_at":"2018-06-07T15:46:48Z","git_url":"git://github.com/jacobrosenthal/mynewt-core.git","ssh_url":"git@github.com:jacobrosenthal/mynewt-core.git","clone_url":"https://github.com/jacobrosenthal/mynewt-core.git","svn_url":"https://github.com/jacobrosenthal/mynewt-core","homepage":"","size":153973,"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","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"4de756474e973a2822a199cd2e0129caa432518b","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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,"node_id":"MDEwOlJlcG9zaXRvcnk0NTE2NTk5Mw==","name":"mynewt-core","full_name":"apache/mynewt-core","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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-06-07T03:12:42Z","pushed_at":"2018-06-07T15:46:50Z","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":153923,"stargazers_count":346,"watchers_count":346,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":177,"mirror_url":null,"archived":false,"open_issues_count":39,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":177,"open_issues":39,"watchers":346,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/1154"},"html":{"href":"https://github.com/apache/mynewt-core/pull/1154"},"issue":{"href":"https://api.github.com/repos/apache/mynewt-core/issues/1154"},"comments":{"href":"https://api.github.com/repos/apache/mynewt-core/issues/1154/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/mynewt-core/pulls/1154/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/1154/commits"},"statuses":{"href":"https://api.github.com/repos/apache/mynewt-core/statuses/eaad01cd2dbb00703d12ef80ca65b9e8874b92df"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jacobrosenthal"}}