{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/30459764","id":30459764,"diff_hunk":"@@ -0,0 +1,170 @@\n+/*\n+ * Copyright 2015 Ludwig Ortmann\n+ * Copyright 2015 Christian Mehlis\n+ *\n+ * This file is subject to the terms and conditions of the GNU Lesser\n+ * General Public License v2.1. See the file LICENSE in the top level\n+ * directory for more details.\n+ */\n+\n+/**\n+ * @ingroup     driver_dht\n+ * @{\n+ *\n+ * @file\n+ * @brief       Device driver implementation for the DHT 11 and 22\n+ *              temperature and humidity sensor\n+ *\n+ * @author      Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>\n+ * @author      Christian Mehlis <mehlis@inf.fu-berlin.de>\n+ *\n+ * @}\n+ */\n+\n+#include <stdint.h>\n+\n+#include \"hwtimer.h\"\n+#include \"periph/gpio.h\"\n+\n+#include \"dht.h\"\n+\n+#define ENABLE_DEBUG    (1)\n+#include \"debug.h\"\n+\n+/***********************************************************************\n+ * internal API declaration\n+ **********************************************************************/\n+\n+static void dht_read_data(gpio_t dev, uint32_t *data, uint8_t *checksum);\n+static int dht_test_checksum(uint32_t data, uint8_t checksum);\n+\n+/***********************************************************************\n+ * internal API implementation\n+ **********************************************************************/\n+\n+static int dht_test_checksum(uint32_t data, uint8_t checksum)\n+{\n+    uint8_t sum;\n+    sum  = data >>  0 & 0x000000FF;\n+    sum += data >>  8 & 0x000000FF;\n+    sum += data >> 16 & 0x000000FF;\n+    sum += data >> 24 & 0x000000FF;\n+\n+    return ((checksum == sum) && (checksum != 0));\n+}\n+\n+static void dht_read_data(gpio_t dev, uint32_t *data, uint8_t *checksum)\n+{\n+    /* send init signal to device */\n+    gpio_clear(dev);\n+    hwtimer_wait(HWTIMER_TICKS(20 * 1000));","path":"drivers/dht/dht.c","position":81,"original_position":60,"commit_id":"bce918b873ae1bc7b44557043a59b739872f2a33","original_commit_id":"7e66e072228bc0f433e8e8ed4b6e8704df459ccd","user":{"login":"LudwigOrtmann","id":3739173,"avatar_url":"https://avatars.githubusercontent.com/u/3739173?v=3","gravatar_id":"","url":"https://api.github.com/users/LudwigOrtmann","html_url":"https://github.com/LudwigOrtmann","followers_url":"https://api.github.com/users/LudwigOrtmann/followers","following_url":"https://api.github.com/users/LudwigOrtmann/following{/other_user}","gists_url":"https://api.github.com/users/LudwigOrtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LudwigOrtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LudwigOrtmann/subscriptions","organizations_url":"https://api.github.com/users/LudwigOrtmann/orgs","repos_url":"https://api.github.com/users/LudwigOrtmann/repos","events_url":"https://api.github.com/users/LudwigOrtmann/events{/privacy}","received_events_url":"https://api.github.com/users/LudwigOrtmann/received_events","type":"User","site_admin":false},"body":"ah, wrong working directory.. sry","created_at":"2015-05-16T09:04:37Z","updated_at":"2015-05-16T09:04:37Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/2990#discussion_r30459764","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/30459764"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/2990#discussion_r30459764"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990"}}},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990","id":35552806,"html_url":"https://github.com/RIOT-OS/RIOT/pull/2990","diff_url":"https://github.com/RIOT-OS/RIOT/pull/2990.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/2990.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2990","number":2990,"state":"open","locked":false,"title":"drivers/dht: initial import","user":{"login":"LudwigOrtmann","id":3739173,"avatar_url":"https://avatars.githubusercontent.com/u/3739173?v=3","gravatar_id":"","url":"https://api.github.com/users/LudwigOrtmann","html_url":"https://github.com/LudwigOrtmann","followers_url":"https://api.github.com/users/LudwigOrtmann/followers","following_url":"https://api.github.com/users/LudwigOrtmann/following{/other_user}","gists_url":"https://api.github.com/users/LudwigOrtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LudwigOrtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LudwigOrtmann/subscriptions","organizations_url":"https://api.github.com/users/LudwigOrtmann/orgs","repos_url":"https://api.github.com/users/LudwigOrtmann/repos","events_url":"https://api.github.com/users/LudwigOrtmann/events{/privacy}","received_events_url":"https://api.github.com/users/LudwigOrtmann/received_events","type":"User","site_admin":false},"body":"Unified driver for DHT11 and DHT22.\r\nTest application included.","created_at":"2015-05-15T21:31:47Z","updated_at":"2015-05-16T09:04:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c51191c2b65d1d5b79ac44a822e7fe8c4d95d3c","assignee":{"login":"PeterKietzmann","id":7765855,"avatar_url":"https://avatars.githubusercontent.com/u/7765855?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterKietzmann","html_url":"https://github.com/PeterKietzmann","followers_url":"https://api.github.com/users/PeterKietzmann/followers","following_url":"https://api.github.com/users/PeterKietzmann/following{/other_user}","gists_url":"https://api.github.com/users/PeterKietzmann/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterKietzmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterKietzmann/subscriptions","organizations_url":"https://api.github.com/users/PeterKietzmann/orgs","repos_url":"https://api.github.com/users/PeterKietzmann/repos","events_url":"https://api.github.com/users/PeterKietzmann/events{/privacy}","received_events_url":"https://api.github.com/users/PeterKietzmann/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990/comments","review_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2990/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/bce918b873ae1bc7b44557043a59b739872f2a33","head":{"label":"LudwigOrtmann:pr/dht","ref":"pr/dht","sha":"bce918b873ae1bc7b44557043a59b739872f2a33","user":{"login":"LudwigOrtmann","id":3739173,"avatar_url":"https://avatars.githubusercontent.com/u/3739173?v=3","gravatar_id":"","url":"https://api.github.com/users/LudwigOrtmann","html_url":"https://github.com/LudwigOrtmann","followers_url":"https://api.github.com/users/LudwigOrtmann/followers","following_url":"https://api.github.com/users/LudwigOrtmann/following{/other_user}","gists_url":"https://api.github.com/users/LudwigOrtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LudwigOrtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LudwigOrtmann/subscriptions","organizations_url":"https://api.github.com/users/LudwigOrtmann/orgs","repos_url":"https://api.github.com/users/LudwigOrtmann/repos","events_url":"https://api.github.com/users/LudwigOrtmann/events{/privacy}","received_events_url":"https://api.github.com/users/LudwigOrtmann/received_events","type":"User","site_admin":false},"repo":{"id":8590137,"name":"RIOT","full_name":"LudwigOrtmann/RIOT","owner":{"login":"LudwigOrtmann","id":3739173,"avatar_url":"https://avatars.githubusercontent.com/u/3739173?v=3","gravatar_id":"","url":"https://api.github.com/users/LudwigOrtmann","html_url":"https://github.com/LudwigOrtmann","followers_url":"https://api.github.com/users/LudwigOrtmann/followers","following_url":"https://api.github.com/users/LudwigOrtmann/following{/other_user}","gists_url":"https://api.github.com/users/LudwigOrtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LudwigOrtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LudwigOrtmann/subscriptions","organizations_url":"https://api.github.com/users/LudwigOrtmann/orgs","repos_url":"https://api.github.com/users/LudwigOrtmann/repos","events_url":"https://api.github.com/users/LudwigOrtmann/events{/privacy}","received_events_url":"https://api.github.com/users/LudwigOrtmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LudwigOrtmann/RIOT","description":"RIOT - The rum OS for the IoT ","fork":true,"url":"https://api.github.com/repos/LudwigOrtmann/RIOT","forks_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/forks","keys_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/teams","hooks_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/hooks","issue_events_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/events","assignees_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/tags","blobs_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/languages","stargazers_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/stargazers","contributors_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/contributors","subscribers_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/subscribers","subscription_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/subscription","commits_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/merges","archive_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/downloads","issues_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/releases{/id}","created_at":"2013-03-05T22:01:42Z","updated_at":"2015-05-05T18:50:29Z","pushed_at":"2015-05-16T08:40:42Z","git_url":"git://github.com/LudwigOrtmann/RIOT.git","ssh_url":"git@github.com:LudwigOrtmann/RIOT.git","clone_url":"https://github.com/LudwigOrtmann/RIOT.git","svn_url":"https://github.com/LudwigOrtmann/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":23662,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"RIOT-OS:master","ref":"master","sha":"a30be984ca4ea6689f2ce66209931f3b500c5ea5","user":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"repo":{"id":7370241,"name":"RIOT","full_name":"RIOT-OS/RIOT","owner":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIOT-OS/RIOT","description":"RIOT -  The friendly OS for IoT","fork":false,"url":"https://api.github.com/repos/RIOT-OS/RIOT","forks_url":"https://api.github.com/repos/RIOT-OS/RIOT/forks","keys_url":"https://api.github.com/repos/RIOT-OS/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIOT-OS/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIOT-OS/RIOT/teams","hooks_url":"https://api.github.com/repos/RIOT-OS/RIOT/hooks","issue_events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/events","assignees_url":"https://api.github.com/repos/RIOT-OS/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/RIOT-OS/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/tags","blobs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/RIOT-OS/RIOT/languages","stargazers_url":"https://api.github.com/repos/RIOT-OS/RIOT/stargazers","contributors_url":"https://api.github.com/repos/RIOT-OS/RIOT/contributors","subscribers_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscribers","subscription_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscription","commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIOT-OS/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/RIOT-OS/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIOT-OS/RIOT/merges","archive_url":"https://api.github.com/repos/RIOT-OS/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIOT-OS/RIOT/downloads","issues_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/RIOT-OS/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/RIOT-OS/RIOT/releases{/id}","created_at":"2012-12-29T20:38:40Z","updated_at":"2015-05-16T00:12:16Z","pushed_at":"2015-05-16T08:40:45Z","git_url":"git://github.com/RIOT-OS/RIOT.git","ssh_url":"git@github.com:RIOT-OS/RIOT.git","clone_url":"https://github.com/RIOT-OS/RIOT.git","svn_url":"https://github.com/RIOT-OS/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":110230,"stargazers_count":360,"watchers_count":360,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":292,"mirror_url":null,"open_issues_count":330,"forks":292,"open_issues":330,"watchers":360,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/2990"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2990"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2990/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990/comments"},"review_comment":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2990/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/bce918b873ae1bc7b44557043a59b739872f2a33"}}}}