{"action":"created","comment":{"url":"https://api.github.com/repos/tessel/t2-firmware/pulls/comments/52038843","id":52038843,"diff_hunk":"@@ -427,6 +434,12 @@ Tessel.Pin.interruptModes = {\n   low: 5,\n };\n \n+Tessel.Pin.pullModes = {\n+  pulldown: 0,\n+  pullup: 1,\n+  none: 2,","path":"node/tessel-export.js","position":38,"original_position":38,"commit_id":"6a3dc199afbc84ed37d28ee565234828af4867c9","original_commit_id":"6a3dc199afbc84ed37d28ee565234828af4867c9","user":{"login":"rwaldron","id":27985,"avatar_url":"https://avatars.githubusercontent.com/u/27985?v=3","gravatar_id":"","url":"https://api.github.com/users/rwaldron","html_url":"https://github.com/rwaldron","followers_url":"https://api.github.com/users/rwaldron/followers","following_url":"https://api.github.com/users/rwaldron/following{/other_user}","gists_url":"https://api.github.com/users/rwaldron/gists{/gist_id}","starred_url":"https://api.github.com/users/rwaldron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwaldron/subscriptions","organizations_url":"https://api.github.com/users/rwaldron/orgs","repos_url":"https://api.github.com/users/rwaldron/repos","events_url":"https://api.github.com/users/rwaldron/events{/privacy}","received_events_url":"https://api.github.com/users/rwaldron/received_events","type":"User","site_admin":false},"body":"Can these be \"const\" named to match the C code?\r\n\r\nEither: \r\n\r\n```js\r\nTessel.Pin.pullModes = {\r\n  PULL_DOWN: 0,\r\n  PULL_UP: 1,\r\n  PULL_NONE: 2,\r\n};\r\n```\r\n\r\nor \r\n\r\n```js\r\nTessel.Pin.pullModes = {\r\n  DOWN: 0,\r\n  UP: 1,\r\n  NONE: 2,\r\n};\r\n```\r\n\r\nMy vote is for the latter.\r\n","created_at":"2016-02-05T16:33:24Z","updated_at":"2016-02-05T16:33:24Z","html_url":"https://github.com/tessel/t2-firmware/pull/147#discussion_r52038843","pull_request_url":"https://api.github.com/repos/tessel/t2-firmware/pulls/147","_links":{"self":{"href":"https://api.github.com/repos/tessel/t2-firmware/pulls/comments/52038843"},"html":{"href":"https://github.com/tessel/t2-firmware/pull/147#discussion_r52038843"},"pull_request":{"href":"https://api.github.com/repos/tessel/t2-firmware/pulls/147"}}},"pull_request":{"url":"https://api.github.com/repos/tessel/t2-firmware/pulls/147","id":58044072,"html_url":"https://github.com/tessel/t2-firmware/pull/147","diff_url":"https://github.com/tessel/t2-firmware/pull/147.diff","patch_url":"https://github.com/tessel/t2-firmware/pull/147.patch","issue_url":"https://api.github.com/repos/tessel/t2-firmware/issues/147","number":147,"state":"open","locked":false,"title":"Adds support for pull resistors","user":{"login":"johnnyman727","id":432909,"avatar_url":"https://avatars.githubusercontent.com/u/432909?v=3","gravatar_id":"","url":"https://api.github.com/users/johnnyman727","html_url":"https://github.com/johnnyman727","followers_url":"https://api.github.com/users/johnnyman727/followers","following_url":"https://api.github.com/users/johnnyman727/following{/other_user}","gists_url":"https://api.github.com/users/johnnyman727/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnyman727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnyman727/subscriptions","organizations_url":"https://api.github.com/users/johnnyman727/orgs","repos_url":"https://api.github.com/users/johnnyman727/repos","events_url":"https://api.github.com/users/johnnyman727/events{/privacy}","received_events_url":"https://api.github.com/users/johnnyman727/received_events","type":"User","site_admin":false},"body":"Intended to be compatible [with T1 Firmware](https://github.com/tessel/t1-docs/blob/master/hardware-api.md#api-pin-pull-mode).\r\n\r\nTo test:\r\n* Build and flash the firmware (see instructions in README.md)\r\n* Transfer the revised `tessel-export.js` to your Tessel (`scp -i ~/.tessel/id_rsa node/tessel-export.js root@YOUR_TESSEL_NAME.local:/usr/lib/node/tessel-export.js`)\r\n\r\nUse the API as described in that T1 doc.\r\n\r\n```.js\r\nvar tessel = require('tessel');\r\nvar pin = tessel.port.A.pin[2];\r\n\r\npin.mode('pullup', () => {\r\n  pin.read((err, val) => {\r\n    console.log('pull up val', val) // 1\r\n    pin.mode('pulldown', () => {\r\n      pin.read((err, val) => {\r\n         console.log('pull down val', val); // 0\r\n      });\r\n    });\r\n  });\r\n})\r\n```\r\nFixes #145.","created_at":"2016-02-02T20:21:00Z","updated_at":"2016-02-05T16:33:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ab245b37a799e8e611bf1d9c26778463084601a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tessel/t2-firmware/pulls/147/commits","review_comments_url":"https://api.github.com/repos/tessel/t2-firmware/pulls/147/comments","review_comment_url":"https://api.github.com/repos/tessel/t2-firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tessel/t2-firmware/issues/147/comments","statuses_url":"https://api.github.com/repos/tessel/t2-firmware/statuses/6a3dc199afbc84ed37d28ee565234828af4867c9","head":{"label":"tessel:jon-pull","ref":"jon-pull","sha":"6a3dc199afbc84ed37d28ee565234828af4867c9","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":29262099,"name":"t2-firmware","full_name":"tessel/t2-firmware","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/t2-firmware","description":"Firmware for Tessel 2's SAMD21 coprocessor and related SoC code","fork":false,"url":"https://api.github.com/repos/tessel/t2-firmware","forks_url":"https://api.github.com/repos/tessel/t2-firmware/forks","keys_url":"https://api.github.com/repos/tessel/t2-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/t2-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/t2-firmware/teams","hooks_url":"https://api.github.com/repos/tessel/t2-firmware/hooks","issue_events_url":"https://api.github.com/repos/tessel/t2-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/t2-firmware/events","assignees_url":"https://api.github.com/repos/tessel/t2-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/t2-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/t2-firmware/tags","blobs_url":"https://api.github.com/repos/tessel/t2-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/t2-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/t2-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/t2-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/t2-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/t2-firmware/languages","stargazers_url":"https://api.github.com/repos/tessel/t2-firmware/stargazers","contributors_url":"https://api.github.com/repos/tessel/t2-firmware/contributors","subscribers_url":"https://api.github.com/repos/tessel/t2-firmware/subscribers","subscription_url":"https://api.github.com/repos/tessel/t2-firmware/subscription","commits_url":"https://api.github.com/repos/tessel/t2-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/t2-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/t2-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/t2-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/tessel/t2-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/t2-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/t2-firmware/merges","archive_url":"https://api.github.com/repos/tessel/t2-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/t2-firmware/downloads","issues_url":"https://api.github.com/repos/tessel/t2-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/t2-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/t2-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/t2-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/t2-firmware/labels{/name}","releases_url":"https://api.github.com/repos/tessel/t2-firmware/releases{/id}","deployments_url":"https://api.github.com/repos/tessel/t2-firmware/deployments","created_at":"2015-01-14T19:38:00Z","updated_at":"2016-01-23T14:45:29Z","pushed_at":"2016-02-05T05:46:00Z","git_url":"git://github.com/tessel/t2-firmware.git","ssh_url":"git@github.com:tessel/t2-firmware.git","clone_url":"https://github.com/tessel/t2-firmware.git","svn_url":"https://github.com/tessel/t2-firmware","homepage":"","size":550,"stargazers_count":27,"watchers_count":27,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":32,"forks":11,"open_issues":32,"watchers":27,"default_branch":"master"}},"base":{"label":"tessel:master","ref":"master","sha":"0226935d89d34d1324fd9f2f4246bfbe5321dabc","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":29262099,"name":"t2-firmware","full_name":"tessel/t2-firmware","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/t2-firmware","description":"Firmware for Tessel 2's SAMD21 coprocessor and related SoC code","fork":false,"url":"https://api.github.com/repos/tessel/t2-firmware","forks_url":"https://api.github.com/repos/tessel/t2-firmware/forks","keys_url":"https://api.github.com/repos/tessel/t2-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/t2-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/t2-firmware/teams","hooks_url":"https://api.github.com/repos/tessel/t2-firmware/hooks","issue_events_url":"https://api.github.com/repos/tessel/t2-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/t2-firmware/events","assignees_url":"https://api.github.com/repos/tessel/t2-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/t2-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/t2-firmware/tags","blobs_url":"https://api.github.com/repos/tessel/t2-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/t2-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/t2-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/t2-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/t2-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/t2-firmware/languages","stargazers_url":"https://api.github.com/repos/tessel/t2-firmware/stargazers","contributors_url":"https://api.github.com/repos/tessel/t2-firmware/contributors","subscribers_url":"https://api.github.com/repos/tessel/t2-firmware/subscribers","subscription_url":"https://api.github.com/repos/tessel/t2-firmware/subscription","commits_url":"https://api.github.com/repos/tessel/t2-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/t2-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/t2-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/t2-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/tessel/t2-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/t2-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/t2-firmware/merges","archive_url":"https://api.github.com/repos/tessel/t2-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/t2-firmware/downloads","issues_url":"https://api.github.com/repos/tessel/t2-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/t2-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/t2-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/t2-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/t2-firmware/labels{/name}","releases_url":"https://api.github.com/repos/tessel/t2-firmware/releases{/id}","deployments_url":"https://api.github.com/repos/tessel/t2-firmware/deployments","created_at":"2015-01-14T19:38:00Z","updated_at":"2016-01-23T14:45:29Z","pushed_at":"2016-02-05T05:46:00Z","git_url":"git://github.com/tessel/t2-firmware.git","ssh_url":"git@github.com:tessel/t2-firmware.git","clone_url":"https://github.com/tessel/t2-firmware.git","svn_url":"https://github.com/tessel/t2-firmware","homepage":"","size":550,"stargazers_count":27,"watchers_count":27,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":32,"forks":11,"open_issues":32,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tessel/t2-firmware/pulls/147"},"html":{"href":"https://github.com/tessel/t2-firmware/pull/147"},"issue":{"href":"https://api.github.com/repos/tessel/t2-firmware/issues/147"},"comments":{"href":"https://api.github.com/repos/tessel/t2-firmware/issues/147/comments"},"review_comments":{"href":"https://api.github.com/repos/tessel/t2-firmware/pulls/147/comments"},"review_comment":{"href":"https://api.github.com/repos/tessel/t2-firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tessel/t2-firmware/pulls/147/commits"},"statuses":{"href":"https://api.github.com/repos/tessel/t2-firmware/statuses/6a3dc199afbc84ed37d28ee565234828af4867c9"}}}}